mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-24 17:30:12 +01:00
nir/lower_clip: don't set cursor to fix crashes due to removed instructions
The original builder already points at the end of the function impl. Just use that. Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32363>
This commit is contained in:
parent
1a0b4531d1
commit
3e40c2010e
1 changed files with 1 additions and 8 deletions
|
|
@ -161,7 +161,6 @@ static nir_def *
|
|||
find_output(nir_builder *b, unsigned location)
|
||||
{
|
||||
nir_def *comp[4] = {NULL};
|
||||
nir_instr *last_comp = NULL;
|
||||
|
||||
nir_foreach_function_impl(impl, b->shader) {
|
||||
nir_foreach_block(block, impl) {
|
||||
|
|
@ -184,9 +183,7 @@ find_output(nir_builder *b, unsigned location)
|
|||
|
||||
/* Each component should be written only once. */
|
||||
assert(!comp[index]);
|
||||
b->cursor = nir_before_instr(&intr->instr);
|
||||
comp[index] = nir_channel(b, intr->src[0].ssa, i);
|
||||
last_comp = comp[index]->parent_instr;
|
||||
}
|
||||
|
||||
/* Remove it because it's going to be replaced by CLIP_DIST. */
|
||||
|
|
@ -196,11 +193,7 @@ find_output(nir_builder *b, unsigned location)
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!last_comp)
|
||||
return NULL;
|
||||
|
||||
b->cursor = nir_after_instr(last_comp);
|
||||
assert(comp[0] || comp[1] || comp[2] || comp[3]);
|
||||
|
||||
for (unsigned i = 0; i < 4; i++) {
|
||||
if (!comp[i])
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue