Mesa (main): lima: handle 1D samplers

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Tue Nov 16 23:13:17 UTC 2021


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

Author: Vasily Khoruzhick <anarsoul at gmail.com>
Date:   Wed Oct  6 07:01:18 2021 -0700

lima: handle 1D samplers

It's just a matter of changing number of dimensions in texture
descriptor.

Reviewed-by: Andreas Baierl <ichgeh at imkreisrum.de>
Signed-off-by: Vasily Khoruzhick <anarsoul at gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13213>

---

 src/gallium/drivers/lima/ir/pp/nir.c    | 1 +
 src/gallium/drivers/lima/lima_texture.c | 3 +++
 src/gallium/drivers/lima/lima_texture.h | 1 +
 3 files changed, 5 insertions(+)

diff --git a/src/gallium/drivers/lima/ir/pp/nir.c b/src/gallium/drivers/lima/ir/pp/nir.c
index 4fc6ca4d583..6f61a0986fb 100644
--- a/src/gallium/drivers/lima/ir/pp/nir.c
+++ b/src/gallium/drivers/lima/ir/pp/nir.c
@@ -447,6 +447,7 @@ static bool ppir_emit_tex(ppir_block *block, nir_instr *ni)
    }
 
    switch (instr->sampler_dim) {
+   case GLSL_SAMPLER_DIM_1D:
    case GLSL_SAMPLER_DIM_2D:
    case GLSL_SAMPLER_DIM_3D:
    case GLSL_SAMPLER_DIM_CUBE:
diff --git a/src/gallium/drivers/lima/lima_texture.c b/src/gallium/drivers/lima/lima_texture.c
index 7eacd69c0bb..59e30ac3df3 100644
--- a/src/gallium/drivers/lima/lima_texture.c
+++ b/src/gallium/drivers/lima/lima_texture.c
@@ -131,6 +131,9 @@ lima_update_tex_desc(struct lima_context *ctx, struct lima_sampler_state *sample
    memset(desc, 0, desc_size);
 
    switch (texture->base.target) {
+   case PIPE_TEXTURE_1D:
+      desc->sampler_dim = LIMA_SAMPLER_DIM_1D;
+      break;
    case PIPE_TEXTURE_2D:
    case PIPE_TEXTURE_RECT:
       desc->sampler_dim = LIMA_SAMPLER_DIM_2D;
diff --git a/src/gallium/drivers/lima/lima_texture.h b/src/gallium/drivers/lima/lima_texture.h
index 1f41de0f39a..f95dfdfbcc9 100644
--- a/src/gallium/drivers/lima/lima_texture.h
+++ b/src/gallium/drivers/lima/lima_texture.h
@@ -27,6 +27,7 @@
 
 #define lima_min_tex_desc_size 64
 
+#define LIMA_SAMPLER_DIM_1D   0
 #define LIMA_SAMPLER_DIM_2D   1
 #define LIMA_SAMPLER_DIM_3D   2
 



More information about the mesa-commit mailing list