optForNoOpt4.hlsl 1.1 KB

12345678910111213141516171819202122
  1. // RUN: %dxc -Zi -E main -Od -T ps_6_0 %s | FileCheck %s -check-prefix=CHK_DB
  2. // RUN: %dxc -E main -Od -T ps_6_0 %s | FileCheck %s -check-prefix=CHK_NODB
  3. // CHK_DB: 19:10: error: Offsets to texture access operations must be immediate values. Unrolling the loop containing the offset value manually and using -O3 may help in some cases.
  4. // CHK_DB: 19:10: error: Offsets to texture access operations must be immediate values. Unrolling the loop containing the offset value manually and using -O3 may help in some cases.
  5. // CHK_NODB: error: Offsets to texture access operations must be immediate values. Unrolling the loop containing the offset value manually and using -O3 may help in some cases.
  6. // CHK_NODB: error: Offsets to texture access operations must be immediate values. Unrolling the loop containing the offset value manually and using -O3 may help in some cases.
  7. SamplerState samp1 : register(s5);
  8. Texture2D<float4> text1 : register(t3);
  9. int i;
  10. float4 main(float2 a : A) : SV_Target {
  11. float4 r = 0;
  12. for (uint x=0; x<i;x++)
  13. for (uint y=0; y<2;y++) {
  14. r += text1.Sample(samp1, a, int2(x+y,x-y));
  15. }
  16. return r;
  17. }