Mesa (main): crocus: cleanup some deadcode in the gen5 blend emit

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Sun Jul 4 21:07:15 UTC 2021


Module: Mesa
Branch: main
Commit: 64f65fe8a8bd9b9bda6226fabb062aa2398acfa4
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=64f65fe8a8bd9b9bda6226fabb062aa2398acfa4

Author: Dave Airlie <airlied at redhat.com>
Date:   Fri Jul  2 16:12:03 2021 +1000

crocus: cleanup some deadcode in the gen5 blend emit

The rt->blend_enable is always 1 at this point, and the gen5
specific code isn't being used anymore, it just looked like it
was.

Reviewed-by: Adam Jackson <ajax at redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11693>

---

 src/gallium/drivers/crocus/crocus_state.c | 17 ++---------------
 1 file changed, 2 insertions(+), 15 deletions(-)

diff --git a/src/gallium/drivers/crocus/crocus_state.c b/src/gallium/drivers/crocus/crocus_state.c
index f9ad130e98a..da5fb7a80c2 100644
--- a/src/gallium/drivers/crocus/crocus_state.c
+++ b/src/gallium/drivers/crocus/crocus_state.c
@@ -1553,10 +1553,10 @@ set_blend_entry_bits(struct crocus_batch *batch, BLEND_ENTRY_GENXML *entry,
       if (idx == 0) {
          struct crocus_compiled_shader *shader = ice->shaders.prog[MESA_SHADER_FRAGMENT];
          struct brw_wm_prog_data *wm_prog_data = (void *) shader->prog_data;
-         entry->ColorBufferBlendEnable = rt->blend_enable &&
+         entry->ColorBufferBlendEnable =
             (!cso_blend->dual_color_blending || wm_prog_data->dual_src_blend);
       } else
-         entry->ColorBufferBlendEnable = rt->blend_enable;
+         entry->ColorBufferBlendEnable = 1;
 
       entry->ColorBlendFunction          = rt->rgb_func;
       entry->AlphaBlendFunction          = rt->alpha_func;
@@ -6152,17 +6152,6 @@ crocus_upload_dirty_render_state(struct crocus_context *ice,
                       64, &cc_offset);
 #if GFX_VER <= 5
       dirty |= CROCUS_DIRTY_GEN5_PIPELINED_POINTERS;
-      int blend_idx = 0;
-
-      if (cso_blend->cso.independent_blend_enable) {
-         for (unsigned i = 0; i < PIPE_MAX_COLOR_BUFS; i++) {
-            if (cso_blend->cso.rt[i].blend_enable) {
-               blend_idx = i;
-               break;
-            }
-         }
-      }
-      const struct pipe_rt_blend_state *rt = &cso_blend->cso.rt[blend_idx];
 #endif
       _crocus_pack_state(batch, GENX(COLOR_CALC_STATE), cc_map, cc) {
          cc.AlphaTestFormat = ALPHATEST_FLOAT32;
@@ -6172,8 +6161,6 @@ crocus_upload_dirty_render_state(struct crocus_context *ice,
 
          set_depth_stencil_bits(ice, &cc);
 
-         cc.ColorBufferBlendEnable = rt->blend_enable;
-
          if (cso_blend->cso.logicop_enable) {
             if (can_emit_logic_op(ice)) {
                cc.LogicOpEnable = cso_blend->cso.logicop_enable;



More information about the mesa-commit mailing list