diff options
| author | Tim Foley <tfoleyNV@users.noreply.github.com> | 2018-11-19 09:08:26 -0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2018-11-19 09:08:26 -0800 |
| commit | 1f4b49596f710e8009d1cc996574049c4afc3627 (patch) | |
| tree | 873cded8658a74227349082eef9cc24656125e10 /source/slang/parameter-binding.cpp | |
| parent | 7e0c5ad677e04be4ecd2ce087d856ba26f1667a4 (diff) | |
Fix declaration of RWTexture*.Load() operations (#722)
The `Texture2D.Load()` operation takes a `uint3` of coordinates, with the `.xy` part holding the texel coordinates and the `.z` part holding a mip level.
In contrast, the `RWTexture2D.Load()` operation only takes a `uint2`.
This isn't clearly specified on MSDN, so Slang failed to get the declaration right.
This change fixes it so that we only add the extra coordinate for the mip level on non-multisample, read-only texture types (the previous code only checked for multisample-ness).
I also changed the logic that outputs swizzles to extract the coordinates and mip level so that it only applies when there is a mip level being passed through (this code should never actually be applied, though, because we shouldn't be generating `texelFetch` for RW texures anyway...).
One final change that sneask in here is making the `offset` parameter for one of the load-with-offset cases correctly use the base coordinate count for the texture type (e.g., 2D even for `Texture2DArray`). That is an unrelated fix, but I thought I'd sneak it in here rather than do a separate PR.
Diffstat (limited to 'source/slang/parameter-binding.cpp')
0 files changed, 0 insertions, 0 deletions
