diff options
author | Marek Olšák <[email protected]> | 2012-05-11 22:25:03 +0200 |
---|---|---|
committer | Marek Olšák <[email protected]> | 2012-05-12 00:50:52 +0200 |
commit | bdba35befac74a0bef0d1be657e4e77de628e28b (patch) | |
tree | 20533517872a8c219f509583b19424fd34eae725 /src/gallium/drivers/r300/r300_screen.c | |
parent | 550de24c17fd4873b0200c0d4a61656e184631ac (diff) |
r300g: fix breakage after gallium-userbuf merge
Diffstat (limited to 'src/gallium/drivers/r300/r300_screen.c')
-rw-r--r-- | src/gallium/drivers/r300/r300_screen.c | 29 |
1 files changed, 20 insertions, 9 deletions
diff --git a/src/gallium/drivers/r300/r300_screen.c b/src/gallium/drivers/r300/r300_screen.c index f84f3e5c58e..1e7f9276b73 100644 --- a/src/gallium/drivers/r300/r300_screen.c +++ b/src/gallium/drivers/r300/r300_screen.c @@ -103,9 +103,6 @@ static int r300_get_param(struct pipe_screen* pscreen, enum pipe_cap param) case PIPE_CAP_TGSI_CAN_COMPACT_VARYINGS: case PIPE_CAP_TGSI_CAN_COMPACT_CONSTANTS: case PIPE_CAP_VERTEX_COLOR_CLAMPED: - case PIPE_CAP_VERTEX_BUFFER_OFFSET_4BYTE_ALIGNED_ONLY: - case PIPE_CAP_VERTEX_BUFFER_STRIDE_4BYTE_ALIGNED_ONLY: - case PIPE_CAP_VERTEX_ELEMENT_SRC_OFFSET_4BYTE_ALIGNED_ONLY: case PIPE_CAP_USER_INDEX_BUFFERS: case PIPE_CAP_USER_CONSTANT_BUFFERS: return 1; @@ -149,13 +146,19 @@ static int r300_get_param(struct pipe_screen* pscreen, enum pipe_cap param) case PIPE_CAP_STREAM_OUTPUT_PAUSE_RESUME: case PIPE_CAP_FRAGMENT_COLOR_CLAMPED: case PIPE_CAP_QUADS_FOLLOW_PROVOKING_VERTEX_CONVENTION: - case PIPE_CAP_USER_VERTEX_BUFFERS: return 0; /* SWTCL-only features. */ case PIPE_CAP_PRIMITIVE_RESTART: + case PIPE_CAP_USER_VERTEX_BUFFERS: return !r300screen->caps.has_tcl; + /* HWTCL-only features / limitations. */ + case PIPE_CAP_VERTEX_BUFFER_OFFSET_4BYTE_ALIGNED_ONLY: + case PIPE_CAP_VERTEX_BUFFER_STRIDE_4BYTE_ALIGNED_ONLY: + case PIPE_CAP_VERTEX_ELEMENT_SRC_OFFSET_4BYTE_ALIGNED_ONLY: + return r300screen->caps.has_tcl; + /* Texturing. */ case PIPE_CAP_MAX_COMBINED_SAMPLERS: return r300screen->caps.num_tex_units; @@ -426,11 +429,19 @@ static boolean r300_is_format_supported(struct pipe_screen* screen, } /* Check vertex buffer format support. */ - if (usage & PIPE_BIND_VERTEX_BUFFER && - /* Half float is supported on >= R400. */ - (is_r400 || is_r500 || !is_half_float) && - r300_translate_vertex_data_type(format) != R300_INVALID_FORMAT) { - retval |= PIPE_BIND_VERTEX_BUFFER; + if (usage & PIPE_BIND_VERTEX_BUFFER) { + if (r300_screen(screen)->caps.has_tcl) { + /* Half float is supported on >= R400. */ + if ((is_r400 || is_r500 || !is_half_float) && + r300_translate_vertex_data_type(format) != R300_INVALID_FORMAT) { + retval |= PIPE_BIND_VERTEX_BUFFER; + } + } else { + /* SW TCL */ + if (!util_format_is_pure_integer(format)) { + retval |= PIPE_BIND_VERTEX_BUFFER; + } + } } /* Transfers are always supported. */ |