interface1.hlsl 706 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. // RUN: %fxc /T ps_5_0 %s /Fo %t.dxbc
  2. // RUN: %dxbc2dxil %t.dxbc /emit-llvm /o %t.ll.converted
  3. // RUN: fc %b.ref %t.ll.converted
  4. interface IFace
  5. {
  6. float foo();
  7. };
  8. class First : IFace
  9. {
  10. float f;
  11. SamplerState samp;
  12. Texture2D<float4> tex;
  13. //RWStructuredBuffer<float4> rwbuf; // not allowed
  14. float foo() {
  15. float4 result = tex.Sample(samp, float2(0.25, 0.75));
  16. //rwbuf[1] = result;
  17. return result.x * f;
  18. }
  19. };
  20. class Second : IFace
  21. {
  22. float f;
  23. SamplerState samp;
  24. Texture2D<float4> tex;
  25. float foo() {
  26. float4 result = tex.Sample(samp, float2(0.125, 0.875));
  27. return result.x + f;
  28. }
  29. };
  30. interface IFace I[253];
  31. uint i;
  32. float main() : SV_TARGET
  33. {
  34. return I[i].foo();
  35. }