diff options
| author | Yong He <yonghe@outlook.com> | 2023-11-01 21:42:12 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-11-01 21:42:12 -0700 |
| commit | 6aca3813c4ccc496c0f9b2db293acb546aa11d2d (patch) | |
| tree | 5281f0ac62946787db90409c1ab3da5ed3f0fc5c /tools/gfx/renderer-shared.h | |
| parent | 532c4322c9d9ab2c95a5bb573c89062456b59236 (diff) | |
Parameter binding and gfx fixes. (#3302)
* Parameter binding and gfx fixes.
* Add diagnostics on entry point parameters.
* Fix.
---------
Co-authored-by: Yong He <yhe@nvidia.com>
Diffstat (limited to 'tools/gfx/renderer-shared.h')
| -rw-r--r-- | tools/gfx/renderer-shared.h | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/tools/gfx/renderer-shared.h b/tools/gfx/renderer-shared.h index f94b909f7..9e208c34c 100644 --- a/tools/gfx/renderer-shared.h +++ b/tools/gfx/renderer-shared.h @@ -1524,16 +1524,20 @@ Result ShaderObjectBaseImpl<TShaderObjectImpl, TShaderObjectLayoutImpl, TShaderO case slang::BindingType::ConstantBuffer: case slang::BindingType::RawBuffer: case slang::BindingType::MutableRawBuffer: - // Currently we only handle the case where the field's type is - // `ParameterBlock<SomeStruct>` or `ConstantBuffer<SomeStruct>`, where - // `SomeStruct` is a struct type (not directly an interface type). In this case, - // we just recursively collect the specialization arguments from the bound sub - // object. + // If the field's type is `ParameterBlock<IFoo>`, we want to pull in the type argument + // from the sub object for specialization. + if (bindingRange.isSpecializable) + { + ExtendedShaderObjectType specializedSubObjType; + SLANG_RETURN_ON_FAIL( + subObject->getSpecializedShaderObjectType(&specializedSubObjType)); + typeArgs.add(specializedSubObjType); + } + + // If field's type is `ParameterBlock<SomeStruct>` or `ConstantBuffer<SomeStruct>`, where + // `SomeStruct` is a struct type (not directly an interface type), we need to recursively + // collect the specialization arguments from the bound sub object. SLANG_RETURN_ON_FAIL(subObject->collectSpecializationArgs(typeArgs)); - // TODO: we need to handle the case where the field is of the form - // `ParameterBlock<IFoo>`. We should treat this case the same way as the - // `ExistentialValue` case here, but currently we lack a mechanism to - // distinguish the two scenarios. break; } |
