diff options
author | Ian Romanick <[email protected]> | 2018-01-03 11:45:58 -0800 |
---|---|---|
committer | Ian Romanick <[email protected]> | 2018-01-26 11:21:46 +0800 |
commit | 0aaa27f29187ffb739c7ba2d789b82114f59f054 (patch) | |
tree | 9043ee0a749893d3676c354a5a9e391efa187260 /src/mesa/drivers/dri/i915 | |
parent | cf0b26ec1250567fe0c5e9cc556806e64e843d19 (diff) |
mesa: Pass the translated color logic op dd_function_table::LogicOpcode
And delete the resulting dead code. This has only been compile-tested.
v2: sed --in-place -e 's/color_logic_ops/gl_logicop_mode/g' $(grep -lr
color_logic_ops src/) suggested by Brian.
Signed-off-by: Ian Romanick <[email protected]>
Reviewed-by: Brian Paul <[email protected]>
Reviewed-by: Nicolai Hähnle <[email protected]>
Diffstat (limited to 'src/mesa/drivers/dri/i915')
-rw-r--r-- | src/mesa/drivers/dri/i915/i830_state.c | 8 | ||||
-rw-r--r-- | src/mesa/drivers/dri/i915/i915_state.c | 8 | ||||
-rw-r--r-- | src/mesa/drivers/dri/i915/intel_context.h | 1 | ||||
-rw-r--r-- | src/mesa/drivers/dri/i915/intel_screen.h | 1 | ||||
-rw-r--r-- | src/mesa/drivers/dri/i915/intel_state.c | 41 |
5 files changed, 8 insertions, 51 deletions
diff --git a/src/mesa/drivers/dri/i915/i830_state.c b/src/mesa/drivers/dri/i915/i830_state.c index 7ce5ef7e41a..c8f48fbfa5a 100644 --- a/src/mesa/drivers/dri/i915/i830_state.c +++ b/src/mesa/drivers/dri/i915/i830_state.c @@ -573,16 +573,16 @@ i830Scissor(struct gl_context * ctx) } static void -i830LogicOp(struct gl_context * ctx, GLenum opcode) +i830LogicOp(struct gl_context * ctx, enum gl_logicop_mode opcode) { struct i830_context *i830 = i830_context(ctx); - int tmp = intel_translate_logic_op(opcode); DBG("%s\n", __func__); - + + assert((unsigned)opcode <= 15); I830_STATECHANGE(i830, I830_UPLOAD_CTX); i830->state.Ctx[I830_CTXREG_STATE4] &= ~LOGICOP_MASK; - i830->state.Ctx[I830_CTXREG_STATE4] |= LOGIC_OP_FUNC(tmp); + i830->state.Ctx[I830_CTXREG_STATE4] |= opcode; } diff --git a/src/mesa/drivers/dri/i915/i915_state.c b/src/mesa/drivers/dri/i915/i915_state.c index 685af046b59..bf7005a06fd 100644 --- a/src/mesa/drivers/dri/i915/i915_state.c +++ b/src/mesa/drivers/dri/i915/i915_state.c @@ -539,16 +539,16 @@ i915Scissor(struct gl_context * ctx) } static void -i915LogicOp(struct gl_context * ctx, GLenum opcode) +i915LogicOp(struct gl_context * ctx, enum gl_logicop_mode opcode) { struct i915_context *i915 = I915_CONTEXT(ctx); - int tmp = intel_translate_logic_op(opcode); DBG("%s\n", __func__); - + + assert((unsigned)opcode <= 15); I915_STATECHANGE(i915, I915_UPLOAD_CTX); i915->state.Ctx[I915_CTXREG_STATE4] &= ~LOGICOP_MASK; - i915->state.Ctx[I915_CTXREG_STATE4] |= LOGIC_OP_FUNC(tmp); + i915->state.Ctx[I915_CTXREG_STATE4] |= LOGIC_OP_FUNC(opcode); } diff --git a/src/mesa/drivers/dri/i915/intel_context.h b/src/mesa/drivers/dri/i915/intel_context.h index c59436aa2a0..5361dcf5e34 100644 --- a/src/mesa/drivers/dri/i915/intel_context.h +++ b/src/mesa/drivers/dri/i915/intel_context.h @@ -421,7 +421,6 @@ extern int intel_translate_shadow_compare_func(GLenum func); extern int intel_translate_compare_func(GLenum func); extern int intel_translate_stencil_op(GLenum op); extern int intel_translate_blend_factor(GLenum factor); -extern int intel_translate_logic_op(GLenum opcode); void intel_update_renderbuffers(__DRIcontext *context, __DRIdrawable *drawable); diff --git a/src/mesa/drivers/dri/i915/intel_screen.h b/src/mesa/drivers/dri/i915/intel_screen.h index a22888b391a..ec4592d1e10 100644 --- a/src/mesa/drivers/dri/i915/intel_screen.h +++ b/src/mesa/drivers/dri/i915/intel_screen.h @@ -139,7 +139,6 @@ struct intel_screen #define get_time old_get_time #define intel_translate_blend_factor old_intel_translate_blend_factor #define intel_translate_compare_func old_intel_translate_compare_func -#define intel_translate_logic_op old_intel_translate_logic_op #define intel_translate_shadow_compare_func old_intel_translate_shadow_compare_func #define intel_translate_stencil_op old_intel_translate_stencil_op #define intel_init_syncobj_functions old_intel_init_syncobj_functions diff --git a/src/mesa/drivers/dri/i915/intel_state.c b/src/mesa/drivers/dri/i915/intel_state.c index 3de9d50a4d7..4f47013dd92 100644 --- a/src/mesa/drivers/dri/i915/intel_state.c +++ b/src/mesa/drivers/dri/i915/intel_state.c @@ -151,44 +151,3 @@ intel_translate_blend_factor(GLenum factor) fprintf(stderr, "Unknown value in %s: %x\n", __func__, factor); return BLENDFACT_ZERO; } - -int -intel_translate_logic_op(GLenum opcode) -{ - switch (opcode) { - case GL_CLEAR: - return LOGICOP_CLEAR; - case GL_AND: - return LOGICOP_AND; - case GL_AND_REVERSE: - return LOGICOP_AND_RVRSE; - case GL_COPY: - return LOGICOP_COPY; - case GL_COPY_INVERTED: - return LOGICOP_COPY_INV; - case GL_AND_INVERTED: - return LOGICOP_AND_INV; - case GL_NOOP: - return LOGICOP_NOOP; - case GL_XOR: - return LOGICOP_XOR; - case GL_OR: - return LOGICOP_OR; - case GL_OR_INVERTED: - return LOGICOP_OR_INV; - case GL_NOR: - return LOGICOP_NOR; - case GL_EQUIV: - return LOGICOP_EQUIV; - case GL_INVERT: - return LOGICOP_INV; - case GL_OR_REVERSE: - return LOGICOP_OR_RVRSE; - case GL_NAND: - return LOGICOP_NAND; - case GL_SET: - return LOGICOP_SET; - default: - return LOGICOP_SET; - } -} |