r600g: consolidate some translate functions
authorMarek Olšák <maraeo@gmail.com>
Tue, 14 Feb 2012 14:12:49 +0000 (15:12 +0100)
committerMarek Olšák <maraeo@gmail.com>
Tue, 14 Feb 2012 14:49:23 +0000 (15:49 +0100)
src/gallium/drivers/r600/evergreen_state.c
src/gallium/drivers/r600/r600_pipe.h
src/gallium/drivers/r600/r600_state.c
src/gallium/drivers/r600/r600_state_common.c

index b8825163161a9e7581b937557af82c4f8fc24107..1d13547f4de1a1f70fe45987952a4e31b6c365a1 100644 (file)
@@ -173,48 +173,6 @@ static uint32_t r600_translate_blend_factor(int blend_fact)
        return 0;
 }
 
-static uint32_t r600_translate_stencil_op(int s_op)
-{
-       switch (s_op) {
-       case PIPE_STENCIL_OP_KEEP:
-               return V_028800_STENCIL_KEEP;
-       case PIPE_STENCIL_OP_ZERO:
-               return V_028800_STENCIL_ZERO;
-       case PIPE_STENCIL_OP_REPLACE:
-               return V_028800_STENCIL_REPLACE;
-       case PIPE_STENCIL_OP_INCR:
-               return V_028800_STENCIL_INCR;
-       case PIPE_STENCIL_OP_DECR:
-               return V_028800_STENCIL_DECR;
-       case PIPE_STENCIL_OP_INCR_WRAP:
-               return V_028800_STENCIL_INCR_WRAP;
-       case PIPE_STENCIL_OP_DECR_WRAP:
-               return V_028800_STENCIL_DECR_WRAP;
-       case PIPE_STENCIL_OP_INVERT:
-               return V_028800_STENCIL_INVERT;
-       default:
-               R600_ERR("Unknown stencil op %d", s_op);
-               assert(0);
-               break;
-       }
-       return 0;
-}
-
-static uint32_t r600_translate_fill(uint32_t func)
-{
-       switch(func) {
-       case PIPE_POLYGON_MODE_FILL:
-               return 2;
-       case PIPE_POLYGON_MODE_LINE:
-               return 1;
-       case PIPE_POLYGON_MODE_POINT:
-               return 0;
-       default:
-               assert(0);
-               return 0;
-       }
-}
-
 /* translates straight */
 static uint32_t r600_translate_ds_func(int func)
 {
index f1306176b9413261c772e8b9d40789fb5ba66d81..7b6eb3509b41899b866c65cc7450e915c08a3669 100644 (file)
@@ -471,6 +471,8 @@ void r600_set_so_targets(struct pipe_context *ctx,
 void r600_set_pipe_stencil_ref(struct pipe_context *ctx,
                               const struct pipe_stencil_ref *state);
 void r600_draw_vbo(struct pipe_context *ctx, const struct pipe_draw_info *info);
+uint32_t r600_translate_stencil_op(int s_op);
+uint32_t r600_translate_fill(uint32_t func);
 
 /*
  * common helpers
index 0d83fa608fbb66eb47c53cbd6114d67fe1d75f2e..03cb780aa6501b558184d8e55c167fec7d4c6a1a 100644 (file)
@@ -116,48 +116,6 @@ static uint32_t r600_translate_blend_factor(int blend_fact)
        return 0;
 }
 
-static uint32_t r600_translate_stencil_op(int s_op)
-{
-       switch (s_op) {
-       case PIPE_STENCIL_OP_KEEP:
-               return V_028800_STENCIL_KEEP;
-       case PIPE_STENCIL_OP_ZERO:
-               return V_028800_STENCIL_ZERO;
-       case PIPE_STENCIL_OP_REPLACE:
-               return V_028800_STENCIL_REPLACE;
-       case PIPE_STENCIL_OP_INCR:
-               return V_028800_STENCIL_INCR;
-       case PIPE_STENCIL_OP_DECR:
-               return V_028800_STENCIL_DECR;
-       case PIPE_STENCIL_OP_INCR_WRAP:
-               return V_028800_STENCIL_INCR_WRAP;
-       case PIPE_STENCIL_OP_DECR_WRAP:
-               return V_028800_STENCIL_DECR_WRAP;
-       case PIPE_STENCIL_OP_INVERT:
-               return V_028800_STENCIL_INVERT;
-       default:
-               R600_ERR("Unknown stencil op %d", s_op);
-               assert(0);
-               break;
-       }
-       return 0;
-}
-
-static uint32_t r600_translate_fill(uint32_t func)
-{
-       switch(func) {
-       case PIPE_POLYGON_MODE_FILL:
-               return 2;
-       case PIPE_POLYGON_MODE_LINE:
-               return 1;
-       case PIPE_POLYGON_MODE_POINT:
-               return 0;
-       default:
-               assert(0);
-               return 0;
-       }
-}
-
 /* translates straight */
 static uint32_t r600_translate_ds_func(int func)
 {
index 21e4bd13f55a530959bacda301838d10c59fbeae..bf72d71ec2ed8f571a51cc548bb899855b9a154b 100644 (file)
@@ -936,3 +936,45 @@ void r600_pipe_state_add_reg_noblock(struct r600_pipe_state *state,
        state->nregs++;
        assert(state->nregs < R600_BLOCK_MAX_REG);
 }
+
+uint32_t r600_translate_stencil_op(int s_op)
+{
+       switch (s_op) {
+       case PIPE_STENCIL_OP_KEEP:
+               return V_028800_STENCIL_KEEP;
+       case PIPE_STENCIL_OP_ZERO:
+               return V_028800_STENCIL_ZERO;
+       case PIPE_STENCIL_OP_REPLACE:
+               return V_028800_STENCIL_REPLACE;
+       case PIPE_STENCIL_OP_INCR:
+               return V_028800_STENCIL_INCR;
+       case PIPE_STENCIL_OP_DECR:
+               return V_028800_STENCIL_DECR;
+       case PIPE_STENCIL_OP_INCR_WRAP:
+               return V_028800_STENCIL_INCR_WRAP;
+       case PIPE_STENCIL_OP_DECR_WRAP:
+               return V_028800_STENCIL_DECR_WRAP;
+       case PIPE_STENCIL_OP_INVERT:
+               return V_028800_STENCIL_INVERT;
+       default:
+               R600_ERR("Unknown stencil op %d", s_op);
+               assert(0);
+               break;
+       }
+       return 0;
+}
+
+uint32_t r600_translate_fill(uint32_t func)
+{
+       switch(func) {
+       case PIPE_POLYGON_MODE_FILL:
+               return 2;
+       case PIPE_POLYGON_MODE_LINE:
+               return 1;
+       case PIPE_POLYGON_MODE_POINT:
+               return 0;
+       default:
+               assert(0);
+               return 0;
+       }
+}