diff options
author | Timothy Arceri <tarceri@itsqueeze.com> | 2020-02-10 11:22:32 +1100 |
---|---|---|
committer | Dylan Baker <dylan@pnwbakers.com> | 2020-02-14 09:37:57 -0800 |
commit | 7b42cb219d58dd8d38f1ae722695789422c6ed2a (patch) | |
tree | 6ac72fa1dfc62efb4e94655f686c683039901aca | |
parent | 1c3744877b80b4bad5116e280c849c439f3d02ba (diff) |
glsl: fix gl_nir_set_uniform_initializers() for image arrays
The if was incorrectly checking for an image type on what could
be an array of images. Here we change it to use the type stored
in uniform storage which has already been stripped of arrays,
this is what the above code for samplers does also.
Fixes: 2bf91733fcb5 ("nir/linker: Set the uniform initial values")
Reviewed-by: Alejandro PiƱeiro <apinheiro@igalia.com>
Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3757>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3757>
(cherry picked from commit 676869e1d4bb1660430fcdb99443238a7de50eb8)
-rw-r--r-- | .pick_status.json | 2 | ||||
-rw-r--r-- | src/compiler/glsl/gl_nir_link_uniform_initializers.c | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/.pick_status.json b/.pick_status.json index 0ace0f34b8f..16dc3e8811d 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -112,7 +112,7 @@ "description": "glsl: fix gl_nir_set_uniform_initializers() for image arrays", "nominated": true, "nomination_type": 1, - "resolution": 0, + "resolution": 1, "master_sha": null, "because_sha": "2bf91733fcb5ff8f74d71de03feeb5f3d664d199" }, diff --git a/src/compiler/glsl/gl_nir_link_uniform_initializers.c b/src/compiler/glsl/gl_nir_link_uniform_initializers.c index 1c4529c9307..752eedb63aa 100644 --- a/src/compiler/glsl/gl_nir_link_uniform_initializers.c +++ b/src/compiler/glsl/gl_nir_link_uniform_initializers.c @@ -87,7 +87,7 @@ set_opaque_binding(struct set_opaque_binding_closure *data, storage->storage[i].i; } } - } else if (glsl_type_is_image(type)) { + } else if (glsl_type_is_image(storage->type)) { for (unsigned i = 0; i < elements; i++) { const unsigned index = storage->opaque[sh].index + i; |