Konstantin Lazukin (31675fc7) at 29 Aug 11:58
Cannon reproduce this issue on Ubuntu 21.10 (with default mesa and kernel).
Konstantin Lazukin (a42eabdf) at 24 Mar 12:51
vulkan/cmd_queue: Do not generate unreachable vk_free_* calls.
Only in case of error after successful allocation.
Konstantin Lazukin (03c9b02e) at 24 Mar 11:54
vulkan/cmd_queue: Do not generate unreachable vk_free_* calls.
CID: 1503117 1503118 1503119 1503120 1503121 1503122 1503123 1503124 1503125 1503126 1503127 1503128 1503129 1503130 1503131 1503132 1503133 1503134 1503135 1503136 1503137 1503138 1503139 1503140 1503141 1503142 1503143 1503144 1503145 1503146 1503147 1503148 1503149 1503150 1503151 1503152 1503153 1503154 1503155 1503156 1503157 1503158 1503159 1503160 1503161 1503162 1503163 1503164 1503165 1503166 1503167 1503168 1503169 1503170 1503171 1503172 1503173 1503174 1503175 1503176 1503177 1503178 1503179 1503180 1503181 1503182 1503183 1503184 1503185 1503186 1503187 1503188 1503189 1503190
Signed-off-by: Kostiantyn Lazukin kostiantyn.lazukin@globallogic.com
Reviewed-by: Boris Brezillon boris.brezillon@collabora.com
Konstantin Lazukin (17126df2) at 24 Mar 11:19
vulkan/cmd_queue: Do not generate unreachable vk_free_* calls.
... and 4068 more commits
Konstantin Lazukin (7b78a14f) at 18 Mar 00:22
state_tracker: remove unused program resources (inputs)
Konstantin Lazukin (8692f0d2) at 17 Mar 23:41
state_tracker: remove unused program resources (inputs)
... and 296 more commits
@tpalli what should I do with other commits in this MR?
Konstantin Lazukin (624e3e06) at 10 Mar 11:26
intel/fs: Faster lookup for acp entries during copy propagation
... and 2977 more commits
Konstantin Lazukin (7a596807) at 10 Mar 09:03
state_tracker: remove unused program resources (inputs)
... and 222 more commits
As far as I understand, nir_shrink_vec_array_vars
will remove unused array elements. In this case program interface may be changed. For example if shader has vec4 foo[2]
array and element 0 is unused, it will be removed and array will be converted to vec4 foo[1]
which means that we will foo[0]
in program resource list instead of foo[1]
.
Konstantin Lazukin (97c69968) at 03 Mar 10:18
Test commit
Konstantin Lazukin (618b2865) at 02 Mar 09:19
state_tracker: remove unused program resources (inputs)
... and 108 more commits
I'd love to see an example of where you're going to end up with optimization DCEing an input var post-linking where it couldn't pre-linking. We already do a lot of optimization pre-linking.
The original task was to remove program resources created for unused array elements. In this particular case I need an optimization that converts arrays to separate variable so that each variable can be removed as dead variable later. This optimization happens in st_glsl_to_nir_post_ops
call and that's the reason why I remove unused resources right after this function call in st_link_nir
.
Yeah, but if you trivially remove the dead vars before you create program inputs from vars, then you don't have unused program inputs!
I guess the list of program inputs is constructed before certain optimizations because we will lose some required information about input variables. For example I am sure that it will not work for arrays (at least without modifications).
Konstantin Lazukin (17c9763b) at 28 Feb 13:31
state_tracker: remove unused program resources (inputs)
... and 343 more commits
Konstantin Lazukin (17c9763b) at 28 Feb 13:28
state_tracker: remove unused program resources (inputs)
... and 3127 more commits
Why isn't this unused variable detection happening at
gl_nir_link_glsl()
time when the variables are being created?
I do it as late as possible to make sure that all optimizations that may influence the result are already applied.
Why can't we just add
nir_var_shader_in
to thenir_remove_dead_variables()
there?
This patch is not about removing dead nir variables but removing unused program inputs. Moreover, nir_remove_dead_variables
for nir_var_shader_in
already happens during link process.