summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/r300/r300_state.c
diff options
context:
space:
mode:
authorMarek Olšák <[email protected]>2012-03-31 04:56:48 +0200
committerMarek Olšák <[email protected]>2012-04-24 01:39:21 +0200
commit31714ea4d5a20285f398286fe45b53d0609926dd (patch)
tree55bef20927e0c26953bfbfd5e7747e17bcdc564b /src/gallium/drivers/r300/r300_state.c
parent76c4760e5d8522780d770f9a0a62d710806206a0 (diff)
u_vbuf: override set_index_buffer
This makes u_vbuf_mgr call the driver instead of the other way around.
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);
}
}