From 1ab4fe2dd690491ffb6fdb82eea6fc61b48a53b4 Mon Sep 17 00:00:00 2001 From: Kenneth Graunke Date: Wed, 1 Jan 2025 04:53:26 -0800 Subject: [PATCH] brw: Don't shrink UBO push ranges in the backend Back in the bad old days (vec4?) we had a bunch of smarts in the backend to dead code eliminate unused vector components and re-pack regular uniforms, so we really couldn't decide how much data we were pushing until very late in the backend. Nowadays we have none of that - we do all of our elimination and packing in NIR. anv shrinks ranges to deal with Vulkan API push constants, and iris treats everything as a UBO and as of the previous commit will also shrink appropriately. So we don't need to do this anymore...which will let us simplify quite a bit of code. Reviewed-by: Lionel Landwerlin Part-of: --- src/intel/compiler/brw_fs.cpp | 19 ------------------- 1 file changed, 19 deletions(-) diff --git a/src/intel/compiler/brw_fs.cpp b/src/intel/compiler/brw_fs.cpp index 83e1a157e6e..1643da3908c 100644 --- a/src/intel/compiler/brw_fs.cpp +++ b/src/intel/compiler/brw_fs.cpp @@ -1147,25 +1147,6 @@ fs_visitor::assign_constant_locations() push_constant_loc = ralloc_array(mem_ctx, int, uniforms); for (unsigned u = 0; u < uniforms; u++) push_constant_loc[u] = u; - - /* Now that we know how many regular uniforms we'll push, reduce the - * UBO push ranges so we don't exceed the 3DSTATE_CONSTANT limits. - */ - const unsigned max_push_length = 64; - unsigned push_length = - round_components_to_whole_registers(devinfo, prog_data->nr_params); - for (int i = 0; i < 4; i++) { - struct brw_ubo_range *range = &prog_data->ubo_ranges[i]; - - if (push_length + range->length > max_push_length) - range->length = max_push_length - push_length; - - push_length += range->length; - - assert(push_length % (1 * reg_unit(devinfo)) == 0); - - } - assert(push_length <= max_push_length); } bool