From 4d593fe34ff89ce13882e47ccd95881ef4743c6b Mon Sep 17 00:00:00 2001 From: jsmall-nvidia Date: Thu, 7 Feb 2019 18:04:46 -0500 Subject: Hotfix/remove null this work around (#831) * Re-enable warnings around null this. * Remove testing for nullptr in Substitution::Equals tests * Fix ref counting problem in vulkan render. * * Remove SLANG_ASSERT(this) in mthods * Place asserts conservatively at method call sites where appropriate. --- source/slang/parameter-binding.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'source/slang/parameter-binding.cpp') diff --git a/source/slang/parameter-binding.cpp b/source/slang/parameter-binding.cpp index 583d4fe54..ba5a68341 100644 --- a/source/slang/parameter-binding.cpp +++ b/source/slang/parameter-binding.cpp @@ -2259,7 +2259,10 @@ static RefPtr computeEntryPointParameterTypeLayout( RefPtr paramVarLayout, EntryPointParameterState& state) { - auto paramType = GetType(paramDeclRef)->Substitute(typeSubst).as(); + auto paramDeclRefType = GetType(paramDeclRef); + SLANG_ASSERT(paramDeclRefType); + + auto paramType = paramDeclRefType->Substitute(typeSubst).as(); if( paramDeclRef.getDecl()->HasModifier() ) { @@ -2489,6 +2492,7 @@ static void collectEntryPointParameters( // for( auto taggedUnionType : entryPoint->taggedUnionTypes ) { + SLANG_ASSERT(taggedUnionType); auto substType = taggedUnionType->Substitute(typeSubst).as(); auto typeLayout = CreateTypeLayout(context->layoutContext, substType); entryPointLayout->taggedUnionTypeLayouts.Add(typeLayout); @@ -2594,6 +2598,8 @@ static void collectEntryPointParameters( // types and apply this logic unconditionally. // auto resultType = GetResultType(entryPointFuncDeclRef)->Substitute(typeSubst).as(); + SLANG_ASSERT(resultType); + if( !resultType->Equals(resultType->getSession()->getVoidType()) ) { state.loc = entryPointFuncDeclRef.getLoc(); @@ -3106,9 +3112,10 @@ RefPtr specializeProgramLayout( // In the case where things are generic-dependent, we need to re-do // the type layout process on the type that results from doing - // substutition with the global generic arguments. + // substitution with the global generic arguments. // RefPtr oldType = oldVarLayout->getTypeLayout()->getType(); + SLANG_ASSERT(oldType); RefPtr newType = oldType->Substitute(typeSubst).as(); RefPtr newTypeLayout = getTypeLayoutForGlobalShaderParameter( -- cgit v1.2.3