From 3d435f7321c3f9241d33a0f7521573f21b548186 Mon Sep 17 00:00:00 2001 From: Yong He Date: Thu, 4 Jan 2018 13:41:09 -0800 Subject: Bug fixes for Slang integration (#356) * fix #353 * move validateEntryPoint to after all entrypoints has been checked * bug fix: DeclRefType::SubstituteImpl should change ioDiff * bug fix: generic resource usage should have count of 1 instead of 0. * update test case --- source/slang/parameter-binding.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'source/slang/parameter-binding.cpp') diff --git a/source/slang/parameter-binding.cpp b/source/slang/parameter-binding.cpp index 6dac47631..fcd3fa525 100644 --- a/source/slang/parameter-binding.cpp +++ b/source/slang/parameter-binding.cpp @@ -1077,7 +1077,7 @@ static void completeBindingsForParameter( else if (kind == LayoutResourceKind::GenericResource) { bindingInfo.space = 0; - bindingInfo.count = 0; + bindingInfo.count = 1; bindingInfo.index = 0; continue; } @@ -2118,8 +2118,7 @@ RefPtr specializeProgramLayout( for (auto & varLayout : globalStructLayout->fields) { // To recover layout context, we skip generic resources in the first pass - // If the var is a generic resource, its resourceInfos will be empty. - if (varLayout->resourceInfos.Count() == 0) + if (varLayout->FindResourceInfo(LayoutResourceKind::GenericResource)) continue; SLANG_ASSERT(varLayout->resourceInfos.Count() == varLayout->typeLayout->resourceInfos.Count()); auto uniformInfo = varLayout->FindResourceInfo(LayoutResourceKind::Uniform); @@ -2140,7 +2139,7 @@ RefPtr specializeProgramLayout( usedRangeSet->usedResourceRanges[(int)resInfo.kind].Add( nullptr, // we don't need to track parameter info here resInfo.index, - resInfo.index + varLayout->typeLayout->resourceInfos[0].count); + resInfo.index + tresInfo.count); } structLayout->fields.Add(varLayout); varLayoutMapping[varLayout] = varLayout; -- cgit v1.2.3