Fix SPIR-V for SampleBias
authorGreg Fischer <greg@lunarg.com>
Fri, 17 Sep 2021 23:14:36 +0000 (17:14 -0600)
committerGreg Fischer <greg@lunarg.com>
Fri, 17 Sep 2021 23:22:39 +0000 (17:22 -0600)
Fixes #2757

Test/baseResults/hlsl.samplebias.offset.dx10.frag.out
Test/baseResults/hlsl.samplebias.offsetarray.dx10.frag.out
glslang/HLSL/hlslParseHelper.cpp
glslang/HLSL/hlslParseables.cpp

index 478091d..291f624 100644 (file)
@@ -16,9 +16,9 @@ using depth_any
 0:31            Constant:
 0:31              0.100000
 0:31            Constant:
-0:31              0.500000
-0:31            Constant:
 0:31              1 (const int)
+0:31            Constant:
+0:31              0.500000
 0:32      Sequence
 0:32        move second child to first child ( temp 4-component vector of int)
 0:32          'txval11' ( temp 4-component vector of int)
@@ -29,9 +29,9 @@ using depth_any
 0:32            Constant:
 0:32              0.200000
 0:32            Constant:
-0:32              0.500000
-0:32            Constant:
 0:32              1 (const int)
+0:32            Constant:
+0:32              0.500000
 0:33      Sequence
 0:33        move second child to first child ( temp 4-component vector of uint)
 0:33          'txval12' ( temp 4-component vector of uint)
@@ -42,9 +42,9 @@ using depth_any
 0:33            Constant:
 0:33              0.300000
 0:33            Constant:
-0:33              0.500000
-0:33            Constant:
 0:33              1 (const int)
+0:33            Constant:
+0:33              0.500000
 0:35      Sequence
 0:35        move second child to first child ( temp 4-component vector of float)
 0:35          'txval20' ( temp 4-component vector of float)
@@ -56,10 +56,10 @@ using depth_any
 0:35              0.100000
 0:35              0.200000
 0:35            Constant:
-0:35              0.500000
-0:35            Constant:
 0:35              1 (const int)
 0:35              0 (const int)
+0:35            Constant:
+0:35              0.500000
 0:36      Sequence
 0:36        move second child to first child ( temp 4-component vector of int)
 0:36          'txval21' ( temp 4-component vector of int)
@@ -71,10 +71,10 @@ using depth_any
 0:36              0.300000
 0:36              0.400000
 0:36            Constant:
-0:36              0.500000
-0:36            Constant:
 0:36              1 (const int)
 0:36              1 (const int)
+0:36            Constant:
+0:36              0.500000
 0:37      Sequence
 0:37        move second child to first child ( temp 4-component vector of uint)
 0:37          'txval22' ( temp 4-component vector of uint)
@@ -86,10 +86,10 @@ using depth_any
 0:37              0.500000
 0:37              0.600000
 0:37            Constant:
-0:37              0.500000
-0:37            Constant:
 0:37              1 (const int)
 0:37              -1 (const int)
+0:37            Constant:
+0:37              0.500000
 0:39      Sequence
 0:39        move second child to first child ( temp 4-component vector of float)
 0:39          'txval30' ( temp 4-component vector of float)
@@ -102,11 +102,11 @@ using depth_any
 0:39              0.200000
 0:39              0.300000
 0:39            Constant:
-0:39              0.500000
-0:39            Constant:
 0:39              1 (const int)
 0:39              0 (const int)
 0:39              1 (const int)
+0:39            Constant:
+0:39              0.500000
 0:40      Sequence
 0:40        move second child to first child ( temp 4-component vector of int)
 0:40          'txval31' ( temp 4-component vector of int)
@@ -119,11 +119,11 @@ using depth_any
 0:40              0.500000
 0:40              0.600000
 0:40            Constant:
-0:40              0.500000
-0:40            Constant:
 0:40              1 (const int)
 0:40              1 (const int)
 0:40              1 (const int)
