Do not output location decoration for certain variables in ray tracing storage
classes.
This commit is contained in:
parent
ec5ea2d6cb
commit
e306f02927
18 changed files with 12 additions and 22 deletions
|
|
@ -8716,8 +8716,18 @@ spv::Id TGlslangToSpvTraverser::getSymbolId(const glslang::TIntermSymbol* symbol
|
|||
builder.addDecoration(id, spv::DecorationOffset, symbol->getQualifier().layoutOffset);
|
||||
}
|
||||
|
||||
if (symbol->getQualifier().hasLocation())
|
||||
builder.addDecoration(id, spv::DecorationLocation, symbol->getQualifier().layoutLocation);
|
||||
if (symbol->getQualifier().hasLocation()) {
|
||||
if (!(glslangIntermediate->isRayTracingStage() && glslangIntermediate->IsRequestedExtension(glslang::E_GL_EXT_ray_tracing)
|
||||
&& (builder.getStorageClass(id) == spv::StorageClassRayPayloadKHR ||
|
||||
builder.getStorageClass(id) == spv::StorageClassIncomingRayPayloadKHR ||
|
||||
builder.getStorageClass(id) == spv::StorageClassCallableDataKHR ||
|
||||
builder.getStorageClass(id) == spv::StorageClassIncomingCallableDataKHR))) {
|
||||
// Location values are used to link TraceRayKHR and ExecuteCallableKHR to corresponding variables
|
||||
// but are not valid in SPIRV since they are supported only for Input/Output Storage classes.
|
||||
builder.addDecoration(id, spv::DecorationLocation, symbol->getQualifier().layoutLocation);
|
||||
}
|
||||
}
|
||||
|
||||
builder.addDecoration(id, TranslateInvariantDecoration(symbol->getType().getQualifier()));
|
||||
if (symbol->getQualifier().hasStream() && glslangIntermediate->isMultiStream()) {
|
||||
builder.addCapability(spv::CapabilityGeometryStreams);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue