diff options
Diffstat (limited to 'source')
| -rw-r--r-- | source/slang/emit.cpp | 5 | ||||
| -rw-r--r-- | source/slang/ir-glsl-legalize.cpp | 18 |
2 files changed, 17 insertions, 6 deletions
diff --git a/source/slang/emit.cpp b/source/slang/emit.cpp index c3e1b2d08..536c72e11 100644 --- a/source/slang/emit.cpp +++ b/source/slang/emit.cpp @@ -3572,6 +3572,9 @@ struct EmitVisitor UInt argCount = inst->getOperandCount(); for( UInt aa = 1; aa < argCount; ++aa ) { + auto operand = inst->getOperand(aa); + if (as<IRVoidType>(operand->getDataType())) + continue; if(aa != 1) emit(", "); emitIROperand(ctx, inst->getOperand(aa), mode, kEOp_General); } @@ -6087,6 +6090,8 @@ struct EmitVisitor { varType = outType->getValueType(); } + if (as<IRVoidType>(varType)) + return; // When a global shader parameter represents a "parameter group" // (either a constant buffer or a parameter block with non-resource 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); |
