Sign in to follow this  

Problem about interface in cgfx

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

This topic is 3319 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.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this