mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-03-05 01:30:31 +01:00
Texel buffer could be arbitrary large, so the assumption being made in the following comment is wrong: "Zero-extension (u16) and sign-extension (i16) have the same behavior here - txf returns 0 if bit 15 is set because it's out of bounds and the higher bits don't matter." Sign extension should matter for GLSL_SAMPLER_DIM_BUF. This fixes the case of doing texelFetch with u16 offset: uniform itextureBuffer s1; uint16_t offset = some_ssbo.offset; value = texelFetch(s1, offset).x; If the offset is higher than s16 optimization incorrectly left it as 16b. In spirv the above glsl is translated into: %22 = OpLoad %ushort %21 %23 = OpUConvert %uint %22 %24 = OpBitcast %int %23 %26 = OpImageFetch %v4int %16 %24 Cc: mesa-stable Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com> Reviewed-by: Georg Lehmann <dadschoorse@gmail.com> Reviewed-by: Connor Abbott <cwabbott0@gmail.com> Reviewed-by: Rob Clark <robdclark@chromium.org> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31664> |
||
|---|---|---|
| .. | ||
| clc | ||
| glsl | ||
| isaspec | ||
| nir | ||
| rust | ||
| spirv | ||
| builtin_types.py | ||
| builtin_types_c.py | ||
| builtin_types_h.py | ||
| glsl_types.c | ||
| glsl_types.h | ||
| meson.build | ||
| shader_enums.c | ||
| shader_enums.h | ||
| shader_info.h | ||