hlsl.intrinsics.negative.frag 7.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137
  1. float PixelShaderFunctionS(float inF0, float inF1, float inF2, int inI0)
  2. {
  3. // AllMemoryBarrier(); // TODO: expected error: invalid in fragment stage
  4. // AllMemoryBarrierWithGroupSync(); // TODO: expected error: invalid in fragment stage
  5. asdouble(inF0, inF1); // expected error: only integer inputs
  6. CheckAccessFullyMapped(3.0); // expected error: only valid on integers
  7. countbits(inF0); // expected error: only integer inputs
  8. cross(inF0, inF1); // expected error: only on float3 inputs
  9. D3DCOLORtoUBYTE4(inF0); // expected error: only on float4 inputs
  10. determinant(inF0); // expected error: only valid on mats
  11. // DeviceMemoryBarrierWithGroupSync(); // TODO: expected error: only valid in compute stage
  12. f16tof32(inF0); // expected error: only integer inputs
  13. firstbithigh(inF0); // expected error: only integer inputs
  14. firstbitlow(inF0); // expected error: only integer inputs
  15. // fma(inF0, inF1, inF2); // TODO: this might auto-promote: need to check against FXC
  16. // InterlockedAdd(inI0, inI0, 3); // expected error: last parameter is out TODO: accepted even though marked as out in proto generator
  17. // InterlockedAnd(inI0, inI0, 3); // expected error: last parameter is out TODO: accepted even though marked as out i // InterlockedMax(inI0, inI0, 3); // expected error: last parameter is out TODO: accepted even though marked as out in proto generator
  18. // InterlockedMin(inI0, inI0, 3); // expected error: last parameter is out TODO: accepted even though marked as out in proto generator
  19. // InterlockedOor(inI0, inI0, 3); // expected error: last parameter is out TODO: accepted even though marked as out in proto generator
  20. // InterlockedXor(inI0, inI0, 3); // expected error: last parameter is out TODO: accepted even though marked as out in proto generator
  21. // GroupMemoryBarrier(); // TODO: expected error: invalid in fragment stage
  22. // GroupMemoryBarrierWithGroupSync(); // TODO: expected error: invalid in fragment stage
  23. length(inF0); // expected error: invalid on scalars
  24. msad4(inF0, float2(0), float4(0)); // expected error: only integer inputs
  25. normalize(inF0); // expected error: invalid on scalars
  26. reflect(inF0, inF1); // expected error: invalid on scalars
  27. refract(inF0, inF1, inF2); // expected error: invalid on scalars
  28. refract(float2(0), float2(0), float2(0)); // expected error: last parameter only scalar
  29. reversebits(inF0); // expected error: only integer inputs
  30. transpose(inF0); // expected error: only valid on mats
  31. return 0.0;
  32. }
  33. float1 PixelShaderFunction1(float1 inF0, float1 inF1, float1 inF2, int1 inI0)
  34. {
  35. // TODO: ... add when float1 prototypes are generated
  36. GetRenderTargetSamplePosition(inF0); // expected error: only integer inputs
  37. return 0.0;
  38. }
  39. float2 PixelShaderFunction2(float2 inF0, float2 inF1, float2 inF2, int2 inI0)
  40. {
  41. asdouble(inF0, inF1); // expected error: only integer inputs
  42. CheckAccessFullyMapped(inF0); // expected error: only valid on scalars
  43. countbits(inF0); // expected error: only integer inputs
  44. cross(inF0, inF1); // expected error: only on float3 inputs
  45. D3DCOLORtoUBYTE4(inF0); // expected error: only on float4 inputs
  46. determinant(inF0); // expected error: only valid on mats
  47. f16tof32(inF0); // expected error: only integer inputs
  48. firstbithigh(inF0); // expected error: only integer inputs
  49. firstbitlow(inF0); // expected error: only integer inputs
  50. // fma(inF0, inF1, inF2); // TODO: this might auto-promote: need to check against FXC
  51. reversebits(inF0); // expected error: only integer inputs
  52. transpose(inF0); // expected error: only valid on mats
  53. return float2(1,2);
  54. }
  55. float3 PixelShaderFunction3(float3 inF0, float3 inF1, float3 inF2, int3 inI0)
  56. {
  57. CheckAccessFullyMapped(inF0); // expected error: only valid on scalars
  58. countbits(inF0); // expected error: only integer inputs
  59. D3DCOLORtoUBYTE4(inF0); // expected error: only on float4 inputs
  60. determinant(inF0); // expected error: only valid on mats
  61. f16tof32(inF0); // expected error: only integer inputs
  62. firstbithigh(inF0); // expected error: only integer inputs
  63. firstbitlow(inF0); // expected error: only integer inputs
  64. // fma(inF0, inF1, inF2); // TODO: this might auto-promote: need to check against FXC
  65. reversebits(inF0); // expected error: only integer inputs
  66. transpose(inF0); // expected error: only valid on mats
  67. return float3(1,2,3);
  68. }
  69. float4 PixelShaderFunction(float4 inF0, float4 inF1, float4 inF2, int4 inI0)
  70. {
  71. CheckAccessFullyMapped(inF0); // expected error: only valid on scalars
  72. countbits(inF0); // expected error: only integer inputs
  73. cross(inF0, inF1); // expected error: only on float3 inputs
  74. determinant(inF0); // expected error: only valid on mats
  75. f16tof32(inF0); // expected error: only integer inputs
  76. firstbithigh(inF0); // expected error: only integer inputs
  77. firstbitlow(inF0); // expected error: only integer inputs
  78. // fma(inF0, inF1, inF2); // TODO: this might auto-promote: need to check against FXC
  79. reversebits(inF0); // expected error: only integer inputs
  80. transpose(inF0); // expected error: only valid on mats
  81. return float4(1,2,3,4);
  82. }
  83. // TODO: FXC doesn't accept this with (), but glslang doesn't accept it without.
  84. #define MATFNS() \
  85. countbits(inF0); \
  86. D3DCOLORtoUBYTE4(inF0); \
  87. cross(inF0, inF1); \
  88. f16tof32(inF0); \
  89. firstbithigh(inF0); \
  90. firstbitlow(inF0); \
  91. reversebits(inF0); \
  92. length(inF0); \
  93. noise(inF0); \
  94. normalize(inF0); \
  95. reflect(inF0, inF1); \
  96. refract(inF0, inF1, 1.0); \
  97. reversebits(inF0); \
  98. // TODO: turn on non-square matrix tests when protos are available.
  99. float2x2 PixelShaderFunction2x2(float2x2 inF0, float2x2 inF1, float2x2 inF2)
  100. {
  101. // TODO: FXC doesn't accept this with (), but glslang doesn't accept it without.
  102. MATFNS()
  103. return float2x2(2,2,2,2);
  104. }
  105. float3x3 PixelShaderFunction3x3(float3x3 inF0, float3x3 inF1, float3x3 inF2)
  106. {
  107. // TODO: FXC doesn't accept this with (), but glslang doesn't accept it without.
  108. MATFNS()
  109. return float3x3(3,3,3,3,3,3,3,3,3);
  110. }
  111. float4x4 PixelShaderFunction4x4(float4x4 inF0, float4x4 inF1, float4x4 inF2)
  112. {
  113. // TODO: FXC doesn't accept this with (), but glslang doesn't accept it without.
  114. MATFNS()
  115. return float4x4(4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4);
  116. }