Jump to content

  • Log In with Google      Sign In   
  • Create Account

ankan_ban

Member Since 08 Aug 2010
Offline Last Active Feb 03 2013 04:25 AM

Topics I've Started

Constant Buffer Array in DX11

08 August 2010 - 02:21 AM

Hi,

Is it possible to create an array of similar constant buffers in DX11 and then index them on constant slot number?

This is an example what what I want to do (but it doesn't work):

cbuffer cIndexableCB [3]
{
uint4 myIndexableConst[4];
};

// the paramaters below are number of threads in a thread group/CTA in each direction
[numthreads(256, 1, 1)]
void cs_main( uint3 threadID : SV_DispatchThreadID )
{
uint v1 = uav1[threadID.x];
uint multiplier = cIndexableCB[1].myIndexableConst[2].x;
uav1[threadID.x] = multiplier*v1;
}


Thanks

PARTNERS