local_resource6.hlsl 477 B

12345678910111213141516171819202122
  1. // RUN: %dxc -E main -T ps_6_0 %s | FileCheck %s
  2. // CHECK: local resource not guaranteed to map to unique global resource
  3. float4 Tex2D(Texture2D<float4> t,
  4. SamplerState s, float2 c) {
  5. return t.Sample(s, c);
  6. }
  7. SamplerState g_ss;
  8. Texture2D<float4> g_texture;
  9. Texture2D<float4> g_texture2;
  10. float4 main(float2 c: T) : SV_Target {
  11. Texture2D<float4> l_texture;
  12. if (c.x>0)
  13. l_texture = g_texture;
  14. else
  15. l_texture = g_texture2;
  16. return Tex2D(l_texture, g_ss, c);
  17. }