Skip to content

Commit

Permalink
Fix clang hlsl/spirv tests
Browse files Browse the repository at this point in the history
  • Loading branch information
jiaolu committed Nov 24, 2021
1 parent 1fb3fd3 commit bed7933
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion tools/clang/lib/Sema/SemaHLSL.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3595,7 +3595,7 @@ class HLSLExternalSource : public ExternalSemaSource {
recordDecl = DeclareUIntTemplatedTypeWithHandle(*m_context, "FeedbackTexture2DArray", "kind");
}
#ifdef ENABLE_SPIRV_CODEGEN
else if (kind == AR_OBJECT_VK_SPV_INTRINSIC_TYPE) {
else if (kind == AR_OBJECT_VK_SPV_INTRINSIC_TYPE && m_vkNSDecl) {
recordDecl = DeclareUIntTemplatedTypeWithHandleInDeclContext(
*m_context, m_vkNSDecl, typeName, "id");
recordDecl->setImplicit(true);
Expand Down
10 changes: 5 additions & 5 deletions tools/clang/test/CodeGenSPIRV/spv.intrinsicTypeRayquery.hlsl
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,16 @@ void createAcceleStructureType();

[[vk::ext_instruction(/* OpRayQueryTerminateKHR */ 4474)]]
void rayQueryTerminateEXT(
[[vk::ext_reference]] ext_type<2> rq);
[[vk::ext_reference]] vk::ext_type<2> rq);

ext_type<3> as : register(t0);
vk::ext_type<3> as : register(t0);

[[vk::ext_instruction(/* OpRayQueryInitializeKHR */ 4473)]]
void rayQueryInitializeEXT([[vk::ext_reference]] ext_type<2> rayQuery, ext_type<3> as, uint rayFlags, uint cullMask, float3 origin, float tMin, float3 direction, float tMax);
void rayQueryInitializeEXT([[vk::ext_reference]] vk::ext_type<2> rayQuery, vk::ext_type<3> as, uint rayFlags, uint cullMask, float3 origin, float tMin, float3 direction, float tMax);

[[vk::ext_instruction(/* OpRayQueryTerminateKHR */ 4474)]]
void rayQueryTerminateEXT(
[[vk::ext_reference]] ext_type<2> rq );
[[vk::ext_reference]] vk::ext_type<2> rq );

//CHECK: %spirvIntrinsicType = OpTypeAccelerationStructureKHR
//CHECK: %spirvIntrinsicType_0 = OpTypeRayQueryKHR
Expand All @@ -34,7 +34,7 @@ void main()
{
createTypeRayQueryKHR();
createAcceleStructureType();
ext_type<2> rq;
vk::ext_type<2> rq;
rayQueryInitializeEXT(rq, as, 0, 0, float3(0, 0, 0), 0.0, float3(1,1,1), 1.0);
rayQueryTerminateEXT(rq);
}

0 comments on commit bed7933

Please sign in to comment.