Module: Mesa
Branch: main
Commit: 284547af55864032ad410c59027ef110efa62b42
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=284547af55864032ad410c59027ef110efa62b42

Author: Rob Clark <[email protected]>
Date:   Mon Feb  6 14:33:04 2023 -0800

freedreno+ir3: Move storage_16bit to compiler options

This isn't a thing in gl.

Signed-off-by: Rob Clark <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21152>

---

 src/freedreno/ir3/ir3_compiler.c               | 2 --
 src/freedreno/ir3/ir3_compiler.h               | 3 +++
 src/freedreno/ir3/ir3_nir.c                    | 2 +-
 src/freedreno/vulkan/tu_device.c               | 2 ++
 src/gallium/drivers/freedreno/a6xx/fd6_image.c | 3 +--
 5 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/src/freedreno/ir3/ir3_compiler.c b/src/freedreno/ir3/ir3_compiler.c
index 7c7a0737167..4636a7398c7 100644
--- a/src/freedreno/ir3/ir3_compiler.c
+++ b/src/freedreno/ir3/ir3_compiler.c
@@ -196,8 +196,6 @@ ir3_compiler_create(struct fd_device *dev, const struct 
fd_dev_id *dev_id,
 
       compiler->tess_use_shared = dev_info->a6xx.tess_use_shared;
 
-      compiler->storage_16bit = dev_info->a6xx.storage_16bit;
-
       compiler->has_getfiberid = dev_info->a6xx.has_getfiberid;
 
       compiler->has_dp2acc = dev_info->a6xx.has_dp2acc;
diff --git a/src/freedreno/ir3/ir3_compiler.h b/src/freedreno/ir3/ir3_compiler.h
index f0b6dfbf750..3d45a37bc2f 100644
--- a/src/freedreno/ir3/ir3_compiler.h
+++ b/src/freedreno/ir3/ir3_compiler.h
@@ -61,6 +61,9 @@ struct ir3_compiler_options {
     */
    int bindless_fb_read_descriptor;
    int bindless_fb_read_slot;
+
+   /* True if 16-bit descriptors are used for both 16-bit and 32-bit access. */
+   bool storage_16bit;
 };
 
 struct ir3_compiler {
diff --git a/src/freedreno/ir3/ir3_nir.c b/src/freedreno/ir3/ir3_nir.c
index 6f685e84d05..388017eb9be 100644
--- a/src/freedreno/ir3/ir3_nir.c
+++ b/src/freedreno/ir3/ir3_nir.c
@@ -602,7 +602,7 @@ ir3_nir_post_finalize(struct ir3_shader *shader)
     * dwords.
     */
    if (compiler->gen >= 6)
-      OPT_V(s, ir3_nir_lower_ssbo_size, compiler->storage_16bit ? 1 : 2);
+      OPT_V(s, ir3_nir_lower_ssbo_size, compiler->options.storage_16bit ? 1 : 
2);
 
    ir3_optimize_loop(compiler, s);
 }
diff --git a/src/freedreno/vulkan/tu_device.c b/src/freedreno/vulkan/tu_device.c
index de1372b4310..083ef002120 100644
--- a/src/freedreno/vulkan/tu_device.c
+++ b/src/freedreno/vulkan/tu_device.c
@@ -2085,6 +2085,8 @@ tu_CreateDevice(VkPhysicalDevice physicalDevice,
                               .disable_cache = true,
                               .bindless_fb_read_descriptor = -1,
                               .bindless_fb_read_slot = -1,
+                              .storage_16bit =
+                                    physical_device->info->a6xx.storage_16bit
                            });
    if (!device->compiler) {
       result = vk_startup_errorf(physical_device->instance,
diff --git a/src/gallium/drivers/freedreno/a6xx/fd6_image.c 
b/src/gallium/drivers/freedreno/a6xx/fd6_image.c
index 61abc2a5122..e8755701aea 100644
--- a/src/gallium/drivers/freedreno/a6xx/fd6_image.c
+++ b/src/gallium/drivers/freedreno/a6xx/fd6_image.c
@@ -55,8 +55,7 @@ fd6_ssbo_descriptor(struct fd_context *ctx,
 {
    fdl6_buffer_view_init(
       descriptor,
-      ctx->screen->info->a6xx.storage_16bit ? PIPE_FORMAT_R16_UINT
-                                            : PIPE_FORMAT_R32_UINT,
+      PIPE_FORMAT_R32_UINT,
       swiz_identity, rsc_iova(buf->buffer, buf->buffer_offset),
       buf->buffer_size);
 }

Reply via email to