+0:40            Constant:
+0:40              0.500000
 0:41      Sequence
 0:41        move second child to first child ( temp 4-component vector of uint)
 0:41          'txval32' ( temp 4-component vector of uint)
@@ -136,11 +136,11 @@ using depth_any
 0:41              0.800000
 0:41              0.900000
 0:41            Constant:
-0:41              0.500000
-0:41            Constant:
 0:41              1 (const int)
 0:41              0 (const int)
 0:41              -1 (const int)
+0:41            Constant:
+0:41              0.500000
 0:45      move second child to first child ( temp 4-component vector of float)
 0:45        Color: direct index for structure ( temp 4-component vector of float)
 0:45          'psout' ( temp structure{ temp 4-component vector of float Color,  temp float Depth})
@@ -218,9 +218,9 @@ using depth_any
 0:31            Constant:
 0:31              0.100000
 0:31            Constant:
-0:31              0.500000
-0:31            Constant:
 0:31              1 (const int)
+0:31            Constant:
+0:31              0.500000
 0:32      Sequence
 0:32        move second child to first child ( temp 4-component vector of int)
 0:32          'txval11' ( temp 4-component vector of int)
@@ -231,9 +231,9 @@ using depth_any
 0:32            Constant:
 0:32              0.200000
 0:32            Constant:
-0:32              0.500000
-0:32            Constant:
 0:32              1 (const int)
+0:32            Constant:
+0:32              0.500000
 0:33      Sequence
 0:33        move second child to first child ( temp 4-component vector of uint)
 0:33          'txval12' ( temp 4-component vector of uint)
@@ -244,9 +244,9 @@ using depth_any
 0:33            Constant:
 0:33              0.300000
 0:33            Constant:
-0:33              0.500000
-0:33            Constant:
 0:33              1 (const int)
+0:33            Constant:
+0:33              0.500000
 0:35      Sequence
 0:35        move second child to first child ( temp 4-component vector of float)
 0:35          'txval20' ( temp 4-component vector of float)
@@ -258,10 +258,10 @@ using depth_any
 0:35              0.100000
 0:35              0.200000
 0:35            Constant:
-0:35              0.500000
-0:35            Constant:
 0:35              1 (const int)
 0:35              0 (const int)
+0:35            Constant:
+0:35              0.500000
 0:36      Sequence
 0:36        move second child to first child ( temp 4-component vector of int)
 0:36          'txval21' ( temp 4-component vector of int)
@@ -273,10 +273,10 @@ using depth_any
 0:36              0.300000
 0:36              0.400000
 0:36            Constant:
-0:36              0.500000
-0:36            Constant:
 0:36              1 (const int)
 0:36              1 (const int)
+0:36            Constant:
+0:36              0.500000
 0:37      Sequence
 0:37        move second child to first child ( temp 4-component vector of uint)
 0:37          'txval22' ( temp 4-component vector of uint)
@@ -288,10 +288,10 @@ using depth_any
 0:37              0.500000
 0:37              0.600000
 0:37            Constant:
-0:37              0.500000
-0:37            Constant:
 0:37              1 (const int)
 0:37              -1 (const int)
+0:37            Constant:
+0:37              0.500000
 0:39      Sequence
 0:39        move second child to first child ( temp 4-component vector of float)
 0:39          'txval30' ( temp 4-component vector of float)
@@ -304,11 +304,11 @@ using depth_any
 0:39              0.200000
 0:39              0.300000
 0:39            Constant:
-0:39              0.500000
-0:39            Constant:
 0:39              1 (const int)
 0:39              0 (const int)
 0:39              1 (const int)
+0:39            Constant:
+0:39              0.500000
 0:40      Sequence
 0:40        move second child to first child ( temp 4-component vector of int)
 0:40          'txval31' ( temp 4-component vector of int)
@@ -321,11 +321,11 @@ using depth_any
 0:40              0.500000
 0:40              0.600000
 0:40            Constant:
-0:40              0.500000
-0:40            Constant:
 0:40              1 (const int)
 0:40              1 (const int)
 0:40              1 (const int)
