[Mesa-dev] [PATCH 3/3] svga: add switch case for PIPE_SHADER_CAP_PREFERRED_IR, remove default case
Jose Fonseca
jfonseca at vmware.com
Tue May 6 08:03:16 PDT 2014
Series LGTM.
Jose
----- Original Message -----
> Remove default switch case so we're warned of missing cases at compile
> time.
> ---
> src/gallium/drivers/svga/svga_screen.c | 18 ++++++++++--------
> 1 file changed, 10 insertions(+), 8 deletions(-)
>
> diff --git a/src/gallium/drivers/svga/svga_screen.c
> b/src/gallium/drivers/svga/svga_screen.c
> index 8c70bb7..bc914b7 100644
> --- a/src/gallium/drivers/svga/svga_screen.c
> +++ b/src/gallium/drivers/svga/svga_screen.c
> @@ -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 */
> --
> 1.7.10.4
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> https://urldefense.proofpoint.com/v1/url?u=http://lists.freedesktop.org/mailman/listinfo/mesa-dev&k=oIvRg1%2BdGAgOoM1BIlLLqw%3D%3D%0A&r=NMr9uy2iTjWVixC0wOcYCWEIYhfo80qKwRgdodpoDzA%3D%0A&m=MQcxpL%2FgTB1nG3hZaJq%2FUqYDOOEJQ8XufGj7cxgVFEA%3D%0A&s=b771d15063454cf04d10429852920d1ef152aac7a9e539b01aa528bb1bedfdbc
>
More information about the mesa-dev
mailing list