1 2cbuffer CB { 3 float4 foo; 4}; 5 6static const float4 bar = foo; // test const (in the immutable sense) initializer from non-const. 7 8static const float2 a1[2] = { { 1, 2 }, { foo.x, 4 } }; // not entirely constant 9static const float2 a2[2] = { { 5, 6 }, { 7, 8 } }; // entirely constant 10 11float4 main() : SV_Target0 12{ 13 return bar; 14} 15