+0:40            Constant:
+0:40              0.500000
 0:41      Sequence
 0:41        move second child to first child ( temp 4-component vector of uint)
 0:41          'txval32' ( temp 4-component vector of uint)
@@ -338,11 +338,11 @@ using depth_any
 0:41              0.800000
 0:41              0.900000
 0:41            Constant:
-0:41              0.500000
-0:41            Constant:
 0:41              1 (const int)
 0:41              0 (const int)
 0:41              -1 (const int)
+0:41            Constant:
+0:41              0.500000
 0:45      move second child to first child ( temp 4-component vector of float)
 0:45        Color: direct index for structure ( temp 4-component vector of float)
 0:45          'psout' ( temp structure{ temp 4-component vector of float Color,  temp float Depth})
@@ -399,7 +399,6 @@ using depth_any
 0:?     '@entryPointOutput.Depth' ( out float FragDepth)
 0:?     '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float)
 
-Validation failed
 // Module Version 10000
 // Generated by (magic number): 8000a
 // Id's are bound by 161
@@ -489,12 +488,12 @@ Validation failed
      20(g_sSamp):     19(ptr) Variable UniformConstant
               22:             TypeSampledImage 14
               24:    6(float) Constant 1036831949
-              25:    6(float) Constant 1056964608
-              26:             TypeInt 32 1
-              27:     26(int) Constant 1
-              29:             TypeVector 26(int) 4
+              25:             TypeInt 32 1
+              26:     25(int) Constant 1
+              27:    6(float) Constant 1056964608
+              29:             TypeVector 25(int) 4
               30:             TypePointer Function 29(ivec4)
-              32:             TypeImage 26(int) 1D sampled format:Unknown
+              32:             TypeImage 25(int) 1D sampled format:Unknown
               33:             TypePointer UniformConstant 32
   34(g_tTex1di4):     33(ptr) Variable UniformConstant
               37:             TypeSampledImage 32
@@ -513,38 +512,38 @@ Validation failed
               60:             TypeSampledImage 55
               62:             TypeVector 6(float) 2
               63:   62(fvec2) ConstantComposite 24 39
-              64:             TypeVector 26(int) 2
-              65:     26(int) Constant 0
-              66:   64(ivec2) ConstantComposite 27 65
-              69:             TypeImage 26(int) 2D sampled format:Unknown
+              64:             TypeVector 25(int) 2
+              65:     25(int) Constant 0
+              66:   64(ivec2) ConstantComposite 26 65
+              69:             TypeImage 25(int) 2D sampled format:Unknown
               70:             TypePointer UniformConstant 69
   71(g_tTex2di4):     70(ptr) Variable UniformConstant
               74:             TypeSampledImage 69
               76:    6(float) Constant 1053609165
               77:   62(fvec2) ConstantComposite 52 76
-              78:   64(ivec2) ConstantComposite 27 27
+              78:   64(ivec2) ConstantComposite 26 26
               81:             TypeImage 41(int) 2D sampled format:Unknown
               82:             TypePointer UniformConstant 81
   83(g_tTex2du4):     82(ptr) Variable UniformConstant
               86:             TypeSampledImage 81
               88:    6(float) Constant 1058642330
-              89:   62(fvec2) ConstantComposite 25 88
-              90:     26(int) Constant 4294967295
-              91:   64(ivec2) ConstantComposite 27 90
+              89:   62(fvec2) ConstantComposite 27 88
+              90:     25(int) Constant 4294967295
+              91:   64(ivec2) ConstantComposite 26 90
               94:             TypeImage 6(float) 3D sampled format:Unknown
               95:             TypePointer UniformConstant 94
   96(g_tTex3df4):     95(ptr) Variable UniformConstant
               99:             TypeSampledImage 94
              101:             TypeVector 6(float) 3
              102:  101(fvec3) ConstantComposite 24 39 52
