Directx10 shader pools example question

Started by
-1 comments, last by FoxMulder900 15 years, 2 months ago
I am trying to implement shader pools into my project and I am following the example that comes with the DX10 SDK. My question has to do with the shared buffers - here is the example given in the SDK. shared cbuffer cbShared { float3 g_LightDir; // Light's direction in world space float4 g_LightDiffuse; // Light's diffuse color float4x4 g_mViewProj; // View * Projection matrix float g_TexMove; // random variable that offsets the V texcoord }; Now lets say I am sharing this buffer between 3 shaders and lets say that the third shader does not use the g_LightDir and the g_LightDiffuse variables. Could this cause any problems? Or is it ok to share variables that will not be used in all shaders? EDIT: Also do you have to bind shared variables to each effect each time a new one is activated? Or is there a way to globally bind them just a single time? Thanks in advance [Edited by - FoxMulder900 on January 21, 2009 3:09:16 PM]

This topic is closed to new replies.

Advertisement