diff options
| author | Yong He <yonghe@google.com> | 2019-01-25 17:45:42 -0800 |
|---|---|---|
| committer | Yong He <yonghe@google.com> | 2019-01-25 18:10:57 -0800 |
| commit | 864c38ee72991f414f2478ccacb462bfb11b4bca (patch) | |
| tree | 6cf97e1d3ad5546c8ee139cdc2acffc790804031 /source/slang/ir-glsl-legalize.cpp | |
| parent | a38490d7716ef6cbf9cbb992b880b9bbc9c1ac93 (diff) | |
fix up empty-struct-parameters
Diffstat (limited to 'source/slang/ir-glsl-legalize.cpp')
| -rw-r--r-- | source/slang/ir-glsl-legalize.cpp | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/source/slang/ir-glsl-legalize.cpp b/source/slang/ir-glsl-legalize.cpp index 9c4210be0..d2b696c5b 100644 --- a/source/slang/ir-glsl-legalize.cpp +++ b/source/slang/ir-glsl-legalize.cpp @@ -567,7 +567,11 @@ ScalarizedVal createGLSLGlobalVaryingsImpl( UInt bindingIndex, GlobalVaryingDeclarator* declarator) { - if( as<IRBasicType>(type) ) + if (as<IRVoidType>(type)) + { + return ScalarizedVal(); + } + else if( as<IRBasicType>(type) ) { return createSimpleGLSLGlobalVarying( context, @@ -675,12 +679,14 @@ ScalarizedVal createGLSLGlobalVaryingsImpl( stage, fieldBindingIndex, declarator); + if (fieldVal.flavor != ScalarizedVal::Flavor::none) + { + ScalarizedTupleValImpl::Element element; + element.val = fieldVal; + element.key = field->getKey(); - ScalarizedTupleValImpl::Element element; - element.val = fieldVal; - element.key = field->getKey(); - - tupleValImpl->elements.Add(element); + tupleValImpl->elements.Add(element); + } } return ScalarizedVal::tuple(tupleValImpl); |