-             103:             TypeVector 26(int) 3
-             104:  103(ivec3) ConstantComposite 27 65 27
-             107:             TypeImage 26(int) 3D sampled format:Unknown
+             103:             TypeVector 25(int) 3
+             104:  103(ivec3) ConstantComposite 26 65 26
+             107:             TypeImage 25(int) 3D sampled format:Unknown
              108:             TypePointer UniformConstant 107
  109(g_tTex3di4):    108(ptr) Variable UniformConstant
              112:             TypeSampledImage 107
-             114:  101(fvec3) ConstantComposite 76 25 88
-             115:  103(ivec3) ConstantComposite 27 27 27
+             114:  101(fvec3) ConstantComposite 76 27 88
+             115:  103(ivec3) ConstantComposite 26 26 26
              118:             TypeImage 41(int) 3D sampled format:Unknown
              119:             TypePointer UniformConstant 118
  120(g_tTex3du4):    119(ptr) Variable UniformConstant
@@ -553,7 +552,7 @@ Validation failed
              126:    6(float) Constant 1061997773
              127:    6(float) Constant 1063675494
              128:  101(fvec3) ConstantComposite 125 126 127
-             129:  103(ivec3) ConstantComposite 27 65 90
+             129:  103(ivec3) ConstantComposite 26 65 90
              131:             TypePointer Function 8(PS_OUTPUT)
              133:    6(float) Constant 1065353216
              134:    7(fvec4) ConstantComposite 133 133 133 133
@@ -566,7 +565,7 @@ Validation failed
              152:             TypeImage 6(float) Cube sampled format:Unknown
              153:             TypePointer UniformConstant 152
  154(g_tTexcdf4):    153(ptr) Variable UniformConstant
-             155:             TypeImage 26(int) Cube sampled format:Unknown
+             155:             TypeImage 25(int) Cube sampled format:Unknown
              156:             TypePointer UniformConstant 155
  157(g_tTexcdi4):    156(ptr) Variable UniformConstant
              158:             TypeImage 41(int) Cube sampled format:Unknown
@@ -580,7 +579,7 @@ Validation failed
              145:     12(ptr) AccessChain 141(flattenTemp) 65
              146:    7(fvec4) Load 145
                               Store 144(@entryPointOutput.Color) 146
-             149:    136(ptr) AccessChain 141(flattenTemp) 27
+             149:    136(ptr) AccessChain 141(flattenTemp) 26
              150:    6(float) Load 149
                               Store 148(@entryPointOutput.Depth) 150
                               Return
@@ -600,51 +599,51 @@ Validation failed
               17:          14 Load 16(g_tTex1df4)
               21:          18 Load 20(g_sSamp)
               23:          22 SampledImage 17 21
-              28:    7(fvec4) ImageSampleImplicitLod 23 24 Bias ConstOffset 27 25
+              28:    7(fvec4) ImageSampleImplicitLod 23 24 Bias ConstOffset 27 26
                               Store 13(txval10) 28
               35:          32 Load 34(g_tTex1di4)
               36:          18 Load 20(g_sSamp)
               38:          37 SampledImage 35 36
-              40:   29(ivec4) ImageSampleImplicitLod 38 39 Bias ConstOffset 27 25
+              40:   29(ivec4) ImageSampleImplicitLod 38 39 Bias ConstOffset 27 26
                               Store 31(txval11) 40
               48:          45 Load 47(g_tTex1du4)
               49:          18 Load 20(g_sSamp)
               51:          50 SampledImage 48 49
-              53:   42(ivec4) ImageSampleImplicitLod 51 52 Bias ConstOffset 27 25
+              53:   42(ivec4) ImageSampleImplicitLod 51 52 Bias ConstOffset 27 26
                               Store 44(txval12) 53
               58:          55 Load 57(g_tTex2df4)
               59:          18 Load 20(g_sSamp)
               61:          60 SampledImage 58 59
-              67:    7(fvec4) ImageSampleImplicitLod 61 63 Bias ConstOffset 66 25
+              67:    7(fvec4) ImageSampleImplicitLod 61 63 Bias ConstOffset 27 66
                               Store 54(txval20) 67
               72:          69 Load 71(g_tTex2di4)
               73:          18 Load 20(g_sSamp)
               75:          74 SampledImage 72 73
-              79:   29(ivec4) ImageSampleImplicitLod 75 77 Bias ConstOffset 78 25
+              79:   29(ivec4) ImageSampleImplicitLod 75 77 Bias ConstOffset 27 78
                               Store 68(txval21) 79
               84:          81 Load 83(g_tTex2du4)
               85:          18 Load 20(g_sSamp)
               87:          86 SampledImage 84 85
-              92:   42(ivec4) ImageSampleImplicitLod 87 89 Bias ConstOffset 91 25
+              92:   42(ivec4) ImageSampleImplicitLod 87 89 Bias ConstOffset 27 91
                               Store 80(txval22) 92
               97:          94 Load 96(g_tTex3df4)
               98:          18 Load 20(g_sSamp)
              100:          99 SampledImage 97 98
-             105:    7(fvec4) ImageSampleImplicitLod 100 102 Bias ConstOffset 104 25
+             105:    7(fvec4) ImageSampleImplicitLod 100 102 Bias ConstOffset 27 104
                               Store 93(txval30) 105
              110:         107 Load 109(g_tTex3di4)
              111:          18 Load 20(g_sSamp)
              113:         112 SampledImage 110 111
-             116:   29(ivec4) ImageSampleImplicitLod 113 114 Bias ConstOffset 115 25
+             116:   29(ivec4) ImageSampleImplicitLod 113 114 Bias ConstOffset 27 115
                               Store 106(txval31) 116
              121:         118 Load 120(g_tTex3du4)
              122:          18 Load 20(g_sSamp)
              124:         123 SampledImage 121 122
-             130:   42(ivec4) ImageSampleImplicitLod 124 128 Bias ConstOffset 129 25
+             130:   42(ivec4) ImageSampleImplicitLod 124 128 Bias ConstOffset 27 129
                               Store 117(txval32) 130
              135:     12(ptr) AccessChain 132(psout) 65
                               Store 135 134
-             137:    136(ptr) AccessChain 132(psout) 27
+             137:    136(ptr) AccessChain 132(psout) 26
                               Store 137 133
              138:8(PS_OUTPUT) Load 132(psout)
                               ReturnValue 138
index f5aff67..a5bb613 100644 (file)
@@ -17,9 +17,9 @@ using depth_any
 0:23              0.100000
 0:23              0.200000
 0:23            Constant:
-0:23              0.500000
-0:23            Constant:
 0:23              0 (const int)
+0:23            Constant:
+0:23              0.500000
 0:24      Sequence
 0:24        move second child to first child ( temp 4-component vector of int)
 0:24          'txval11' ( temp 4-component vector of int)
@@ -31,9 +31,9 @@ using depth_any
 0:24              0.200000
 0:24              0.300000
 0:24            Constant:
-0:24              0.500000
-0:24            Constant:
 0:24              1 (const int)
+0:24            Constant:
+0:24              0.500000
 0:25      Sequence
 0:25        move second child to first child ( temp 4-component vector of uint)
 0:25          'txval12' ( temp 4-component vector of uint)
@@ -45,9 +45,9 @@ using depth_any
 0:25              0.300000
 0:25              0.400000
 0:25            Constant:
-0:25              0.500000
-0:25            Constant:
 0:25              2 (const int)
+0:25            Constant:
+0:25              0.500000
 0:27      Sequence
 0:27        move second child to first child ( temp 4-component vector of float)
 0:27          'txval20' ( temp 4-component vector of float)
@@ -60,10 +60,10 @@ using depth_any
 0:27              0.200000
 0:27              0.300000
 0:27            Constant:
-0:27              0.500000
-0:27            Constant:
 0:27              0 (const int)
 0:27              0 (const int)
+0:27            Constant:
+0:27              0.500000
 0:28      Sequence
 0:28        move second child to first child ( temp 4-component vector of int)
 0:28          'txval21' ( temp 4-component vector of int)
@@ -76,10 +76,10 @@ using depth_any
 0:28              0.400000
 0:28              0.500000
 0:28            Constant:
