Fix an issue of spirv_by_reference
When using this qualifier for a parameter, we make it as a pointer. However, the function TranslateStorageClass() is therefore called and the storage class should only be set to Function when it is invoked to translate parameter types rather than actual argument types.
This commit is contained in:
@@ -1256,8 +1256,10 @@ spv::StorageClass TGlslangToSpvTraverser::TranslateStorageClass(const glslang::T
|
||||
if (type.getBasicType() == glslang::EbtRayQuery)
|
||||
return spv::StorageClassPrivate;
|
||||
#ifndef GLSLANG_WEB
|
||||
if (type.getQualifier().isSpirvByReference())
|
||||
return spv::StorageClassFunction;
|
||||
if (type.getQualifier().isSpirvByReference()) {
|
||||
if (type.getQualifier().isParamInput() || type.getQualifier().isParamOutput())
|
||||
return spv::StorageClassFunction;
|
||||
}
|
||||
#endif
|
||||
if (type.getQualifier().isPipeInput())
|
||||
return spv::StorageClassInput;
|
||||
|
||||
Reference in New Issue
Block a user