Mesa (master): panfrost: Split the sampler and texture count

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Thu Mar 11 15:22:41 UTC 2021


Module: Mesa
Branch: master
Commit: 825b1f94464be7bfdbd2a3a1065ee72428c8dd58
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=825b1f94464be7bfdbd2a3a1065ee72428c8dd58

Author: Boris Brezillon <boris.brezillon at collabora.com>
Date:   Fri Mar  5 13:23:09 2021 +0100

panfrost: Split the sampler and texture count

The texture and sampler descriptors are well separated in Vulkan,
let's add a new field to allow mixing sampler and texture descs.

Signed-off-by: Boris Brezillon <boris.brezillon at collabora.com>
Reviewed-by: Alyssa Rosenzweig <alyssa at collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9517>

---

 src/panfrost/lib/pan_shader.c | 2 +-
 src/panfrost/lib/pan_shader.h | 2 +-
 src/panfrost/util/pan_ir.h    | 1 +
 3 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/panfrost/lib/pan_shader.c b/src/panfrost/lib/pan_shader.c
index 13b6e4c203f..40c026cf4a2 100644
--- a/src/panfrost/lib/pan_shader.c
+++ b/src/panfrost/lib/pan_shader.c
@@ -234,5 +234,5 @@ pan_shader_compile(const struct panfrost_device *dev,
         info->attribute_count += util_bitcount(s->info.images_used);
         info->writes_global = s->info.writes_memory;
 
-        info->texture_count = s->info.num_textures;
+        info->sampler_count = info->texture_count = s->info.num_textures;
 }
diff --git a/src/panfrost/lib/pan_shader.h b/src/panfrost/lib/pan_shader.h
index cda399d73af..12bf4a0b732 100644
--- a/src/panfrost/lib/pan_shader.h
+++ b/src/panfrost/lib/pan_shader.h
@@ -176,7 +176,7 @@ pan_shader_prepare_rsd(const struct panfrost_device *dev,
         rsd->shader.varying_count = shader_info->varyings.input_count +
                                    shader_info->varyings.output_count;
         rsd->shader.texture_count = shader_info->texture_count;
-        rsd->shader.sampler_count = shader_info->texture_count;
+        rsd->shader.sampler_count = shader_info->sampler_count;
         rsd->properties.shader_contains_barrier = shader_info->contains_barrier;
 
         if (shader_info->stage == MESA_SHADER_FRAGMENT) {
diff --git a/src/panfrost/util/pan_ir.h b/src/panfrost/util/pan_ir.h
index 794007e64a4..aca6d7ba9cf 100644
--- a/src/panfrost/util/pan_ir.h
+++ b/src/panfrost/util/pan_ir.h
@@ -186,6 +186,7 @@ struct pan_shader_info {
         bool writes_global;
         uint64_t outputs_written;
 
+        unsigned sampler_count;
         unsigned texture_count;
         unsigned ubo_count;
         unsigned attribute_count;



More information about the mesa-commit mailing list