-0:28              0.500000
-0:28            Constant:
 0:28              0 (const int)
 0:28              0 (const int)
+0:28            Constant:
+0:28              0.500000
 0:29      Sequence
 0:29        move second child to first child ( temp 4-component vector of uint)
 0:29          'txval22' ( temp 4-component vector of uint)
@@ -92,10 +92,10 @@ using depth_any
 0:29              0.600000
 0:29              0.700000
 0:29            Constant:
-0:29              0.500000
-0:29            Constant:
 0:29              0 (const int)
 0:29              1 (const int)
+0:29            Constant:
+0:29              0.500000
 0:33      move second child to first child ( temp 4-component vector of float)
 0:33        Color: direct index for structure ( temp 4-component vector of float)
 0:33          'psout' ( temp structure{ temp 4-component vector of float Color,  temp float Depth})
@@ -168,9 +168,9 @@ using depth_any
 0:23              0.100000
 0:23              0.200000
 0:23            Constant:
-0:23              0.500000
-0:23            Constant:
 0:23              0 (const int)
+0:23            Constant:
+0:23              0.500000
 0:24      Sequence
 0:24        move second child to first child ( temp 4-component vector of int)
 0:24          'txval11' ( temp 4-component vector of int)
@@ -182,9 +182,9 @@ using depth_any
 0:24              0.200000
 0:24              0.300000
 0:24            Constant:
-0:24              0.500000
-0:24            Constant:
 0:24              1 (const int)
+0:24            Constant:
+0:24              0.500000
 0:25      Sequence
 0:25        move second child to first child ( temp 4-component vector of uint)
 0:25          'txval12' ( temp 4-component vector of uint)
@@ -196,9 +196,9 @@ using depth_any
 0:25              0.300000
 0:25              0.400000
 0:25            Constant:
-0:25              0.500000
-0:25            Constant:
 0:25              2 (const int)
+0:25            Constant:
+0:25              0.500000
 0:27      Sequence
 0:27        move second child to first child ( temp 4-component vector of float)
 0:27          'txval20' ( temp 4-component vector of float)
@@ -211,10 +211,10 @@ using depth_any
 0:27              0.200000
 0:27              0.300000
 0:27            Constant:
-0:27              0.500000
-0:27            Constant:
 0:27              0 (const int)
 0:27              0 (const int)
+0:27            Constant:
+0:27              0.500000
 0:28      Sequence
 0:28        move second child to first child ( temp 4-component vector of int)
 0:28          'txval21' ( temp 4-component vector of int)
@@ -227,10 +227,10 @@ using depth_any
 0:28              0.400000
 0:28              0.500000
 0:28            Constant:
-0:28              0.500000
-0:28            Constant:
 0:28              0 (const int)
 0:28              0 (const int)
+0:28            Constant:
+0:28              0.500000
 0:29      Sequence
 0:29        move second child to first child ( temp 4-component vector of uint)
 0:29          'txval22' ( temp 4-component vector of uint)
@@ -243,10 +243,10 @@ using depth_any
 0:29              0.600000
 0:29              0.700000
 0:29            Constant:
-0:29              0.500000
-0:29            Constant:
 0:29              0 (const int)
 0:29              1 (const int)
+0:29            Constant:
+0:29              0.500000
 0:33      move second child to first child ( temp 4-component vector of float)
 0:33        Color: direct index for structure ( temp 4-component vector of float)
 0:33          'psout' ( temp structure{ temp 4-component vector of float Color,  temp float Depth})
@@ -297,7 +297,6 @@ using depth_any
 0:?     '@entryPointOutput.Depth' ( out float FragDepth)
 0:?     '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float)
 
-Validation failed
 // Module Version 10000
 // Generated by (magic number): 8000a
 // Id's are bound by 118
@@ -369,18 +368,18 @@ Validation failed
               25:    6(float) Constant 1036831949
               26:    6(float) Constant 1045220557
               27:   24(fvec2) ConstantComposite 25 26
