diff options
| author | Tim Foley <tfoleyNV@users.noreply.github.com> | 2020-09-17 09:54:49 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-09-17 09:54:49 -0700 |
| commit | 0124bf25c53ba76bf0d0e624d9a0d1b2b03760a6 (patch) | |
| tree | 74a13305d3eff3508458b002e90f79a5f24e750b /premake5.lua | |
| parent | 3e2cb34bf112722368c296130b1424de267d2b3c (diff) | |
Fix an issue with double-counting uniform data for CUDA/CPU (#1545)
The `SimpleScopeLayoutBuilder` helper that is used to build up binding information for entry-point parameter lists has logic to try to support both explicit and implicit binding of parameters. This logic was added as part of supporting dual-source color blending on Vulkan. The basic approach is similar to that used for the global scope, where parameters with explicit binding first "carve out" the ranges they claim via a `UsedRangeSet`, and then parameters without explicit binding allocate space from what is left.
The logic is (seemingly by accident) also applied to uniform/ordinary data, which creates a problem because the `ScopeLayoutBuilder` base type is also responsible for computing a layout for uniform/ordinary data that is 100% implicit (while dealing with all the relevant alignment restrictions). That logic goes on to add the computed uniform/ordinary resource usage to the computed type layout, but because such a layout has already been computed (albeit without taking alignment into account), the result is that the uniform/ordinary usage is reported at approximately double what it should be.
The fix here is to skip uniform/ordinary resource usage when doing the explicit/implicit dance in `SimpleScopeLayoutBuilder`. This approach means that explicit bindings on entry-point `uniform` parameters will only apply to resources (which matches our rules for the global scope, where we don't allow for explicit binding on uniform/ordinary parameters). This is appropriate since the only reason we are supported explicit layout at all is for dual-source color blending (in general, we only support explicit `register` and `[[vk::binding(...)]]` modifiers on global parameters; users are stuck with our computed layouts in all other cases.
Co-authored-by: Yong He <yonghe@outlook.com>
Diffstat (limited to 'premake5.lua')
0 files changed, 0 insertions, 0 deletions
