Skip to content

Commit 92e04d1

Browse files
committed
Address copilot comments
1 parent 16294e5 commit 92e04d1

3 files changed

Lines changed: 6 additions & 4 deletions

File tree

tools/clang/lib/Sema/SemaHLSL.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5074,7 +5074,9 @@ class HLSLExternalSource : public ExternalSemaSource {
50745074
ResClass = DXIL::ResourceClass::UAV;
50755075
return true;
50765076
case AR_OBJECT_TEXTURE2D_ARRAY:
5077+
#ifdef ENABLE_SPIRV_CODEGEN
50775078
case AR_OBJECT_VK_SAMPLED_TEXTURE2D_ARRAY:
5079+
#endif
50785080
ResKind = DXIL::ResourceKind::Texture2DArray;
50795081
ResClass = DXIL::ResourceClass::SRV;
50805082
return true;

tools/clang/test/CodeGenSPIRV/vk.sampledtexture.get-dimensions.hlsl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ void main() {
4848
tex2dArray.GetDimensions(width, height, elements);
4949

5050
// CHECK: [[t2_load:%[0-9]+]] = OpLoad [[type_2d_sampled_image_array]] %tex2dArray
51-
// CHECK-NEXT: [[image4:%[0-9]+]] = OpImage %type_2d_image_array [[t2_load]]
51+
// CHECK-NEXT: [[image4:%[0-9]+]] = OpImage [[type_2d_image_array]] [[t2_load]]
5252
// CHECK-NEXT: [[mip:%[0-9]+]] = OpLoad %uint %mipLevel
5353
// CHECK-NEXT: [[query4:%[0-9]+]] = OpImageQuerySizeLod %v3uint [[image4]] [[mip]]
5454
// CHECK-NEXT: [[query4_0:%[0-9]+]] = OpCompositeExtract %uint [[query4]] 0

tools/clang/test/CodeGenSPIRV/vk.sampledtexture.load.hlsl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,15 @@ float4 main(int3 location3: A, int4 location4: B) : SV_Target {
1717
// CHECK-NEXT: [[coord_0:%[0-9]+]] = OpVectorShuffle %v2int [[loc]] [[loc]] 0 1
1818
// CHECK-NEXT: [[lod_0:%[0-9]+]] = OpCompositeExtract %int [[loc]] 2
1919
// CHECK-NEXT: [[tex:%[0-9]+]] = OpLoad [[type_2d_sampled_image]] %tex2d
20-
// CHECK-NEXT: [[tex_img:%[0-9]+]] = OpImage %type_2d_image [[tex]]
20+
// CHECK-NEXT: [[tex_img:%[0-9]+]] = OpImage [[type_2d_image]] [[tex]]
2121
// CHECK-NEXT: {{%[0-9]+}} = OpImageFetch %v4float [[tex_img]] [[coord_0]] Lod [[lod_0]]
2222
float4 val1 = tex2d.Load(location3);
2323

2424
// CHECK: [[loc:%[0-9]+]] = OpLoad %v3int %location3
2525
// CHECK-NEXT: [[coord_0:%[0-9]+]] = OpVectorShuffle %v2int [[loc]] [[loc]] 0 1
2626
// CHECK-NEXT: [[lod_0:%[0-9]+]] = OpCompositeExtract %int [[loc]] 2
2727
// CHECK-NEXT: [[tex:%[0-9]+]] = OpLoad [[type_2d_sampled_image]] %tex2d
28-
// CHECK-NEXT: [[tex_img:%[0-9]+]] = OpImage %type_2d_image [[tex]]
28+
// CHECK-NEXT: [[tex_img:%[0-9]+]] = OpImage [[type_2d_image]] [[tex]]
2929
// CHECK-NEXT: {{%[0-9]+}} = OpImageFetch %v4float [[tex_img]] [[coord_0]] Lod|ConstOffset [[lod_0]] [[v2ic]]
3030
float4 val2 = tex2d.Load(location3, int2(1, 2));
3131

@@ -37,7 +37,7 @@ float4 main(int3 location3: A, int4 location4: B) : SV_Target {
3737
// CHECK-NEXT: [[coord_0:%[0-9]+]] = OpVectorShuffle %v2int [[loc]] [[loc]] 0 1
3838
// CHECK-NEXT: [[lod_0:%[0-9]+]] = OpCompositeExtract %int [[loc]] 2
3939
// CHECK-NEXT: [[tex:%[0-9]+]] = OpLoad [[type_2d_sampled_image]] %tex2d
40-
// CHECK-NEXT: [[tex_img:%[0-9]+]] = OpImage %type_2d_image [[tex]]
40+
// CHECK-NEXT: [[tex_img:%[0-9]+]] = OpImage [[type_2d_image]] [[tex]]
4141
// CHECK-NEXT:[[structResult:%[0-9]+]] = OpImageSparseFetch %SparseResidencyStruct [[tex_img]] [[coord_0]] Lod|ConstOffset [[lod_0]] [[v2ic]]
4242
// CHECK-NEXT: [[status:%[0-9]+]] = OpCompositeExtract %uint [[structResult]] 0
4343
// CHECK-NEXT: OpStore %status [[status]]

0 commit comments

Comments
 (0)