Skip to content

Commit 6de7fe1

Browse files
authored
[SPIRV] Update spir-v submodules and handle multi-dim array (#8167)
We are updating the spir-v submodules. They contain a new pass that will linearize multi-dimensional resource arrays, and call the combine access chain pass. This means we need to fix up some tests, and we want to make sure that we can properly handle multi-dimensional resource array in DXC. Fixes #7922
1 parent 22b71b0 commit 6de7fe1

File tree

6 files changed

+81
-71
lines changed

6 files changed

+81
-71
lines changed

external/SPIRV-Headers

external/SPIRV-Tools

Submodule SPIRV-Tools updated 51 files

tools/clang/lib/SPIRV/DeclResultIdMapper.cpp

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1263,6 +1263,21 @@ SpirvVariable *DeclResultIdMapper::createExternVar(const VarDecl *var,
12631263
// another variable or function parameter
12641264
needsLegalization = true;
12651265
}
1266+
1267+
// If we have a multi-dimensional array of resources, we need to run
1268+
// legalization to flatten the array.
1269+
if (const auto *arrayType = astContext.getAsConstantArrayType(type)) {
1270+
if (astContext.getAsConstantArrayType(arrayType->getElementType())) {
1271+
QualType elemType = arrayType->getElementType();
1272+
while (const auto *innerArrayType =
1273+
astContext.getAsConstantArrayType(elemType)) {
1274+
elemType = innerArrayType->getElementType();
1275+
}
1276+
if (hlsl::IsHLSLResourceType(elemType))
1277+
needsLegalization = true;
1278+
}
1279+
}
1280+
12661281
if (vkImgFeatures.isCombinedImageSampler || vkImgFeatures.format) {
12671282
spvContext.registerVkImageFeaturesForSpvVariable(varInstr, vkImgFeatures);
12681283
}

tools/clang/test/CodeGenSPIRV/type.rwstructured-buffer.array.counter.indirect.hlsl

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,11 @@ void func(RWStructuredBuffer<uint> local) {
2020

2121
float4 main(PSInput input) : SV_TARGET
2222
{
23-
// CHECK: [[ac1:%[0-9]+]] = OpAccessChain %_ptr_Uniform_type_ACSBuffer_counter %counter_var_g_rwbuffer {{%[0-9]+}}
24-
// CHECK: [[ac2:%[0-9]+]] = OpAccessChain %_ptr_Uniform_int [[ac1]] %uint_0
23+
// CHECK: [[ac2:%[0-9]+]] = OpAccessChain %_ptr_Uniform_int %counter_var_g_rwbuffer {{%[0-9]+}} %uint_0
2524
// CHECK: OpAtomicIAdd %int [[ac2]] %uint_1 %uint_0 %int_1
2625
func(g_rwbuffer[input.idx]);
2726

28-
// CHECK: [[ac1_0:%[0-9]+]] = OpAccessChain %_ptr_Uniform_type_RWStructuredBuffer_uint %g_rwbuffer {{%[0-9]+}}
29-
// CHECK: [[ac2_0:%[0-9]+]] = OpAccessChain %_ptr_Uniform_uint [[ac1_0]] %int_0 %uint_0
27+
// CHECK: [[ac2_0:%[0-9]+]] = OpAccessChain %_ptr_Uniform_uint %g_rwbuffer {{%[0-9]+}} %int_0 %uint_0
3028
// CHECK: OpLoad %uint [[ac2_0]]
3129
return g_rwbuffer[input.idx][0];
3230
}

tools/clang/test/CodeGenSPIRV/type.rwstructured-buffer.array.counter.indirect2.hlsl

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,11 @@ float4 main(PSInput input) : SV_TARGET
1818
{
1919
RWStructuredBuffer<uint> l_rwbuffer[5] = g_rwbuffer;
2020

21-
// CHECK: [[ac1:%[0-9]+]] = OpAccessChain %_ptr_Uniform_type_ACSBuffer_counter %counter_var_g_rwbuffer %int_0
22-
// CHECK: [[ac2:%[0-9]+]] = OpAccessChain %_ptr_Uniform_int [[ac1]] %uint_0
21+
// CHECK: [[ac2:%[0-9]+]] = OpAccessChain %_ptr_Uniform_int %counter_var_g_rwbuffer %int_0 %uint_0
2322
// CHECK: OpAtomicIAdd %int [[ac2]] %uint_1 %uint_0 %int_1
2423
l_rwbuffer[0].IncrementCounter();
2524

26-
// CHECK: [[ac1_0:%[0-9]+]] = OpAccessChain %_ptr_Uniform_type_RWStructuredBuffer_uint %g_rwbuffer {{%[0-9]+}}
27-
// CHECK: [[ac2_0:%[0-9]+]] = OpAccessChain %_ptr_Uniform_uint [[ac1_0]] %int_0 %uint_0
25+
// CHECK: [[ac2_0:%[0-9]+]] = OpAccessChain %_ptr_Uniform_uint %g_rwbuffer {{%[0-9]+}} %int_0 %uint_0
2826
// CHECK: OpLoad %uint [[ac2_0]]
2927
return l_rwbuffer[input.idx][0];
3028
}

tools/clang/test/CodeGenSPIRV/vk.binding.global-struct-of-resources.optimized.hlsl

Lines changed: 60 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,20 @@
33
// Check the names
44
//
55
// CHECK: OpName %secondGlobal_t "secondGlobal.t"
6-
// CHECK: OpName %firstGlobal_0__0__t "firstGlobal[0][0].t"
7-
// CHECK: OpName %firstGlobal_0__1__t "firstGlobal[0][1].t"
8-
// CHECK: OpName %firstGlobal_1__0__t "firstGlobal[1][0].t"
9-
// CHECK: OpName %firstGlobal_1__1__t "firstGlobal[1][1].t"
6+
// CHECK: OpName %[[fg0:firstGlobal_[0-9]+__t]] "firstGlobal{{.*}}.t"
7+
// CHECK: OpName %[[fg1:firstGlobal_[0-9]+__t]] "firstGlobal{{.*}}.t"
8+
// CHECK: OpName %[[fg2:firstGlobal_[0-9]+__t]] "firstGlobal{{.*}}.t"
9+
// CHECK: OpName %[[fg3:firstGlobal_[0-9]+__t]] "firstGlobal{{.*}}.t"
1010
// CHECK: OpName %secondGlobal_tt_0__s "secondGlobal.tt[0].s"
1111
// CHECK: OpName %secondGlobal_tt_1__s "secondGlobal.tt[1].s"
12-
// CHECK: OpName %firstGlobal_0__0__tt_0__s "firstGlobal[0][0].tt[0].s"
13-
// CHECK: OpName %firstGlobal_0__0__tt_1__s "firstGlobal[0][0].tt[1].s"
14-
// CHECK: OpName %firstGlobal_0__1__tt_0__s "firstGlobal[0][1].tt[0].s"
15-
// CHECK: OpName %firstGlobal_0__1__tt_1__s "firstGlobal[0][1].tt[1].s"
16-
// CHECK: OpName %firstGlobal_1__0__tt_0__s "firstGlobal[1][0].tt[0].s"
17-
// CHECK: OpName %firstGlobal_1__0__tt_1__s "firstGlobal[1][0].tt[1].s"
18-
// CHECK: OpName %firstGlobal_1__1__tt_0__s "firstGlobal[1][1].tt[0].s"
19-
// CHECK: OpName %firstGlobal_1__1__tt_1__s "firstGlobal[1][1].tt[1].s"
12+
// CHECK: OpName %[[fgtt0_0:firstGlobal_[0-9]+__tt_0__s]] "firstGlobal{{.*}}.tt[0].s"
13+
// CHECK: OpName %[[fgtt0_1:firstGlobal_[0-9]+__tt_1__s]] "firstGlobal{{.*}}.tt[1].s"
14+
// CHECK: OpName %[[fgtt1_0:firstGlobal_[0-9]+__tt_0__s]] "firstGlobal{{.*}}.tt[0].s"
15+
// CHECK: OpName %[[fgtt1_1:firstGlobal_[0-9]+__tt_1__s]] "firstGlobal{{.*}}.tt[1].s"
16+
// CHECK: OpName %[[fgtt2_0:firstGlobal_[0-9]+__tt_0__s]] "firstGlobal{{.*}}.tt[0].s"
17+
// CHECK: OpName %[[fgtt2_1:firstGlobal_[0-9]+__tt_1__s]] "firstGlobal{{.*}}.tt[1].s"
18+
// CHECK: OpName %[[fgtt3_0:firstGlobal_[0-9]+__tt_0__s]] "firstGlobal{{.*}}.tt[0].s"
19+
// CHECK: OpName %[[fgtt3_1:firstGlobal_[0-9]+__tt_1__s]] "firstGlobal{{.*}}.tt[1].s"
2020

2121
// Check flattening of bindings
2222
// Explanation: Only the resources that are used will have a binding assignment
@@ -70,52 +70,52 @@
7070
//
7171
// CHECK: OpDecorate %secondGlobal_t DescriptorSet 0
7272
// CHECK: OpDecorate %secondGlobal_t Binding 32
73-
// CHECK: OpDecorate %firstGlobal_0__0__t DescriptorSet 0
74-
// CHECK: OpDecorate %firstGlobal_0__0__t Binding 0
75-
// CHECK: OpDecorate %firstGlobal_0__1__t DescriptorSet 0
76-
// CHECK: OpDecorate %firstGlobal_0__1__t Binding 8
77-
// CHECK: OpDecorate %firstGlobal_1__0__t DescriptorSet 0
78-
// CHECK: OpDecorate %firstGlobal_1__0__t Binding 16
79-
// CHECK: OpDecorate %firstGlobal_1__1__t DescriptorSet 0
80-
// CHECK: OpDecorate %firstGlobal_1__1__t Binding 24
73+
// CHECK: OpDecorate %[[fg0]] DescriptorSet 0
74+
// CHECK: OpDecorate %[[fg0]] Binding 0
75+
// CHECK: OpDecorate %[[fg1]] DescriptorSet 0
76+
// CHECK: OpDecorate %[[fg1]] Binding 8
77+
// CHECK: OpDecorate %[[fg2]] DescriptorSet 0
78+
// CHECK: OpDecorate %[[fg2]] Binding 16
79+
// CHECK: OpDecorate %[[fg3]] DescriptorSet 0
80+
// CHECK: OpDecorate %[[fg3]] Binding 24
8181
// CHECK: OpDecorate %secondGlobal_tt_0__s DescriptorSet 0
8282
// CHECK: OpDecorate %secondGlobal_tt_0__s Binding 34
8383
// CHECK: OpDecorate %secondGlobal_tt_1__s DescriptorSet 0
8484
// CHECK: OpDecorate %secondGlobal_tt_1__s Binding 37
85-
// CHECK: OpDecorate %firstGlobal_0__0__tt_0__s DescriptorSet 0
86-
// CHECK: OpDecorate %firstGlobal_0__0__tt_0__s Binding 2
87-
// CHECK: OpDecorate %firstGlobal_0__0__tt_1__s DescriptorSet 0
88-
// CHECK: OpDecorate %firstGlobal_0__0__tt_1__s Binding 5
89-
// CHECK: OpDecorate %firstGlobal_0__1__tt_0__s DescriptorSet 0
90-
// CHECK: OpDecorate %firstGlobal_0__1__tt_0__s Binding 10
91-
// CHECK: OpDecorate %firstGlobal_0__1__tt_1__s DescriptorSet 0
92-
// CHECK: OpDecorate %firstGlobal_0__1__tt_1__s Binding 13
93-
// CHECK: OpDecorate %firstGlobal_1__0__tt_0__s DescriptorSet 0
94-
// CHECK: OpDecorate %firstGlobal_1__0__tt_0__s Binding 18
95-
// CHECK: OpDecorate %firstGlobal_1__0__tt_1__s DescriptorSet 0
96-
// CHECK: OpDecorate %firstGlobal_1__0__tt_1__s Binding 21
97-
// CHECK: OpDecorate %firstGlobal_1__1__tt_0__s DescriptorSet 0
98-
// CHECK: OpDecorate %firstGlobal_1__1__tt_0__s Binding 26
99-
// CHECK: OpDecorate %firstGlobal_1__1__tt_1__s DescriptorSet 0
100-
// CHECK: OpDecorate %firstGlobal_1__1__tt_1__s Binding 29
85+
// CHECK: OpDecorate %[[fgtt0_0]] DescriptorSet 0
86+
// CHECK: OpDecorate %[[fgtt0_0]] Binding 2
87+
// CHECK: OpDecorate %[[fgtt0_1]] DescriptorSet 0
88+
// CHECK: OpDecorate %[[fgtt0_1]] Binding 5
89+
// CHECK: OpDecorate %[[fgtt1_0]] DescriptorSet 0
90+
// CHECK: OpDecorate %[[fgtt1_0]] Binding 10
91+
// CHECK: OpDecorate %[[fgtt1_1]] DescriptorSet 0
92+
// CHECK: OpDecorate %[[fgtt1_1]] Binding 13
93+
// CHECK: OpDecorate %[[fgtt2_0]] DescriptorSet 0
94+
// CHECK: OpDecorate %[[fgtt2_0]] Binding 18
95+
// CHECK: OpDecorate %[[fgtt2_1]] DescriptorSet 0
96+
// CHECK: OpDecorate %[[fgtt2_1]] Binding 21
97+
// CHECK: OpDecorate %[[fgtt3_0]] DescriptorSet 0
98+
// CHECK: OpDecorate %[[fgtt3_0]] Binding 26
99+
// CHECK: OpDecorate %[[fgtt3_1]] DescriptorSet 0
100+
// CHECK: OpDecorate %[[fgtt3_1]] Binding 29
101101

102102
// Check existence of replacement variables
103103
//
104104
// CHECK: %secondGlobal_t = OpVariable %_ptr_UniformConstant__arr_type_2d_image_uint_2 UniformConstant
105-
// CHECK: %firstGlobal_0__0__t = OpVariable %_ptr_UniformConstant__arr_type_2d_image_uint_2 UniformConstant
106-
// CHECK: %firstGlobal_0__1__t = OpVariable %_ptr_UniformConstant__arr_type_2d_image_uint_2 UniformConstant
107-
// CHECK: %firstGlobal_1__0__t = OpVariable %_ptr_UniformConstant__arr_type_2d_image_uint_2 UniformConstant
108-
// CHECK: %firstGlobal_1__1__t = OpVariable %_ptr_UniformConstant__arr_type_2d_image_uint_2 UniformConstant
105+
// CHECK: %[[fg0]] = OpVariable %_ptr_UniformConstant__arr_type_2d_image_uint_2 UniformConstant
106+
// CHECK: %[[fg1]] = OpVariable %_ptr_UniformConstant__arr_type_2d_image_uint_2 UniformConstant
107+
// CHECK: %[[fg2]] = OpVariable %_ptr_UniformConstant__arr_type_2d_image_uint_2 UniformConstant
108+
// CHECK: %[[fg3]] = OpVariable %_ptr_UniformConstant__arr_type_2d_image_uint_2 UniformConstant
109109
// CHECK: %secondGlobal_tt_0__s = OpVariable %_ptr_UniformConstant__arr_type_sampler_uint_3 UniformConstant
110110
// CHECK: %secondGlobal_tt_1__s = OpVariable %_ptr_UniformConstant__arr_type_sampler_uint_3 UniformConstant
111-
// CHECK: %firstGlobal_0__0__tt_0__s = OpVariable %_ptr_UniformConstant__arr_type_sampler_uint_3 UniformConstant
112-
// CHECK: %firstGlobal_0__0__tt_1__s = OpVariable %_ptr_UniformConstant__arr_type_sampler_uint_3 UniformConstant
113-
// CHECK: %firstGlobal_0__1__tt_0__s = OpVariable %_ptr_UniformConstant__arr_type_sampler_uint_3 UniformConstant
114-
// CHECK: %firstGlobal_0__1__tt_1__s = OpVariable %_ptr_UniformConstant__arr_type_sampler_uint_3 UniformConstant
115-
// CHECK: %firstGlobal_1__0__tt_0__s = OpVariable %_ptr_UniformConstant__arr_type_sampler_uint_3 UniformConstant
116-
// CHECK: %firstGlobal_1__0__tt_1__s = OpVariable %_ptr_UniformConstant__arr_type_sampler_uint_3 UniformConstant
117-
// CHECK: %firstGlobal_1__1__tt_0__s = OpVariable %_ptr_UniformConstant__arr_type_sampler_uint_3 UniformConstant
118-
// CHECK: %firstGlobal_1__1__tt_1__s = OpVariable %_ptr_UniformConstant__arr_type_sampler_uint_3 UniformConstant
111+
// CHECK: %[[fgtt0_0]] = OpVariable %_ptr_UniformConstant__arr_type_sampler_uint_3 UniformConstant
112+
// CHECK: %[[fgtt0_1]] = OpVariable %_ptr_UniformConstant__arr_type_sampler_uint_3 UniformConstant
113+
// CHECK: %[[fgtt1_0]] = OpVariable %_ptr_UniformConstant__arr_type_sampler_uint_3 UniformConstant
114+
// CHECK: %[[fgtt1_1]] = OpVariable %_ptr_UniformConstant__arr_type_sampler_uint_3 UniformConstant
115+
// CHECK: %[[fgtt2_0]] = OpVariable %_ptr_UniformConstant__arr_type_sampler_uint_3 UniformConstant
116+
// CHECK: %[[fgtt2_1]] = OpVariable %_ptr_UniformConstant__arr_type_sampler_uint_3 UniformConstant
117+
// CHECK: %[[fgtt3_0]] = OpVariable %_ptr_UniformConstant__arr_type_sampler_uint_3 UniformConstant
118+
// CHECK: %[[fgtt3_1]] = OpVariable %_ptr_UniformConstant__arr_type_sampler_uint_3 UniformConstant
119119

120120
struct T {
121121
SamplerState s[3];
@@ -135,12 +135,12 @@ S secondGlobal;
135135

136136
float4 main() : SV_Target {
137137
return
138-
// CHECK: [[fg_0_0_t:%[0-9]+]] = OpLoad %_arr_type_2d_image_uint_2 %firstGlobal_0__0__t
138+
// CHECK: [[fg_0_0_t:%[0-9]+]] = OpLoad %_arr_type_2d_image_uint_2 %[[fg0]]
139139
// CHECK: [[fg_1_t_0:%[0-9]+]] = OpCompositeExtract %type_2d_image [[fg_0_0_t]] 0
140140
// CHECK: [[fg_1_t_1:%[0-9]+]] = OpCompositeExtract %type_2d_image [[fg_0_0_t]] 1
141-
// CHECK: [[tmp:%[0-9]+]] = OpAccessChain %_ptr_UniformConstant_type_sampler %firstGlobal_0__0__tt_0__s %uint_1
141+
// CHECK: [[tmp:%[0-9]+]] = OpAccessChain %_ptr_UniformConstant_type_sampler %[[fgtt0_0]] %uint_1
142142
// CHECK: [[fg_1_tt_0_s_1:%[0-9]+]] = OpLoad %type_sampler [[tmp]]
143-
// CHECK: [[tmp:%[0-9]+]] = OpAccessChain %_ptr_UniformConstant_type_sampler %firstGlobal_0__0__tt_1__s %uint_2
143+
// CHECK: [[tmp:%[0-9]+]] = OpAccessChain %_ptr_UniformConstant_type_sampler %[[fgtt0_1]] %uint_2
144144
// CHECK: [[fg_1_tt_1_s_2:%[0-9]+]] = OpLoad %type_sampler [[tmp]]
145145
// CHECK: [[sampled_img_1:%[0-9]+]] = OpSampledImage %type_sampled_image [[fg_1_t_0]] [[fg_1_tt_0_s_1]]
146146
// CHECK: {{%[0-9]+}} = OpImageSampleImplicitLod %v4float [[sampled_img_1]]
@@ -149,38 +149,38 @@ float4 main() : SV_Target {
149149
// CHECK: OpFAdd
150150
tex2D(firstGlobal[0][0], float2(0,0)) +
151151

152-
// CHECK: [[fg_0_1_t:%[0-9]+]] = OpLoad %_arr_type_2d_image_uint_2 %firstGlobal_0__1__t
152+
// CHECK: [[fg_0_1_t:%[0-9]+]] = OpLoad %_arr_type_2d_image_uint_2 %[[fg1]]
153153
// CHECK: [[fg_0_1_t_0:%[0-9]+]] = OpCompositeExtract %type_2d_image [[fg_0_1_t]] 0
154154
// CHECK: [[fg_0_1_t_1:%[0-9]+]] = OpCompositeExtract %type_2d_image [[fg_0_1_t]] 1
155-
// CHECK: [[tmp:%[0-9]+]] = OpAccessChain %_ptr_UniformConstant_type_sampler %firstGlobal_0__1__tt_0__s %uint_1
155+
// CHECK: [[tmp:%[0-9]+]] = OpAccessChain %_ptr_UniformConstant_type_sampler %[[fgtt1_0]] %uint_1
156156
// CHECK: [[fg_0_1_tt_0_s_1:%[0-9]+]] = OpLoad %type_sampler [[tmp]]
157-
// CHECK: [[tmp:%[0-9]+]] = OpAccessChain %_ptr_UniformConstant_type_sampler %firstGlobal_0__1__tt_1__s %uint_2
157+
// CHECK: [[tmp:%[0-9]+]] = OpAccessChain %_ptr_UniformConstant_type_sampler %[[fgtt1_1]] %uint_2
158158
// CHECK: [[fg_0_1_tt_1_s_2:%[0-9]+]] = OpLoad %type_sampler [[tmp]]
159159
// CHECK: [[sampled_img_3:%[0-9]+]] = OpSampledImage %type_sampled_image [[fg_0_1_t_0]] [[fg_0_1_tt_0_s_1]]
160160
// CHECK: {{%[0-9]+}} = OpImageSampleImplicitLod %v4float [[sampled_img_3]]
161161
// CHECK: [[sampled_img_4:%[0-9]+]] = OpSampledImage %type_sampled_image [[fg_0_1_t_1]] [[fg_0_1_tt_1_s_2]]
162162
// CHECK: {{%[0-9]+}} = OpImageSampleImplicitLod %v4float [[sampled_img_4]]
163163
// CHECK: OpFAdd
164164
tex2D(firstGlobal[0][1], float2(0,0)) +
165-
// CHECK: [[fg_1_0_t:%[0-9]+]] = OpLoad %_arr_type_2d_image_uint_2 %firstGlobal_1__0__t
165+
// CHECK: [[fg_1_0_t:%[0-9]+]] = OpLoad %_arr_type_2d_image_uint_2 %[[fg2]]
166166
// CHECK: [[fg_1_0_t_0:%[0-9]+]] = OpCompositeExtract %type_2d_image [[fg_1_0_t]] 0
167167
// CHECK: [[fg_1_0_t_1:%[0-9]+]] = OpCompositeExtract %type_2d_image [[fg_1_0_t]] 1
168-
// CHECK: [[tmp:%[0-9]+]] = OpAccessChain %_ptr_UniformConstant_type_sampler %firstGlobal_1__0__tt_0__s %uint_1
168+
// CHECK: [[tmp:%[0-9]+]] = OpAccessChain %_ptr_UniformConstant_type_sampler %[[fgtt2_0]] %uint_1
169169
// CHECK: [[fg_1_0_tt_0_s_1:%[0-9]+]] = OpLoad %type_sampler [[tmp]]
170-
// CHECK: [[tmp:%[0-9]+]] = OpAccessChain %_ptr_UniformConstant_type_sampler %firstGlobal_1__0__tt_1__s %uint_2
170+
// CHECK: [[tmp:%[0-9]+]] = OpAccessChain %_ptr_UniformConstant_type_sampler %[[fgtt2_1]] %uint_2
171171
// CHECK: [[fg_1_0_tt_1_s_2:%[0-9]+]] = OpLoad %type_sampler [[tmp]]
172172
// CHECK: [[sampled_img_5:%[0-9]+]] = OpSampledImage %type_sampled_image [[fg_1_0_t_0]] [[fg_1_0_tt_0_s_1]]
173173
// CHECK: {{%[0-9]+}} = OpImageSampleImplicitLod %v4float [[sampled_img_5]]
174174
// CHECK: [[sampled_img_6:%[0-9]+]] = OpSampledImage %type_sampled_image [[fg_1_0_t_1]] [[fg_1_0_tt_1_s_2]]
175175
// CHECK: {{%[0-9]+}} = OpImageSampleImplicitLod %v4float [[sampled_img_6]]
176176
// CHECK: OpFAdd
177177
tex2D(firstGlobal[1][0], float2(0,0)) +
178-
// CHECK: [[fg_1_1_t:%[0-9]+]] = OpLoad %_arr_type_2d_image_uint_2 %firstGlobal_1__1__t
178+
// CHECK: [[fg_1_1_t:%[0-9]+]] = OpLoad %_arr_type_2d_image_uint_2 %[[fg3]]
179179
// CHECK: [[fg_1_1_t_0:%[0-9]+]] = OpCompositeExtract %type_2d_image [[fg_1_1_t]] 0
180180
// CHECK: [[fg_1_1_t_1:%[0-9]+]] = OpCompositeExtract %type_2d_image [[fg_1_1_t]] 1
181-
// CHECK: [[tmp:%[0-9]+]] = OpAccessChain %_ptr_UniformConstant_type_sampler %firstGlobal_1__1__tt_0__s %uint_1
181+
// CHECK: [[tmp:%[0-9]+]] = OpAccessChain %_ptr_UniformConstant_type_sampler %[[fgtt3_0]] %uint_1
182182
// CHECK: [[fg_1_1_tt_0_s_1:%[0-9]+]] = OpLoad %type_sampler [[tmp]]
183-
// CHECK: [[tmp:%[0-9]+]] = OpAccessChain %_ptr_UniformConstant_type_sampler %firstGlobal_1__1__tt_1__s %uint_2
183+
// CHECK: [[tmp:%[0-9]+]] = OpAccessChain %_ptr_UniformConstant_type_sampler %[[fgtt3_1]] %uint_2
184184
// CHECK: [[fg_1_1_tt_1_s_2:%[0-9]+]] = OpLoad %type_sampler [[tmp]]
185185
// CHECK: [[sampled_img_7:%[0-9]+]] = OpSampledImage %type_sampled_image [[fg_1_1_t_0]] [[fg_1_1_tt_0_s_1]]
186186
// CHECK: {{%[0-9]+}} = OpImageSampleImplicitLod %v4float [[sampled_img_7]]
@@ -204,4 +204,3 @@ float4 main() : SV_Target {
204204
// CHECK: {{%[0-9]+}} = OpImageSampleImplicitLod %v4float [[sampled_img_10]]
205205
secondGlobal.t[1].Sample(secondGlobal.tt[1].s[2], float2(0,0));
206206
}
207-

0 commit comments

Comments
 (0)