[Mesa-dev] [PATCH 1/2] tgsi: add TGSI_TEXTURE_SHADOWCUBEMAP

Dave Airlie airlied at gmail.com
Wed Jan 11 05:25:57 PST 2012


From: Dave Airlie <airlied at redhat.com>

This adds support for shadow cubemap texture sampling instructions.

This is required for GL 3.0.

Signed-off-by: Dave Airlie <airlied at redhat.com>
---
 src/gallium/auxiliary/tgsi/tgsi_exec.c     |    2 ++
 src/gallium/auxiliary/tgsi/tgsi_strings.c  |    1 +
 src/gallium/auxiliary/tgsi/tgsi_util.c     |    1 +
 src/gallium/include/pipe/p_shader_tokens.h |    3 ++-
 4 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/src/gallium/auxiliary/tgsi/tgsi_exec.c b/src/gallium/auxiliary/tgsi/tgsi_exec.c
index 72b1dca..c0bd2d0 100644
--- a/src/gallium/auxiliary/tgsi/tgsi_exec.c
+++ b/src/gallium/auxiliary/tgsi/tgsi_exec.c
@@ -1865,6 +1865,7 @@ exec_tex(struct tgsi_exec_machine *mach,
                   &r[0], &r[1], &r[2], &r[3]);  /* outputs */
       break;
    case TGSI_TEXTURE_SHADOW2D_ARRAY:
+   case TGSI_TEXTURE_SHADOWCUBE:
       FETCH(&r[0], 0, CHAN_X);
       FETCH(&r[1], 0, CHAN_Y);
       FETCH(&r[2], 0, CHAN_Z);
@@ -2182,6 +2183,7 @@ exec_sample(struct tgsi_exec_machine *mach,
       break;
 
    case TGSI_TEXTURE_SHADOW2D_ARRAY:
+   case TGSI_TEXTURE_SHADOWCUBE:
       FETCH(&r[0], 0, CHAN_X);
       FETCH(&r[1], 0, CHAN_Y);
       FETCH(&r[2], 0, CHAN_Z);
diff --git a/src/gallium/auxiliary/tgsi/tgsi_strings.c b/src/gallium/auxiliary/tgsi/tgsi_strings.c
index de9152d..520452c 100644
--- a/src/gallium/auxiliary/tgsi/tgsi_strings.c
+++ b/src/gallium/auxiliary/tgsi/tgsi_strings.c
@@ -90,6 +90,7 @@ const char *tgsi_texture_names[TGSI_TEXTURE_COUNT] =
    "2DARRAY",
    "SHADOW1DARRAY",
    "SHADOW2DARRAY",
+   "SHADOWCUBE"
 };
 
 const char *tgsi_property_names[TGSI_PROPERTY_COUNT] =
diff --git a/src/gallium/auxiliary/tgsi/tgsi_util.c b/src/gallium/auxiliary/tgsi/tgsi_util.c
index 9f6997d..36dc10d 100644
--- a/src/gallium/auxiliary/tgsi/tgsi_util.c
+++ b/src/gallium/auxiliary/tgsi/tgsi_util.c
@@ -284,6 +284,7 @@ tgsi_util_get_inst_usage_mask(const struct tgsi_full_instruction *inst,
             read_mask = TGSI_WRITEMASK_XYZ;
             break;
          case TGSI_TEXTURE_SHADOW2D_ARRAY:
+         case TGSI_TEXTURE_SHADOWCUBE:
             read_mask = TGSI_WRITEMASK_XYZW;
             break;
          default:
diff --git a/src/gallium/include/pipe/p_shader_tokens.h b/src/gallium/include/pipe/p_shader_tokens.h
index a131630..df2dd5e 100644
--- a/src/gallium/include/pipe/p_shader_tokens.h
+++ b/src/gallium/include/pipe/p_shader_tokens.h
@@ -454,7 +454,8 @@ struct tgsi_instruction_label
 #define TGSI_TEXTURE_2D_ARRAY       10
 #define TGSI_TEXTURE_SHADOW1D_ARRAY 11
 #define TGSI_TEXTURE_SHADOW2D_ARRAY 12
-#define TGSI_TEXTURE_COUNT          13
+#define TGSI_TEXTURE_SHADOWCUBE     13
+#define TGSI_TEXTURE_COUNT          14
 
 struct tgsi_instruction_texture
 {
-- 
1.7.7.4



More information about the mesa-dev mailing list