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

Author: Kenneth Graunke <kenn...@whitecape.org>
Date:   Wed Nov 23 00:38:02 2022 -0800

intel/compiler: Delete unused repclear shader uniform handling

A long time ago, we used a uniform for the clear color.  Back in 2014,
we added support for using a flat input instead, as this was easier for
Vulkan, but we left the option of using a uniform for OpenGL.

Eventually nobody used the uniform approach anymore, but the compiler
code to handle it remained.  Drop the dead code.

Reviewed-by: Caio Oliveira <caio.olive...@intel.com>
Reviewed-by: Emma Anholt <e...@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20172>

---

 src/intel/compiler/brw_fs.cpp | 29 ++++++++---------------------
 1 file changed, 8 insertions(+), 21 deletions(-)

diff --git a/src/intel/compiler/brw_fs.cpp b/src/intel/compiler/brw_fs.cpp
index 8199cfbe9a9..2d81e5f0897 100644
--- a/src/intel/compiler/brw_fs.cpp
+++ b/src/intel/compiler/brw_fs.cpp
@@ -3601,21 +3601,15 @@ fs_visitor::emit_repclear_shader()
    brw_wm_prog_key *key = (brw_wm_prog_key*) this->key;
    int base_mrf = 0;
    int color_mrf = base_mrf + 2;
-   fs_inst *mov;
 
-   if (uniforms > 0) {
-      mov = bld.exec_all().group(4, 0)
-               .MOV(brw_message_reg(color_mrf),
-                    fs_reg(UNIFORM, 0, BRW_REGISTER_TYPE_F));
-   } else {
-      struct brw_reg reg =
-         brw_reg(BRW_GENERAL_REGISTER_FILE, 2, 3, 0, 0, BRW_REGISTER_TYPE_UD,
-                 BRW_VERTICAL_STRIDE_8, BRW_WIDTH_2, BRW_HORIZONTAL_STRIDE_4,
-                 BRW_SWIZZLE_XYZW, WRITEMASK_XYZW);
+   assert(uniforms == 0);
 
-      mov = bld.exec_all().group(4, 0)
-               .MOV(brw_uvec_mrf(4, color_mrf, 0), fs_reg(reg));
-   }
+   struct brw_reg reg =
+      brw_reg(BRW_GENERAL_REGISTER_FILE, 2, 3, 0, 0, BRW_REGISTER_TYPE_UD,
+              BRW_VERTICAL_STRIDE_8, BRW_WIDTH_2, BRW_HORIZONTAL_STRIDE_4,
+              BRW_SWIZZLE_XYZW, WRITEMASK_XYZW);
+
+   bld.exec_all().group(4, 0).MOV(brw_uvec_mrf(4, color_mrf, 0), fs_reg(reg));
 
    fs_inst *write = NULL;
    if (key->nr_color_regions == 1) {
@@ -3652,14 +3646,7 @@ fs_visitor::emit_repclear_shader()
 
    calculate_cfg();
 
-   assign_constant_locations();
-   assign_curb_setup();
-
-   /* Now that we have the uniform assigned, go ahead and force it to a vec4. 
*/
-   if (uniforms > 0) {
-      assert(mov->src[0].file == FIXED_GRF);
-      mov->src[0] = brw_vec4_grf(mov->src[0].nr, 0);
-   }
+   this->first_non_payload_grf = payload().num_regs;
 
    lower_scoreboard();
 }

Reply via email to