gallium/tgsi: Redefine the TGSI_TEXTURE_UNKNOWN texture target.
authorJosé Fonseca <jfonseca@vmware.com>
Fri, 11 May 2012 12:36:46 +0000 (13:36 +0100)
committerJosé Fonseca <jfonseca@vmware.com>
Fri, 11 May 2012 13:36:20 +0000 (14:36 +0100)
Some code relies on the existing of an invalid texture target. It seems
safer to bring it back than to deal with unintended consequences.

This partially reverts commit a4ebb04214bab1cd9bd41967232ec89441e31744.

Reviewed-by: Brian Paul <brianp@vmware.com>
src/gallium/auxiliary/tgsi/tgsi_build.c
src/gallium/auxiliary/tgsi/tgsi_strings.c
src/gallium/auxiliary/util/u_blitter.c
src/gallium/drivers/nv50/codegen/nv50_ir_from_tgsi.cpp
src/gallium/include/pipe/p_shader_tokens.h

index 1d3c4bcdf71ed608d42f22b7375e0e2914751fb6..869faa1b42002fb1fcb0e024856e11aff0ef9db3 100644 (file)
@@ -707,7 +707,7 @@ tgsi_default_instruction_texture( void )
 {
    struct tgsi_instruction_texture instruction_texture;
 
-   instruction_texture.Texture = TGSI_BUFFER;
+   instruction_texture.Texture = TGSI_TEXTURE_UNKNOWN;
    instruction_texture.NumOffsets = 0;
    instruction_texture.Padding = 0;
 
index d7b74ba2b8b2d3638db7fd264baddee80847edd1..b5fd1fc0a650d090dd7349e1505fb9ae8f354f28 100644 (file)
@@ -96,7 +96,8 @@ const char *tgsi_texture_names[TGSI_TEXTURE_COUNT] =
    "2DARRAY",
    "SHADOW1DARRAY",
    "SHADOW2DARRAY",
-   "SHADOWCUBE"
+   "SHADOWCUBE",
+   "UNKNOWN"
 };
 
 const char *tgsi_property_names[TGSI_PROPERTY_COUNT] =
index 28e73832540b50cdc74d551197816a6df4ab2467..d0b9187d1f9c7acc7558eb97359d1eb964e13fec 100644 (file)
@@ -674,7 +674,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 0;
+      return TGSI_TEXTURE_UNKNOWN;
    }
 }
 
index 955eb92ec3cefe8fa712b14f490ca68237f67540..ba08493c282beeea6603c998308a0fc6d7174a1a 100644 (file)
@@ -349,6 +349,8 @@ static nv50_ir::TexTarget translateTexture(uint tex)
    NV50_IR_TEX_TARG_CASE(SHADOWRECT, RECT_SHADOW);
    case TGSI_BUFFER:
       return nv50_ir::TEX_TARGET_BUFFER;
+
+   case TGSI_TEXTURE_UNKNOWN:
    default:
       assert(!"invalid texture target");
       return nv50_ir::TEX_TARGET_2D;
index 5325e43896c91ff6bb7c530abda1fc1ba6539e54..615a89a220616ec8b41b3271304369f5cf1c0ce4 100644 (file)
@@ -504,7 +504,8 @@ struct tgsi_instruction_label
 #define TGSI_TEXTURE_SHADOW1D_ARRAY 11
 #define TGSI_TEXTURE_SHADOW2D_ARRAY 12
 #define TGSI_TEXTURE_SHADOWCUBE     13
-#define TGSI_TEXTURE_COUNT          14
+#define TGSI_TEXTURE_UNKNOWN        14
+#define TGSI_TEXTURE_COUNT          15
 
 struct tgsi_instruction_texture
 {