HLSL: Fix #1064: Don't include empty structures on OpEntryPoint
This commit is contained in:
parent
31365afaf4
commit
5f77d864f3
@ -1081,9 +1081,11 @@ void TGlslangToSpvTraverser::visitSymbol(glslang::TIntermSymbol* symbol)
|
|||||||
// Include all "static use" and "linkage only" interface variables on the OpEntryPoint instruction
|
// Include all "static use" and "linkage only" interface variables on the OpEntryPoint instruction
|
||||||
if (builder.isPointer(id)) {
|
if (builder.isPointer(id)) {
|
||||||
spv::StorageClass sc = builder.getStorageClass(id);
|
spv::StorageClass sc = builder.getStorageClass(id);
|
||||||
if (sc == spv::StorageClassInput || sc == spv::StorageClassOutput)
|
if (sc == spv::StorageClassInput || sc == spv::StorageClassOutput) {
|
||||||
|
if (!symbol->getType().isStruct() || symbol->getType().getStruct()->size() > 0)
|
||||||
iOSet.insert(id);
|
iOSet.insert(id);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Only process non-linkage-only nodes for generating actual static uses
|
// Only process non-linkage-only nodes for generating actual static uses
|
||||||
if (! linkageOnly || symbol->getQualifier().isSpecConstant()) {
|
if (! linkageOnly || symbol->getQualifier().isSpecConstant()) {
|
||||||
|
@ -56,7 +56,7 @@ gl_FragCoord origin is upper left
|
|||||||
Capability Shader
|
Capability Shader
|
||||||
1: ExtInstImport "GLSL.std.450"
|
1: ExtInstImport "GLSL.std.450"
|
||||||
MemoryModel Logical GLSL450
|
MemoryModel Logical GLSL450
|
||||||
EntryPoint Fragment 4 "main" 20 23
|
EntryPoint Fragment 4 "main"
|
||||||
ExecutionMode 4 OriginUpperLeft
|
ExecutionMode 4 OriginUpperLeft
|
||||||
Source HLSL 500
|
Source HLSL 500
|
||||||
Name 4 "main"
|
Name 4 "main"
|
||||||
|
@ -54,7 +54,7 @@ Shader version: 500
|
|||||||
Capability Shader
|
Capability Shader
|
||||||
1: ExtInstImport "GLSL.std.450"
|
1: ExtInstImport "GLSL.std.450"
|
||||||
MemoryModel Logical GLSL450
|
MemoryModel Logical GLSL450
|
||||||
EntryPoint Vertex 4 "main" 20 23
|
EntryPoint Vertex 4 "main"
|
||||||
Source HLSL 500
|
Source HLSL 500
|
||||||
Name 4 "main"
|
Name 4 "main"
|
||||||
Name 6 "vs_in"
|
Name 6 "vs_in"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user