Jump to content
  • Advertisement
Sign in to follow this  

DX11 [DX11] Sharing CB's between few effects

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

For a few days I'm trying to achieve EffectPools functionality in DirectX11.
In my test app I'v got two effects:
-GlobalVariables.fx (Something like effect pool but using registers)


shared Texture2D txDiffuse[MAX_TEXTURES_PER_MATERIAL] : register(t7);
//Clip plane info
shared cbuffer clipPlaneData :register(b2)
float3 clipPlaneNormal;
float clipPlaneOffset;


#include GlobalVariables.fx
//Make use of it

The only effect I use to set constant buffers and variables is created using GlobalVariables.fx (similary to effect pools).

cpData = (CLIP_PLANE_DATA*)subResource.pData;
cpData->clipPlaneNormal = normal;
cpData->clipPlaneOffset = offset;
// Set the constant buffer
ID3DX11EffectConstantBuffer* cbuffer = m_effectPool->GetConstantBufferByName("clipPlaneData");
if (cbuffer != NULL && cbuffer->IsValid()) {

I update texture buffers updat using ID3DX11EffectShaderResourceVariable interface.

Sadly, It doesn't work :( Is the whole idea wrong or I have just messed up someting in implementation ?

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!