summaryrefslogtreecommitdiff
path: root/src/gallium/drivers/r300/r300_context.h
diff options
context:
space:
mode:
authorMarek Olšák <maraeo@gmail.com>2010-04-05 06:26:11 +0200
committerMarek Olšák <maraeo@gmail.com>2010-04-05 07:09:46 +0200
commita955f86b31304a1a0f35faa0e0861e920354e23b (patch)
treeac1fc496b191fc20da8983bfe95d029e819ebe48 /src/gallium/drivers/r300/r300_context.h
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.h')
-rw-r--r--src/gallium/drivers/r300/r300_context.h23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/gallium/drivers/r300/r300_context.h b/src/gallium/drivers/r300/r300_context.h
index 351bd2cdae..9d7e9d1226 100644
--- a/src/gallium/drivers/r300/r300_context.h
+++ b/src/gallium/drivers/r300/r300_context.h
@@ -79,6 +79,11 @@ struct r300_dsa_state {
uint32_t z_stencil_control; /* R300_ZB_ZSTENCILCNTL: 0x4f04 */
uint32_t stencil_ref_mask; /* R300_ZB_STENCILREFMASK: 0x4f08 */
uint32_t stencil_ref_bf; /* R500_ZB_STENCILREFMASK_BF: 0x4fd4 */
+
+ /* Whether a two-sided stencil is enabled. */
+ boolean two_sided;
+ /* Whether a fallback should be used for a two-sided stencil ref value. */
+ boolean stencil_ref_bf_fallback;
};
struct r300_rs_state {
@@ -290,6 +295,21 @@ struct r300_context {
/* Parent class */
struct pipe_context context;
+ /* Emission of drawing packets. */
+ void (*emit_draw_arrays_immediate)(
+ struct r300_context *r300,
+ unsigned mode, unsigned start, unsigned count);
+
+ void (*emit_draw_arrays)(
+ struct r300_context *r300,
+ unsigned mode, unsigned count);
+
+ void (*emit_draw_elements)(
+ struct r300_context *r300, struct pipe_buffer* indexBuffer,
+ unsigned indexSize, unsigned minIndex, unsigned maxIndex,
+ unsigned mode, unsigned start, unsigned count);
+
+
/* The interface to the windowing system, etc. */
struct r300_winsys_screen *rws;
/* Screen. */
@@ -382,6 +402,9 @@ struct r300_context {
boolean scissor_enabled;
/* Whether rendering is conditional and should be skipped. */
boolean skip_rendering;
+ /* Whether the two-sided stencil ref value is different for front and
+ * back faces, and fallback should be used for r3xx-r4xx. */
+ boolean stencil_ref_bf_fallback;
/* upload managers */
struct u_upload_mgr *upload_vb;
struct u_upload_mgr *upload_ib;