-              28:    6(float) Constant 1056964608
-              29:             TypeInt 32 1
-              30:     29(int) Constant 0
-              32:             TypeVector 29(int) 4
+              28:             TypeInt 32 1
+              29:     28(int) Constant 0
+              30:    6(float) Constant 1056964608
+              32:             TypeVector 28(int) 4
               33:             TypePointer Function 32(ivec4)
-              35:             TypeImage 29(int) 1D array sampled format:Unknown
+              35:             TypeImage 28(int) 1D array sampled format:Unknown
               36:             TypePointer UniformConstant 35
   37(g_tTex1di4):     36(ptr) Variable UniformConstant
               40:             TypeSampledImage 35
               42:    6(float) Constant 1050253722
               43:   24(fvec2) ConstantComposite 26 42
-              44:     29(int) Constant 1
+              44:     28(int) Constant 1
               46:             TypeInt 32 0
               47:             TypeVector 46(int) 4
               48:             TypePointer Function 47(ivec4)
@@ -390,28 +389,28 @@ Validation failed
               55:             TypeSampledImage 50
               57:    6(float) Constant 1053609165
               58:   24(fvec2) ConstantComposite 42 57
-              59:     29(int) Constant 2
+              59:     28(int) Constant 2
               62:             TypeImage 6(float) 2D array sampled format:Unknown
               63:             TypePointer UniformConstant 62
   64(g_tTex2df4):     63(ptr) Variable UniformConstant
               67:             TypeSampledImage 62
               69:             TypeVector 6(float) 3
               70:   69(fvec3) ConstantComposite 25 26 42
-              71:             TypeVector 29(int) 2
-              72:   71(ivec2) ConstantComposite 30 30
-              75:             TypeImage 29(int) 2D array sampled format:Unknown
+              71:             TypeVector 28(int) 2
+              72:   71(ivec2) ConstantComposite 29 29
+              75:             TypeImage 28(int) 2D array sampled format:Unknown
               76:             TypePointer UniformConstant 75
   77(g_tTex2di4):     76(ptr) Variable UniformConstant
               80:             TypeSampledImage 75
-              82:   69(fvec3) ConstantComposite 42 57 28
+              82:   69(fvec3) ConstantComposite 42 57 30
               85:             TypeImage 46(int) 2D array sampled format:Unknown
               86:             TypePointer UniformConstant 85
   87(g_tTex2du4):     86(ptr) Variable UniformConstant
               90:             TypeSampledImage 85
               92:    6(float) Constant 1058642330
               93:    6(float) Constant 1060320051
-              94:   69(fvec3) ConstantComposite 28 92 93
-              95:   71(ivec2) ConstantComposite 30 44
+              94:   69(fvec3) ConstantComposite 30 92 93
+              95:   71(ivec2) ConstantComposite 29 44
               97:             TypePointer Function 8(PS_OUTPUT)
               99:    6(float) Constant 1065353216
              100:    7(fvec4) ConstantComposite 99 99 99 99
