mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-22 15:40:11 +01:00
mesa/st: handle adding pointsize when gl_Position is never written
Reviewed-by: Marek Olšák <marek.olsak@amd.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15821>
This commit is contained in:
parent
9c212e117d
commit
ee29db0270
1 changed files with 7 additions and 0 deletions
|
|
@ -265,6 +265,7 @@ st_nir_add_point_size(nir_shader *nir)
|
||||||
nir_builder b;
|
nir_builder b;
|
||||||
nir_function_impl *impl = nir_shader_get_entrypoint(nir);
|
nir_function_impl *impl = nir_shader_get_entrypoint(nir);
|
||||||
nir_builder_init(&b, impl);
|
nir_builder_init(&b, impl);
|
||||||
|
bool found = false;
|
||||||
nir_foreach_block_safe(block, impl) {
|
nir_foreach_block_safe(block, impl) {
|
||||||
nir_foreach_instr_safe(instr, block) {
|
nir_foreach_instr_safe(instr, block) {
|
||||||
if (instr->type == nir_instr_type_intrinsic) {
|
if (instr->type == nir_instr_type_intrinsic) {
|
||||||
|
|
@ -276,11 +277,17 @@ st_nir_add_point_size(nir_shader *nir)
|
||||||
b.cursor = nir_after_instr(instr);
|
b.cursor = nir_after_instr(instr);
|
||||||
nir_deref_instr *deref = nir_build_deref_var(&b, psiz);
|
nir_deref_instr *deref = nir_build_deref_var(&b, psiz);
|
||||||
nir_store_deref(&b, deref, nir_imm_float(&b, 1.0), BITFIELD_BIT(0));
|
nir_store_deref(&b, deref, nir_imm_float(&b, 1.0), BITFIELD_BIT(0));
|
||||||
|
found = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (!found) {
|
||||||
|
b.cursor = nir_before_cf_list(&impl->body);
|
||||||
|
nir_deref_instr *deref = nir_build_deref_var(&b, psiz);
|
||||||
|
nir_store_deref(&b, deref, nir_imm_float(&b, 1.0), BITFIELD_BIT(0));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue