Merge pull request #2831 from amdrexu/bugfix

Fix an issue of spirv_by_reference
This commit is contained in:
Greg Fischer 2021-11-23 13:39:57 -07:00 committed by GitHub
commit 042aaea516
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 14 additions and 12 deletions

View File

@ -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;

View File

@ -1,30 +1,30 @@
spv.intrinsicsSpirvLiteral.vert
Validation failed
// Module Version 10000
// Generated by (magic number): 8000a
// Id's are bound by 12
// Id's are bound by 13
Capability Shader
1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450
EntryPoint Vertex 4 "main"
EntryPoint Vertex 4 "main" 9 11
Source GLSL 450
SourceExtension "GL_EXT_spirv_intrinsics"
Name 4 "main"
Name 9 "vec4Out"
Name 10 "vec4In"
Name 11 "vec4In"
Decorate 9(vec4Out) Location 1
Decorate 10(vec4In) Location 0
Decorate 11(vec4In) Location 0
2: TypeVoid
3: TypeFunction 2
6: TypeFloat 32
7: TypeVector 6(float) 4
8: TypePointer Function 7(fvec4)
8: TypePointer Output 7(fvec4)
9(vec4Out): 8(ptr) Variable Output
10: TypePointer Input 7(fvec4)
11(vec4In): 10(ptr) Variable Input
4(main): 2 Function None 3
5: Label
9(vec4Out): 8(ptr) Variable Function
10(vec4In): 8(ptr) Variable Function
11: 7(fvec4) Load 10(vec4In) None
Store 9(vec4Out) 11 Volatile
12: 7(fvec4) Load 11(vec4In) None
Store 9(vec4Out) 12 Volatile
Return
FunctionEnd