From 8a963d122d4b67209214b0483084ba950814f42b Mon Sep 17 00:00:00 2001 From: =?utf8?q?Marek=20Ol=C5=A1=C3=A1k?= Date: Fri, 11 May 2012 23:09:05 +0200 Subject: [PATCH] r300g/swtcl: don't do stuff which is only for HWTCL --- src/gallium/drivers/r300/r300_context.c | 11 +++++++---- src/gallium/drivers/r300/r300_state.c | 21 ++++++++++++--------- 2 files changed, 19 insertions(+), 13 deletions(-) diff --git a/src/gallium/drivers/r300/r300_context.c b/src/gallium/drivers/r300/r300_context.c index 1006336d44e..8cbe246f787 100644 --- a/src/gallium/drivers/r300/r300_context.c +++ b/src/gallium/drivers/r300/r300_context.c @@ -80,7 +80,8 @@ static void r300_destroy_context(struct pipe_context* context) if (r300->draw) draw_destroy(r300->draw); - u_upload_destroy(r300->uploader); + if (r300->uploader) + u_upload_destroy(r300->uploader); /* XXX: This function assumes r300->query_list was initialized */ r300_release_referenced_objects(r300); @@ -402,8 +403,10 @@ 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; - r300->uploader = u_upload_create(&r300->context, 256 * 1024, 4, - PIPE_BIND_INDEX_BUFFER); + if (r300screen->caps.has_tcl) { + r300->uploader = u_upload_create(&r300->context, 256 * 1024, 4, + PIPE_BIND_INDEX_BUFFER); + } r300->blitter = util_blitter_create(&r300->context); if (r300->blitter == NULL) @@ -437,7 +440,7 @@ struct pipe_context* r300_create_context(struct pipe_screen* screen, pipe_resource_reference(&tex, NULL); } - { + if (r300screen->caps.has_tcl) { struct pipe_resource vb; memset(&vb, 0, sizeof(vb)); vb.target = PIPE_BUFFER; diff --git a/src/gallium/drivers/r300/r300_state.c b/src/gallium/drivers/r300/r300_state.c index a9a76c5fed8..5b02cfd90cd 100644 --- a/src/gallium/drivers/r300/r300_state.c +++ b/src/gallium/drivers/r300/r300_state.c @@ -1594,19 +1594,22 @@ static void r300_set_vertex_buffers(struct pipe_context* pipe, { struct r300_context* r300 = r300_context(pipe); - /* There must be at least one vertex buffer set, otherwise it locks up. */ - if (!count) { - buffers = &r300->dummy_vb; - count = 1; - } + if (r300->screen->caps.has_tcl) { + /* There must be at least one vertex buffer set, otherwise it locks up. */ + if (!count) { + buffers = &r300->dummy_vb; + count = 1; + } - util_copy_vertex_buffers(r300->vertex_buffer, - &r300->nr_vertex_buffers, - buffers, count); + util_copy_vertex_buffers(r300->vertex_buffer, + &r300->nr_vertex_buffers, + buffers, count); - if (r300->screen->caps.has_tcl) { r300->vertex_arrays_dirty = TRUE; } else { + util_copy_vertex_buffers(r300->vertex_buffer, + &r300->nr_vertex_buffers, + buffers, count); draw_set_vertex_buffers(r300->draw, count, buffers); } } -- 2.30.2