Jump to content
  • Advertisement
Sign in to follow this  
dacredens

global HLSL shader structs (in D3D10)??

This topic is 3166 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, I've come from using HLSL in d3d 9 and I'm migrating to d3d10. Using d3d9, I was able to declare a global instance of a custom struct in my hlsl shader. It seems that I can do this in d3d10 too. However, using d3d9 I could set the data of the struct (from my cpu code) using a convention such as this "my_struct_instance@my_structs_field". this convention was possible via the effect system that d3d9 offers. In d3d10 I have to get a pointer to an object representing the shader variable - is it possible to modify fields of structs in hlsl code via d3d10? thanks

Share this post


Link to post
Share on other sites
Advertisement
solved:

the
ID3D10EffectVariable

interface has a member function

GetMemberByName

which basically gives a pointer to the member variable of a global struct in the hlsl

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.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!