summaryrefslogtreecommitdiff
path: root/source/slang/slang-emit-spirv.cpp
diff options
context:
space:
mode:
authorYong He <yonghe@outlook.com>2023-09-12 10:49:16 -0700
committerGitHub <noreply@github.com>2023-09-12 10:49:16 -0700
commitc0a77c360436c4f1ec4d284e331063c35bdf95ad (patch)
tree6c1379a074304bdee3f33f6861754112d7d12c47 /source/slang/slang-emit-spirv.cpp
parent3f4081d854db2d186adea4067da575eca7c7adf1 (diff)
Direct SPIRV for RayTracing Inline. (#3201)
* Direct SPIRV for RayTracing Inline. * Fix. * Cleanup. * Fix compile error. --------- Co-authored-by: Yong He <yhe@nvidia.com>
Diffstat (limited to 'source/slang/slang-emit-spirv.cpp')
-rw-r--r--source/slang/slang-emit-spirv.cpp18
1 files changed, 13 insertions, 5 deletions
diff --git a/source/slang/slang-emit-spirv.cpp b/source/slang/slang-emit-spirv.cpp
index 07f1b2aee..88fb8b0fe 100644
--- a/source/slang/slang-emit-spirv.cpp
+++ b/source/slang/slang-emit-spirv.cpp
@@ -1430,11 +1430,17 @@ struct SPIRVEmitContext
);
}
case kIROp_SamplerStateType:
- return emitOpTypeSampler(inst);
- // > OpTypeArray
- // > OpTypeRuntimeArray
- // > OpTypeOpaque
- // > OpTypePointer
+ return emitOpTypeSampler(inst);
+
+ case kIROp_RaytracingAccelerationStructureType:
+ requireSPIRVCapability(SpvCapabilityRayTracingKHR);
+ ensureExtensionDeclaration(UnownedStringSlice("SPV_KHR_ray_tracing"));
+ return emitOpTypeAccelerationStructure(inst);
+
+ case kIROp_RayQueryType:
+ ensureExtensionDeclaration(UnownedStringSlice("SPV_KHR_ray_query"));
+ requireSPIRVCapability(SpvCapabilityRayQueryKHR);
+ return emitOpTypeRayQuery(inst);
case kIROp_FuncType:
// > OpTypeFunction
@@ -1544,6 +1550,8 @@ struct SPIRVEmitContext
}
case kIROp_GetStringHash:
return emitGetStringHash(inst);
+ case kIROp_AllocateOpaqueHandle:
+ return nullptr;
default:
{
if (as<IRSPIRVAsmOperand>(inst))