@@ -426,7 +425,7 @@ Validation failed
 107(flattenTemp):     97(ptr) Variable Function
              108:8(PS_OUTPUT) FunctionCall 10(@main()
                               Store 107(flattenTemp) 108
-             111:     12(ptr) AccessChain 107(flattenTemp) 30
+             111:     12(ptr) AccessChain 107(flattenTemp) 29
              112:    7(fvec4) Load 111
                               Store 110(@entryPointOutput.Color) 112
              115:    102(ptr) AccessChain 107(flattenTemp) 44
@@ -446,34 +445,34 @@ Validation failed
               17:          14 Load 16(g_tTex1df4)
               21:          18 Load 20(g_sSamp)
               23:          22 SampledImage 17 21
-              31:    7(fvec4) ImageSampleImplicitLod 23 27 Bias ConstOffset 30 28
+              31:    7(fvec4) ImageSampleImplicitLod 23 27 Bias ConstOffset 30 29
                               Store 13(txval10) 31
               38:          35 Load 37(g_tTex1di4)
               39:          18 Load 20(g_sSamp)
               41:          40 SampledImage 38 39
-              45:   32(ivec4) ImageSampleImplicitLod 41 43 Bias ConstOffset 44 28
+              45:   32(ivec4) ImageSampleImplicitLod 41 43 Bias ConstOffset 30 44
                               Store 34(txval11) 45
               53:          50 Load 52(g_tTex1du4)
               54:          18 Load 20(g_sSamp)
               56:          55 SampledImage 53 54
-              60:   47(ivec4) ImageSampleImplicitLod 56 58 Bias ConstOffset 59 28
+              60:   47(ivec4) ImageSampleImplicitLod 56 58 Bias ConstOffset 30 59
                               Store 49(txval12) 60
               65:          62 Load 64(g_tTex2df4)
               66:          18 Load 20(g_sSamp)
               68:          67 SampledImage 65 66
-              73:    7(fvec4) ImageSampleImplicitLod 68 70 Bias ConstOffset 72 28
+              73:    7(fvec4) ImageSampleImplicitLod 68 70 Bias ConstOffset 30 72
                               Store 61(txval20) 73
               78:          75 Load 77(g_tTex2di4)
               79:          18 Load 20(g_sSamp)
               81:          80 SampledImage 78 79
-              83:   32(ivec4) ImageSampleImplicitLod 81 82 Bias ConstOffset 72 28
+              83:   32(ivec4) ImageSampleImplicitLod 81 82 Bias ConstOffset 30 72
                               Store 74(txval21) 83
               88:          85 Load 87(g_tTex2du4)
               89:          18 Load 20(g_sSamp)
               91:          90 SampledImage 88 89
-              96:   47(ivec4) ImageSampleImplicitLod 91 94 Bias ConstOffset 95 28
+              96:   47(ivec4) ImageSampleImplicitLod 91 94 Bias ConstOffset 30 95
                               Store 84(txval22) 96
-             101:     12(ptr) AccessChain 98(psout) 30
+             101:     12(ptr) AccessChain 98(psout) 29
                               Store 101 100
              103:    102(ptr) AccessChain 98(psout) 44
                               Store 103 99
index 02aac3c..39b3eca 100644 (file)
@@ -4017,12 +4017,12 @@ void HlslParseContext::decomposeSampleMethods(const TSourceLoc& loc, TIntermType
             txsample->getSequence().push_back(txcombine);
             txsample->getSequence().push_back(argCoord);
 
-            if (argBias != nullptr)
-                txsample->getSequence().push_back(argBias);
-
             if (argOffset != nullptr)
                 txsample->getSequence().push_back(argOffset);
 
+            if (argBias != nullptr)
+              txsample->getSequence().push_back(argBias);
+
             node = convertReturn(txsample, sampler);
 
             break;
index 4673b46..15918dc 100644 (file)
@@ -665,8 +665,8 @@ void TBuiltInParseablesHlsl::initialize(int /*version*/, EProfile /*profile*/, c
         { "Sample",             /*!O*/        "V4",    nullptr,   "%@,S,V",         "FIU,S,F",        EShLangPS,    true },
         { "Sample",             /* O*/        "V4",    nullptr,   "%@,S,V,",        "FIU,S,F,I",      EShLangPS,    true },
 
-        { "SampleBias",         /*!O*/        "V4",    nullptr,   "%@,S,V,S",       "FIU,S,F,",       EShLangPS,    true },
-        { "SampleBias",         /* O*/        "V4",    nullptr,   "%@,S,V,S,V",     "FIU,S,F,,I",     EShLangPS,    true },
+        { "SampleBias",         /*!O*/        "V4",    nullptr,   "%@,S,V,S",       "FIU,S,F,F",      EShLangPS,    true },
+        { "SampleBias",         /* O*/        "V4",    nullptr,   "%@,S,V,S,V",     "FIU,S,F,F,I",    EShLangPS,    true },
 
         // TODO: FXC accepts int/uint samplers here.  unclear what that means.
         { "SampleCmp",          /*!O*/        "S",     "F",       "%@,S,V,S",       "FIU,s,F,",       EShLangPS,    true },