tgsi: add missing switch cases in tgsi_exec_get_shader_param()
authorBrian Paul <brianp@vmware.com>
Mon, 5 May 2014 16:18:49 +0000 (10:18 -0600)
committerBrian Paul <brianp@vmware.com>
Wed, 7 May 2014 17:32:11 +0000 (11:32 -0600)
Add cases for PIPE_SHADER_CAP_MAX_SAMPLER_VIEWS and
PIPE_SHADER_CAP_PREFERRED_IR.  Remove default switch case so we
learn of missing cases at compile time.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
src/gallium/auxiliary/tgsi/tgsi_exec.h

index 9b1995c09c81cfed9ac03049b42ed91bbb2c5e32..bb56934df6ce49f01eb513a441b2bd76a70a0e9f 100644 (file)
@@ -449,11 +449,17 @@ tgsi_exec_get_shader_param(enum pipe_shader_cap param)
       return 1;
    case PIPE_SHADER_CAP_MAX_TEXTURE_SAMPLERS:
       return PIPE_MAX_SAMPLERS;
+   case PIPE_SHADER_CAP_MAX_SAMPLER_VIEWS:
+      return PIPE_MAX_SHADER_SAMPLER_VIEWS;
+   case PIPE_SHADER_CAP_PREFERRED_IR:
+      return PIPE_SHADER_IR_TGSI;
    case PIPE_SHADER_CAP_TGSI_SQRT_SUPPORTED:
       return 1;
-   default:
-      return 0;
    }
+   /* if we get here, we missed a shader cap above (and should have seen
+    * a compiler warning.)
+    */
+   return 0;
 }
 
 #if defined __cplusplus