[Mesa-dev] [PATCH 04/11] gallium/tgsi: Define the TGSI_BUFFER texture target.

Francisco Jerez currojerez at riseup.net
Thu Mar 22 17:40:33 PDT 2012


This texture type was already referred to by the documentation but it
was never defined.  Define it as 0 to match the pipe_texture_target
enumeration values.
---
 src/gallium/auxiliary/tgsi/tgsi_build.c            |    4 ++--
 src/gallium/auxiliary/tgsi/tgsi_strings.c          |    2 +-
 src/gallium/auxiliary/util/u_blitter.c             |    2 +-
 .../drivers/nv50/codegen/nv50_ir_from_tgsi.cpp     |    4 ++--
 src/gallium/drivers/nv50/nv50_tgsi_to_nc.c         |    1 -
 src/gallium/include/pipe/p_shader_tokens.h         |    2 +-
 6 files changed, 7 insertions(+), 8 deletions(-)

diff --git a/src/gallium/auxiliary/tgsi/tgsi_build.c b/src/gallium/auxiliary/tgsi/tgsi_build.c
index f5880a8..f0e0c65 100644
--- a/src/gallium/auxiliary/tgsi/tgsi_build.c
+++ b/src/gallium/auxiliary/tgsi/tgsi_build.c
@@ -257,7 +257,7 @@ tgsi_default_declaration_resource(void)
 {
    struct tgsi_declaration_resource declaration_resource;
 
-   declaration_resource.Resource = TGSI_TEXTURE_UNKNOWN;
+   declaration_resource.Resource = TGSI_BUFFER;
    declaration_resource.ReturnTypeX = PIPE_TYPE_UNORM;
    declaration_resource.ReturnTypeY = PIPE_TYPE_UNORM;
    declaration_resource.ReturnTypeZ = PIPE_TYPE_UNORM;
@@ -669,7 +669,7 @@ tgsi_default_instruction_texture( void )
 {
    struct tgsi_instruction_texture instruction_texture;
 
-   instruction_texture.Texture = TGSI_TEXTURE_UNKNOWN;
+   instruction_texture.Texture = TGSI_BUFFER;
    instruction_texture.NumOffsets = 0;
    instruction_texture.Padding = 0;
 
diff --git a/src/gallium/auxiliary/tgsi/tgsi_strings.c b/src/gallium/auxiliary/tgsi/tgsi_strings.c
index e266658..9e9c0dc 100644
--- a/src/gallium/auxiliary/tgsi/tgsi_strings.c
+++ b/src/gallium/auxiliary/tgsi/tgsi_strings.c
@@ -78,7 +78,7 @@ const char *tgsi_semantic_names[TGSI_SEMANTIC_COUNT] =
 
 const char *tgsi_texture_names[TGSI_TEXTURE_COUNT] =
 {
-   "UNKNOWN",
+   "BUFFER",
    "1D",
    "2D",
    "3D",
diff --git a/src/gallium/auxiliary/util/u_blitter.c b/src/gallium/auxiliary/util/u_blitter.c
index 5784a7c..e98aa4b 100644
--- a/src/gallium/auxiliary/util/u_blitter.c
+++ b/src/gallium/auxiliary/util/u_blitter.c
@@ -677,7 +677,7 @@ pipe_tex_to_tgsi_tex(enum pipe_texture_target pipe_tex_target)
       return TGSI_TEXTURE_2D_ARRAY;
    default:
       assert(0 && "unexpected texture target");
-      return TGSI_TEXTURE_UNKNOWN;
+      return 0;
    }
 }
 
diff --git a/src/gallium/drivers/nv50/codegen/nv50_ir_from_tgsi.cpp b/src/gallium/drivers/nv50/codegen/nv50_ir_from_tgsi.cpp
index 26c4392..c568082 100644
--- a/src/gallium/drivers/nv50/codegen/nv50_ir_from_tgsi.cpp
+++ b/src/gallium/drivers/nv50/codegen/nv50_ir_from_tgsi.cpp
@@ -347,8 +347,8 @@ static nv50_ir::TexTarget translateTexture(uint tex)
    NV50_IR_TEX_TARG_CASE(SHADOW2D_ARRAY, 2D_ARRAY_SHADOW);
    NV50_IR_TEX_TARG_CASE(SHADOWCUBE, CUBE_SHADOW);
    NV50_IR_TEX_TARG_CASE(SHADOWRECT, RECT_SHADOW);
-
-   case TGSI_TEXTURE_UNKNOWN:
+   case TGSI_BUFFER:
+      return nv50_ir::TEX_TARGET_BUFFER;
    default:
       assert(!"invalid texture target");
       return nv50_ir::TEX_TARGET_2D;
diff --git a/src/gallium/drivers/nv50/nv50_tgsi_to_nc.c b/src/gallium/drivers/nv50/nv50_tgsi_to_nc.c
index 717a902..1f61660 100644
--- a/src/gallium/drivers/nv50/nv50_tgsi_to_nc.c
+++ b/src/gallium/drivers/nv50/nv50_tgsi_to_nc.c
@@ -1264,7 +1264,6 @@ get_tex_dim(const struct tgsi_full_instruction *insn, int *dim, int *arg)
       *dim = 1;
       *arg = 2;
       break;
-   case TGSI_TEXTURE_UNKNOWN:
    case TGSI_TEXTURE_2D:
    case TGSI_TEXTURE_RECT:
       *arg = *dim = 2;
diff --git a/src/gallium/include/pipe/p_shader_tokens.h b/src/gallium/include/pipe/p_shader_tokens.h
index c2c2eab..3c6441d 100644
--- a/src/gallium/include/pipe/p_shader_tokens.h
+++ b/src/gallium/include/pipe/p_shader_tokens.h
@@ -458,7 +458,7 @@ struct tgsi_instruction_label
    unsigned Padding  : 8;
 };
 
-#define TGSI_TEXTURE_UNKNOWN        0
+#define TGSI_BUFFER                 0
 #define TGSI_TEXTURE_1D             1
 #define TGSI_TEXTURE_2D             2
 #define TGSI_TEXTURE_3D             3
-- 
1.7.9.2



More information about the mesa-dev mailing list