diff options
author | Corbin Simpson <[email protected]> | 2009-04-05 01:00:25 -0700 |
---|---|---|
committer | Corbin Simpson <[email protected]> | 2009-04-05 01:00:25 -0700 |
commit | ce7963f338ab95b06619074bc6aaf99c96ff5f11 (patch) | |
tree | f53e1e361b07345c0be4bcf160c61db7457bd44e /src/gallium/drivers/r300/r300_state.c | |
parent | 484795ff14faa794b7a150f29554a73e0113f67d (diff) |
r300-gallium: Properly interface with Draw for vert shaders.
Diffstat (limited to 'src/gallium/drivers/r300/r300_state.c')
-rw-r--r-- | src/gallium/drivers/r300/r300_state.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/gallium/drivers/r300/r300_state.c b/src/gallium/drivers/r300/r300_state.c index 4dee4ab8ce1..5b3bb328ddf 100644 --- a/src/gallium/drivers/r300/r300_state.c +++ b/src/gallium/drivers/r300/r300_state.c @@ -403,6 +403,11 @@ static void* r300_create_rs_state(struct pipe_context* pipe, rs->rs = *state; + /* If using HW TCL, tell Draw to not do its magic. */ + if (r300_screen(pipe->screen)->caps->has_tcl) { + rs->rs.bypass_vs_clip_and_viewport = TRUE; + } + return (void*)rs; } @@ -604,6 +609,9 @@ static void* r300_create_vs_state(struct pipe_context* pipe, tgsi_scan_shader(shader->tokens, &vs->info); + /* Appease Draw. */ + vs->draw = draw_create_vertex_shader(r300->draw, shader); + return (void*)vs; } else { return draw_create_vertex_shader(r300->draw, shader); @@ -624,6 +632,7 @@ static void r300_bind_vs_state(struct pipe_context* pipe, void* shader) r300_translate_vertex_shader(r300, vs); } + draw_bind_vertex_shader(r300->draw, vs->draw); r300->vs = vs; r300->dirty_state |= R300_NEW_VERTEX_SHADER; } else { @@ -637,6 +646,9 @@ static void r300_delete_vs_state(struct pipe_context* pipe, void* shader) struct r300_context* r300 = r300_context(pipe); if (r300_screen(pipe->screen)->caps->has_tcl) { + struct r300_vertex_shader* vs = (struct r300_vertex_shader*)shader; + + draw_delete_vertex_shader(r300->draw, vs->draw); FREE(shader); } else { draw_delete_vertex_shader(r300->draw, |