Jump to content
  • Advertisement
Sign in to follow this  
newltf

Problem about interface in cgfx

This topic is 3679 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 have two interface types , and create two structs inherit from them. But if I use these inherit object a and b as parameters of my pixel shader,the complier reported an error. When I try cgGetLastListing() to find what the error exactly is ,but it returns a null pointer. If I define two objects inherit from one type as paramters, complier can works well. Anyone can tell me why. interface ABase { float evaluate(); }; interface BBase { float evaluate(); }; struct AInherit :ABase{ float evaluate(){ return 1.0f; } }; struct BInherit :BBase{ float evaluate(){ return 2.0f; } }; AInherit a; BInherit b; struct Fragment{ float4 color: COLOR; }; Pixel Pixel_Shader(uniform ABase aparam,uniform BBase bparam,Fragment IN) { Pixel OUT; aparam.evaluate(); bparam.evaluate(); return OUT; } technique tech{ pass { FragmentProgram = compile gp4fp Pixel_Shader(a,b);//can't complie } }

Share this post


Link to post
Share on other sites
Advertisement
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!