diff options
author | Marek Olšák <[email protected]> | 2012-04-10 06:00:17 +0200 |
---|---|---|
committer | Marek Olšák <[email protected]> | 2012-04-24 01:39:22 +0200 |
commit | e0773da1e897164ed7597437070e32b867734ee5 (patch) | |
tree | 1653bdb8fab0d8e250f7fcc0ca225e7245043184 /src/gallium/drivers/r300 | |
parent | 79eafc14ca70a684b4ea8b89723c1dad3e61eb3d (diff) |
gallium: make user vertex buffers optional
This couldn't be split because it would break bisecting.
Summary:
* r300g,r600g: stop using u_vbuf
* r300g,r600g: also report that the FIXED vertex type is unsupported
* u_vbuf: refactor for use in the state tracker
* cso: wire up u_vbuf with cso_context
* st/mesa: conditionally install u_vbuf
Diffstat (limited to 'src/gallium/drivers/r300')
-rw-r--r-- | src/gallium/drivers/r300/r300_blit.c | 12 | ||||
-rw-r--r-- | src/gallium/drivers/r300/r300_context.c | 18 | ||||
-rw-r--r-- | src/gallium/drivers/r300/r300_context.h | 2 | ||||
-rw-r--r-- | src/gallium/drivers/r300/r300_screen.c | 7 |
4 files changed, 5 insertions, 34 deletions
diff --git a/src/gallium/drivers/r300/r300_blit.c b/src/gallium/drivers/r300/r300_blit.c index 5b76c4b16e1..8d82bb920f6 100644 --- a/src/gallium/drivers/r300/r300_blit.c +++ b/src/gallium/drivers/r300/r300_blit.c @@ -62,15 +62,9 @@ static void r300_blitter_begin(struct r300_context* r300, enum r300_blitter_op o util_blitter_save_fragment_shader(r300->blitter, r300->fs.state); util_blitter_save_vertex_shader(r300->blitter, r300->vs_state.state); util_blitter_save_viewport(r300->blitter, &r300->viewport); - if (r300->vbuf_mgr) { - util_blitter_save_vertex_buffers(r300->blitter, r300->vbuf_mgr->nr_vertex_buffers, - r300->vbuf_mgr->vertex_buffer); - util_blitter_save_vertex_elements(r300->blitter, r300->vbuf_mgr->vertex_elements); - } else { - util_blitter_save_vertex_buffers(r300->blitter, r300->nr_vertex_buffers, - r300->vertex_buffer); - util_blitter_save_vertex_elements(r300->blitter, r300->velems); - } + util_blitter_save_vertex_buffers(r300->blitter, r300->nr_vertex_buffers, + r300->vertex_buffer); + util_blitter_save_vertex_elements(r300->blitter, r300->velems); if (op & R300_SAVE_FRAMEBUFFER) { util_blitter_save_framebuffer(r300->blitter, r300->fb_state.state); diff --git a/src/gallium/drivers/r300/r300_context.c b/src/gallium/drivers/r300/r300_context.c index cb8cef15134..e1330a42a1d 100644 --- a/src/gallium/drivers/r300/r300_context.c +++ b/src/gallium/drivers/r300/r300_context.c @@ -100,9 +100,6 @@ static void r300_destroy_context(struct pipe_context* context) if (r300->draw) draw_destroy(r300->draw); - if (r300->vbuf_mgr) - u_vbuf_destroy(r300->vbuf_mgr); - u_upload_destroy(r300->uploader); /* XXX: This function assumes r300->query_list was initialized */ @@ -429,20 +426,7 @@ struct pipe_context* r300_create_context(struct pipe_screen* screen, r300->context.create_video_decoder = vl_create_decoder; r300->context.create_video_buffer = vl_video_buffer_create; - if (r300->screen->caps.has_tcl) { - struct u_vbuf_caps caps; - - u_vbuf_get_caps(screen, &caps); - caps.format_fixed32 = 0; - - r300->vbuf_mgr = u_vbuf_create(&r300->context, &caps, 1024 * 1024, 4, - PIPE_BIND_VERTEX_BUFFER | - PIPE_BIND_INDEX_BUFFER); - if (!r300->vbuf_mgr) - goto fail; - } - - r300->uploader = u_upload_create(&r300->context, 256 * 1024, 16, + r300->uploader = u_upload_create(&r300->context, 256 * 1024, 4, PIPE_BIND_INDEX_BUFFER); r300->blitter = util_blitter_create(&r300->context); diff --git a/src/gallium/drivers/r300/r300_context.h b/src/gallium/drivers/r300/r300_context.h index 8f125d19c16..ca57a5c7857 100644 --- a/src/gallium/drivers/r300/r300_context.h +++ b/src/gallium/drivers/r300/r300_context.h @@ -30,7 +30,6 @@ #include "pipe/p_context.h" #include "util/u_inlines.h" #include "util/u_transfer.h" -#include "util/u_vbuf.h" #include "r300_defines.h" #include "r300_screen.h" @@ -576,7 +575,6 @@ struct r300_context { void *dsa_decompress_zmask; - struct u_vbuf *vbuf_mgr; struct pipe_index_buffer index_buffer; struct pipe_vertex_buffer vertex_buffer[PIPE_MAX_ATTRIBS]; unsigned nr_vertex_buffers; diff --git a/src/gallium/drivers/r300/r300_screen.c b/src/gallium/drivers/r300/r300_screen.c index 8c12865e9ce..0803a0808b5 100644 --- a/src/gallium/drivers/r300/r300_screen.c +++ b/src/gallium/drivers/r300/r300_screen.c @@ -361,10 +361,6 @@ static boolean r300_is_format_supported(struct pipe_screen* screen, format == PIPE_FORMAT_R16G16_FLOAT || format == PIPE_FORMAT_R16G16B16_FLOAT || format == PIPE_FORMAT_R16G16B16A16_FLOAT; - boolean is_fixed = format == PIPE_FORMAT_R32_FIXED || - format == PIPE_FORMAT_R32G32_FIXED || - format == PIPE_FORMAT_R32G32B32_FIXED || - format == PIPE_FORMAT_R32G32B32A32_FIXED; if (!util_format_is_supported(format, usage)) return FALSE; @@ -428,8 +424,7 @@ static boolean r300_is_format_supported(struct pipe_screen* screen, if (usage & PIPE_BIND_VERTEX_BUFFER && /* Half float is supported on >= R400. */ (is_r400 || is_r500 || !is_half_float) && - /* We have a fallback for FIXED. */ - (is_fixed || r300_translate_vertex_data_type(format) != R300_INVALID_FORMAT)) { + r300_translate_vertex_data_type(format) != R300_INVALID_FORMAT) { retval |= PIPE_BIND_VERTEX_BUFFER; } |