diff options
author | Brian Paul <[email protected]> | 2012-04-05 15:28:09 -0600 |
---|---|---|
committer | Brian Paul <[email protected]> | 2012-04-06 14:10:50 -0600 |
commit | ecc480524bf56076e05291529f65dc996114aa90 (patch) | |
tree | 6cf2d3cb5592e4a8b1e726c54fecc62d1a352376 /src/gallium/drivers | |
parent | d7707ef5a554ca0a1ec17b9491055e8c8db570c4 (diff) |
svga: add missing cases for PIPE_CAP_x queries
Return 0 for features we don't support. Added debug_printf()
warnings when we fail to handle a new PIPE_CAP_x case. That will
alert us to interfaces changes in the future. We don't want to
just ignore new PIPE_CAPs and possibly miss something important.
Reviewed-by: José Fonseca <[email protected]>
Diffstat (limited to 'src/gallium/drivers')
-rw-r--r-- | src/gallium/drivers/svga/svga_screen.c | 49 |
1 files changed, 42 insertions, 7 deletions
diff --git a/src/gallium/drivers/svga/svga_screen.c b/src/gallium/drivers/svga/svga_screen.c index b2f3e33a6f0..a5d28b1ab25 100644 --- a/src/gallium/drivers/svga/svga_screen.c +++ b/src/gallium/drivers/svga/svga_screen.c @@ -120,6 +120,7 @@ svga_get_paramf(struct pipe_screen *screen, enum pipe_capf param) return 15.0; default: + debug_printf("Unexpected PIPE_CAPF_ query %u\n", param); return 0; } } @@ -197,11 +198,6 @@ svga_get_param(struct pipe_screen *screen, enum pipe_cap param) case PIPE_CAP_DEPTHSTENCIL_CLEAR_SEPARATE: return 1; - case PIPE_CAP_MIXED_COLORBUFFER_FORMATS: - return 0; - - case PIPE_CAP_QUADS_FOLLOW_PROVOKING_VERTEX_CONVENTION: - return 0; case PIPE_CAP_VERTEX_COLOR_UNCLAMPED: return 1; /* The color outputs of vertex shaders are not clamped */ @@ -210,7 +206,36 @@ svga_get_param(struct pipe_screen *screen, enum pipe_cap param) case PIPE_CAP_FRAGMENT_COLOR_CLAMPED: return 0; /* The driver can't clamp fragment colors */ + /* Unsupported features */ + case PIPE_CAP_MIXED_COLORBUFFER_FORMATS: + case PIPE_CAP_QUADS_FOLLOW_PROVOKING_VERTEX_CONVENTION: + case PIPE_CAP_TEXTURE_MIRROR_CLAMP: + case PIPE_CAP_SM3: + case PIPE_CAP_SHADER_STENCIL_EXPORT: + case PIPE_CAP_DEPTH_CLIP_DISABLE: + case PIPE_CAP_SEAMLESS_CUBE_MAP: + case PIPE_CAP_SEAMLESS_CUBE_MAP_PER_TEXTURE: + case PIPE_CAP_INDEP_BLEND_ENABLE: + case PIPE_CAP_INDEP_BLEND_FUNC: + case PIPE_CAP_MAX_STREAM_OUTPUT_BUFFERS: + case PIPE_CAP_PRIMITIVE_RESTART: + case PIPE_CAP_TGSI_INSTANCEID: + case PIPE_CAP_VERTEX_ELEMENT_INSTANCE_DIVISOR: + case PIPE_CAP_MAX_TEXTURE_ARRAY_LAYERS: + case PIPE_CAP_MIN_TEXEL_OFFSET: + case PIPE_CAP_MAX_TEXEL_OFFSET: + case PIPE_CAP_CONDITIONAL_RENDER: + case PIPE_CAP_TEXTURE_BARRIER: + case PIPE_CAP_MAX_STREAM_OUTPUT_SEPARATE_COMPONENTS: + case PIPE_CAP_MAX_STREAM_OUTPUT_INTERLEAVED_COMPONENTS: + case PIPE_CAP_STREAM_OUTPUT_PAUSE_RESUME: + case PIPE_CAP_TGSI_CAN_COMPACT_VARYINGS: + case PIPE_CAP_TGSI_CAN_COMPACT_CONSTANTS: + case PIPE_CAP_GLSL_FEATURE_LEVEL: + return 0; + default: + debug_printf("Unexpected PIPE_CAP_ query %u\n", param); return 0; } } @@ -266,6 +291,9 @@ static int svga_get_shader_param(struct pipe_screen *screen, unsigned shader, en return 0; case PIPE_SHADER_CAP_MAX_TEXTURE_SAMPLERS: return 16; + default: + debug_printf("Unexpected vertex shader query %u\n", param); + return 0; } break; case PIPE_SHADER_VERTEX: @@ -309,12 +337,19 @@ static int svga_get_shader_param(struct pipe_screen *screen, unsigned shader, en return 0; case PIPE_SHADER_CAP_INTEGERS: return 0; + case PIPE_SHADER_CAP_MAX_TEXTURE_SAMPLERS: + return 0; default: - break; + debug_printf("Unexpected vertex shader query %u\n", param); + return 0; } break; + case PIPE_SHADER_GEOMETRY: + /* no support for geometry shaders at this time */ + return 0; default: - break; + debug_printf("Unexpected vertex shader query %u\n", param); + return 0; } return 0; } |