gallivm: add PIPE_SHADER_CAP_PREFERRED_IR switch case, remove default
authorBrian Paul <brianp@vmware.com>
Mon, 5 May 2014 16:17:48 +0000 (10:17 -0600)
committerBrian Paul <brianp@vmware.com>
Wed, 7 May 2014 17:32:11 +0000 (11:32 -0600)
Return PIPE_SHADER_IR_TGSI for the PIPE_SHADER_CAP_PREFERRED_IR query.
Remove default switch case so we learn of missing switch cases at
compile time.

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

index 87be3511d9495239b32fb5a08149439d9c83edb8..6cb09490bc8e55213b1e98b2351db39825132c2c 100644 (file)
@@ -122,11 +122,15 @@ gallivm_get_shader_param(enum pipe_shader_cap param)
       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;
 }