• Advertisement
Sign in to follow this  

Creating a shader resource view in DX10

This topic is 3481 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

When creating a shader resource view, especially a texture2D, in the: D3D10_SHADER_RESOURCE_VIEW_DESC.D3D10_TEX2D_SRV structure, it contains UINT MostDetailedMip; UINT MipLevels; How exactly do I use this values? I loaded a texture resource with 10 MipLevel. I set MostDetailedMip to 7, and MipLevels to 10. However the CreateShaderResourceView is throwing up a error of invalid argument. If I set MostDetailedMip to 0, everything works alright.

Share this post


Link to post
Share on other sites
Advertisement
The MostDetailedMip is the largest level that is used when reading from this resource view. The largest level always has the number 0.

MipLevels define how many layers behind the MostDetailedMip are accessible.

Share this post


Link to post
Share on other sites
Ah I see. Thanks, i changed it to:

MostDetailedMip = 7;
MipLevels = 3;

and it works. So that means MostDetailedMip + MipLevels must be equal to the texture total mip levels. Thanks again Demirug. I got confused by the SDK as it says:

Quote:

http://msdn.microsoft.com/en-us/library/bb172475(VS.85).aspx
MostDetailedMip
Index of the most detailed mipmap level to use; this number is between 0 and MipLevels.
MipLevels
Number of mipmap levels to use


Thanks alot Demirug.

Share this post


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

  • Advertisement