summaryrefslogtreecommitdiff
path: root/src/gallium/drivers/r600/r600_state_inlines.h
diff options
context:
space:
mode:
authorDave Airlie <airlied@redhat.com>2010-08-02 14:48:59 +1000
committerDave Airlie <airlied@redhat.com>2010-08-02 16:27:15 +1000
commit4af5f11c3232015006f61c1a6befdff3411b8d6c (patch)
tree1d9241e0449261a3c9de500a5c49b09f57c34dcc /src/gallium/drivers/r600/r600_state_inlines.h
parent3f4ec394b027c6d947ccc88309a7d37bc3859e9d (diff)
r600g: add stencil op/func translation
Diffstat (limited to 'src/gallium/drivers/r600/r600_state_inlines.h')
-rw-r--r--src/gallium/drivers/r600/r600_state_inlines.h33
1 files changed, 33 insertions, 0 deletions
diff --git a/src/gallium/drivers/r600/r600_state_inlines.h b/src/gallium/drivers/r600/r600_state_inlines.h
index 42bab52b3f..369263dc8f 100644
--- a/src/gallium/drivers/r600/r600_state_inlines.h
+++ b/src/gallium/drivers/r600/r600_state_inlines.h
@@ -97,4 +97,37 @@ static INLINE uint32_t r600_translate_blend_factor(int blend_fact)
return 0;
}
+static INLINE uint32_t r600_translate_stencil_op(int s_op)
+{
+ switch (s_op) {
+ case PIPE_STENCIL_OP_KEEP:
+ return R600_ZS_KEEP;
+ case PIPE_STENCIL_OP_ZERO:
+ return R600_ZS_ZERO;
+ case PIPE_STENCIL_OP_REPLACE:
+ return R600_ZS_REPLACE;
+ case PIPE_STENCIL_OP_INCR:
+ return R600_ZS_INCR;
+ case PIPE_STENCIL_OP_DECR:
+ return R600_ZS_DECR;
+ case PIPE_STENCIL_OP_INCR_WRAP:
+ return R600_ZS_INCR_WRAP;
+ case PIPE_STENCIL_OP_DECR_WRAP:
+ return R600_ZS_DECR_WRAP;
+ case PIPE_STENCIL_OP_INVERT:
+ return R600_ZS_INVERT;
+ default:
+ fprintf(stderr, "r600: Unknown stencil op %d", s_op);
+ assert(0);
+ break;
+ }
+ return 0;
+}
+
+/* translates straight */
+static INLINE uint32_t r600_translate_ds_func(int func)
+{
+ return func;
+}
+
#endif