Jump to content
  • Advertisement
Sign in to follow this  
51mon

How to Set Up Custom Mipmapping in DX10?

This topic is 4002 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I was doing some custom mipmapping in DX9. I where using the last rendered surface as input when rendering the next level. When trying to port my code to DX10, I got the following message: D3D10: WARNING: ID3D10Device::PSSetShaderResources: Resource being set to PS shader resource slot 0 is still bound on output! Forcing to NULL. [ STATE_SETTING WARNING #7: DEVICE_PSSETSHADERRESOURCES_HAZARD ] D3D10: WARNING: ID3D10Device::PSSetShaderResources: Resource being set to PS shader resource slot 1 is still bound on output! Forcing to NULL. [ STATE_SETTING WARNING #7: DEVICE_PSSETSHADERRESOURCES_HAZARD ] As I understands it DX10 look upon the whole mipmap chain as a single object and therefore not let me ping-pong between the levels. I’m of course not using the same surface as input and output at the same time. Can I fix this somehow? Does someone know about any clever hacks? Thanks

Share this post


Link to post
Share on other sites
Advertisement
One solution as I see it would be to manage my own chain by declare an nonhomogeneous texture array in the fx-file:

Texture2D g_CustomMipmap[Depth];

I’m just confused how to bind the array to the CPU application. I don’t think ID3D10Effect::GetVariableByName works on nonhomogeneous texture arrays. Can I use ID3D10Effect::GetVariableByIndex or something?

Thanks

Share this post


Link to post
Share on other sites
Just use GetVariableByName(...)->AsShaderResource()->SetResourceArray(...)

http://msdn2.microsoft.com/en-us/library/bb173697.aspx

Share this post


Link to post
Share on other sites
Thanks Jalibr

I managed to implement the custom mipmapping and the GPU writes to all the levels. In order to follow the DX10 access rules I had to put the different levels in a non-homogenous texture array like this:

Texture2D g_LightTextureDirection[12];

But when I try to read the data like this:

Output.Direction = g_LightTextureDirection[iIndex].Sample( ScreenTextureSampler, vCoord).rgb;

I got problems again, I got this message:

error X3512: sampler array index must be a literal expression

If anyone has an idea of how to solve this, I would be thrilled.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!