diff options
| author | Yong He <yonghe@outlook.com> | 2018-01-04 13:41:09 -0800 |
|---|---|---|
| committer | Tim Foley <tfoleyNV@users.noreply.github.com> | 2018-01-04 13:41:09 -0800 |
| commit | 3d435f7321c3f9241d33a0f7521573f21b548186 (patch) | |
| tree | 3a4f2d21250f1dbad1ca9bf4668b566a6c87ea89 /source/slang/parameter-binding.cpp | |
| parent | e90dfcfd6a0a6d92688012b1216c46c24965cfc0 (diff) | |
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
Diffstat (limited to 'source/slang/parameter-binding.cpp')
| -rw-r--r-- | source/slang/parameter-binding.cpp | 7 |
1 files changed, 3 insertions, 4 deletions
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<ProgramLayout> 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<ProgramLayout> 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; |
