Jump to content
  • Advertisement
Sign in to follow this  

DX11 FXC Problem with Variables

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

Hi everybody!
First of all I am a newbie, I hope somebody can help me! (I use DX11)

I have a big problem... I have a file shader.hlsl.

In this shader, i have a Texture2DArray called "myarray".

So far so good.

I compile the hlsl shader with fxc to a .fxo file.

When I now want to set the resource:

hr = shaderReflection->GetResourceBindingDescByName(name,

with the name "myarray", I get an error. The Shader parameter "myarray" cannot be found. Why is that so?

Do I have to make the variable known anywhere? How does dx know the name of the variable, is its name coded to the assembler file (.fxo)?

Which steps to perform, to make the 2D Texture Array known in my DX-Program?

Please help me,

I am relativly new to this stuff and sorry for my poor English! :-)

Thank you very much


Edit: hr = shaderReflection->GetResourceBindingDescByName(name,

gibt E_INVALIDARG zurück

Share this post

Link to post
Share on other sites
In addition, notice the code sample on the MSDN documentation. It depends also on what part of the shader you're looking at. If you use your textures in your pixel shader but you reflected the vertex shader, then you won't see the variable since it's not used by it. Same goes for global variables (at least, the constant buffer - if your vertex shader uses a single variable from a constant buffer, you're able to look at the whole thing via the reflection interfaces). I recently grappled with reflecting my effect files in SlimDX and I found it kind of a pain because of this.

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!