0

Using d3d11, I have two cbuffer in a vertex shader that's

cbuffer A{
 float2
 float2
 float2 
 float2
};

cbuffer B {
 uint2
 uint2
 float2
 float2
 float2 
 float2
};

Their buffers are created and run on my vertex shader successfully.

However when I add a bool to the second cbuffer:

(c++ side)    
struct B {
 uint32_t, uint32_t,
 uint32_t, uint32_t,
 float, float,
 float, float,
 float, float, 
 float, float,
 uint32_t
};

(hlsl)
cbuffer B {
 uint2
 uint2
 float2
 float2
 float2 
 float2
 bool
};

CreateBuffer fails with an unhandled exception. The buffer packing all seems fine, the bool should be the first element in a new row after the 48th byte.

0

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.