diff options
author | Marek Olšák <[email protected]> | 2020-02-24 19:10:21 -0500 |
---|---|---|
committer | Marge Bot <[email protected]> | 2020-02-25 02:30:08 +0000 |
commit | 5ab94df0f6a9b2fdf8c053a68486d8be4d254d01 (patch) | |
tree | 3be9e6b65b130644faea34695d57cb9cbfcf8021 /src/compiler | |
parent | 26d42645f9f7ae260031685ad3e0664e8b94b32b (diff) |
nir: fix gl_nir_lower_images for bindless images
Fixes: 7342b859afb5a7e7f9fb1813e7ab3a55a1c8a704
Reviewed-by: Eric Anholt <[email protected]>
Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3938>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3938>
Diffstat (limited to 'src/compiler')
-rw-r--r-- | src/compiler/glsl/gl_nir_lower_images.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/src/compiler/glsl/gl_nir_lower_images.c b/src/compiler/glsl/gl_nir_lower_images.c index a02e2509368..7dbefc36d0f 100644 --- a/src/compiler/glsl/gl_nir_lower_images.c +++ b/src/compiler/glsl/gl_nir_lower_images.c @@ -78,22 +78,21 @@ lower_impl(nir_builder *b, nir_instr *instr, bool bindless_only) return false; } - if (bindless_only) { - if (deref->mode == nir_var_uniform && !var->data.bindless) - return false; - } + bool bindless = deref->mode != nir_var_uniform || var->data.bindless; + if (bindless_only && !bindless) + return false; b->cursor = nir_before_instr(instr); nir_ssa_def *src; - if (var->data.bindless) { + if (bindless) { src = nir_load_deref(b, deref); } else { src = nir_iadd_imm(b, nir_build_deref_offset(b, deref, type_size_align_1), var->data.driver_location); } - nir_rewrite_image_intrinsic(intrinsic, src, var->data.bindless); + nir_rewrite_image_intrinsic(intrinsic, src, bindless); return true; } |