diff options
| author | Tim Foley <tfoley@nvidia.com> | 2017-07-18 15:21:04 -0700 |
|---|---|---|
| committer | Tim Foley <tfoley@nvidia.com> | 2017-07-18 15:21:04 -0700 |
| commit | 4d6da3a1177f27807d47ca46ec25ed96eda4642c (patch) | |
| tree | 2cc4e5645e56df929d1a8eee1815f26ab4a7c3e9 /source/slang/slang-stdlib.cpp | |
| parent | b2b46a9ced9dad18b41df0361cb91b0afb1ea710 (diff) | |
Swizzle result of buffer load based on element type
When lowering `buf[i]` to `texelFetch(..., i)` we need to deal with the case where the type of `b` might be `Buffer<float>` in which case we want to add a `.x` swizzle to the end of the fetch.
Diffstat (limited to 'source/slang/slang-stdlib.cpp')
| -rw-r--r-- | source/slang/slang-stdlib.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/source/slang/slang-stdlib.cpp b/source/slang/slang-stdlib.cpp index 8aa0d0e4c..a62db693c 100644 --- a/source/slang/slang-stdlib.cpp +++ b/source/slang/slang-stdlib.cpp @@ -2024,12 +2024,12 @@ namespace Slang sb << "__intrinsic void GetDimensions(out uint dim);\n"; - sb << "__intrinsic(glsl, \"texelFetch($P, $0)\")\n"; + sb << "__intrinsic(glsl, \"texelFetch($P, $0)$z\")\n"; sb << "__intrinsic T Load(int location);\n"; sb << "__intrinsic T Load(int location, out uint status);\n"; - sb << "__intrinsic(glsl, \"texelFetch($P, int($0))\")\n"; + sb << "__intrinsic(glsl, \"texelFetch($P, int($0))$z\")\n"; sb << "__intrinsic __subscript(uint index) -> T"; if (kBaseBufferAccessLevels[aa].access != SLANG_RESOURCE_ACCESS_READ) |
