mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-06 13:48:06 +02:00
glsl/images: bounds check image unit assignment
The CTS test:
GL45-CTS.multi_bind.dispatch_bind_image_textures
binds 192 image uniforms, we reject this later,
but not until after we trash the contents of the
struct gl_shader.
Error now reads:
Too many compute shader image uniforms (192 > 16)
instead of
Too many compute shader image uniforms (2745344416 > 16)
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: "12.0" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Dave Airlie <airlied@redhat.com>
(cherry picked from commit f87352d769)
This commit is contained in:
parent
36e26f2ee2
commit
d3c92267e0
1 changed files with 2 additions and 0 deletions
|
|
@ -145,6 +145,8 @@ set_opaque_binding(void *mem_ctx, gl_shader_program *prog,
|
|||
storage->opaque[sh].active) {
|
||||
for (unsigned i = 0; i < elements; i++) {
|
||||
const unsigned index = storage->opaque[sh].index + i;
|
||||
if (index >= ARRAY_SIZE(shader->ImageUnits))
|
||||
break;
|
||||
shader->ImageUnits[index] = storage->storage[i].i;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue