diff --git a/external/SPIRV-Headers b/external/SPIRV-Headers index 04f10f650d..f88a2d7668 160000 --- a/external/SPIRV-Headers +++ b/external/SPIRV-Headers @@ -1 +1 @@ -Subproject commit 04f10f650d514df88b76d25e83db360142c7b174 +Subproject commit f88a2d766840fc825af1fc065977953ba1fa4a91 diff --git a/external/SPIRV-Tools b/external/SPIRV-Tools index fbe4f3ad91..b2033ea811 160000 --- a/external/SPIRV-Tools +++ b/external/SPIRV-Tools @@ -1 +1 @@ -Subproject commit fbe4f3ad913c44fe8700545f8ffe35d1382b7093 +Subproject commit b2033ea811c6c0150982b114c3cf4d3139c65fee diff --git a/tools/clang/lib/SPIRV/DeclResultIdMapper.cpp b/tools/clang/lib/SPIRV/DeclResultIdMapper.cpp index a9d10f9296..9fed57b41b 100644 --- a/tools/clang/lib/SPIRV/DeclResultIdMapper.cpp +++ b/tools/clang/lib/SPIRV/DeclResultIdMapper.cpp @@ -1263,6 +1263,21 @@ SpirvVariable *DeclResultIdMapper::createExternVar(const VarDecl *var, // another variable or function parameter needsLegalization = true; } + + // If we have a multi-dimensional array of resources, we need to run + // legalization to flatten the array. + if (const auto *arrayType = astContext.getAsConstantArrayType(type)) { + if (astContext.getAsConstantArrayType(arrayType->getElementType())) { + QualType elemType = arrayType->getElementType(); + while (const auto *innerArrayType = + astContext.getAsConstantArrayType(elemType)) { + elemType = innerArrayType->getElementType(); + } + if (hlsl::IsHLSLResourceType(elemType)) + needsLegalization = true; + } + } + if (vkImgFeatures.isCombinedImageSampler || vkImgFeatures.format) { spvContext.registerVkImageFeaturesForSpvVariable(varInstr, vkImgFeatures); } diff --git a/tools/clang/test/CodeGenSPIRV/type.rwstructured-buffer.array.counter.indirect.hlsl b/tools/clang/test/CodeGenSPIRV/type.rwstructured-buffer.array.counter.indirect.hlsl index aa65570f71..76d8165107 100644 --- a/tools/clang/test/CodeGenSPIRV/type.rwstructured-buffer.array.counter.indirect.hlsl +++ b/tools/clang/test/CodeGenSPIRV/type.rwstructured-buffer.array.counter.indirect.hlsl @@ -20,13 +20,11 @@ void func(RWStructuredBuffer local) { float4 main(PSInput input) : SV_TARGET { -// CHECK: [[ac1:%[0-9]+]] = OpAccessChain %_ptr_Uniform_type_ACSBuffer_counter %counter_var_g_rwbuffer {{%[0-9]+}} -// CHECK: [[ac2:%[0-9]+]] = OpAccessChain %_ptr_Uniform_int [[ac1]] %uint_0 +// CHECK: [[ac2:%[0-9]+]] = OpAccessChain %_ptr_Uniform_int %counter_var_g_rwbuffer {{%[0-9]+}} %uint_0 // CHECK: OpAtomicIAdd %int [[ac2]] %uint_1 %uint_0 %int_1 func(g_rwbuffer[input.idx]); -// CHECK: [[ac1_0:%[0-9]+]] = OpAccessChain %_ptr_Uniform_type_RWStructuredBuffer_uint %g_rwbuffer {{%[0-9]+}} -// CHECK: [[ac2_0:%[0-9]+]] = OpAccessChain %_ptr_Uniform_uint [[ac1_0]] %int_0 %uint_0 +// CHECK: [[ac2_0:%[0-9]+]] = OpAccessChain %_ptr_Uniform_uint %g_rwbuffer {{%[0-9]+}} %int_0 %uint_0 // CHECK: OpLoad %uint [[ac2_0]] return g_rwbuffer[input.idx][0]; } diff --git a/tools/clang/test/CodeGenSPIRV/type.rwstructured-buffer.array.counter.indirect2.hlsl b/tools/clang/test/CodeGenSPIRV/type.rwstructured-buffer.array.counter.indirect2.hlsl index 68cfb9f6e1..0ea52864a2 100644 --- a/tools/clang/test/CodeGenSPIRV/type.rwstructured-buffer.array.counter.indirect2.hlsl +++ b/tools/clang/test/CodeGenSPIRV/type.rwstructured-buffer.array.counter.indirect2.hlsl @@ -18,13 +18,11 @@ float4 main(PSInput input) : SV_TARGET { RWStructuredBuffer l_rwbuffer[5] = g_rwbuffer; -// CHECK: [[ac1:%[0-9]+]] = OpAccessChain %_ptr_Uniform_type_ACSBuffer_counter %counter_var_g_rwbuffer %int_0 -// CHECK: [[ac2:%[0-9]+]] = OpAccessChain %_ptr_Uniform_int [[ac1]] %uint_0 +// CHECK: [[ac2:%[0-9]+]] = OpAccessChain %_ptr_Uniform_int %counter_var_g_rwbuffer %int_0 %uint_0 // CHECK: OpAtomicIAdd %int [[ac2]] %uint_1 %uint_0 %int_1 l_rwbuffer[0].IncrementCounter(); -// CHECK: [[ac1_0:%[0-9]+]] = OpAccessChain %_ptr_Uniform_type_RWStructuredBuffer_uint %g_rwbuffer {{%[0-9]+}} -// CHECK: [[ac2_0:%[0-9]+]] = OpAccessChain %_ptr_Uniform_uint [[ac1_0]] %int_0 %uint_0 +// CHECK: [[ac2_0:%[0-9]+]] = OpAccessChain %_ptr_Uniform_uint %g_rwbuffer {{%[0-9]+}} %int_0 %uint_0 // CHECK: OpLoad %uint [[ac2_0]] return l_rwbuffer[input.idx][0]; } diff --git a/tools/clang/test/CodeGenSPIRV/vk.binding.global-struct-of-resources.optimized.hlsl b/tools/clang/test/CodeGenSPIRV/vk.binding.global-struct-of-resources.optimized.hlsl index ddf85b3cc1..1656e7f50f 100644 --- a/tools/clang/test/CodeGenSPIRV/vk.binding.global-struct-of-resources.optimized.hlsl +++ b/tools/clang/test/CodeGenSPIRV/vk.binding.global-struct-of-resources.optimized.hlsl @@ -3,20 +3,20 @@ // Check the names // // CHECK: OpName %secondGlobal_t "secondGlobal.t" -// CHECK: OpName %firstGlobal_0__0__t "firstGlobal[0][0].t" -// CHECK: OpName %firstGlobal_0__1__t "firstGlobal[0][1].t" -// CHECK: OpName %firstGlobal_1__0__t "firstGlobal[1][0].t" -// CHECK: OpName %firstGlobal_1__1__t "firstGlobal[1][1].t" +// CHECK: OpName %[[fg0:firstGlobal_[0-9]+__t]] "firstGlobal{{.*}}.t" +// CHECK: OpName %[[fg1:firstGlobal_[0-9]+__t]] "firstGlobal{{.*}}.t" +// CHECK: OpName %[[fg2:firstGlobal_[0-9]+__t]] "firstGlobal{{.*}}.t" +// CHECK: OpName %[[fg3:firstGlobal_[0-9]+__t]] "firstGlobal{{.*}}.t" // CHECK: OpName %secondGlobal_tt_0__s "secondGlobal.tt[0].s" // CHECK: OpName %secondGlobal_tt_1__s "secondGlobal.tt[1].s" -// CHECK: OpName %firstGlobal_0__0__tt_0__s "firstGlobal[0][0].tt[0].s" -// CHECK: OpName %firstGlobal_0__0__tt_1__s "firstGlobal[0][0].tt[1].s" -// CHECK: OpName %firstGlobal_0__1__tt_0__s "firstGlobal[0][1].tt[0].s" -// CHECK: OpName %firstGlobal_0__1__tt_1__s "firstGlobal[0][1].tt[1].s" -// CHECK: OpName %firstGlobal_1__0__tt_0__s "firstGlobal[1][0].tt[0].s" -// CHECK: OpName %firstGlobal_1__0__tt_1__s "firstGlobal[1][0].tt[1].s" -// CHECK: OpName %firstGlobal_1__1__tt_0__s "firstGlobal[1][1].tt[0].s" -// CHECK: OpName %firstGlobal_1__1__tt_1__s "firstGlobal[1][1].tt[1].s" +// CHECK: OpName %[[fgtt0_0:firstGlobal_[0-9]+__tt_0__s]] "firstGlobal{{.*}}.tt[0].s" +// CHECK: OpName %[[fgtt0_1:firstGlobal_[0-9]+__tt_1__s]] "firstGlobal{{.*}}.tt[1].s" +// CHECK: OpName %[[fgtt1_0:firstGlobal_[0-9]+__tt_0__s]] "firstGlobal{{.*}}.tt[0].s" +// CHECK: OpName %[[fgtt1_1:firstGlobal_[0-9]+__tt_1__s]] "firstGlobal{{.*}}.tt[1].s" +// CHECK: OpName %[[fgtt2_0:firstGlobal_[0-9]+__tt_0__s]] "firstGlobal{{.*}}.tt[0].s" +// CHECK: OpName %[[fgtt2_1:firstGlobal_[0-9]+__tt_1__s]] "firstGlobal{{.*}}.tt[1].s" +// CHECK: OpName %[[fgtt3_0:firstGlobal_[0-9]+__tt_0__s]] "firstGlobal{{.*}}.tt[0].s" +// CHECK: OpName %[[fgtt3_1:firstGlobal_[0-9]+__tt_1__s]] "firstGlobal{{.*}}.tt[1].s" // Check flattening of bindings // Explanation: Only the resources that are used will have a binding assignment @@ -70,52 +70,52 @@ // // CHECK: OpDecorate %secondGlobal_t DescriptorSet 0 // CHECK: OpDecorate %secondGlobal_t Binding 32 -// CHECK: OpDecorate %firstGlobal_0__0__t DescriptorSet 0 -// CHECK: OpDecorate %firstGlobal_0__0__t Binding 0 -// CHECK: OpDecorate %firstGlobal_0__1__t DescriptorSet 0 -// CHECK: OpDecorate %firstGlobal_0__1__t Binding 8 -// CHECK: OpDecorate %firstGlobal_1__0__t DescriptorSet 0 -// CHECK: OpDecorate %firstGlobal_1__0__t Binding 16 -// CHECK: OpDecorate %firstGlobal_1__1__t DescriptorSet 0 -// CHECK: OpDecorate %firstGlobal_1__1__t Binding 24 +// CHECK: OpDecorate %[[fg0]] DescriptorSet 0 +// CHECK: OpDecorate %[[fg0]] Binding 0 +// CHECK: OpDecorate %[[fg1]] DescriptorSet 0 +// CHECK: OpDecorate %[[fg1]] Binding 8 +// CHECK: OpDecorate %[[fg2]] DescriptorSet 0 +// CHECK: OpDecorate %[[fg2]] Binding 16 +// CHECK: OpDecorate %[[fg3]] DescriptorSet 0 +// CHECK: OpDecorate %[[fg3]] Binding 24 // CHECK: OpDecorate %secondGlobal_tt_0__s DescriptorSet 0 // CHECK: OpDecorate %secondGlobal_tt_0__s Binding 34 // CHECK: OpDecorate %secondGlobal_tt_1__s DescriptorSet 0 // CHECK: OpDecorate %secondGlobal_tt_1__s Binding 37 -// CHECK: OpDecorate %firstGlobal_0__0__tt_0__s DescriptorSet 0 -// CHECK: OpDecorate %firstGlobal_0__0__tt_0__s Binding 2 -// CHECK: OpDecorate %firstGlobal_0__0__tt_1__s DescriptorSet 0 -// CHECK: OpDecorate %firstGlobal_0__0__tt_1__s Binding 5 -// CHECK: OpDecorate %firstGlobal_0__1__tt_0__s DescriptorSet 0 -// CHECK: OpDecorate %firstGlobal_0__1__tt_0__s Binding 10 -// CHECK: OpDecorate %firstGlobal_0__1__tt_1__s DescriptorSet 0 -// CHECK: OpDecorate %firstGlobal_0__1__tt_1__s Binding 13 -// CHECK: OpDecorate %firstGlobal_1__0__tt_0__s DescriptorSet 0 -// CHECK: OpDecorate %firstGlobal_1__0__tt_0__s Binding 18 -// CHECK: OpDecorate %firstGlobal_1__0__tt_1__s DescriptorSet 0 -// CHECK: OpDecorate %firstGlobal_1__0__tt_1__s Binding 21 -// CHECK: OpDecorate %firstGlobal_1__1__tt_0__s DescriptorSet 0 -// CHECK: OpDecorate %firstGlobal_1__1__tt_0__s Binding 26 -// CHECK: OpDecorate %firstGlobal_1__1__tt_1__s DescriptorSet 0 -// CHECK: OpDecorate %firstGlobal_1__1__tt_1__s Binding 29 +// CHECK: OpDecorate %[[fgtt0_0]] DescriptorSet 0 +// CHECK: OpDecorate %[[fgtt0_0]] Binding 2 +// CHECK: OpDecorate %[[fgtt0_1]] DescriptorSet 0 +// CHECK: OpDecorate %[[fgtt0_1]] Binding 5 +// CHECK: OpDecorate %[[fgtt1_0]] DescriptorSet 0 +// CHECK: OpDecorate %[[fgtt1_0]] Binding 10 +// CHECK: OpDecorate %[[fgtt1_1]] DescriptorSet 0 +// CHECK: OpDecorate %[[fgtt1_1]] Binding 13 +// CHECK: OpDecorate %[[fgtt2_0]] DescriptorSet 0 +// CHECK: OpDecorate %[[fgtt2_0]] Binding 18 +// CHECK: OpDecorate %[[fgtt2_1]] DescriptorSet 0 +// CHECK: OpDecorate %[[fgtt2_1]] Binding 21 +// CHECK: OpDecorate %[[fgtt3_0]] DescriptorSet 0 +// CHECK: OpDecorate %[[fgtt3_0]] Binding 26 +// CHECK: OpDecorate %[[fgtt3_1]] DescriptorSet 0 +// CHECK: OpDecorate %[[fgtt3_1]] Binding 29 // Check existence of replacement variables // // CHECK: %secondGlobal_t = OpVariable %_ptr_UniformConstant__arr_type_2d_image_uint_2 UniformConstant -// CHECK: %firstGlobal_0__0__t = OpVariable %_ptr_UniformConstant__arr_type_2d_image_uint_2 UniformConstant -// CHECK: %firstGlobal_0__1__t = OpVariable %_ptr_UniformConstant__arr_type_2d_image_uint_2 UniformConstant -// CHECK: %firstGlobal_1__0__t = OpVariable %_ptr_UniformConstant__arr_type_2d_image_uint_2 UniformConstant -// CHECK: %firstGlobal_1__1__t = OpVariable %_ptr_UniformConstant__arr_type_2d_image_uint_2 UniformConstant +// CHECK: %[[fg0]] = OpVariable %_ptr_UniformConstant__arr_type_2d_image_uint_2 UniformConstant +// CHECK: %[[fg1]] = OpVariable %_ptr_UniformConstant__arr_type_2d_image_uint_2 UniformConstant +// CHECK: %[[fg2]] = OpVariable %_ptr_UniformConstant__arr_type_2d_image_uint_2 UniformConstant +// CHECK: %[[fg3]] = OpVariable %_ptr_UniformConstant__arr_type_2d_image_uint_2 UniformConstant // CHECK: %secondGlobal_tt_0__s = OpVariable %_ptr_UniformConstant__arr_type_sampler_uint_3 UniformConstant // CHECK: %secondGlobal_tt_1__s = OpVariable %_ptr_UniformConstant__arr_type_sampler_uint_3 UniformConstant -// CHECK: %firstGlobal_0__0__tt_0__s = OpVariable %_ptr_UniformConstant__arr_type_sampler_uint_3 UniformConstant -// CHECK: %firstGlobal_0__0__tt_1__s = OpVariable %_ptr_UniformConstant__arr_type_sampler_uint_3 UniformConstant -// CHECK: %firstGlobal_0__1__tt_0__s = OpVariable %_ptr_UniformConstant__arr_type_sampler_uint_3 UniformConstant -// CHECK: %firstGlobal_0__1__tt_1__s = OpVariable %_ptr_UniformConstant__arr_type_sampler_uint_3 UniformConstant -// CHECK: %firstGlobal_1__0__tt_0__s = OpVariable %_ptr_UniformConstant__arr_type_sampler_uint_3 UniformConstant -// CHECK: %firstGlobal_1__0__tt_1__s = OpVariable %_ptr_UniformConstant__arr_type_sampler_uint_3 UniformConstant -// CHECK: %firstGlobal_1__1__tt_0__s = OpVariable %_ptr_UniformConstant__arr_type_sampler_uint_3 UniformConstant -// CHECK: %firstGlobal_1__1__tt_1__s = OpVariable %_ptr_UniformConstant__arr_type_sampler_uint_3 UniformConstant +// CHECK: %[[fgtt0_0]] = OpVariable %_ptr_UniformConstant__arr_type_sampler_uint_3 UniformConstant +// CHECK: %[[fgtt0_1]] = OpVariable %_ptr_UniformConstant__arr_type_sampler_uint_3 UniformConstant +// CHECK: %[[fgtt1_0]] = OpVariable %_ptr_UniformConstant__arr_type_sampler_uint_3 UniformConstant +// CHECK: %[[fgtt1_1]] = OpVariable %_ptr_UniformConstant__arr_type_sampler_uint_3 UniformConstant +// CHECK: %[[fgtt2_0]] = OpVariable %_ptr_UniformConstant__arr_type_sampler_uint_3 UniformConstant +// CHECK: %[[fgtt2_1]] = OpVariable %_ptr_UniformConstant__arr_type_sampler_uint_3 UniformConstant +// CHECK: %[[fgtt3_0]] = OpVariable %_ptr_UniformConstant__arr_type_sampler_uint_3 UniformConstant +// CHECK: %[[fgtt3_1]] = OpVariable %_ptr_UniformConstant__arr_type_sampler_uint_3 UniformConstant struct T { SamplerState s[3]; @@ -135,12 +135,12 @@ S secondGlobal; float4 main() : SV_Target { return -// CHECK: [[fg_0_0_t:%[0-9]+]] = OpLoad %_arr_type_2d_image_uint_2 %firstGlobal_0__0__t +// CHECK: [[fg_0_0_t:%[0-9]+]] = OpLoad %_arr_type_2d_image_uint_2 %[[fg0]] // CHECK: [[fg_1_t_0:%[0-9]+]] = OpCompositeExtract %type_2d_image [[fg_0_0_t]] 0 // CHECK: [[fg_1_t_1:%[0-9]+]] = OpCompositeExtract %type_2d_image [[fg_0_0_t]] 1 -// CHECK: [[tmp:%[0-9]+]] = OpAccessChain %_ptr_UniformConstant_type_sampler %firstGlobal_0__0__tt_0__s %uint_1 +// CHECK: [[tmp:%[0-9]+]] = OpAccessChain %_ptr_UniformConstant_type_sampler %[[fgtt0_0]] %uint_1 // CHECK: [[fg_1_tt_0_s_1:%[0-9]+]] = OpLoad %type_sampler [[tmp]] -// CHECK: [[tmp:%[0-9]+]] = OpAccessChain %_ptr_UniformConstant_type_sampler %firstGlobal_0__0__tt_1__s %uint_2 +// CHECK: [[tmp:%[0-9]+]] = OpAccessChain %_ptr_UniformConstant_type_sampler %[[fgtt0_1]] %uint_2 // CHECK: [[fg_1_tt_1_s_2:%[0-9]+]] = OpLoad %type_sampler [[tmp]] // CHECK: [[sampled_img_1:%[0-9]+]] = OpSampledImage %type_sampled_image [[fg_1_t_0]] [[fg_1_tt_0_s_1]] // CHECK: {{%[0-9]+}} = OpImageSampleImplicitLod %v4float [[sampled_img_1]] @@ -149,12 +149,12 @@ float4 main() : SV_Target { // CHECK: OpFAdd tex2D(firstGlobal[0][0], float2(0,0)) + -// CHECK: [[fg_0_1_t:%[0-9]+]] = OpLoad %_arr_type_2d_image_uint_2 %firstGlobal_0__1__t +// CHECK: [[fg_0_1_t:%[0-9]+]] = OpLoad %_arr_type_2d_image_uint_2 %[[fg1]] // CHECK: [[fg_0_1_t_0:%[0-9]+]] = OpCompositeExtract %type_2d_image [[fg_0_1_t]] 0 // CHECK: [[fg_0_1_t_1:%[0-9]+]] = OpCompositeExtract %type_2d_image [[fg_0_1_t]] 1 -// CHECK: [[tmp:%[0-9]+]] = OpAccessChain %_ptr_UniformConstant_type_sampler %firstGlobal_0__1__tt_0__s %uint_1 +// CHECK: [[tmp:%[0-9]+]] = OpAccessChain %_ptr_UniformConstant_type_sampler %[[fgtt1_0]] %uint_1 // CHECK: [[fg_0_1_tt_0_s_1:%[0-9]+]] = OpLoad %type_sampler [[tmp]] -// CHECK: [[tmp:%[0-9]+]] = OpAccessChain %_ptr_UniformConstant_type_sampler %firstGlobal_0__1__tt_1__s %uint_2 +// CHECK: [[tmp:%[0-9]+]] = OpAccessChain %_ptr_UniformConstant_type_sampler %[[fgtt1_1]] %uint_2 // CHECK: [[fg_0_1_tt_1_s_2:%[0-9]+]] = OpLoad %type_sampler [[tmp]] // CHECK: [[sampled_img_3:%[0-9]+]] = OpSampledImage %type_sampled_image [[fg_0_1_t_0]] [[fg_0_1_tt_0_s_1]] // CHECK: {{%[0-9]+}} = OpImageSampleImplicitLod %v4float [[sampled_img_3]] @@ -162,12 +162,12 @@ float4 main() : SV_Target { // CHECK: {{%[0-9]+}} = OpImageSampleImplicitLod %v4float [[sampled_img_4]] // CHECK: OpFAdd tex2D(firstGlobal[0][1], float2(0,0)) + -// CHECK: [[fg_1_0_t:%[0-9]+]] = OpLoad %_arr_type_2d_image_uint_2 %firstGlobal_1__0__t +// CHECK: [[fg_1_0_t:%[0-9]+]] = OpLoad %_arr_type_2d_image_uint_2 %[[fg2]] // CHECK: [[fg_1_0_t_0:%[0-9]+]] = OpCompositeExtract %type_2d_image [[fg_1_0_t]] 0 // CHECK: [[fg_1_0_t_1:%[0-9]+]] = OpCompositeExtract %type_2d_image [[fg_1_0_t]] 1 -// CHECK: [[tmp:%[0-9]+]] = OpAccessChain %_ptr_UniformConstant_type_sampler %firstGlobal_1__0__tt_0__s %uint_1 +// CHECK: [[tmp:%[0-9]+]] = OpAccessChain %_ptr_UniformConstant_type_sampler %[[fgtt2_0]] %uint_1 // CHECK: [[fg_1_0_tt_0_s_1:%[0-9]+]] = OpLoad %type_sampler [[tmp]] -// CHECK: [[tmp:%[0-9]+]] = OpAccessChain %_ptr_UniformConstant_type_sampler %firstGlobal_1__0__tt_1__s %uint_2 +// CHECK: [[tmp:%[0-9]+]] = OpAccessChain %_ptr_UniformConstant_type_sampler %[[fgtt2_1]] %uint_2 // CHECK: [[fg_1_0_tt_1_s_2:%[0-9]+]] = OpLoad %type_sampler [[tmp]] // CHECK: [[sampled_img_5:%[0-9]+]] = OpSampledImage %type_sampled_image [[fg_1_0_t_0]] [[fg_1_0_tt_0_s_1]] // CHECK: {{%[0-9]+}} = OpImageSampleImplicitLod %v4float [[sampled_img_5]] @@ -175,12 +175,12 @@ float4 main() : SV_Target { // CHECK: {{%[0-9]+}} = OpImageSampleImplicitLod %v4float [[sampled_img_6]] // CHECK: OpFAdd tex2D(firstGlobal[1][0], float2(0,0)) + -// CHECK: [[fg_1_1_t:%[0-9]+]] = OpLoad %_arr_type_2d_image_uint_2 %firstGlobal_1__1__t +// CHECK: [[fg_1_1_t:%[0-9]+]] = OpLoad %_arr_type_2d_image_uint_2 %[[fg3]] // CHECK: [[fg_1_1_t_0:%[0-9]+]] = OpCompositeExtract %type_2d_image [[fg_1_1_t]] 0 // CHECK: [[fg_1_1_t_1:%[0-9]+]] = OpCompositeExtract %type_2d_image [[fg_1_1_t]] 1 -// CHECK: [[tmp:%[0-9]+]] = OpAccessChain %_ptr_UniformConstant_type_sampler %firstGlobal_1__1__tt_0__s %uint_1 +// CHECK: [[tmp:%[0-9]+]] = OpAccessChain %_ptr_UniformConstant_type_sampler %[[fgtt3_0]] %uint_1 // CHECK: [[fg_1_1_tt_0_s_1:%[0-9]+]] = OpLoad %type_sampler [[tmp]] -// CHECK: [[tmp:%[0-9]+]] = OpAccessChain %_ptr_UniformConstant_type_sampler %firstGlobal_1__1__tt_1__s %uint_2 +// CHECK: [[tmp:%[0-9]+]] = OpAccessChain %_ptr_UniformConstant_type_sampler %[[fgtt3_1]] %uint_2 // CHECK: [[fg_1_1_tt_1_s_2:%[0-9]+]] = OpLoad %type_sampler [[tmp]] // CHECK: [[sampled_img_7:%[0-9]+]] = OpSampledImage %type_sampled_image [[fg_1_1_t_0]] [[fg_1_1_tt_0_s_1]] // CHECK: {{%[0-9]+}} = OpImageSampleImplicitLod %v4float [[sampled_img_7]] @@ -204,4 +204,3 @@ float4 main() : SV_Target { // CHECK: {{%[0-9]+}} = OpImageSampleImplicitLod %v4float [[sampled_img_10]] secondGlobal.t[1].Sample(secondGlobal.tt[1].s[2], float2(0,0)); } -