summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/r300/r300_context.c
diff options
context:
space:
mode:
authorMarek Olšák <[email protected]>2010-04-05 06:26:11 +0200
committerMarek Olšák <[email protected]>2010-04-05 07:09:46 +0200
commita955f86b31304a1a0f35faa0e0861e920354e23b (patch)
treeac1fc496b191fc20da8983bfe95d029e819ebe48 /src/gallium/drivers/r300/r300_context.c
parentb71bfc4400e1d7c15a2bebbbd3b26a8770fbf546 (diff)
r300g: add fallback for back stencil reference value and masks for r3xx-r4xx
This splits rendering into two passes when front and back stencil reference value, value mask, or write mask don't match. The advantages of doing it in the driver instead of in st are: * SWTCL is executed just once and the resulting vertex buffer is reused in the second pass. * Lower driver overhead due to the fallback being very close to the actual draw emission with minimum state change.
Diffstat (limited to 'src/gallium/drivers/r300/r300_context.c')
-rw-r--r--src/gallium/drivers/r300/r300_context.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/gallium/drivers/r300/r300_context.c b/src/gallium/drivers/r300/r300_context.c
index 1e1c7161eca..46fdf087942 100644
--- a/src/gallium/drivers/r300/r300_context.c
+++ b/src/gallium/drivers/r300/r300_context.c
@@ -175,6 +175,16 @@ struct pipe_context* r300_create_context(struct pipe_screen* screen,
r300->context.draw_arrays = r300_draw_arrays;
r300->context.draw_elements = r300_draw_elements;
r300->context.draw_range_elements = r300_draw_range_elements;
+
+ if (r300screen->caps.is_r500) {
+ r300->emit_draw_arrays_immediate = r500_emit_draw_arrays_immediate;
+ r300->emit_draw_arrays = r500_emit_draw_arrays;
+ r300->emit_draw_elements = r500_emit_draw_elements;
+ } else {
+ r300->emit_draw_arrays_immediate = r300_emit_draw_arrays_immediate;
+ r300->emit_draw_arrays = r300_emit_draw_arrays;
+ r300->emit_draw_elements = r300_emit_draw_elements;
+ }
} else {
r300->context.draw_arrays = r300_swtcl_draw_arrays;
r300->context.draw_elements = r300_draw_elements;