diff options
Diffstat (limited to 'source')
| -rw-r--r-- | source/slang/slang-diagnostic-defs.h | 2 | ||||
| -rw-r--r-- | source/slang/slang-parameter-binding.cpp | 9 |
2 files changed, 9 insertions, 2 deletions
diff --git a/source/slang/slang-diagnostic-defs.h b/source/slang/slang-diagnostic-defs.h index eb7b5b993..f4bad6664 100644 --- a/source/slang/slang-diagnostic-defs.h +++ b/source/slang/slang-diagnostic-defs.h @@ -695,6 +695,8 @@ DIAGNOSTIC(39026, Error, matrixLayoutModifierOnNonMatrixType, "matrix layout mod DIAGNOSTIC(39027, Error, getAttributeAtVertexMustReferToPerVertexInput, "'GetAttributeAtVertex' must reference a vertex input directly, and the vertex input must be decorated with 'pervertex' or 'nointerpolation'.") +DIAGNOSTIC(39028, Error, notValidVaryingParameter, "parameter '$0' is not a valid varying parameter.") + // // 4xxxx - IL code generation. diff --git a/source/slang/slang-parameter-binding.cpp b/source/slang/slang-parameter-binding.cpp index 523ba9287..bce9b5d05 100644 --- a/source/slang/slang-parameter-binding.cpp +++ b/source/slang/slang-parameter-binding.cpp @@ -2185,9 +2185,11 @@ static RefPtr<TypeLayout> processEntryPointVaryingParameter( state, fieldVarLayout); - SLANG_ASSERT(fieldTypeLayout); - if(!fieldTypeLayout) + if (!fieldTypeLayout) + { + getSink(context)->diagnose(field, Diagnostics::notValidVaryingParameter, field); continue; + } fieldVarLayout->typeLayout = fieldTypeLayout; // The field needs to have offset information stored @@ -4169,6 +4171,9 @@ ProgramLayout* TargetProgram::getOrCreateLayout(DiagnosticSink* sink) if( !m_layout ) { m_layout = generateParameterBindings(this, sink); + if (sink->getErrorCount() != 0) + return nullptr; + if( m_layout ) { m_irModuleForLayout = createIRModuleForLayout(sink); |
