yum-mirror/glslang
git clone https://git.yummers.dev/yum-mirror/glslang
4e55988a
main
1 2// uniform Texture1D g_tex3[3][2]; // TODO: legal in HLSL, but we don't handle it yet. 3 4uniform Texture1D g_tex [3 ]; 5uniform Texture1D g_tex_explicit [3 ] : register(t1 ); 6 7SamplerState g_samp [3 ]; 8SamplerState g_samp_explicit [3 ] : register(s5 ); 9 10uniform float3x3 g_mats [4 ]; 11uniform float3x3 g_mats_explicit [4 ] : register(b10 ); 12uniform float g_floats [4 ]; 13 14// uniform float g_floats[4] = { 10, 11, 12, 13 }; // TODO: ... add when initializer lists can be flattened. 15 16float4 TestFn1 () 17{ 18return g_tex [1 ].Sample (g_samp [1 ],0.2 ); 19} 20 21float4 TestFn2 (Texture1D l_tex [3 ],SamplerState l_samp [3 ]) 22{ 23return l_tex [2 ].Sample (l_samp [2 ],0.2 ); 24} 25 26static int not_flattened_a [5 ]= {1 ,2 ,3 ,4 ,5 }; 27 28struct PS_OUTPUT {float4 color :SV_Target0 ; }; 29 30void main (out PS_OUTPUT ps_output ) 31{ 32// test flattening for local assignment initialization 33SamplerState local_sampler_array [3 ]= g_samp ; 34Texture1D local_texture_array [3 ]= g_tex ; 35float local_float_array [4 ]= g_floats ; 36 37ps_output .color = TestFn1 ()+ TestFn2 (g_tex ,g_samp ); 38}