Jump to content
  • Advertisement
Sign in to follow this  
Waaayoff

[DX11] Getting texture info from reflection API?

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

So i managed to use the Reflection API to load constant buffer descriptions and create variable objects to manipulate the shader constants. However i can't figure out how to load texture and sampler descriptions?

Share this post


Link to post
Share on other sites
Advertisement
Well i'm not sure bit i think it's:

// Get shader reflection
ID3D11ShaderReflection* pReflector = 0;
HRESULT hr = D3DReflect(pShader->mCompiledShader->GetBufferPointer(),
pShader->mCompiledShader->GetBufferSize(),
IID_ID3D11ShaderReflection,
(void**) &pReflector);
if (FAILED(hr))
{
OUT_ERR(hr);
return;
}

D3D11_SHADER_DESC shader_desc;
pReflector->GetDesc(&shader_desc);

// Create shader resources
for (unsigned i = 0; i < shader_desc.BoundResources; i++)
{
D3D11_SHADER_INPUT_BIND_DESC desc;
pReflector->GetResourceBindingDesc(i, &desc);

ShaderResource* pResource = 0;

switch (desc.Type)
{
case D3D10_SIT_TEXTURE:
{
// ....
}
break;
}
}

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.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!