Mesa (main): clover: Set images/samplers_used when lowering images
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Thu May 12 02:03:44 UTC 2022
Module: Mesa
Branch: main
Commit: 0a4c0bc0dd7fe345410ded728263fc53a0171487
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=0a4c0bc0dd7fe345410ded728263fc53a0171487
Author: Jason Ekstrand <jason.ekstrand at collabora.com>
Date: Tue May 10 10:00:14 2022 -0500
clover: Set images/samplers_used when lowering images
Also, stop using BITSET_SET_RANGE_INSIDE_WORD for textures so we can
handle more than 32 of them.
Reviewed-by: Karol Herbst <kherbst at redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16435>
---
src/gallium/frontends/clover/nir/invocation.cpp | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/src/gallium/frontends/clover/nir/invocation.cpp b/src/gallium/frontends/clover/nir/invocation.cpp
index c5cb23a6845..b741a0a184c 100644
--- a/src/gallium/frontends/clover/nir/invocation.cpp
+++ b/src/gallium/frontends/clover/nir/invocation.cpp
@@ -119,7 +119,11 @@ clover_nir_lower_images(nir_shader *shader)
shader->info.num_textures = num_rd_images;
BITSET_ZERO(shader->info.textures_used);
if (num_rd_images)
- BITSET_SET_RANGE_INSIDE_WORD(shader->info.textures_used, 0, num_rd_images - 1);
+ BITSET_SET_RANGE(shader->info.textures_used, 0, num_rd_images - 1);
+
+ BITSET_ZERO(shader->info.images_used);
+ if (num_wr_images)
+ BITSET_SET_RANGE(shader->info.images_used, 0, num_wr_images - 1);
shader->info.num_images = num_wr_images;
last_loc = -1;
@@ -137,6 +141,9 @@ clover_nir_lower_images(nir_shader *shader)
assert(!glsl_type_is_sampler(var->type));
}
}
+ BITSET_ZERO(shader->info.samplers_used);
+ if (num_samplers)
+ BITSET_SET_RANGE(shader->info.samplers_used, 0, num_samplers - 1);
nir_builder b;
nir_builder_init(&b, impl);
More information about the mesa-commit
mailing list