mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-24 19:40:10 +01:00
Section 5.11 (Out-of-Bounds Accesses) of the GLSL 4.60 spec says: "In the subsections described above for array, vector, matrix and structure accesses, any out-of-bounds access produced undefined behavior.... Out-of-bounds reads return undefined values, which include values from other variables of the active program or zero." Robustness extensions suggest to return zero on out-of-bounds accesses, however it's not applicable to the arrays of samplers, so just clamp the index. Otherwise instr->sampler_index or instr->texture_index would be out of bounds, and they are used as an index to arrays of driver state. E.g. this fixes such dereference: if (options->lower_tex_packing[tex->sampler_index] != in nir_lower_tex.c CC: <mesa-stable@lists.freedesktop.org> Signed-off-by: Danylo Piliaiev <danylo.piliaiev@globallogic.com> Reviewed-by: Eric Anholt <eric@anholt.net> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6428> |
||
|---|---|---|
| .. | ||
| glsl | ||
| nir | ||
| spirv | ||
| Android.glsl.gen.mk | ||
| Android.glsl.mk | ||
| Android.mk | ||
| Android.nir.gen.mk | ||
| Android.nir.mk | ||
| builtin_type_macros.h | ||
| glsl_types.cpp | ||
| glsl_types.h | ||
| Makefile.sources | ||
| meson.build | ||
| nir_types.cpp | ||
| nir_types.h | ||
| SConscript | ||
| SConscript.glsl | ||
| SConscript.nir | ||
| SConscript.spirv | ||
| shader_enums.c | ||
| shader_enums.h | ||
| shader_info.h | ||