1Texture2D g_tColor[ 128 ] ; 2 3layout (push_constant) cbuffer PerViewConstantBuffer_t 4{ 5 uint g_nDataIdx; 6 uint g_nDataIdx2; 7 bool g_B; 8} ; 9 10SamplerState g_sAniso; 11 12struct PS_INPUT 13{ 14 float2 vTextureCoords : TEXCOORD2 ; 15} ; 16 17struct PS_OUTPUT 18{ 19 float4 vColor : SV_Target0 ; 20} ; 21 22PS_OUTPUT MainPs ( PS_INPUT i ) 23{ 24 PS_OUTPUT ps_output ; 25 26 uint u; 27 if (g_B) 28#include "i1.h" 29 else 30 u = g_nDataIdx2; 31 ps_output . vColor = g_tColor [ u ] . Sample ( g_sAniso , i . vTextureCoords . xy ); 32 return ps_output ; 33} 34 35