svga: add switch case for PIPE_SHADER_CAP_PREFERRED_IR, remove default case
authorBrian Paul <brianp@vmware.com>
Mon, 5 May 2014 16:19:56 +0000 (10:19 -0600)
committerBrian Paul <brianp@vmware.com>
Wed, 7 May 2014 17:32:11 +0000 (11:32 -0600)
Remove default switch case so we're warned of missing cases at compile
time.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
src/gallium/drivers/svga/svga_screen.c

index 8c70bb7184fc00053905f3fc075ae798acd36765..bc914b7af7fe23ca2f4595b740d6cf9a105aae50 100644 (file)
@@ -343,11 +343,12 @@ static int svga_get_shader_param(struct pipe_screen *screen, unsigned shader, en
       case PIPE_SHADER_CAP_MAX_TEXTURE_SAMPLERS:
       case PIPE_SHADER_CAP_MAX_SAMPLER_VIEWS:
          return 16;
-      default:
-         debug_printf("Unexpected fragment shader query %u\n", param);
-         return 0;
+      case PIPE_SHADER_CAP_PREFERRED_IR:
+         return PIPE_SHADER_IR_TGSI;
       }
-      break;
+      /* If we get here, we failed to handle a cap above */
+      debug_printf("Unexpected fragment shader query %u\n", param);
+      return 0;
    case PIPE_SHADER_VERTEX:
       switch (param)
       {
@@ -394,11 +395,12 @@ static int svga_get_shader_param(struct pipe_screen *screen, unsigned shader, en
       case PIPE_SHADER_CAP_MAX_TEXTURE_SAMPLERS:
       case PIPE_SHADER_CAP_MAX_SAMPLER_VIEWS:
          return 0;
-      default:
-         debug_printf("Unexpected vertex shader query %u\n", param);
-         return 0;
+      case PIPE_SHADER_CAP_PREFERRED_IR:
+         return PIPE_SHADER_IR_TGSI;
       }
-      break;
+      /* If we get here, we failed to handle a cap above */
+      debug_printf("Unexpected vertex shader query %u\n", param);
+      return 0;
    case PIPE_SHADER_GEOMETRY:
    case PIPE_SHADER_COMPUTE:
       /* no support for geometry or compute shaders at this time */