Browse Source

[spirv] Refresh SPIRV-Tools (#1197)

* Canged to use max_digits10 for float precision
* Fixed bugs regarding OpImageTexelPointer

Fixes https://github.com/Microsoft/DirectXShaderCompiler/issues/1194
Lei Zhang 7 years ago
parent
commit
3a6c072fd1
26 changed files with 207 additions and 207 deletions
  1. 1 1
      external/SPIRV-Tools
  2. 8 8
      tools/clang/test/CodeGenSPIRV/cast.matrix.splat.hlsl
  3. 3 3
      tools/clang/test/CodeGenSPIRV/cast.vector.splat.hlsl
  4. 4 4
      tools/clang/test/CodeGenSPIRV/cf.if.for.hlsl
  5. 5 5
      tools/clang/test/CodeGenSPIRV/constant.scalar.16bit.disabled.hlsl
  6. 6 6
      tools/clang/test/CodeGenSPIRV/constant.scalar.64bit.hlsl
  7. 3 3
      tools/clang/test/CodeGenSPIRV/constant.scalar.hlsl
  8. 2 2
      tools/clang/test/CodeGenSPIRV/intrinsics.D3DCOLORtoUBYTE4.hlsl
  9. 2 2
      tools/clang/test/CodeGenSPIRV/intrinsics.log10.hlsl
  10. 2 2
      tools/clang/test/CodeGenSPIRV/texture.array.gather-cmp.hlsl
  11. 4 4
      tools/clang/test/CodeGenSPIRV/texture.array.gather.hlsl
  12. 12 12
      tools/clang/test/CodeGenSPIRV/texture.array.sample-bias.hlsl
  13. 8 8
      tools/clang/test/CodeGenSPIRV/texture.array.sample-cmp-level-zero.hlsl
  14. 10 10
      tools/clang/test/CodeGenSPIRV/texture.array.sample-cmp.hlsl
  15. 23 23
      tools/clang/test/CodeGenSPIRV/texture.array.sample-grad.hlsl
  16. 10 10
      tools/clang/test/CodeGenSPIRV/texture.array.sample-level.hlsl
  17. 12 12
      tools/clang/test/CodeGenSPIRV/texture.array.sample.hlsl
  18. 2 2
      tools/clang/test/CodeGenSPIRV/texture.gather-cmp.hlsl
  19. 4 4
      tools/clang/test/CodeGenSPIRV/texture.gather.hlsl
  20. 14 14
      tools/clang/test/CodeGenSPIRV/texture.sample-bias.hlsl
  21. 8 8
      tools/clang/test/CodeGenSPIRV/texture.sample-cmp-level-zero.hlsl
  22. 10 10
      tools/clang/test/CodeGenSPIRV/texture.sample-cmp.hlsl
  23. 25 25
      tools/clang/test/CodeGenSPIRV/texture.sample-grad.hlsl
  24. 11 11
      tools/clang/test/CodeGenSPIRV/texture.sample-level.hlsl
  25. 14 14
      tools/clang/test/CodeGenSPIRV/texture.sample.hlsl
  26. 4 4
      tools/clang/test/CodeGenSPIRV/vk.spec-constant.init.hlsl

+ 1 - 1
external/SPIRV-Tools

@@ -1 +1 @@
-Subproject commit cbceeceab44580e30ae27c58db3755b40990ea69
+Subproject commit 742454968db1da529f54050bac9e6cc40d0611fb

+ 8 - 8
tools/clang/test/CodeGenSPIRV/cast.matrix.splat.hlsl

@@ -1,7 +1,7 @@
 // Run: %dxc -T vs_6_0 -E main
 
-// CHECK:      [[v2f10_3:%\d+]] = OpConstantComposite %v2float %float_10_3 %float_10_3
-// CHECK:      [[v3f10_4:%\d+]] = OpConstantComposite %v3float %float_10_4 %float_10_4 %float_10_4
+// CHECK:       [[v2f8_5:%\d+]] = OpConstantComposite %v2float %float_8_5 %float_8_5
+// CHECK:       [[v3f9_5:%\d+]] = OpConstantComposite %v3float %float_9_5 %float_9_5 %float_9_5
 // CHECK:      [[v2f10_5:%\d+]] = OpConstantComposite %v2float %float_10_5 %float_10_5
 // CHECK:    [[m3v2f10_5:%\d+]] = OpConstantComposite %mat3v2float [[v2f10_5]] [[v2f10_5]] [[v2f10_5]]
 // CHECK:        [[v2i10:%\d+]] = OpConstantComposite %v2int %int_10 %int_10
@@ -16,12 +16,12 @@ void main() {
     // definitions instead of OpStore. Constant evaluation in the front
     // end doesn't really support it for now.
 
-// CHECK:      OpStore %a %float_10_2
-    float1x1 a = 10.2;
-// CHECK-NEXT: OpStore %b [[v2f10_3]]
-    float1x2 b = 10.3;
-// CHECK-NEXT: OpStore %c [[v3f10_4]]
-    float3x1 c = 10.4;
+// CHECK:      OpStore %a %float_7_5
+    float1x1 a = 7.5;
+// CHECK-NEXT: OpStore %b [[v2f8_5]]
+    float1x2 b = 8.5;
+// CHECK-NEXT: OpStore %c [[v3f9_5]]
+    float3x1 c = 9.5;
 // CHECK-NEXT: OpStore %d [[m3v2f10_5]]
     float3x2 d = 10.5;
 // CHECK-NEXT: OpStore %e [[int3x2_i10]]

+ 3 - 3
tools/clang/test/CodeGenSPIRV/cast.vector.splat.hlsl

@@ -26,9 +26,9 @@ void main() {
     int3 vi3;
     vi3 = si1;
 
-// CHECK-NEXT: [[v0p55:%\d+]] = OpCompositeConstruct %v4float %float_0_55 %float_0_55 %float_0_55 %float_0_55
-// CHECK-NEXT: OpStore %vf4 [[v0p55]]
-    vf4 = float4(0.55.xxxx);
+// CHECK-NEXT: [[v0p5:%\d+]] = OpCompositeConstruct %v4float %float_0_5 %float_0_5 %float_0_5 %float_0_5
+// CHECK-NEXT: OpStore %vf4 [[v0p5]]
+    vf4 = float4(0.5.xxxx);
 
 // CHECK-NEXT: [[v3:%\d+]] = OpCompositeConstruct %v3int %int_3 %int_3 %int_3
 // CHECK-NEXT: OpStore %vi3 [[v3]]

+ 4 - 4
tools/clang/test/CodeGenSPIRV/cf.if.for.hlsl

@@ -7,10 +7,10 @@ float4 main(float color: COLOR) : SV_TARGET {
     float val = 0.;
 
 // CHECK-NEXT: [[color0:%\d+]] = OpLoad %float %color
-// CHECK-NEXT: [[lt0:%\d+]] = OpFOrdLessThan %bool [[color0]] %float_0_3
+// CHECK-NEXT: [[lt0:%\d+]] = OpFOrdLessThan %bool [[color0]] %float_0_5
 // CHECK-NEXT: OpSelectionMerge %if_merge None
 // CHECK-NEXT: OpBranchConditional [[lt0]] %if_true %if_merge
-    if (color < 0.3) {
+    if (color < 0.5) {
 // CHECK-LABEL: %if_true = OpLabel
 // CHECK-NEXT: OpStore %val %float_1
         val = 1.;
@@ -123,10 +123,10 @@ float4 main(float color: COLOR) : SV_TARGET {
 
     // if-stmt following for-stmt
 // CHECK-NEXT: [[color3:%\d+]] = OpLoad %float %color
-// CHECK-NEXT: [[lt7:%\d+]] = OpFOrdLessThan %bool [[color3]] %float_0_9
+// CHECK-NEXT: [[lt7:%\d+]] = OpFOrdLessThan %bool [[color3]] %float_1_5
 // CHECK-NEXT: OpSelectionMerge %if_merge_3 None
 // CHECK-NEXT: OpBranchConditional [[lt7]] %if_true_3 %if_merge_3
-    if (color < 0.9) {
+    if (color < 1.5) {
 // CHECK-LABEL: %if_true_3 = OpLabel
 // CHECK: OpStore %val
         val = val + 6.;

+ 5 - 5
tools/clang/test/CodeGenSPIRV/constant.scalar.16bit.disabled.hlsl

@@ -18,10 +18,10 @@
 void main() {
 // Note: in the absence of "-enable-16bit-types" option,
 // 'half' is translated to float *without* RelaxedPrecision decoration.
-// CHECK: %float_7_7 = OpConstant %float 7.7
-  half c_half_4_5 = 7.7;
-// CHECK: %float_n8_8 = OpConstant %float -8.8
-  half c_half_n8_2 = -8.8;
+// CHECK: %float_7_5 = OpConstant %float 7.5
+  half c_half_7_5 = 7.5;
+// CHECK: %float_n8_80000019 = OpConstant %float -8.80000019
+  half c_half_n8_8 = -8.8;
 
 // Note: in the absence of "-enable-16bit-type" option,
 // 'min{10|16}float' are translated to
@@ -41,6 +41,6 @@ void main() {
 // CHECK: %int_n9 = OpConstant %int -9
   min12int c_min12int = -9;
 // It seems that min12uint is still not supported by the front-end.
-// XXXXX: %uint_12 = OpConstant %uint 12 
+// XXXXX: %uint_12 = OpConstant %uint 12
 //  min12uint c_min12uint = 12;
 }

+ 6 - 6
tools/clang/test/CodeGenSPIRV/constant.scalar.64bit.hlsl

@@ -8,17 +8,17 @@ void main() {
   float64_t c_double_n0 = -0.;
 // CHECK: %double_4_5 = OpConstant %double 4.5
   float64_t c_double_4_5 = 4.5;
-// CHECK: %double_n8_2 = OpConstant %double -8.2
-  double c_double_n8_2 = -8.2;
-// CHECK: %double_1234567898765_32 = OpConstant %double 1234567898765.32
+// CHECK: %double_n8_5 = OpConstant %double -8.5
+  double c_double_n8_5 = -8.5;
+// CHECK: %double_1234567898765_3201 = OpConstant %double 1234567898765.3201
   double c_large  =  1234567898765.32;
-// CHECK: %double_n1234567898765_32 = OpConstant %double -1234567898765.32
+// CHECK: %double_n1234567898765_3201 = OpConstant %double -1234567898765.3201
   float64_t c_nlarge = -1234567898765.32;
 
 // CHECK: %long_1 = OpConstant %long 1
-  int64_t  c_int64_small_1  = 1;  
+  int64_t  c_int64_small_1  = 1;
 // CHECK: %long_n1 = OpConstant %long -1
-  int64_t  c_int64_small_n1  = -1;  
+  int64_t  c_int64_small_n1  = -1;
 // CHECK: %long_2147483648 = OpConstant %long 2147483648
   int64_t  c_int64_large  = 2147483648;
 

+ 3 - 3
tools/clang/test/CodeGenSPIRV/constant.scalar.hlsl

@@ -41,8 +41,8 @@ void main() {
   float c_float_0 = 0.;
 // CHECK: %float_n0 = OpConstant %float -0
   float c_float_n0 = -0.;
-// CHECK: %float_4_2 = OpConstant %float 4.2
-  float c_float_4_2 = 4.2;
-// CHECK: %float_n4_2 = OpConstant %float -4.2
+// CHECK: %float_4_25 = OpConstant %float 4.25
+  float c_float_4_25 = 4.25;
+// CHECK: %float_n4_19999981 = OpConstant %float -4.19999981
   float c_float_n4_2 = -4.2;
 }

+ 2 - 2
tools/clang/test/CodeGenSPIRV/intrinsics.D3DCOLORtoUBYTE4.hlsl

@@ -1,13 +1,13 @@
 // Run: %dxc -T vs_6_0 -E main
 
-// CHECK: %float_255_002 = OpConstant %float 255.002
+// CHECK: %float_255_001999 = OpConstant %float 255.001999
 
 void main() {
   float4 input;
 
 // CHECK:         [[input:%\d+]] = OpLoad %v4float %input
 // CHECK-NEXT: [[swizzled:%\d+]] = OpVectorShuffle %v4float [[input]] [[input]] 2 1 0 3
-// CHECK-NEXT:   [[scaled:%\d+]] = OpVectorTimesScalar %v4float [[swizzled]] %float_255_002
+// CHECK-NEXT:   [[scaled:%\d+]] = OpVectorTimesScalar %v4float [[swizzled]] %float_255_001999
 // CHECK-NEXT:          {{%\d+}} = OpConvertFToS %v4int [[scaled]]
   int4 result = D3DCOLORtoUBYTE4(input);
 }

+ 2 - 2
tools/clang/test/CodeGenSPIRV/intrinsics.log10.hlsl

@@ -4,13 +4,13 @@
 // The 'log10' function can only operate on float, vector of float, and matrix of floats.
 
 // CHECK:  [[glsl:%\d+]] = OpExtInstImport "GLSL.std.450"
-// CHECK: %float_0_30103 = OpConstant %float 0.30103
+// CHECK: %float_0_30103001 = OpConstant %float 0.30103001
 
 void main() {
   float    a, log10_a;
   float4   b, log10_b;
   float2x3 c, log10_c;
-  
+
 // CHECK:           [[a:%\d+]] = OpLoad %float %a
 // CHECK-NEXT: [[log2_a:%\d+]] = OpExtInst %float [[glsl]] Log2 [[a]]
 // CHECK-NEXT:[[log10_a:%\d+]] = OpFMul %float [[log2_a]] %float_0_30103

+ 2 - 2
tools/clang/test/CodeGenSPIRV/texture.array.gather-cmp.hlsl

@@ -9,7 +9,7 @@ TextureCubeArray<float>t4 : register(t4);
 // .GatherCmp() does not support Texture1DArray.
 
 // CHECK: [[v2ic:%\d+]] = OpConstantComposite %v2int %int_1 %int_2
-// CHECK: [[v3fc:%\d+]] = OpConstantComposite %v3float %float_0_1 %float_0_2 %float_0_3
+// CHECK: [[v3fc:%\d+]] = OpConstantComposite %v3float %float_1 %float_2 %float_3
 
 // CHECK: %SparseResidencyStruct = OpTypeStruct %uint %v4float
 
@@ -29,7 +29,7 @@ float4 main(float3 location: A, float comparator: B, int2 offset: C) : SV_Target
 // CHECK-NEXT: [[comparator:%\d+]] = OpLoad %float %comparator
 // CHECK-NEXT: [[sampledImg:%\d+]] = OpSampledImage %type_sampled_image [[t2]] [[gSampler]]
 // CHECK-NEXT:            {{%\d+}} = OpImageDrefGather %v4float [[sampledImg]] [[v3fc]] [[comparator]]
-    float4 val2 = t2.GatherCmp(gSampler, float3(0.1, 0.2, 0.3), comparator);
+    float4 val2 = t2.GatherCmp(gSampler, float3(1, 2, 3), comparator);
 
 // CHECK:              [[t3:%\d+]] = OpLoad %type_2d_image_array %t3
 // CHECK-NEXT:   [[gSampler:%\d+]] = OpLoad %type_sampler %gSampler

+ 4 - 4
tools/clang/test/CodeGenSPIRV/texture.array.gather.hlsl

@@ -11,7 +11,7 @@ TextureCubeArray <float>  t8 : register(t8);
 // CHECK: OpCapability ImageGatherExtended
 // CHECK: OpCapability SparseResidency
 
-// CHECK: [[v4fc:%\d+]] = OpConstantComposite %v4float %float_0_1 %float_0_2 %float_0_3 %float_0_4
+// CHECK: [[v4fc:%\d+]] = OpConstantComposite %v4float %float_1 %float_2 %float_3 %float_4
 
 // CHECK: %SparseResidencyStruct = OpTypeStruct %uint %v4int
 // CHECK: %SparseResidencyStruct_0 = OpTypeStruct %uint %v4float
@@ -30,7 +30,7 @@ float4 main(float3 location: A, int2 offset: B) : SV_Target {
 // CHECK-NEXT:   [[gSampler:%\d+]] = OpLoad %type_sampler %gSampler
 // CHECK-NEXT: [[sampledImg:%\d+]] = OpSampledImage %type_sampled_image_0 [[t4]] [[gSampler]]
 // CHECK-NEXT:            {{%\d+}} = OpImageGather %v4uint [[sampledImg]] [[v4fc]] %int_0
-    uint4 val4 = t4.Gather(gSampler, float4(0.1, 0.2, 0.3, 0.4));
+    uint4 val4 = t4.Gather(gSampler, float4(1, 2, 3, 4));
 
 // CHECK:              [[t6:%\d+]] = OpLoad %type_2d_image_array_0 %t6
 // CHECK-NEXT:   [[gSampler:%\d+]] = OpLoad %type_sampler %gSampler
@@ -44,7 +44,7 @@ float4 main(float3 location: A, int2 offset: B) : SV_Target {
 // CHECK-NEXT:   [[gSampler:%\d+]] = OpLoad %type_sampler %gSampler
 // CHECK-NEXT: [[sampledImg:%\d+]] = OpSampledImage %type_sampled_image_2 [[t8]] [[gSampler]]
 // CHECK-NEXT:            {{%\d+}} = OpImageGather %v4float [[sampledImg]] [[v4fc]] %int_0
-    float4 val8 = t8.Gather(gSampler, float4(0.1, 0.2, 0.3, 0.4));
+    float4 val8 = t8.Gather(gSampler, float4(1, 2, 3, 4));
 
     uint status;
 // CHECK:                [[t6:%\d+]] = OpLoad %type_2d_image_array_0 %t6
@@ -67,7 +67,7 @@ float4 main(float3 location: A, int2 offset: B) : SV_Target {
 // CHECK-NEXT:                         OpStore %status [[status]]
 // CHECK-NEXT:       [[result:%\d+]] = OpCompositeExtract %v4float [[structResult]] 1
 // CHECK-NEXT:                         OpStore %val10 [[result]]
-    float4 val10 = t8.Gather(gSampler, float4(0.1, 0.2, 0.3, 0.4), status);
+    float4 val10 = t8.Gather(gSampler, float4(1, 2, 3, 4), status);
 
     return 1.0;
 }

+ 12 - 12
tools/clang/test/CodeGenSPIRV/texture.array.sample-bias.hlsl

@@ -14,13 +14,13 @@ TextureCubeArray <float3> t5 : register(t5);
 // CHECK: OpCapability MinLod
 // CHECK: OpCapability SparseResidency
 
-// CHECK: [[v2fc:%\d+]] = OpConstantComposite %v2float %float_0_1 %float_1
+// CHECK: [[v2fc:%\d+]] = OpConstantComposite %v2float %float_1 %float_1
 // CHECK: %type_sampled_image = OpTypeSampledImage %type_1d_image_array
 
-// CHECK: [[v3fc:%\d+]] = OpConstantComposite %v3float %float_0_1 %float_0_2 %float_1
+// CHECK: [[v3fc:%\d+]] = OpConstantComposite %v3float %float_1 %float_2 %float_1
 // CHECK: %type_sampled_image_0 = OpTypeSampledImage %type_2d_image_array
 
-// CHECK: [[v4fc:%\d+]] = OpConstantComposite %v4float %float_0_1 %float_0_2 %float_0_3 %float_1
+// CHECK: [[v4fc:%\d+]] = OpConstantComposite %v4float %float_1 %float_2 %float_3 %float_1
 // CHECK: %type_sampled_image_1 = OpTypeSampledImage %type_cube_image_array
 
 // CHECK: %SparseResidencyStruct = OpTypeStruct %uint %v4float
@@ -31,20 +31,20 @@ float4 main(int2 offset : A) : SV_Target {
 // CHECK-NEXT:   [[gSampler:%\d+]] = OpLoad %type_sampler %gSampler
 // CHECK-NEXT: [[sampledImg:%\d+]] = OpSampledImage %type_sampled_image [[t1]] [[gSampler]]
 // CHECK-NEXT:            {{%\d+}} = OpImageSampleImplicitLod %v4float [[sampledImg]] [[v2fc]] Bias|ConstOffset %float_0_5 %int_1
-    float4 val1 = t1.SampleBias(gSampler, float2(0.1, 1), 0.5, 1);
+    float4 val1 = t1.SampleBias(gSampler, float2(1, 1), 0.5, 1);
 
 // CHECK:              [[t2:%\d+]] = OpLoad %type_2d_image_array %t2
 // CHECK-NEXT:   [[gSampler:%\d+]] = OpLoad %type_sampler %gSampler
 // CHECK-NEXT:     [[offset:%\d+]] = OpLoad %v2int %offset
 // CHECK-NEXT: [[sampledImg:%\d+]] = OpSampledImage %type_sampled_image_0 [[t2]] [[gSampler]]
 // CHECK-NEXT:            {{%\d+}} = OpImageSampleImplicitLod %v4float [[sampledImg]] [[v3fc]] Bias|Offset %float_0_5 [[offset]]
-    float4 val2 = t2.SampleBias(gSampler, float3(0.1, 0.2, 1), 0.5, offset);
+    float4 val2 = t2.SampleBias(gSampler, float3(1, 2, 1), 0.5, offset);
 
 // CHECK:              [[t3:%\d+]] = OpLoad %type_cube_image_array %t3
 // CHECK-NEXT:   [[gSampler:%\d+]] = OpLoad %type_sampler %gSampler
 // CHECK-NEXT: [[sampledImg:%\d+]] = OpSampledImage %type_sampled_image_1 [[t3]] [[gSampler]]
 // CHECK-NEXT:            {{%\d+}} = OpImageSampleImplicitLod %v4float [[sampledImg]] [[v4fc]] Bias %float_0_5
-    float4 val3 = t3.SampleBias(gSampler, float4(0.1, 0.2, 0.3, 1), 0.5);
+    float4 val3 = t3.SampleBias(gSampler, float4(1, 2, 3, 1), 0.5);
 
     float clamp;
 // CHECK:           [[clamp:%\d+]] = OpLoad %float %clamp
@@ -52,13 +52,13 @@ float4 main(int2 offset : A) : SV_Target {
 // CHECK-NEXT:   [[gSampler:%\d+]] = OpLoad %type_sampler %gSampler
 // CHECK-NEXT: [[sampledImg:%\d+]] = OpSampledImage %type_sampled_image [[t1]] [[gSampler]]
 // CHECK-NEXT:            {{%\d+}} = OpImageSampleImplicitLod %v4float [[sampledImg]] [[v2fc]] Bias|ConstOffset|MinLod %float_0_5 %int_1 [[clamp]]
-    float4 val4 = t1.SampleBias(gSampler, float2(0.1, 1), 0.5, 1, clamp);
+    float4 val4 = t1.SampleBias(gSampler, float2(1, 1), 0.5, 1, clamp);
 
 // CHECK:              [[t3:%\d+]] = OpLoad %type_cube_image_array %t3
 // CHECK-NEXT:   [[gSampler:%\d+]] = OpLoad %type_sampler %gSampler
 // CHECK-NEXT: [[sampledImg:%\d+]] = OpSampledImage %type_sampled_image_1 [[t3]] [[gSampler]]
 // CHECK-NEXT:            {{%\d+}} = OpImageSampleImplicitLod %v4float [[sampledImg]] [[v4fc]] Bias|MinLod %float_0_5 %float_2_5
-    float4 val5 = t3.SampleBias(gSampler, float4(0.1, 0.2, 0.3, 1), 0.5, /*clamp*/ 2.5f);
+    float4 val5 = t3.SampleBias(gSampler, float4(1, 2, 3, 1), 0.5, /*clamp*/ 2.5f);
 
     uint status;
 // CHECK:             [[clamp:%\d+]] = OpLoad %float %clamp
@@ -70,7 +70,7 @@ float4 main(int2 offset : A) : SV_Target {
 // CHECK-NEXT:                         OpStore %status [[status]]
 // CHECK-NEXT:       [[result:%\d+]] = OpCompositeExtract %v4float [[structResult]] 1
 // CHECK-NEXT:                         OpStore %val6 [[result]]
-    float4 val6 = t1.SampleBias(gSampler, float2(0.1, 1), 0.5, 1, clamp, status);
+    float4 val6 = t1.SampleBias(gSampler, float2(1, 1), 0.5, 1, clamp, status);
 
 // CHECK:                [[t3:%\d+]] = OpLoad %type_cube_image_array %t3
 // CHECK-NEXT:     [[gSampler:%\d+]] = OpLoad %type_sampler %gSampler
@@ -80,7 +80,7 @@ float4 main(int2 offset : A) : SV_Target {
 // CHECK-NEXT:                         OpStore %status [[status]]
 // CHECK-NEXT:       [[result:%\d+]] = OpCompositeExtract %v4float [[structResult]] 1
 // CHECK-NEXT:                         OpStore %val7 [[result]]
-    float4 val7 = t3.SampleBias(gSampler, float4(0.1, 0.2, 0.3, 1), 0.5, /*clamp*/ 2.5f, status);
+    float4 val7 = t3.SampleBias(gSampler, float4(1, 2, 3, 1), 0.5, /*clamp*/ 2.5f, status);
 
 /////////////////////////////////////////////////////////////////////////////////////////////////////////
 // Make sure OpImageSampleImplicitLod returns a vec4.
@@ -89,12 +89,12 @@ float4 main(int2 offset : A) : SV_Target {
 
 // CHECK: [[v4result:%\d+]] = OpImageSampleImplicitLod %v4float {{%\d+}} {{%\d+}} Bias|Offset %float_0_5 {{%\d+}}
 // CHECK:           {{%\d+}} = OpCompositeExtract %float [[v4result]] 0
-    float  val8 = t4.SampleBias(gSampler, float3(0.1, 0.2, 1), 0.5, offset);
+    float  val8 = t4.SampleBias(gSampler, float3(1, 2, 1), 0.5, offset);
 
 // CHECK: [[structResult:%\d+]] = OpImageSparseSampleImplicitLod %SparseResidencyStruct {{%\d+}} {{%\d+}} Bias|MinLod %float_0_5 %float_2_5
 // CHECK:     [[v4result:%\d+]] = OpCompositeExtract %v4float [[structResult]] 1
 // CHECK:              {{%\d+}} = OpVectorShuffle %v3float [[v4result]] [[v4result]] 0 1 2
-    float3 val9 = t5.SampleBias(gSampler, float4(0.1, 0.2, 0.3, 1), 0.5, /*clamp*/ 2.5f, status);
+    float3 val9 = t5.SampleBias(gSampler, float4(1, 2, 3, 1), 0.5, /*clamp*/ 2.5f, status);
 
     return 1.0;
 }

+ 8 - 8
tools/clang/test/CodeGenSPIRV/texture.array.sample-cmp-level-zero.hlsl

@@ -8,9 +8,9 @@ TextureCubeArray <float>  t3 : register(t3);
 
 // CHECK: OpCapability SparseResidency
 
-// CHECK: [[v2fc:%\d+]] = OpConstantComposite %v2float %float_0_1 %float_1
-// CHECK: [[v3fc:%\d+]] = OpConstantComposite %v3float %float_0_1 %float_0_2 %float_1
-// CHECK: [[v4fc:%\d+]] = OpConstantComposite %v4float %float_0_1 %float_0_2 %float_0_3 %float_1
+// CHECK: [[v2fc:%\d+]] = OpConstantComposite %v2float %float_1 %float_1
+// CHECK: [[v3fc:%\d+]] = OpConstantComposite %v3float %float_1 %float_2 %float_1
+// CHECK: [[v4fc:%\d+]] = OpConstantComposite %v4float %float_1 %float_2 %float_3 %float_1
 
 // CHECK: %SparseResidencyStruct = OpTypeStruct %uint %float
 
@@ -20,7 +20,7 @@ float4 main(int2 offset: A, float comparator: B) : SV_Target {
 // CHECK-NEXT: [[comparator:%\d+]] = OpLoad %float %comparator
 // CHECK-NEXT: [[sampledImg:%\d+]] = OpSampledImage %type_sampled_image [[t1]] [[gSampler]]
 // CHECK-NEXT:            {{%\d+}} = OpImageSampleDrefExplicitLod %float [[sampledImg]] [[v2fc]] [[comparator]] Lod|ConstOffset %float_0 %int_1
-    float val1 = t1.SampleCmpLevelZero(gSampler, float2(0.1, 1), comparator, 1);
+    float val1 = t1.SampleCmpLevelZero(gSampler, float2(1, 1), comparator, 1);
 
 // CHECK:              [[t2:%\d+]] = OpLoad %type_2d_image_array %t2
 // CHECK-NEXT:   [[gSampler:%\d+]] = OpLoad %type_sampler %gSampler
@@ -28,14 +28,14 @@ float4 main(int2 offset: A, float comparator: B) : SV_Target {
 // CHECK-NEXT:     [[offset:%\d+]] = OpLoad %v2int %offset
 // CHECK-NEXT: [[sampledImg:%\d+]] = OpSampledImage %type_sampled_image_0 [[t2]] [[gSampler]]
 // CHECK-NEXT:            {{%\d+}} = OpImageSampleDrefExplicitLod %float [[sampledImg]] [[v3fc]] [[comparator]] Lod|Offset %float_0 [[offset]]
-    float val2 = t2.SampleCmpLevelZero(gSampler, float3(0.1, 0.2, 1), comparator, offset);
+    float val2 = t2.SampleCmpLevelZero(gSampler, float3(1, 2, 1), comparator, offset);
 
 // CHECK:              [[t3:%\d+]] = OpLoad %type_cube_image_array %t3
 // CHECK-NEXT:   [[gSampler:%\d+]] = OpLoad %type_sampler %gSampler
 // CHECK-NEXT: [[comparator:%\d+]] = OpLoad %float %comparator
 // CHECK-NEXT: [[sampledImg:%\d+]] = OpSampledImage %type_sampled_image_1 [[t3]] [[gSampler]]
 // CHECK-NEXT:            {{%\d+}} = OpImageSampleDrefExplicitLod %float [[sampledImg]] [[v4fc]] [[comparator]] Lod %float_0
-    float val3 = t3.SampleCmpLevelZero(gSampler, float4(0.1, 0.2, 0.3, 1), comparator);
+    float val3 = t3.SampleCmpLevelZero(gSampler, float4(1, 2, 3, 1), comparator);
 
     uint status;
 // CHECK:                [[t2:%\d+]] = OpLoad %type_2d_image_array %t2
@@ -48,7 +48,7 @@ float4 main(int2 offset: A, float comparator: B) : SV_Target {
 // CHECK-NEXT:                         OpStore %status [[status]]
 // CHECK-NEXT:       [[result:%\d+]] = OpCompositeExtract %float [[structResult]] 1
 // CHECK-NEXT:                         OpStore %val4 [[result]]
-    float val4 = t2.SampleCmpLevelZero(gSampler, float3(0.1, 0.2, 1), comparator, offset, status);
+    float val4 = t2.SampleCmpLevelZero(gSampler, float3(1, 2, 1), comparator, offset, status);
 
 // CHECK:                [[t3:%\d+]] = OpLoad %type_cube_image_array %t3
 // CHECK-NEXT:     [[gSampler:%\d+]] = OpLoad %type_sampler %gSampler
@@ -59,7 +59,7 @@ float4 main(int2 offset: A, float comparator: B) : SV_Target {
 // CHECK-NEXT:                         OpStore %status [[status]]
 // CHECK-NEXT:       [[result:%\d+]] = OpCompositeExtract %float [[structResult]] 1
 // CHECK-NEXT:                         OpStore %val5 [[result]]
-    float val5 = t3.SampleCmpLevelZero(gSampler, float4(0.1, 0.2, 0.3, 1), comparator, status);
+    float val5 = t3.SampleCmpLevelZero(gSampler, float4(1, 2, 3, 1), comparator, status);
 
     return 1.0;
 }

+ 10 - 10
tools/clang/test/CodeGenSPIRV/texture.array.sample-cmp.hlsl

@@ -9,9 +9,9 @@ TextureCubeArray <float>  t3 : register(t3);
 // CHECK: OpCapability MinLod
 // CHECK: OpCapability SparseResidency
 
-// CHECK: [[v2fc:%\d+]] = OpConstantComposite %v2float %float_0_1 %float_1
-// CHECK: [[v3fc:%\d+]] = OpConstantComposite %v3float %float_0_1 %float_0_2 %float_1
-// CHECK: [[v4fc:%\d+]] = OpConstantComposite %v4float %float_0_1 %float_0_2 %float_0_3 %float_1
+// CHECK: [[v2fc:%\d+]] = OpConstantComposite %v2float %float_1 %float_1
+// CHECK: [[v3fc:%\d+]] = OpConstantComposite %v3float %float_1 %float_2 %float_1
+// CHECK: [[v4fc:%\d+]] = OpConstantComposite %v4float %float_1 %float_2 %float_3 %float_1
 
 // CHECK: %SparseResidencyStruct = OpTypeStruct %uint %float
 
@@ -21,7 +21,7 @@ float4 main(int2 offset: A, float comparator: B) : SV_Target {
 // CHECK-NEXT: [[comparator:%\d+]] = OpLoad %float %comparator
 // CHECK-NEXT: [[sampledImg:%\d+]] = OpSampledImage %type_sampled_image [[t1]] [[gSampler]]
 // CHECK-NEXT:            {{%\d+}} = OpImageSampleDrefImplicitLod %float [[sampledImg]] [[v2fc]] [[comparator]] ConstOffset %int_1
-    float val1 = t1.SampleCmp(gSampler, float2(0.1, 1), comparator, 1);
+    float val1 = t1.SampleCmp(gSampler, float2(1, 1), comparator, 1);
 
 // CHECK:              [[t2:%\d+]] = OpLoad %type_2d_image_array %t2
 // CHECK-NEXT:   [[gSampler:%\d+]] = OpLoad %type_sampler %gSampler
@@ -29,14 +29,14 @@ float4 main(int2 offset: A, float comparator: B) : SV_Target {
 // CHECK-NEXT:     [[offset:%\d+]] = OpLoad %v2int %offset
 // CHECK-NEXT: [[sampledImg:%\d+]] = OpSampledImage %type_sampled_image_0 [[t2]] [[gSampler]]
 // CHECK-NEXT:            {{%\d+}} = OpImageSampleDrefImplicitLod %float [[sampledImg]] [[v3fc]] [[comparator]] Offset [[offset]]
-    float val2 = t2.SampleCmp(gSampler, float3(0.1, 0.2, 1), comparator, offset);
+    float val2 = t2.SampleCmp(gSampler, float3(1, 2, 1), comparator, offset);
 
 // CHECK:              [[t3:%\d+]] = OpLoad %type_cube_image_array %t3
 // CHECK-NEXT:   [[gSampler:%\d+]] = OpLoad %type_sampler %gSampler
 // CHECK-NEXT: [[comparator:%\d+]] = OpLoad %float %comparator
 // CHECK-NEXT: [[sampledImg:%\d+]] = OpSampledImage %type_sampled_image_1 [[t3]] [[gSampler]]
 // CHECK-NEXT:            {{%\d+}} = OpImageSampleDrefImplicitLod %float [[sampledImg]] [[v4fc]] [[comparator]]
-    float val3 = t3.SampleCmp(gSampler, float4(0.1, 0.2, 0.3, 1), comparator);
+    float val3 = t3.SampleCmp(gSampler, float4(1, 2, 3, 1), comparator);
 
     float clamp;
 // CHECK:           [[clamp:%\d+]] = OpLoad %float %clamp
@@ -46,14 +46,14 @@ float4 main(int2 offset: A, float comparator: B) : SV_Target {
 // CHECK-NEXT:     [[offset:%\d+]] = OpLoad %v2int %offset
 // CHECK-NEXT: [[sampledImg:%\d+]] = OpSampledImage %type_sampled_image_0 [[t2]] [[gSampler]]
 // CHECK-NEXT:            {{%\d+}} = OpImageSampleDrefImplicitLod %float [[sampledImg]] [[v3fc]] [[comparator]] Offset|MinLod [[offset]] [[clamp]]
-    float val4 = t2.SampleCmp(gSampler, float3(0.1, 0.2, 1), comparator, offset, clamp);
+    float val4 = t2.SampleCmp(gSampler, float3(1, 2, 1), comparator, offset, clamp);
 
 // CHECK:              [[t3:%\d+]] = OpLoad %type_cube_image_array %t3
 // CHECK-NEXT:   [[gSampler:%\d+]] = OpLoad %type_sampler %gSampler
 // CHECK-NEXT: [[comparator:%\d+]] = OpLoad %float %comparator
 // CHECK-NEXT: [[sampledImg:%\d+]] = OpSampledImage %type_sampled_image_1 [[t3]] [[gSampler]]
 // CHECK-NEXT:            {{%\d+}} = OpImageSampleDrefImplicitLod %float [[sampledImg]] [[v4fc]] [[comparator]] MinLod %float_1_5
-    float val5 = t3.SampleCmp(gSampler, float4(0.1, 0.2, 0.3, 1), comparator, /*clamp*/ 1.5);
+    float val5 = t3.SampleCmp(gSampler, float4(1, 2, 3, 1), comparator, /*clamp*/ 1.5);
 
     uint status;
 // CHECK:             [[clamp:%\d+]] = OpLoad %float %clamp
@@ -67,7 +67,7 @@ float4 main(int2 offset: A, float comparator: B) : SV_Target {
 // CHECK-NEXT:                         OpStore %status [[status]]
 // CHECK-NEXT:       [[result:%\d+]] = OpCompositeExtract %float [[structResult]] 1
 // CHECK-NEXT:                         OpStore %val6 [[result]]
-    float val6 = t2.SampleCmp(gSampler, float3(0.1, 0.2, 1), comparator, offset, clamp, status);
+    float val6 = t2.SampleCmp(gSampler, float3(1, 2, 1), comparator, offset, clamp, status);
 
 // CHECK:                [[t3:%\d+]] = OpLoad %type_cube_image_array %t3
 // CHECK-NEXT:     [[gSampler:%\d+]] = OpLoad %type_sampler %gSampler
@@ -78,7 +78,7 @@ float4 main(int2 offset: A, float comparator: B) : SV_Target {
 // CHECK-NEXT:                         OpStore %status [[status]]
 // CHECK-NEXT:       [[result:%\d+]] = OpCompositeExtract %float [[structResult]] 1
 // CHECK-NEXT:                         OpStore %val7 [[result]]
-    float val7 = t3.SampleCmp(gSampler, float4(0.1, 0.2, 0.3, 1), comparator, /*clamp*/ 1.5, status);
+    float val7 = t3.SampleCmp(gSampler, float4(1, 2, 3, 1), comparator, /*clamp*/ 1.5, status);
 
     return 1.0;
 }

+ 23 - 23
tools/clang/test/CodeGenSPIRV/texture.array.sample-grad.hlsl

@@ -15,17 +15,17 @@ TextureCubeArray <float2> t5 : register(t5);
 // CHECK: OpCapability MinLod
 // CHECK: OpCapability SparseResidency
 
-// CHECK: [[v2f_0_1:%\d+]] = OpConstantComposite %v2float %float_0_1 %float_0_1
+// CHECK: [[v2f_1:%\d+]] = OpConstantComposite %v2float %float_1 %float_1
 // CHECK: %type_sampled_image = OpTypeSampledImage %type_1d_image_array
 
-// CHECK: [[v3f_0_1:%\d+]] = OpConstantComposite %v3float %float_0_1 %float_0_1 %float_0_1
-// CHECK: [[v2f_0_2:%\d+]] = OpConstantComposite %v2float %float_0_2 %float_0_2
-// CHECK: [[v2f_0_3:%\d+]] = OpConstantComposite %v2float %float_0_3 %float_0_3
+// CHECK: [[v3f_1:%\d+]] = OpConstantComposite %v3float %float_1 %float_1 %float_1
+// CHECK: [[v2f_2:%\d+]] = OpConstantComposite %v2float %float_2 %float_2
+// CHECK: [[v2f_3:%\d+]] = OpConstantComposite %v2float %float_3 %float_3
 // CHECK: %type_sampled_image_0 = OpTypeSampledImage %type_2d_image_array
 
-// CHECK: [[v4f_0_1:%\d+]] = OpConstantComposite %v4float %float_0_1 %float_0_1 %float_0_1 %float_0_1
-// CHECK: [[v3f_0_2:%\d+]] = OpConstantComposite %v3float %float_0_2 %float_0_2 %float_0_2
-// CHECK: [[v3f_0_3:%\d+]] = OpConstantComposite %v3float %float_0_3 %float_0_3 %float_0_3
+// CHECK: [[v4f_1:%\d+]] = OpConstantComposite %v4float %float_1 %float_1 %float_1 %float_1
+// CHECK: [[v3f_2:%\d+]] = OpConstantComposite %v3float %float_2 %float_2 %float_2
+// CHECK: [[v3f_3:%\d+]] = OpConstantComposite %v3float %float_3 %float_3 %float_3
 // CHECK: %type_sampled_image_1 = OpTypeSampledImage %type_cube_image_array
 
 // CHECK: %SparseResidencyStruct = OpTypeStruct %uint %v4float
@@ -34,59 +34,59 @@ float4 main(int2 offset : A) : SV_Target {
 // CHECK:              [[t1:%\d+]] = OpLoad %type_1d_image_array %t1
 // CHECK-NEXT:   [[gSampler:%\d+]] = OpLoad %type_sampler %gSampler
 // CHECK-NEXT: [[sampledImg:%\d+]] = OpSampledImage %type_sampled_image [[t1]] [[gSampler]]
-// CHECK-NEXT:            {{%\d+}} = OpImageSampleExplicitLod %v4float [[sampledImg]] [[v2f_0_1]] Grad|ConstOffset %float_0_2 %float_0_3 %int_1
-    float4 val1 = t1.SampleGrad(gSampler, float2(0.1, 0.1), 0.2, 0.3, 1);
+// CHECK-NEXT:            {{%\d+}} = OpImageSampleExplicitLod %v4float [[sampledImg]] [[v2f_1]] Grad|ConstOffset %float_2 %float_3 %int_1
+    float4 val1 = t1.SampleGrad(gSampler, float2(1, 1), 2, 3, 1);
 
 // CHECK:              [[t2:%\d+]] = OpLoad %type_2d_image_array %t2
 // CHECK-NEXT:   [[gSampler:%\d+]] = OpLoad %type_sampler %gSampler
 // CHECK-NEXT:     [[offset:%\d+]] = OpLoad %v2int %offset
 // CHECK-NEXT: [[sampledImg:%\d+]] = OpSampledImage %type_sampled_image_0 [[t2]] [[gSampler]]
-// CHECK-NEXT:            {{%\d+}} = OpImageSampleExplicitLod %v4float [[sampledImg]] [[v3f_0_1]] Grad|Offset [[v2f_0_2]] [[v2f_0_3]] [[offset]]
-    float4 val2 = t2.SampleGrad(gSampler, float3(0.1, 0.1, 0.1), float2(0.2, 0.2), float2(0.3, 0.3), offset);
+// CHECK-NEXT:            {{%\d+}} = OpImageSampleExplicitLod %v4float [[sampledImg]] [[v3f_1]] Grad|Offset [[v2f_2]] [[v2f_3]] [[offset]]
+    float4 val2 = t2.SampleGrad(gSampler, float3(1, 1, 1), float2(2, 2), float2(3, 3), offset);
 
 // CHECK:              [[t3:%\d+]] = OpLoad %type_cube_image_array %t3
 // CHECK-NEXT:   [[gSampler:%\d+]] = OpLoad %type_sampler %gSampler
 // CHECK-NEXT: [[sampledImg:%\d+]] = OpSampledImage %type_sampled_image_1 [[t3]] [[gSampler]]
-// CHECK-NEXT:            {{%\d+}} = OpImageSampleExplicitLod %v4float [[sampledImg]] [[v4f_0_1]] Grad [[v3f_0_2]] [[v3f_0_3]]
-    float4 val3 = t3.SampleGrad(gSampler, float4(0.1, 0.1, 0.1, 0.1), float3(0.2, 0.2, 0.2), float3(0.3, 0.3, 0.3));
+// CHECK-NEXT:            {{%\d+}} = OpImageSampleExplicitLod %v4float [[sampledImg]] [[v4f_1]] Grad [[v3f_2]] [[v3f_3]]
+    float4 val3 = t3.SampleGrad(gSampler, float4(1, 1, 1, 1), float3(2, 2, 2), float3(3, 3, 3));
 
 // CHECK:              [[t2:%\d+]] = OpLoad %type_2d_image_array %t2
 // CHECK-NEXT:   [[gSampler:%\d+]] = OpLoad %type_sampler %gSampler
 // CHECK-NEXT:     [[offset:%\d+]] = OpLoad %v2int %offset
 // CHECK-NEXT: [[sampledImg:%\d+]] = OpSampledImage %type_sampled_image_0 [[t2]] [[gSampler]]
-// CHECK-NEXT:            {{%\d+}} = OpImageSampleExplicitLod %v4float [[sampledImg]] [[v3f_0_1]] Grad|Offset|MinLod [[v2f_0_2]] [[v2f_0_3]] [[offset]] %float_2_5
-    float4 val4 = t2.SampleGrad(gSampler, float3(0.1, 0.1, 0.1), float2(0.2, 0.2), float2(0.3, 0.3), offset, /*clamp*/2.5);
+// CHECK-NEXT:            {{%\d+}} = OpImageSampleExplicitLod %v4float [[sampledImg]] [[v3f_1]] Grad|Offset|MinLod [[v2f_2]] [[v2f_3]] [[offset]] %float_2_5
+    float4 val4 = t2.SampleGrad(gSampler, float3(1, 1, 1), float2(2, 2), float2(3, 3), offset, /*clamp*/2.5);
 
     float clamp;
 // CHECK:           [[clamp:%\d+]] = OpLoad %float %clamp
 // CHECK-NEXT:         [[t3:%\d+]] = OpLoad %type_cube_image_array %t3
 // CHECK-NEXT:   [[gSampler:%\d+]] = OpLoad %type_sampler %gSampler
 // CHECK-NEXT: [[sampledImg:%\d+]] = OpSampledImage %type_sampled_image_1 [[t3]] [[gSampler]]
-// CHECK-NEXT:            {{%\d+}} = OpImageSampleExplicitLod %v4float [[sampledImg]] [[v4f_0_1]] Grad|MinLod [[v3f_0_2]] [[v3f_0_3]] [[clamp]]
-    float4 val5 = t3.SampleGrad(gSampler, float4(0.1, 0.1, 0.1, 0.1), float3(0.2, 0.2, 0.2), float3(0.3, 0.3, 0.3), clamp);
+// CHECK-NEXT:            {{%\d+}} = OpImageSampleExplicitLod %v4float [[sampledImg]] [[v4f_1]] Grad|MinLod [[v3f_2]] [[v3f_3]] [[clamp]]
+    float4 val5 = t3.SampleGrad(gSampler, float4(1, 1, 1, 1), float3(2, 2, 2), float3(3, 3, 3), clamp);
 
     uint status;
 // CHECK:                [[t2:%\d+]] = OpLoad %type_2d_image_array %t2
 // CHECK-NEXT:     [[gSampler:%\d+]] = OpLoad %type_sampler %gSampler
 // CHECK-NEXT:       [[offset:%\d+]] = OpLoad %v2int %offset
 // CHECK-NEXT:   [[sampledImg:%\d+]] = OpSampledImage %type_sampled_image_0 [[t2]] [[gSampler]]
-// CHECK-NEXT: [[structResult:%\d+]] = OpImageSparseSampleExplicitLod %SparseResidencyStruct [[sampledImg]] [[v3f_0_1]] Grad|Offset|MinLod [[v2f_0_2]] [[v2f_0_3]] [[offset]] %float_2_5
+// CHECK-NEXT: [[structResult:%\d+]] = OpImageSparseSampleExplicitLod %SparseResidencyStruct [[sampledImg]] [[v3f_1]] Grad|Offset|MinLod [[v2f_2]] [[v2f_3]] [[offset]] %float_2_5
 // CHECK-NEXT:       [[status:%\d+]] = OpCompositeExtract %uint [[structResult]] 0
 // CHECK-NEXT:                         OpStore %status [[status]]
 // CHECK-NEXT:       [[result:%\d+]] = OpCompositeExtract %v4float [[structResult]] 1
 // CHECK-NEXT:                         OpStore %val6 [[result]]
-    float4 val6 = t2.SampleGrad(gSampler, float3(0.1, 0.1, 0.1), float2(0.2, 0.2), float2(0.3, 0.3), offset, /*clamp*/2.5, status);
+    float4 val6 = t2.SampleGrad(gSampler, float3(1, 1, 1), float2(2, 2), float2(3, 3), offset, /*clamp*/2.5, status);
 
 // CHECK:             [[clamp:%\d+]] = OpLoad %float %clamp
 // CHECK-NEXT:           [[t3:%\d+]] = OpLoad %type_cube_image_array %t3
 // CHECK-NEXT:     [[gSampler:%\d+]] = OpLoad %type_sampler %gSampler
 // CHECK-NEXT:   [[sampledImg:%\d+]] = OpSampledImage %type_sampled_image_1 [[t3]] [[gSampler]]
-// CHECK-NEXT: [[structResult:%\d+]] = OpImageSparseSampleExplicitLod %SparseResidencyStruct [[sampledImg]] [[v4f_0_1]] Grad|MinLod [[v3f_0_2]] [[v3f_0_3]] [[clamp]]
+// CHECK-NEXT: [[structResult:%\d+]] = OpImageSparseSampleExplicitLod %SparseResidencyStruct [[sampledImg]] [[v4f_1]] Grad|MinLod [[v3f_2]] [[v3f_3]] [[clamp]]
 // CHECK-NEXT:       [[status:%\d+]] = OpCompositeExtract %uint [[structResult]] 0
 // CHECK-NEXT:                         OpStore %status [[status]]
 // CHECK-NEXT:       [[result:%\d+]] = OpCompositeExtract %v4float [[structResult]] 1
 // CHECK-NEXT:                         OpStore %val7 [[result]]
-    float4 val7 = t3.SampleGrad(gSampler, float4(0.1, 0.1, 0.1, 0.1), float3(0.2, 0.2, 0.2), float3(0.3, 0.3, 0.3), clamp, status);
+    float4 val7 = t3.SampleGrad(gSampler, float4(1, 1, 1, 1), float3(2, 2, 2), float3(3, 3, 3), clamp, status);
 
 /////////////////////////////////////////////////////////////////////////////////////////////////////////
 // Make sure OpImageSampleExplicitLod returns a vec4.
@@ -95,12 +95,12 @@ float4 main(int2 offset : A) : SV_Target {
 
 // CHECK: [[v4result:%\d+]] = OpImageSampleExplicitLod %v4float {{%\d+}} {{%\d+}} Grad|Offset {{%\d+}} {{%\d+}} {{%\d+}}
 // CHECK:          {{%\d+}} = OpCompositeExtract %float [[v4result]] 0
-	float  val8 = t4.SampleGrad(gSampler, float3(0.1, 0.1, 0.1), float2(0.2, 0.2), float2(0.3, 0.3), offset);
+	float  val8 = t4.SampleGrad(gSampler, float3(1, 1, 1), float2(2, 2), float2(3, 3), offset);
 
 // CHECK: [[structResult:%\d+]] = OpImageSparseSampleExplicitLod %SparseResidencyStruct {{%\d+}} {{%\d+}} Grad|MinLod {{%\d+}} {{%\d+}} {{%\d+}}
 // CHECK:     [[v4result:%\d+]] = OpCompositeExtract %v4float [[structResult]] 1
 // CHECK:              {{%\d+}} = OpVectorShuffle %v2float [[v4result]] [[v4result]] 0 1
-    float2 val9 = t5.SampleGrad(gSampler, float4(0.1, 0.1, 0.1, 0.1), float3(0.2, 0.2, 0.2), float3(0.3, 0.3, 0.3), clamp, status);
+    float2 val9 = t5.SampleGrad(gSampler, float4(1, 1, 1, 1), float3(2, 2, 2), float3(3, 3, 3), clamp, status);
 
     return 1.0;
 }

+ 10 - 10
tools/clang/test/CodeGenSPIRV/texture.array.sample-level.hlsl

@@ -13,13 +13,13 @@ TextureCubeArray <float3> t5 : register(t5);
 // CHECK: OpCapability ImageGatherExtended
 // CHECK: OpCapability SparseResidency
 
-// CHECK: [[v2fc:%\d+]] = OpConstantComposite %v2float %float_0_1 %float_1
+// CHECK: [[v2fc:%\d+]] = OpConstantComposite %v2float %float_1 %float_1
 // CHECK: %type_sampled_image = OpTypeSampledImage %type_1d_image_array
 
-// CHECK: [[v3fc:%\d+]] = OpConstantComposite %v3float %float_0_1 %float_0_2 %float_1
+// CHECK: [[v3fc:%\d+]] = OpConstantComposite %v3float %float_1 %float_2 %float_1
 // CHECK: %type_sampled_image_0 = OpTypeSampledImage %type_2d_image_array
 
-// CHECK: [[v4fc:%\d+]] = OpConstantComposite %v4float %float_0_1 %float_0_2 %float_0_3 %float_1
+// CHECK: [[v4fc:%\d+]] = OpConstantComposite %v4float %float_1 %float_2 %float_3 %float_1
 // CHECK: %type_sampled_image_1 = OpTypeSampledImage %type_cube_image_array
 
 // CHECK: %SparseResidencyStruct = OpTypeStruct %uint %v4float
@@ -29,20 +29,20 @@ float4 main(int2 offset : A) : SV_Target {
 // CHECK-NEXT:   [[gSampler:%\d+]] = OpLoad %type_sampler %gSampler
 // CHECK-NEXT: [[sampledImg:%\d+]] = OpSampledImage %type_sampled_image [[t1]] [[gSampler]]
 // CHECK-NEXT:            {{%\d+}} = OpImageSampleExplicitLod %v4float [[sampledImg]] [[v2fc]] Lod|ConstOffset %float_10 %int_1
-    float4 val1 = t1.SampleLevel(gSampler, float2(0.1, 1), 10, 1);
+    float4 val1 = t1.SampleLevel(gSampler, float2(1, 1), 10, 1);
 
 // CHECK:              [[t2:%\d+]] = OpLoad %type_2d_image_array %t2
 // CHECK-NEXT:   [[gSampler:%\d+]] = OpLoad %type_sampler %gSampler
 // CHECK-NEXT:     [[offset:%\d+]] = OpLoad %v2int %offset
 // CHECK-NEXT: [[sampledImg:%\d+]] = OpSampledImage %type_sampled_image_0 [[t2]] [[gSampler]]
 // CHECK-NEXT:            {{%\d+}} = OpImageSampleExplicitLod %v4float [[sampledImg]] [[v3fc]] Lod|Offset %float_20 [[offset]]
-    float4 val2 = t2.SampleLevel(gSampler, float3(0.1, 0.2, 1), 20, offset);
+    float4 val2 = t2.SampleLevel(gSampler, float3(1, 2, 1), 20, offset);
 
 // CHECK:              [[t3:%\d+]] = OpLoad %type_cube_image_array %t3
 // CHECK-NEXT:   [[gSampler:%\d+]] = OpLoad %type_sampler %gSampler
 // CHECK-NEXT: [[sampledImg:%\d+]] = OpSampledImage %type_sampled_image_1 [[t3]] [[gSampler]]
 // CHECK-NEXT:            {{%\d+}} = OpImageSampleExplicitLod %v4float [[sampledImg]] [[v4fc]] Lod %float_30
-    float4 val3 = t3.SampleLevel(gSampler, float4(0.1, 0.2, 0.3, 1), 30);
+    float4 val3 = t3.SampleLevel(gSampler, float4(1, 2, 3, 1), 30);
 
     uint status;
 // CHECK:                [[t2:%\d+]] = OpLoad %type_2d_image_array %t2
@@ -54,7 +54,7 @@ float4 main(int2 offset : A) : SV_Target {
 // CHECK-NEXT:                         OpStore %status [[status]]
 // CHECK-NEXT:       [[result:%\d+]] = OpCompositeExtract %v4float [[structResult]] 1
 // CHECK-NEXT:                         OpStore %val4 [[result]]
-    float4 val4 = t2.SampleLevel(gSampler, float3(0.1, 0.2, 1), 20, offset, status);
+    float4 val4 = t2.SampleLevel(gSampler, float3(1, 2, 1), 20, offset, status);
 
 // CHECK:                [[t3:%\d+]] = OpLoad %type_cube_image_array %t3
 // CHECK-NEXT:     [[gSampler:%\d+]] = OpLoad %type_sampler %gSampler
@@ -64,7 +64,7 @@ float4 main(int2 offset : A) : SV_Target {
 // CHECK-NEXT:                         OpStore %status [[status]]
 // CHECK-NEXT:       [[result:%\d+]] = OpCompositeExtract %v4float [[structResult]] 1
 // CHECK-NEXT:                         OpStore %val5 [[result]]
-    float4 val5 = t3.SampleLevel(gSampler, float4(0.1, 0.2, 0.3, 1), 30, status);
+    float4 val5 = t3.SampleLevel(gSampler, float4(1, 2, 3, 1), 30, status);
 
 /////////////////////////////////////////////////////////////////////////////////////////////////////////
 // Make sure OpImageSampleExplicitLod returns a vec4.
@@ -73,12 +73,12 @@ float4 main(int2 offset : A) : SV_Target {
 
 // CHECK: [[v4result:%\d+]] = OpImageSampleExplicitLod %v4float {{%\d+}} {{%\d+}} Lod|Offset %float_20 {{%\d+}}
 // CHECK:          {{%\d+}} = OpCompositeExtract %float [[v4result]] 0
-    float val6 = t4.SampleLevel(gSampler, float3(0.1, 0.2, 1), 20, offset);
+    float val6 = t4.SampleLevel(gSampler, float3(1, 2, 1), 20, offset);
 
 // CHECK: [[structResult:%\d+]] = OpImageSparseSampleExplicitLod %SparseResidencyStruct {{%\d+}} {{%\d+}} Lod %float_30
 // CHECK:     [[v4result:%\d+]] = OpCompositeExtract %v4float [[structResult]] 1
 // CHECK:              {{%\d+}} = OpVectorShuffle %v3float [[v4result]] [[v4result]] 0 1 2
-    float3 val7 = t5.SampleLevel(gSampler, float4(0.1, 0.2, 0.3, 1), 30, status);
+    float3 val7 = t5.SampleLevel(gSampler, float4(1, 2, 3, 1), 30, status);
 
     return 1.0;
 }

+ 12 - 12
tools/clang/test/CodeGenSPIRV/texture.array.sample.hlsl

@@ -13,13 +13,13 @@ TextureCubeArray <float3> t5 : register(t5);
 // CHECK: OpCapability MinLod
 // CHECK: OpCapability SparseResidency
 
-// CHECK: [[v2fc:%\d+]] = OpConstantComposite %v2float %float_0_1 %float_1
+// CHECK: [[v2fc:%\d+]] = OpConstantComposite %v2float %float_0_5 %float_1
 // CHECK: %type_sampled_image = OpTypeSampledImage %type_1d_image_array
 
-// CHECK: [[v3fc:%\d+]] = OpConstantComposite %v3float %float_0_1 %float_0_2 %float_1
+// CHECK: [[v3fc:%\d+]] = OpConstantComposite %v3float %float_0_5 %float_0_25 %float_1
 // CHECK: %type_sampled_image_0 = OpTypeSampledImage %type_2d_image_array
 
-// CHECK: [[v4fc:%\d+]] = OpConstantComposite %v4float %float_0_1 %float_0_2 %float_0_3 %float_1
+// CHECK: [[v4fc:%\d+]] = OpConstantComposite %v4float %float_0_5 %float_0_25 %float_0_125 %float_1
 // CHECK: %type_sampled_image_1 = OpTypeSampledImage %type_cube_image_array
 
 // CHECK: %SparseResidencyStruct = OpTypeStruct %uint %v4float
@@ -29,19 +29,19 @@ float4 main() : SV_Target {
 // CHECK-NEXT:   [[gSampler:%\d+]] = OpLoad %type_sampler %gSampler
 // CHECK-NEXT: [[sampledImg:%\d+]] = OpSampledImage %type_sampled_image [[t1]] [[gSampler]]
 // CHECK-NEXT:            {{%\d+}} = OpImageSampleImplicitLod %v4float [[sampledImg]] [[v2fc]] ConstOffset %int_1
-    float4 val1 = t1.Sample(gSampler, float2(0.1, 1), 1);
+    float4 val1 = t1.Sample(gSampler, float2(0.5, 1), 1);
 
 // CHECK:              [[t2:%\d+]] = OpLoad %type_2d_image_array %t2
 // CHECK-NEXT:   [[gSampler:%\d+]] = OpLoad %type_sampler %gSampler
 // CHECK-NEXT: [[sampledImg:%\d+]] = OpSampledImage %type_sampled_image_0 [[t2]] [[gSampler]]
 // CHECK-NEXT:            {{%\d+}} = OpImageSampleImplicitLod %v4float [[sampledImg]] [[v3fc]]
-    float4 val2 = t2.Sample(gSampler, float3(0.1, 0.2, 1));
+    float4 val2 = t2.Sample(gSampler, float3(0.5, 0.25, 1));
 
 // CHECK:              [[t3:%\d+]] = OpLoad %type_cube_image_array %t3
 // CHECK-NEXT:   [[gSampler:%\d+]] = OpLoad %type_sampler %gSampler
 // CHECK-NEXT: [[sampledImg:%\d+]] = OpSampledImage %type_sampled_image_1 [[t3]] [[gSampler]]
 // CHECK-NEXT:            {{%\d+}} = OpImageSampleImplicitLod %v4float [[sampledImg]] [[v4fc]]
-    float4 val3 = t3.Sample(gSampler, float4(0.1, 0.2, 0.3, 1));
+    float4 val3 = t3.Sample(gSampler, float4(0.5, 0.25, 0.125, 1));
 
     float clamp;
 // CHECK:           [[clamp:%\d+]] = OpLoad %float %clamp
@@ -49,13 +49,13 @@ float4 main() : SV_Target {
 // CHECK-NEXT:   [[gSampler:%\d+]] = OpLoad %type_sampler %gSampler
 // CHECK-NEXT: [[sampledImg:%\d+]] = OpSampledImage %type_sampled_image [[t1]] [[gSampler]]
 // CHECK-NEXT:            {{%\d+}} = OpImageSampleImplicitLod %v4float [[sampledImg]] [[v2fc]] ConstOffset|MinLod %int_1 [[clamp]]
-    float4 val4 = t1.Sample(gSampler, float2(0.1, 1), 1, clamp);
+    float4 val4 = t1.Sample(gSampler, float2(0.5, 1), 1, clamp);
 
 // CHECK:              [[t3:%\d+]] = OpLoad %type_cube_image_array %t3
 // CHECK-NEXT:   [[gSampler:%\d+]] = OpLoad %type_sampler %gSampler
 // CHECK-NEXT: [[sampledImg:%\d+]] = OpSampledImage %type_sampled_image_1 [[t3]] [[gSampler]]
 // CHECK-NEXT:            {{%\d+}} = OpImageSampleImplicitLod %v4float [[sampledImg]] [[v4fc]] MinLod %float_1_5
-    float4 val5 = t3.Sample(gSampler, float4(0.1, 0.2, 0.3, 1), /*clamp*/ 1.5);
+    float4 val5 = t3.Sample(gSampler, float4(0.5, 0.25, 0.125, 1), /*clamp*/ 1.5);
 
     uint status;
 // CHECK:             [[clamp:%\d+]] = OpLoad %float %clamp
@@ -67,7 +67,7 @@ float4 main() : SV_Target {
 // CHECK-NEXT:                         OpStore %status [[status]]
 // CHECK-NEXT:       [[result:%\d+]] = OpCompositeExtract %v4float [[structResult]] 1
 // CHECK-NEXT:                         OpStore %val6 [[result]]
-    float4 val6 = t1.Sample(gSampler, float2(0.1, 1), 1, clamp, status);
+    float4 val6 = t1.Sample(gSampler, float2(0.5, 1), 1, clamp, status);
 
 // CHECK:                [[t3:%\d+]] = OpLoad %type_cube_image_array %t3
 // CHECK-NEXT:     [[gSampler:%\d+]] = OpLoad %type_sampler %gSampler
@@ -77,7 +77,7 @@ float4 main() : SV_Target {
 // CHECK-NEXT:                         OpStore %status [[status]]
 // CHECK-NEXT:       [[result:%\d+]] = OpCompositeExtract %v4float [[structResult]] 1
 // CHECK-NEXT:                         OpStore %val7 [[result]]
-    float4 val7 = t3.Sample(gSampler, float4(0.1, 0.2, 0.3, 1), /*clamp*/ 1.5, status);
+    float4 val7 = t3.Sample(gSampler, float4(0.5, 0.25, 0.125, 1), /*clamp*/ 1.5, status);
 
 /////////////////////////////////////////////////////////////////////////////////////////////////////////
 // Make sure OpImageSampleImplicitLod returns a vec4.
@@ -86,12 +86,12 @@ float4 main() : SV_Target {
 
 // CHECK: [[v4result:%\d+]] = OpImageSampleImplicitLod %v4float {{%\d+}} {{%\d+}} ConstOffset %int_1
 // CHECK:          {{%\d+}} = OpCompositeExtract %float [[v4result]] 0
-    float val8 = t4.Sample(gSampler, float2(0.1, 1), 1);
+    float val8 = t4.Sample(gSampler, float2(0.5, 1), 1);
 
 // CHECK: [[structResult:%\d+]] = OpImageSparseSampleImplicitLod %SparseResidencyStruct {{%\d+}} {{%\d+}} MinLod %float_1_5
 // CHECK:     [[v4result:%\d+]] = OpCompositeExtract %v4float [[structResult]] 1
 // CHECK:              {{%\d+}} = OpVectorShuffle %v3float [[v4result]] [[v4result]] 0 1 2
-    float3 val9 = t5.Sample(gSampler, float4(0.1, 0.2, 0.3, 1), /*clamp*/ 1.5, status);
+    float3 val9 = t5.Sample(gSampler, float4(0.5, 0.25, 0.125, 1), /*clamp*/ 1.5, status);
 
     return 1.0;
 }

+ 2 - 2
tools/clang/test/CodeGenSPIRV/texture.gather-cmp.hlsl

@@ -9,7 +9,7 @@ TextureCube<float>t4 : register(t4);
 // .GatherCmp() does not support Texture1D and Texture3D.
 
 // CHECK: [[v2ic:%\d+]] = OpConstantComposite %v2int %int_1 %int_2
-// CHECK: [[v2fc:%\d+]] = OpConstantComposite %v2float %float_0_1 %float_0_2
+// CHECK: [[v2fc:%\d+]] = OpConstantComposite %v2float %float_1 %float_2
 
 // CHECK: %SparseResidencyStruct = OpTypeStruct %uint %v4float
 
@@ -29,7 +29,7 @@ float4 main(float2 location: A, float comparator: B, int2 offset: C) : SV_Target
 // CHECK-NEXT: [[comparator:%\d+]] = OpLoad %float %comparator
 // CHECK-NEXT: [[sampledImg:%\d+]] = OpSampledImage %type_sampled_image [[t2]] [[gSampler]]
 // CHECK-NEXT:            {{%\d+}} = OpImageDrefGather %v4float [[sampledImg]] [[v2fc]] [[comparator]]
-    float4 val2 = t2.GatherCmp(gSampler, float2(0.1, 0.2), comparator);
+    float4 val2 = t2.GatherCmp(gSampler, float2(1, 2), comparator);
 
 // CHECK:              [[t3:%\d+]] = OpLoad %type_2d_image %t3
 // CHECK-NEXT:   [[gSampler:%\d+]] = OpLoad %type_sampler %gSampler

+ 4 - 4
tools/clang/test/CodeGenSPIRV/texture.gather.hlsl

@@ -11,7 +11,7 @@ TextureCube <float>  t8 : register(t8);
 // CHECK: OpCapability SparseResidency
 
 // CHECK: [[v2ic:%\d+]] = OpConstantComposite %v2int %int_1 %int_2
-// CHECK: [[v3fc:%\d+]] = OpConstantComposite %v3float %float_0_1 %float_0_2 %float_0_3
+// CHECK: [[v3fc:%\d+]] = OpConstantComposite %v3float %float_1 %float_2 %float_3
 
 // CHECK: %SparseResidencyStruct = OpTypeStruct %uint %v4int
 // CHECK: %SparseResidencyStruct_0 = OpTypeStruct %uint %v4float
@@ -29,7 +29,7 @@ float4 main(float2 location: A) : SV_Target {
 // CHECK-NEXT:   [[gSampler:%\d+]] = OpLoad %type_sampler %gSampler
 // CHECK-NEXT: [[sampledImg:%\d+]] = OpSampledImage %type_sampled_image_0 [[t4]] [[gSampler]]
 // CHECK-NEXT:            {{%\d+}} = OpImageGather %v4uint [[sampledImg]] [[v3fc]] %int_0
-    uint4 val4 = t4.Gather(gSampler, float3(0.1, 0.2, 0.3));
+    uint4 val4 = t4.Gather(gSampler, float3(1, 2, 3));
 
 // CHECK:              [[t6:%\d+]] = OpLoad %type_2d_image_0 %t6
 // CHECK-NEXT:   [[gSampler:%\d+]] = OpLoad %type_sampler %gSampler
@@ -42,7 +42,7 @@ float4 main(float2 location: A) : SV_Target {
 // CHECK-NEXT:   [[gSampler:%\d+]] = OpLoad %type_sampler %gSampler
 // CHECK-NEXT: [[sampledImg:%\d+]] = OpSampledImage %type_sampled_image_2 [[t8]] [[gSampler]]
 // CHECK-NEXT:            {{%\d+}} = OpImageGather %v4float [[sampledImg]] [[v3fc]] %int_0
-    float4 val8 = t8.Gather(gSampler, float3(0.1, 0.2, 0.3));
+    float4 val8 = t8.Gather(gSampler, float3(1, 2, 3));
 
     uint status;
 
@@ -65,7 +65,7 @@ float4 main(float2 location: A) : SV_Target {
 // CHECK-NEXT:                         OpStore %status [[status]]
 // CHECK-NEXT:       [[result:%\d+]] = OpCompositeExtract %v4float [[structResult]] 1
 // CHECK-NEXT:                         OpStore %val10 [[result]]
-    float4 val10 = t8.Gather(gSampler, float3(0.1, 0.2, 0.3), status);
+    float4 val10 = t8.Gather(gSampler, float3(1, 2, 3), status);
 
     return 1.0;
 }

+ 14 - 14
tools/clang/test/CodeGenSPIRV/texture.sample-bias.hlsl

@@ -16,11 +16,11 @@ Texture3D   <float2> t6 : register(t6);
 // CHECK: OpCapability SparseResidency
 
 // CHECK: %type_sampled_image = OpTypeSampledImage %type_1d_image
-// CHECK: [[v2fc:%\d+]] = OpConstantComposite %v2float %float_0_1 %float_0_2
+// CHECK: [[v2fc:%\d+]] = OpConstantComposite %v2float %float_1 %float_2
 // CHECK: [[v2ic:%\d+]] = OpConstantComposite %v2int %int_2 %int_2
 
 // CHECK: %type_sampled_image_0 = OpTypeSampledImage %type_2d_image
-// CHECK: [[v3fc:%\d+]] = OpConstantComposite %v3float %float_0_1 %float_0_2 %float_0_3
+// CHECK: [[v3fc:%\d+]] = OpConstantComposite %v3float %float_1 %float_2 %float_3
 
 // CHECK: %type_sampled_image_1 = OpTypeSampledImage %type_3d_image
 // CHECK: %type_sampled_image_2 = OpTypeSampledImage %type_cube_image
@@ -31,27 +31,27 @@ float4 main(int3 offset: A) : SV_Target {
 // CHECK:              [[t1:%\d+]] = OpLoad %type_1d_image %t1
 // CHECK-NEXT:   [[gSampler:%\d+]] = OpLoad %type_sampler %gSampler
 // CHECK-NEXT: [[sampledImg:%\d+]] = OpSampledImage %type_sampled_image [[t1]] [[gSampler]]
-// CHECK-NEXT:            {{%\d+}} = OpImageSampleImplicitLod %v4float [[sampledImg]] %float_0_1 Bias %float_0_5
-    float4 val1 = t1.SampleBias(gSampler, 0.1, 0.5);
+// CHECK-NEXT:            {{%\d+}} = OpImageSampleImplicitLod %v4float [[sampledImg]] %float_1 Bias %float_0_5
+    float4 val1 = t1.SampleBias(gSampler, 1, 0.5);
 
 // CHECK:              [[t2:%\d+]] = OpLoad %type_2d_image %t2
 // CHECK-NEXT:   [[gSampler:%\d+]] = OpLoad %type_sampler %gSampler
 // CHECK-NEXT: [[sampledImg:%\d+]] = OpSampledImage %type_sampled_image_0 [[t2]] [[gSampler]]
 // CHECK-NEXT:            {{%\d+}} = OpImageSampleImplicitLod %v4float [[sampledImg]] [[v2fc]] Bias|ConstOffset %float_0_5 [[v2ic]]
-    float4 val2 = t2.SampleBias(gSampler, float2(0.1, 0.2), 0.5, 2);
+    float4 val2 = t2.SampleBias(gSampler, float2(1, 2), 0.5, 2);
 
 // CHECK:              [[t3:%\d+]] = OpLoad %type_3d_image %t3
 // CHECK-NEXT:   [[gSampler:%\d+]] = OpLoad %type_sampler %gSampler
 // CHECK-NEXT:     [[offset:%\d+]] = OpLoad %v3int %offset
 // CHECK-NEXT: [[sampledImg:%\d+]] = OpSampledImage %type_sampled_image_1 [[t3]] [[gSampler]]
 // CHECK-NEXT:            {{%\d+}} = OpImageSampleImplicitLod %v4float [[sampledImg]] [[v3fc]] Bias|Offset %float_0_5 [[offset]]
-    float4 val3 = t3.SampleBias(gSampler, float3(0.1, 0.2, 0.3), 0.5, offset);
+    float4 val3 = t3.SampleBias(gSampler, float3(1, 2, 3), 0.5, offset);
 
 // CHECK:              [[t4:%\d+]] = OpLoad %type_cube_image %t4
 // CHECK-NEXT:   [[gSampler:%\d+]] = OpLoad %type_sampler %gSampler
 // CHECK-NEXT: [[sampledImg:%\d+]] = OpSampledImage %type_sampled_image_2 [[t4]] [[gSampler]]
 // CHECK-NEXT:            {{%\d+}} = OpImageSampleImplicitLod %v4float [[sampledImg]] [[v3fc]] Bias %float_0_5
-    float4 val4 = t4.SampleBias(gSampler, float3(0.1, 0.2, 0.3), 0.5);
+    float4 val4 = t4.SampleBias(gSampler, float3(1, 2, 3), 0.5);
 
     float clamp;
 // CHECK:           [[clamp:%\d+]] = OpLoad %float %clamp
@@ -60,13 +60,13 @@ float4 main(int3 offset: A) : SV_Target {
 // CHECK-NEXT:     [[offset:%\d+]] = OpLoad %v3int %offset
 // CHECK-NEXT: [[sampledImg:%\d+]] = OpSampledImage %type_sampled_image_1 [[t3]] [[gSampler]]
 // CHECK-NEXT:            {{%\d+}} = OpImageSampleImplicitLod %v4float [[sampledImg]] [[v3fc]] Bias|Offset|MinLod %float_0_5 [[offset]] [[clamp]]
-    float4 val5 = t3.SampleBias(gSampler, float3(0.1, 0.2, 0.3), 0.5, offset, clamp);
+    float4 val5 = t3.SampleBias(gSampler, float3(1, 2, 3), 0.5, offset, clamp);
 
 // CHECK:              [[t4:%\d+]] = OpLoad %type_cube_image %t4
 // CHECK-NEXT:   [[gSampler:%\d+]] = OpLoad %type_sampler %gSampler
 // CHECK-NEXT: [[sampledImg:%\d+]] = OpSampledImage %type_sampled_image_2 [[t4]] [[gSampler]]
 // CHECK-NEXT:            {{%\d+}} = OpImageSampleImplicitLod %v4float [[sampledImg]] [[v3fc]] Bias|MinLod %float_0_5 %float_2_5
-    float4 val6 = t4.SampleBias(gSampler, float3(0.1, 0.2, 0.3), 0.5, /*clamp*/ 2.5);
+    float4 val6 = t4.SampleBias(gSampler, float3(1, 2, 3), 0.5, /*clamp*/ 2.5);
 
     uint status;
 // CHECK:             [[clamp:%\d+]] = OpLoad %float %clamp
@@ -79,7 +79,7 @@ float4 main(int3 offset: A) : SV_Target {
 // CHECK-NEXT:                         OpStore %status [[status]]
 // CHECK-NEXT:       [[result:%\d+]] = OpCompositeExtract %v4float [[structResult]] 1
 // CHECK-NEXT:                         OpStore %val7 [[result]]
-    float4 val7 = t3.SampleBias(gSampler, float3(0.1, 0.2, 0.3), 0.5, offset, clamp, status);
+    float4 val7 = t3.SampleBias(gSampler, float3(1, 2, 3), 0.5, offset, clamp, status);
 
 // CHECK:                [[t4:%\d+]] = OpLoad %type_cube_image %t4
 // CHECK-NEXT:     [[gSampler:%\d+]] = OpLoad %type_sampler %gSampler
@@ -89,21 +89,21 @@ float4 main(int3 offset: A) : SV_Target {
 // CHECK-NEXT:                         OpStore %status [[status]]
 // CHECK-NEXT:       [[result:%\d+]] = OpCompositeExtract %v4float [[structResult]] 1
 // CHECK-NEXT:                         OpStore %val8 [[result]]
-    float4 val8 = t4.SampleBias(gSampler, float3(0.1, 0.2, 0.3), 0.5, /*clamp*/ 2.5, status);
+    float4 val8 = t4.SampleBias(gSampler, float3(1, 2, 3), 0.5, /*clamp*/ 2.5, status);
 
 /////////////////////////////////////////////////////////////////////////////////////////////////////////
 // Make sure OpImageSampleImplicitLod returns a vec4.
 // Make sure OpImageSparseSampleImplicitLod returns a struct, in which the second member is a vec4.
 /////////////////////////////////////////////////////////////////////////////////////////////////////////
 
-// CHECK:  [[v4result:%\d+]] = OpImageSampleImplicitLod %v4float {{%\d+}} %float_0_1 Bias %float_0_5
+// CHECK:  [[v4result:%\d+]] = OpImageSampleImplicitLod %v4float {{%\d+}} %float_1 Bias %float_0_5
 // CHECK:           {{%\d+}} = OpCompositeExtract %float [[v4result]] 0
-    float val9 = t5.SampleBias(gSampler, 0.1, 0.5);
+    float val9 = t5.SampleBias(gSampler, 1, 0.5);
 
 // CHECK: [[structResult:%\d+]] = OpImageSparseSampleImplicitLod %SparseResidencyStruct {{%\d+}} {{%\d+}} Bias|Offset|MinLod %float_0_5 {{%\d+}} {{%\d+}}
 // CHECK:     [[v4result:%\d+]] = OpCompositeExtract %v4float [[structResult]] 1
 // CHECK:              {{%\d+}} = OpVectorShuffle %v2float [[v4result]] [[v4result]] 0 1
-    float2 val10 = t6.SampleBias(gSampler, float3(0.1, 0.2, 0.3), 0.5, offset, clamp, status);
+    float2 val10 = t6.SampleBias(gSampler, float3(1, 2, 3), 0.5, offset, clamp, status);
 
     return 1.0;
 }

+ 8 - 8
tools/clang/test/CodeGenSPIRV/texture.sample-cmp-level-zero.hlsl

@@ -9,8 +9,8 @@ TextureCube <float>  t4 : register(t4);
 
 // CHECK: OpCapability SparseResidency
 
-// CHECK: [[v2fc:%\d+]] = OpConstantComposite %v2float %float_0_1 %float_0_2
-// CHECK: [[v3fc:%\d+]] = OpConstantComposite %v3float %float_0_1 %float_0_2 %float_0_3
+// CHECK: [[v2fc:%\d+]] = OpConstantComposite %v2float %float_1 %float_2
+// CHECK: [[v3fc:%\d+]] = OpConstantComposite %v3float %float_1 %float_2 %float_3
 
 // CHECK: %SparseResidencyStruct = OpTypeStruct %uint %float
 
@@ -19,8 +19,8 @@ float4 main(int2 offset: A, float comparator: B) : SV_Target {
 // CHECK-NEXT:   [[gSampler:%\d+]] = OpLoad %type_sampler %gSampler
 // CHECK-NEXT: [[comparator:%\d+]] = OpLoad %float %comparator
 // CHECK-NEXT: [[sampledImg:%\d+]] = OpSampledImage %type_sampled_image [[t1]] [[gSampler]]
-// CHECK-NEXT:            {{%\d+}} = OpImageSampleDrefExplicitLod %float [[sampledImg]] %float_0_1 [[comparator]] Lod|ConstOffset %float_0 %int_5
-    float val1 = t1.SampleCmpLevelZero(gSampler, 0.1, comparator, 5);
+// CHECK-NEXT:            {{%\d+}} = OpImageSampleDrefExplicitLod %float [[sampledImg]] %float_1 [[comparator]] Lod|ConstOffset %float_0 %int_5
+    float val1 = t1.SampleCmpLevelZero(gSampler, 1, comparator, 5);
 
 // CHECK:              [[t2:%\d+]] = OpLoad %type_2d_image %t2
 // CHECK-NEXT:   [[gSampler:%\d+]] = OpLoad %type_sampler %gSampler
@@ -28,14 +28,14 @@ float4 main(int2 offset: A, float comparator: B) : SV_Target {
 // CHECK-NEXT:     [[offset:%\d+]] = OpLoad %v2int %offset
 // CHECK-NEXT: [[sampledImg:%\d+]] = OpSampledImage %type_sampled_image_0 [[t2]] [[gSampler]]
 // CHECK-NEXT:            {{%\d+}} = OpImageSampleDrefExplicitLod %float [[sampledImg]] [[v2fc]] [[comparator]] Lod|Offset %float_0 [[offset]]
-    float val2 = t2.SampleCmpLevelZero(gSampler, float2(0.1, 0.2), comparator, offset);
+    float val2 = t2.SampleCmpLevelZero(gSampler, float2(1, 2), comparator, offset);
 
 // CHECK:              [[t4:%\d+]] = OpLoad %type_cube_image %t4
 // CHECK-NEXT:   [[gSampler:%\d+]] = OpLoad %type_sampler %gSampler
 // CHECK-NEXT: [[comparator:%\d+]] = OpLoad %float %comparator
 // CHECK-NEXT: [[sampledImg:%\d+]] = OpSampledImage %type_sampled_image_1 [[t4]] [[gSampler]]
 // CHECK-NEXT:            {{%\d+}} = OpImageSampleDrefExplicitLod %float [[sampledImg]] [[v3fc]] [[comparator]] Lod %float_0
-    float val4 = t4.SampleCmpLevelZero(gSampler, float3(0.1, 0.2, 0.3), comparator);
+    float val4 = t4.SampleCmpLevelZero(gSampler, float3(1, 2, 3), comparator);
 
     uint status;
 // CHECK:                [[t2:%\d+]] = OpLoad %type_2d_image %t2
@@ -48,7 +48,7 @@ float4 main(int2 offset: A, float comparator: B) : SV_Target {
 // CHECK-NEXT:                         OpStore %status [[status]]
 // CHECK-NEXT:       [[result:%\d+]] = OpCompositeExtract %float [[structResult]] 1
 // CHECK-NEXT:                         OpStore %val5 [[result]]
-    float val5 = t2.SampleCmpLevelZero(gSampler, float2(0.1, 0.2), comparator, offset, status);
+    float val5 = t2.SampleCmpLevelZero(gSampler, float2(1, 2), comparator, offset, status);
 
 // CHECK:                [[t4:%\d+]] = OpLoad %type_cube_image %t4
 // CHECK-NEXT:     [[gSampler:%\d+]] = OpLoad %type_sampler %gSampler
@@ -59,7 +59,7 @@ float4 main(int2 offset: A, float comparator: B) : SV_Target {
 // CHECK-NEXT:                         OpStore %status [[status]]
 // CHECK-NEXT:       [[result:%\d+]] = OpCompositeExtract %float [[structResult]] 1
 // CHECK-NEXT:                         OpStore %val6 [[result]]
-    float val6 = t4.SampleCmpLevelZero(gSampler, float3(0.1, 0.2, 0.3), comparator, status);
+    float val6 = t4.SampleCmpLevelZero(gSampler, float3(1, 2, 3), comparator, status);
 
     return 1.0;
 }

+ 10 - 10
tools/clang/test/CodeGenSPIRV/texture.sample-cmp.hlsl

@@ -10,8 +10,8 @@ TextureCube <float>  t4 : register(t4);
 // CHECK: OpCapability MinLod
 // CHECK: OpCapability SparseResidency
 
-// CHECK: [[v2fc:%\d+]] = OpConstantComposite %v2float %float_0_1 %float_0_2
-// CHECK: [[v3fc:%\d+]] = OpConstantComposite %v3float %float_0_1 %float_0_2 %float_0_3
+// CHECK: [[v2fc:%\d+]] = OpConstantComposite %v2float %float_1 %float_2
+// CHECK: [[v3fc:%\d+]] = OpConstantComposite %v3float %float_1 %float_2 %float_3
 
 // CHECK: %SparseResidencyStruct = OpTypeStruct %uint %float
 
@@ -20,8 +20,8 @@ float4 main(int2 offset: A, float comparator: B) : SV_Target {
 // CHECK-NEXT:   [[gSampler:%\d+]] = OpLoad %type_sampler %gSampler
 // CHECK-NEXT: [[comparator:%\d+]] = OpLoad %float %comparator
 // CHECK-NEXT: [[sampledImg:%\d+]] = OpSampledImage %type_sampled_image [[t1]] [[gSampler]]
-// CHECK-NEXT:            {{%\d+}} = OpImageSampleDrefImplicitLod %float [[sampledImg]] %float_0_1 [[comparator]] ConstOffset %int_5
-    float val1 = t1.SampleCmp(gSampler, 0.1, comparator, 5);
+// CHECK-NEXT:            {{%\d+}} = OpImageSampleDrefImplicitLod %float [[sampledImg]] %float_1 [[comparator]] ConstOffset %int_5
+    float val1 = t1.SampleCmp(gSampler, 1, comparator, 5);
 
 // CHECK:              [[t2:%\d+]] = OpLoad %type_2d_image %t2
 // CHECK-NEXT:   [[gSampler:%\d+]] = OpLoad %type_sampler %gSampler
@@ -29,14 +29,14 @@ float4 main(int2 offset: A, float comparator: B) : SV_Target {
 // CHECK-NEXT:     [[offset:%\d+]] = OpLoad %v2int %offset
 // CHECK-NEXT: [[sampledImg:%\d+]] = OpSampledImage %type_sampled_image_0 [[t2]] [[gSampler]]
 // CHECK-NEXT:            {{%\d+}} = OpImageSampleDrefImplicitLod %float [[sampledImg]] [[v2fc]] [[comparator]] Offset [[offset]]
-    float val2 = t2.SampleCmp(gSampler, float2(0.1, 0.2), comparator, offset);
+    float val2 = t2.SampleCmp(gSampler, float2(1, 2), comparator, offset);
 
 // CHECK:              [[t4:%\d+]] = OpLoad %type_cube_image %t4
 // CHECK-NEXT:   [[gSampler:%\d+]] = OpLoad %type_sampler %gSampler
 // CHECK-NEXT: [[comparator:%\d+]] = OpLoad %float %comparator
 // CHECK-NEXT: [[sampledImg:%\d+]] = OpSampledImage %type_sampled_image_1 [[t4]] [[gSampler]]
 // CHECK-NEXT:            {{%\d+}} = OpImageSampleDrefImplicitLod %float [[sampledImg]] [[v3fc]] [[comparator]]
-    float val4 = t4.SampleCmp(gSampler, float3(0.1, 0.2, 0.3), comparator);
+    float val4 = t4.SampleCmp(gSampler, float3(1, 2, 3), comparator);
 
     float clamp;
 // CHECK:           [[clamp:%\d+]] = OpLoad %float %clamp
@@ -46,14 +46,14 @@ float4 main(int2 offset: A, float comparator: B) : SV_Target {
 // CHECK-NEXT:     [[offset:%\d+]] = OpLoad %v2int %offset
 // CHECK-NEXT: [[sampledImg:%\d+]] = OpSampledImage %type_sampled_image_0 [[t2]] [[gSampler]]
 // CHECK-NEXT:            {{%\d+}} = OpImageSampleDrefImplicitLod %float [[sampledImg]] [[v2fc]] [[comparator]] Offset|MinLod [[offset]] [[clamp]]
-    float val5 = t2.SampleCmp(gSampler, float2(0.1, 0.2), comparator, offset, clamp);
+    float val5 = t2.SampleCmp(gSampler, float2(1, 2), comparator, offset, clamp);
 
 // CHECK:              [[t4:%\d+]] = OpLoad %type_cube_image %t4
 // CHECK-NEXT:   [[gSampler:%\d+]] = OpLoad %type_sampler %gSampler
 // CHECK-NEXT: [[comparator:%\d+]] = OpLoad %float %comparator
 // CHECK-NEXT: [[sampledImg:%\d+]] = OpSampledImage %type_sampled_image_1 [[t4]] [[gSampler]]
 // CHECK-NEXT:            {{%\d+}} = OpImageSampleDrefImplicitLod %float [[sampledImg]] [[v3fc]] [[comparator]] MinLod %float_2_5
-    float val6 = t4.SampleCmp(gSampler, float3(0.1, 0.2, 0.3), comparator, /*clamp*/2.5);
+    float val6 = t4.SampleCmp(gSampler, float3(1, 2, 3), comparator, /*clamp*/2.5);
 
     uint status;
 // CHECK:             [[clamp:%\d+]] = OpLoad %float %clamp
@@ -67,7 +67,7 @@ float4 main(int2 offset: A, float comparator: B) : SV_Target {
 // CHECK-NEXT:                         OpStore %status [[status]]
 // CHECK-NEXT:       [[result:%\d+]] = OpCompositeExtract %float [[structResult]] 1
 // CHECK-NEXT:                         OpStore %val7 [[result]]
-    float val7 = t2.SampleCmp(gSampler, float2(0.1, 0.2), comparator, offset, clamp, status);
+    float val7 = t2.SampleCmp(gSampler, float2(1, 2), comparator, offset, clamp, status);
 
 // CHECK:                [[t4:%\d+]] = OpLoad %type_cube_image %t4
 // CHECK-NEXT:     [[gSampler:%\d+]] = OpLoad %type_sampler %gSampler
@@ -78,7 +78,7 @@ float4 main(int2 offset: A, float comparator: B) : SV_Target {
 // CHECK-NEXT:                         OpStore %status [[status]]
 // CHECK-NEXT:       [[result:%\d+]] = OpCompositeExtract %float [[structResult]] 1
 // CHECK-NEXT:                         OpStore %val8 [[result]]
-    float val8 = t4.SampleCmp(gSampler, float3(0.1, 0.2, 0.3), comparator, /*clamp*/2.5, status);
+    float val8 = t4.SampleCmp(gSampler, float3(1, 2, 3), comparator, /*clamp*/2.5, status);
 
     return 1.0;
 }

+ 25 - 25
tools/clang/test/CodeGenSPIRV/texture.sample-grad.hlsl

@@ -16,14 +16,14 @@ Texture2D   <float2> t6 : register(t6);
 // CHECK: OpCapability SparseResidency
 
 // CHECK: %type_sampled_image = OpTypeSampledImage %type_1d_image
-// CHECK: [[v2f_0_1:%\d+]] = OpConstantComposite %v2float %float_0_1 %float_0_1
-// CHECK: [[v2f_0_2:%\d+]] = OpConstantComposite %v2float %float_0_2 %float_0_2
-// CHECK: [[v2f_0_3:%\d+]] = OpConstantComposite %v2float %float_0_3 %float_0_3
+// CHECK: [[v2f_1:%\d+]] = OpConstantComposite %v2float %float_1 %float_1
+// CHECK: [[v2f_2:%\d+]] = OpConstantComposite %v2float %float_2 %float_2
+// CHECK: [[v2f_3:%\d+]] = OpConstantComposite %v2float %float_3 %float_3
 
 // CHECK: %type_sampled_image_0 = OpTypeSampledImage %type_2d_image
-// CHECK: [[v3f_0_1:%\d+]] = OpConstantComposite %v3float %float_0_1 %float_0_1 %float_0_1
-// CHECK: [[v3f_0_2:%\d+]] = OpConstantComposite %v3float %float_0_2 %float_0_2 %float_0_2
-// CHECK: [[v3f_0_3:%\d+]] = OpConstantComposite %v3float %float_0_3 %float_0_3 %float_0_3
+// CHECK: [[v3f_1:%\d+]] = OpConstantComposite %v3float %float_1 %float_1 %float_1
+// CHECK: [[v3f_2:%\d+]] = OpConstantComposite %v3float %float_2 %float_2 %float_2
+// CHECK: [[v3f_3:%\d+]] = OpConstantComposite %v3float %float_3 %float_3 %float_3
 // CHECK:   [[v3i_3:%\d+]] = OpConstantComposite %v3int %int_3 %int_3 %int_3
 
 // CHECK: %type_sampled_image_1 = OpTypeSampledImage %type_3d_image
@@ -36,27 +36,27 @@ float4 main(int2 offset : A) : SV_Target {
 // CHECK:              [[t1:%\d+]] = OpLoad %type_1d_image %t1
 // CHECK-NEXT:   [[gSampler:%\d+]] = OpLoad %type_sampler %gSampler
 // CHECK-NEXT: [[sampledImg:%\d+]] = OpSampledImage %type_sampled_image [[t1]] [[gSampler]]
-// CHECK-NEXT:            {{%\d+}} = OpImageSampleExplicitLod %v4float [[sampledImg]] %float_0_1 Grad %float_0_2 %float_0_3
-    float4 val1 = t1.SampleGrad(gSampler, 0.1, 0.2, 0.3);
+// CHECK-NEXT:            {{%\d+}} = OpImageSampleExplicitLod %v4float [[sampledImg]] %float_1 Grad %float_2 %float_3
+    float4 val1 = t1.SampleGrad(gSampler, 1, 2, 3);
 
 // CHECK:              [[t2:%\d+]] = OpLoad %type_2d_image %t2
 // CHECK-NEXT:   [[gSampler:%\d+]] = OpLoad %type_sampler %gSampler
 // CHECK-NEXT:     [[offset:%\d+]] = OpLoad %v2int %offset
 // CHECK-NEXT: [[sampledImg:%\d+]] = OpSampledImage %type_sampled_image_0 [[t2]] [[gSampler]]
-// CHECK-NEXT:            {{%\d+}} = OpImageSampleExplicitLod %v4float [[sampledImg]] [[v2f_0_1]] Grad|Offset [[v2f_0_2]] [[v2f_0_3]] [[offset]]
-    float4 val2 = t2.SampleGrad(gSampler, float2(0.1, 0.1), float2(0.2, 0.2), float2(0.3, 0.3), offset);
+// CHECK-NEXT:            {{%\d+}} = OpImageSampleExplicitLod %v4float [[sampledImg]] [[v2f_1]] Grad|Offset [[v2f_2]] [[v2f_3]] [[offset]]
+    float4 val2 = t2.SampleGrad(gSampler, float2(1, 1), float2(2, 2), float2(3, 3), offset);
 
 // CHECK:              [[t3:%\d+]] = OpLoad %type_3d_image %t3
 // CHECK-NEXT:   [[gSampler:%\d+]] = OpLoad %type_sampler %gSampler
 // CHECK-NEXT: [[sampledImg:%\d+]] = OpSampledImage %type_sampled_image_1 [[t3]] [[gSampler]]
-// CHECK-NEXT:            {{%\d+}} = OpImageSampleExplicitLod %v4float [[sampledImg]] [[v3f_0_1]] Grad|ConstOffset [[v3f_0_2]] [[v3f_0_3]] [[v3i_3]]
-    float4 val3 = t3.SampleGrad(gSampler, float3(0.1, 0.1, 0.1), float3(0.2, 0.2, 0.2), float3(0.3, 0.3, 0.3), 3);
+// CHECK-NEXT:            {{%\d+}} = OpImageSampleExplicitLod %v4float [[sampledImg]] [[v3f_1]] Grad|ConstOffset [[v3f_2]] [[v3f_3]] [[v3i_3]]
+    float4 val3 = t3.SampleGrad(gSampler, float3(1, 1, 1), float3(2, 2, 2), float3(3, 3, 3), 3);
 
 // CHECK:              [[t4:%\d+]] = OpLoad %type_cube_image %t4
 // CHECK-NEXT:   [[gSampler:%\d+]] = OpLoad %type_sampler %gSampler
 // CHECK-NEXT: [[sampledImg:%\d+]] = OpSampledImage %type_sampled_image_2 [[t4]] [[gSampler]]
-// CHECK-NEXT:            {{%\d+}} = OpImageSampleExplicitLod %v4float [[sampledImg]] [[v3f_0_1]] Grad [[v3f_0_2]] [[v3f_0_3]]
-    float4 val4 = t4.SampleGrad(gSampler, float3(0.1, 0.1, 0.1), float3(0.2, 0.2, 0.2), float3(0.3, 0.3, 0.3));
+// CHECK-NEXT:            {{%\d+}} = OpImageSampleExplicitLod %v4float [[sampledImg]] [[v3f_1]] Grad [[v3f_2]] [[v3f_3]]
+    float4 val4 = t4.SampleGrad(gSampler, float3(1, 1, 1), float3(2, 2, 2), float3(3, 3, 3));
 
     float clamp;
 // CHECK:           [[clamp:%\d+]] = OpLoad %float %clamp
@@ -64,14 +64,14 @@ float4 main(int2 offset : A) : SV_Target {
 // CHECK-NEXT:   [[gSampler:%\d+]] = OpLoad %type_sampler %gSampler
 // CHECK-NEXT:     [[offset:%\d+]] = OpLoad %v2int %offset
 // CHECK-NEXT: [[sampledImg:%\d+]] = OpSampledImage %type_sampled_image_0 [[t2]] [[gSampler]]
-// CHECK-NEXT:            {{%\d+}} = OpImageSampleExplicitLod %v4float [[sampledImg]] [[v2f_0_1]] Grad|Offset|MinLod [[v2f_0_2]] [[v2f_0_3]] [[offset]] [[clamp]]
-    float4 val5 = t2.SampleGrad(gSampler, float2(0.1, 0.1), float2(0.2, 0.2), float2(0.3, 0.3), offset, clamp);
+// CHECK-NEXT:            {{%\d+}} = OpImageSampleExplicitLod %v4float [[sampledImg]] [[v2f_1]] Grad|Offset|MinLod [[v2f_2]] [[v2f_3]] [[offset]] [[clamp]]
+    float4 val5 = t2.SampleGrad(gSampler, float2(1, 1), float2(2, 2), float2(3, 3), offset, clamp);
 
 // CHECK:              [[t4:%\d+]] = OpLoad %type_cube_image %t4
 // CHECK-NEXT:   [[gSampler:%\d+]] = OpLoad %type_sampler %gSampler
 // CHECK-NEXT: [[sampledImg:%\d+]] = OpSampledImage %type_sampled_image_2 [[t4]] [[gSampler]]
-// CHECK-NEXT:            {{%\d+}} = OpImageSampleExplicitLod %v4float [[sampledImg]] [[v3f_0_1]] Grad|MinLod [[v3f_0_2]] [[v3f_0_3]] %float_3_5
-    float4 val6 = t4.SampleGrad(gSampler, float3(0.1, 0.1, 0.1), float3(0.2, 0.2, 0.2), float3(0.3, 0.3, 0.3), /*clamp*/3.5);
+// CHECK-NEXT:            {{%\d+}} = OpImageSampleExplicitLod %v4float [[sampledImg]] [[v3f_1]] Grad|MinLod [[v3f_2]] [[v3f_3]] %float_3_5
+    float4 val6 = t4.SampleGrad(gSampler, float3(1, 1, 1), float3(2, 2, 2), float3(3, 3, 3), /*clamp*/3.5);
 
     uint status;
 // CHECK:             [[clamp:%\d+]] = OpLoad %float %clamp
@@ -79,36 +79,36 @@ float4 main(int2 offset : A) : SV_Target {
 // CHECK-NEXT:     [[gSampler:%\d+]] = OpLoad %type_sampler %gSampler
 // CHECK-NEXT:       [[offset:%\d+]] = OpLoad %v2int %offset
 // CHECK-NEXT:   [[sampledImg:%\d+]] = OpSampledImage %type_sampled_image_0 [[t2]] [[gSampler]]
-// CHECK-NEXT: [[structResult:%\d+]] = OpImageSparseSampleExplicitLod %SparseResidencyStruct [[sampledImg]] [[v2f_0_1]] Grad|Offset|MinLod [[v2f_0_2]] [[v2f_0_3]] [[offset]] [[clamp]]
+// CHECK-NEXT: [[structResult:%\d+]] = OpImageSparseSampleExplicitLod %SparseResidencyStruct [[sampledImg]] [[v2f_1]] Grad|Offset|MinLod [[v2f_2]] [[v2f_3]] [[offset]] [[clamp]]
 // CHECK-NEXT:       [[status:%\d+]] = OpCompositeExtract %uint [[structResult]] 0
 // CHECK-NEXT:                         OpStore %status [[status]]
 // CHECK-NEXT:       [[result:%\d+]] = OpCompositeExtract %v4float [[structResult]] 1
 // CHECK-NEXT:                         OpStore %val7 [[result]]
-    float4 val7 = t2.SampleGrad(gSampler, float2(0.1, 0.1), float2(0.2, 0.2), float2(0.3, 0.3), offset, clamp, status);
+    float4 val7 = t2.SampleGrad(gSampler, float2(1, 1), float2(2, 2), float2(3, 3), offset, clamp, status);
 
 // CHECK:                [[t4:%\d+]] = OpLoad %type_cube_image %t4
 // CHECK-NEXT:     [[gSampler:%\d+]] = OpLoad %type_sampler %gSampler
 // CHECK-NEXT:   [[sampledImg:%\d+]] = OpSampledImage %type_sampled_image_2 [[t4]] [[gSampler]]
-// CHECK-NEXT: [[structResult:%\d+]] = OpImageSparseSampleExplicitLod %SparseResidencyStruct [[sampledImg]] [[v3f_0_1]] Grad|MinLod [[v3f_0_2]] [[v3f_0_3]] %float_3_5
+// CHECK-NEXT: [[structResult:%\d+]] = OpImageSparseSampleExplicitLod %SparseResidencyStruct [[sampledImg]] [[v3f_1]] Grad|MinLod [[v3f_2]] [[v3f_3]] %float_3_5
 // CHECK-NEXT:       [[status:%\d+]] = OpCompositeExtract %uint [[structResult]] 0
 // CHECK-NEXT:                         OpStore %status [[status]]
 // CHECK-NEXT:       [[result:%\d+]] = OpCompositeExtract %v4float [[structResult]] 1
 // CHECK-NEXT:                         OpStore %val8 [[result]]
-    float4 val8 = t4.SampleGrad(gSampler, float3(0.1, 0.1, 0.1), float3(0.2, 0.2, 0.2), float3(0.3, 0.3, 0.3), /*clamp*/3.5, status);
+    float4 val8 = t4.SampleGrad(gSampler, float3(1, 1, 1), float3(2, 2, 2), float3(3, 3, 3), /*clamp*/3.5, status);
 
 /////////////////////////////////////////////////////////////////////////////////////////////////////////
 // Make sure OpImageSampleExplicitLod returns a vec4.
 // Make sure OpImageSparseSampleExplicitLod returns a struct, in which the second member is a vec4.
 /////////////////////////////////////////////////////////////////////////////////////////////////////////
 
-// CHECK: [[v4result:%\d+]] = OpImageSampleExplicitLod %v4float {{%\d+}} %float_0_1 Grad %float_0_2 %float_0_3
+// CHECK: [[v4result:%\d+]] = OpImageSampleExplicitLod %v4float {{%\d+}} %float_1 Grad %float_2 %float_3
 // CHECK:          {{%\d+}} = OpCompositeExtract %float [[v4result]] 0
-    float val9  = t5.SampleGrad(gSampler, 0.1, 0.2, 0.3);
+    float val9  = t5.SampleGrad(gSampler, 1, 2, 3);
 
 // CHECK: [[structResult:%\d+]] = OpImageSparseSampleExplicitLod %SparseResidencyStruct {{%\d+}} {{%\d+}} Grad|Offset|MinLod {{%\d+}} {{%\d+}} {{%\d+}} {{%\d+}}
 // CHECK:     [[v4result:%\d+]] = OpCompositeExtract %v4float [[structResult]] 1
 // CHECK:              {{%\d+}} = OpVectorShuffle %v2float [[v4result]] [[v4result]] 0 1
-    float2 val10 = t6.SampleGrad(gSampler, float2(0.1, 0.1), float2(0.2, 0.2), float2(0.3, 0.3), offset, clamp, status);
+    float2 val10 = t6.SampleGrad(gSampler, float2(1, 1), float2(2, 2), float2(3, 3), offset, clamp, status);
 
     return 1.0;
 }

+ 11 - 11
tools/clang/test/CodeGenSPIRV/texture.sample-level.hlsl

@@ -15,11 +15,11 @@ TextureCube <float2> t6 : register(t6);
 // CHECK: OpCapability SparseResidency
 
 // CHECK: %type_sampled_image = OpTypeSampledImage %type_1d_image
-// CHECK: [[v2fc:%\d+]] = OpConstantComposite %v2float %float_0_1 %float_0_2
+// CHECK: [[v2fc:%\d+]] = OpConstantComposite %v2float %float_1 %float_2
 // CHECK: [[v2ic:%\d+]] = OpConstantComposite %v2int %int_2 %int_2
 
 // CHECK: %type_sampled_image_0 = OpTypeSampledImage %type_2d_image
-// CHECK: [[v3fc:%\d+]] = OpConstantComposite %v3float %float_0_1 %float_0_2 %float_0_3
+// CHECK: [[v3fc:%\d+]] = OpConstantComposite %v3float %float_1 %float_2 %float_3
 
 // CHECK: %type_sampled_image_1 = OpTypeSampledImage %type_3d_image
 // CHECK: %type_sampled_image_2 = OpTypeSampledImage %type_cube_image
@@ -31,27 +31,27 @@ float4 main(int3 offset: A) : SV_Target {
 // CHECK:              [[t1:%\d+]] = OpLoad %type_1d_image %t1
 // CHECK-NEXT:   [[gSampler:%\d+]] = OpLoad %type_sampler %gSampler
 // CHECK-NEXT: [[sampledImg:%\d+]] = OpSampledImage %type_sampled_image [[t1]] [[gSampler]]
-// CHECK-NEXT:            {{%\d+}} = OpImageSampleExplicitLod %v4float [[sampledImg]] %float_0_1 Lod %float_10
-    float4 val1 = t1.SampleLevel(gSampler, 0.1, 10);
+// CHECK-NEXT:            {{%\d+}} = OpImageSampleExplicitLod %v4float [[sampledImg]] %float_1 Lod %float_10
+    float4 val1 = t1.SampleLevel(gSampler, 1, 10);
 
 // CHECK:              [[t2:%\d+]] = OpLoad %type_2d_image %t2
 // CHECK-NEXT:   [[gSampler:%\d+]] = OpLoad %type_sampler %gSampler
 // CHECK-NEXT: [[sampledImg:%\d+]] = OpSampledImage %type_sampled_image_0 [[t2]] [[gSampler]]
 // CHECK-NEXT:            {{%\d+}} = OpImageSampleExplicitLod %v4float [[sampledImg]] [[v2fc]] Lod|ConstOffset %float_10 [[v2ic]]
-    float4 val2 = t2.SampleLevel(gSampler, float2(0.1, 0.2), 10, 2);
+    float4 val2 = t2.SampleLevel(gSampler, float2(1, 2), 10, 2);
 
 // CHECK:              [[t3:%\d+]] = OpLoad %type_3d_image %t3
 // CHECK-NEXT:   [[gSampler:%\d+]] = OpLoad %type_sampler %gSampler
 // CHECK-NEXT:     [[offset:%\d+]] = OpLoad %v3int %offset
 // CHECK-NEXT: [[sampledImg:%\d+]] = OpSampledImage %type_sampled_image_1 [[t3]] [[gSampler]]
 // CHECK-NEXT:            {{%\d+}} = OpImageSampleExplicitLod %v4float [[sampledImg]] [[v3fc]] Lod|Offset %float_10 [[offset]]
-    float4 val3 = t3.SampleLevel(gSampler, float3(0.1, 0.2, 0.3), 10, offset);
+    float4 val3 = t3.SampleLevel(gSampler, float3(1, 2, 3), 10, offset);
 
 // CHECK:              [[t4:%\d+]] = OpLoad %type_cube_image %t4
 // CHECK-NEXT:   [[gSampler:%\d+]] = OpLoad %type_sampler %gSampler
 // CHECK-NEXT: [[sampledImg:%\d+]] = OpSampledImage %type_sampled_image_2 [[t4]] [[gSampler]]
 // CHECK-NEXT:            {{%\d+}} = OpImageSampleExplicitLod %v4float [[sampledImg]] [[v3fc]] Lod %float_10
-    float4 val4 = t4.SampleLevel(gSampler, float3(0.1, 0.2, 0.3), 10);
+    float4 val4 = t4.SampleLevel(gSampler, float3(1, 2, 3), 10);
 
     uint status;
 // CHECK:                [[t3:%\d+]] = OpLoad %type_3d_image %t3
@@ -63,7 +63,7 @@ float4 main(int3 offset: A) : SV_Target {
 // CHECK-NEXT:                         OpStore %status [[status]]
 // CHECK-NEXT:       [[result:%\d+]] = OpCompositeExtract %v4float [[structResult]] 1
 // CHECK-NEXT:                         OpStore %val5 [[result]]
-    float4 val5 = t3.SampleLevel(gSampler, float3(0.1, 0.2, 0.3), 10, offset, status);
+    float4 val5 = t3.SampleLevel(gSampler, float3(1, 2, 3), 10, offset, status);
 
 // CHECK:                [[t4:%\d+]] = OpLoad %type_cube_image %t4
 // CHECK-NEXT:     [[gSampler:%\d+]] = OpLoad %type_sampler %gSampler
@@ -73,7 +73,7 @@ float4 main(int3 offset: A) : SV_Target {
 // CHECK-NEXT:                         OpStore %status [[status]]
 // CHECK-NEXT:       [[result:%\d+]] = OpCompositeExtract %v4float [[structResult]] 1
 // CHECK-NEXT:                         OpStore %val6 [[result]]
-    float4 val6 = t4.SampleLevel(gSampler, float3(0.1, 0.2, 0.3), 10, status);
+    float4 val6 = t4.SampleLevel(gSampler, float3(1, 2, 3), 10, status);
 
 /////////////////////////////////////////////////////////////////////////////////////////////////////////
 // Make sure OpImageSampleExplicitLod returns a vec4.
@@ -82,12 +82,12 @@ float4 main(int3 offset: A) : SV_Target {
 
 // CHECK: [[v4result:%\d+]] = OpImageSampleExplicitLod %v4float {{%\d+}} {{%\d+}} Lod|Offset %float_10 {{%\d+}}
 // CHECK:          {{%\d+}} = OpCompositeExtract %float [[v4result]] 0
-    float  val7 = t5.SampleLevel(gSampler, float3(0.1, 0.2, 0.3), 10, offset);
+    float  val7 = t5.SampleLevel(gSampler, float3(1, 2, 3), 10, offset);
 
 // CHECK: [[structResult:%\d+]] = OpImageSparseSampleExplicitLod %SparseResidencyStruct {{%\d+}} {{%\d+}} Lod %float_10
 // CHECK:     [[v4result:%\d+]] = OpCompositeExtract %v4float [[structResult]] 1
 // CHECK:              {{%\d+}} = OpVectorShuffle %v2float [[v4result]] [[v4result]] 0 1
-    float2 val8 = t6.SampleLevel(gSampler, float3(0.1, 0.2, 0.3), 10, status);
+    float2 val8 = t6.SampleLevel(gSampler, float3(1, 2, 3), 10, status);
 
     return 1.0;
 }

+ 14 - 14
tools/clang/test/CodeGenSPIRV/texture.sample.hlsl

@@ -16,10 +16,10 @@ TextureCube <float3> t6 : register(t6);
 // CHECK: OpCapability SparseResidency
 
 // CHECK: %type_sampled_image = OpTypeSampledImage %type_1d_image
-// CHECK: [[v2fc:%\d+]] = OpConstantComposite %v2float %float_0_1 %float_0_2
+// CHECK: [[v2fc:%\d+]] = OpConstantComposite %v2float %float_0_5 %float_0_25
 
 // CHECK: %type_sampled_image_0 = OpTypeSampledImage %type_2d_image
-// CHECK: [[v3fc:%\d+]] = OpConstantComposite %v3float %float_0_1 %float_0_2 %float_0_3
+// CHECK: [[v3fc:%\d+]] = OpConstantComposite %v3float %float_0_5 %float_0_25 %float_0_3
 // CHECK: [[v3ic:%\d+]] = OpConstantComposite %v3int %int_3 %int_3 %int_3
 
 // CHECK: %type_sampled_image_1 = OpTypeSampledImage %type_3d_image
@@ -32,27 +32,27 @@ float4 main(int2 offset: A) : SV_Target {
 // CHECK:              [[t1:%\d+]] = OpLoad %type_1d_image %t1
 // CHECK-NEXT:   [[gSampler:%\d+]] = OpLoad %type_sampler %gSampler
 // CHECK-NEXT: [[sampledImg:%\d+]] = OpSampledImage %type_sampled_image [[t1]] [[gSampler]]
-// CHECK-NEXT:            {{%\d+}} = OpImageSampleImplicitLod %v4float [[sampledImg]] %float_0_1
-    float4 val1 = t1.Sample(gSampler, 0.1);
+// CHECK-NEXT:            {{%\d+}} = OpImageSampleImplicitLod %v4float [[sampledImg]] %float_0_5
+    float4 val1 = t1.Sample(gSampler, 0.5);
 
 // CHECK:              [[t2:%\d+]] = OpLoad %type_2d_image %t2
 // CHECK-NEXT:   [[gSampler:%\d+]] = OpLoad %type_sampler %gSampler
 // CHECK-NEXT:     [[offset:%\d+]] = OpLoad %v2int %offset
 // CHECK-NEXT: [[sampledImg:%\d+]] = OpSampledImage %type_sampled_image_0 [[t2]] [[gSampler]]
 // CHECK-NEXT:            {{%\d+}} = OpImageSampleImplicitLod %v4float [[sampledImg]] [[v2fc]] Offset [[offset]]
-    float4 val2 = t2.Sample(gSampler, float2(0.1, 0.2), offset);
+    float4 val2 = t2.Sample(gSampler, float2(0.5, 0.25), offset);
 
 // CHECK:              [[t3:%\d+]] = OpLoad %type_3d_image %t3
 // CHECK-NEXT:   [[gSampler:%\d+]] = OpLoad %type_sampler %gSampler
 // CHECK-NEXT: [[sampledImg:%\d+]] = OpSampledImage %type_sampled_image_1 [[t3]] [[gSampler]]
 // CHECK-NEXT:            {{%\d+}} = OpImageSampleImplicitLod %v4float [[sampledImg]] [[v3fc]] ConstOffset [[v3ic]]
-    float4 val3 = t3.Sample(gSampler, float3(0.1, 0.2, 0.3), 3);
+    float4 val3 = t3.Sample(gSampler, float3(0.5, 0.25, 0.3), 3);
 
 // CHECK:              [[t4:%\d+]] = OpLoad %type_cube_image %t4
 // CHECK-NEXT:   [[gSampler:%\d+]] = OpLoad %type_sampler %gSampler
 // CHECK-NEXT: [[sampledImg:%\d+]] = OpSampledImage %type_sampled_image_2 [[t4]] [[gSampler]]
 // CHECK-NEXT:            {{%\d+}} = OpImageSampleImplicitLod %v4float [[sampledImg]] [[v3fc]]
-    float4 val4 = t4.Sample(gSampler, float3(0.1, 0.2, 0.3));
+    float4 val4 = t4.Sample(gSampler, float3(0.5, 0.25, 0.3));
 
     float clamp;
 // CHECK:           [[clamp:%\d+]] = OpLoad %float %clamp
@@ -61,13 +61,13 @@ float4 main(int2 offset: A) : SV_Target {
 // CHECK-NEXT:     [[offset:%\d+]] = OpLoad %v2int %offset
 // CHECK-NEXT: [[sampledImg:%\d+]] = OpSampledImage %type_sampled_image_0 [[t2]] [[gSampler]]
 // CHECK-NEXT:            {{%\d+}} = OpImageSampleImplicitLod %v4float [[sampledImg]] [[v2fc]] Offset|MinLod [[offset]] [[clamp]]
-    float4 val5 = t2.Sample(gSampler, float2(0.1, 0.2), offset, clamp);
+    float4 val5 = t2.Sample(gSampler, float2(0.5, 0.25), offset, clamp);
 
 // CHECK:              [[t4:%\d+]] = OpLoad %type_cube_image %t4
 // CHECK-NEXT:   [[gSampler:%\d+]] = OpLoad %type_sampler %gSampler
 // CHECK-NEXT: [[sampledImg:%\d+]] = OpSampledImage %type_sampled_image_2 [[t4]] [[gSampler]]
 // CHECK-NEXT:            {{%\d+}} = OpImageSampleImplicitLod %v4float [[sampledImg]] [[v3fc]] MinLod %float_2
-    float4 val6 = t4.Sample(gSampler, float3(0.1, 0.2, 0.3), /*clamp*/ 2.0f);
+    float4 val6 = t4.Sample(gSampler, float3(0.5, 0.25, 0.3), /*clamp*/ 2.0f);
 
     uint status;
 // CHECK:             [[clamp:%\d+]] = OpLoad %float %clamp
@@ -80,7 +80,7 @@ float4 main(int2 offset: A) : SV_Target {
 // CHECK-NEXT:                         OpStore %status [[status]]
 // CHECK-NEXT:       [[result:%\d+]] = OpCompositeExtract %v4float [[structResult]] 1
 // CHECK-NEXT:                         OpStore %val7 [[result]]
-    float4 val7 = t2.Sample(gSampler, float2(0.1, 0.2), offset, clamp, status);
+    float4 val7 = t2.Sample(gSampler, float2(0.5, 0.25), offset, clamp, status);
 
 // CHECK:                [[t4:%\d+]] = OpLoad %type_cube_image %t4
 // CHECK-NEXT:     [[gSampler:%\d+]] = OpLoad %type_sampler %gSampler
@@ -90,7 +90,7 @@ float4 main(int2 offset: A) : SV_Target {
 // CHECK-NEXT:                         OpStore %status [[status]]
 // CHECK-NEXT:       [[result:%\d+]] = OpCompositeExtract %v4float [[structResult]] 1
 // CHECK-NEXT:                         OpStore %val8 [[result]]
-    float4 val8 = t4.Sample(gSampler, float3(0.1, 0.2, 0.3), /*clamp*/ 2.0f, status);
+    float4 val8 = t4.Sample(gSampler, float3(0.5, 0.25, 0.3), /*clamp*/ 2.0f, status);
 
 
 /////////////////////////////////////////////////////////////////////////////////////////////////////////
@@ -98,14 +98,14 @@ float4 main(int2 offset: A) : SV_Target {
 // Make sure OpImageSparseSampleImplicitLod returns a struct, in which the second member is a vec4.
 /////////////////////////////////////////////////////////////////////////////////////////////////////////
 
-// CHECK: [[v4result:%\d+]] = OpImageSampleImplicitLod %v4float {{%\d+}} %float_0_1 None
+// CHECK: [[v4result:%\d+]] = OpImageSampleImplicitLod %v4float {{%\d+}} %float_0_5 None
 // CHECK:          {{%\d+}} = OpCompositeExtract %float [[v4result]] 0
-	float  val9  = t5.Sample(gSampler, 0.1);
+	float  val9  = t5.Sample(gSampler, 0.5);
 
 // CHECK: [[structResult:%\d+]] = OpImageSparseSampleImplicitLod %SparseResidencyStruct {{%\d+}} {{%\d+}} MinLod %float_2
 // CHECK:     [[v4result:%\d+]] = OpCompositeExtract %v4float [[structResult]] 1
 // CHECK:              {{%\d+}} = OpVectorShuffle %v3float [[v4result]] [[v4result]] 0 1 2
-	float3 val10 = t6.Sample(gSampler, float3(0.1, 0.2, 0.3), /*clamp*/ 2.0f, status);
+	float3 val10 = t6.Sample(gSampler, float3(0.5, 0.25, 0.3), /*clamp*/ 2.0f, status);
 
     return 1.0;
 }

+ 4 - 4
tools/clang/test/CodeGenSPIRV/vk.spec-constant.init.hlsl

@@ -44,12 +44,12 @@ int i3 = 2.5;
 [[vk::constant_id(20)]]
 uint uintConst1 = 56;
 
-// CHECK: [[f0]] = OpSpecConstant %float 4.2
+// CHECK: [[f0]] = OpSpecConstant %float 4.5
 [[vk::constant_id(30)]]
-float f0 = (4.2);
-// CHECK: [[f1]] = OpSpecConstant %float -4.2
+float f0 = (4.5);
+// CHECK: [[f1]] = OpSpecConstant %float -4.5
 [[vk::constant_id(31)]]
-float f1 = -4.2;
+float f1 = -4.5;
 // CHECK: [[f2]] = OpSpecConstant %float 1
 [[vk::constant_id(32)]]
 float f2 = true;