summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/r300/r300_state.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/gallium/drivers/r300/r300_state.c')
-rw-r--r--src/gallium/drivers/r300/r300_state.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/src/gallium/drivers/r300/r300_state.c b/src/gallium/drivers/r300/r300_state.c
index 10625b45e3e..ab5c18158d1 100644
--- a/src/gallium/drivers/r300/r300_state.c
+++ b/src/gallium/drivers/r300/r300_state.c
@@ -1618,15 +1618,14 @@ static void r300_set_index_buffer(struct pipe_context* pipe,
{
struct r300_context* r300 = r300_context(pipe);
- if (r300->screen->caps.has_tcl) {
- u_vbuf_set_index_buffer(r300->vbuf_mgr, ib);
+ if (ib) {
+ pipe_resource_reference(&r300->index_buffer.buffer, ib->buffer);
+ memcpy(&r300->index_buffer, ib, sizeof(*ib));
} else {
- if (ib) {
- pipe_resource_reference(&r300->swtcl_index_buffer.buffer, ib->buffer);
- memcpy(&r300->swtcl_index_buffer, ib, sizeof(*ib));
- } else {
- pipe_resource_reference(&r300->swtcl_index_buffer.buffer, NULL);
- }
+ pipe_resource_reference(&r300->index_buffer.buffer, NULL);
+ }
+
+ if (!r300->screen->caps.has_tcl) {
draw_set_index_buffer(r300->draw, ib);
}
}