v3dv/pipeline: set load_layer_id to zero

We don't support layered rendering so let's lower the intrinsic to
zero for now. Based on turnip commit 99a4f7c ("turnip: set
load_layer_id to zero")

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6766>
This commit is contained in:
Alejandro Piñeiro
2020-05-09 01:06:12 +02:00
committed by Marge Bot
parent 6e0cec5a13
commit 19d3639ee7

View File

@@ -718,6 +718,14 @@ lower_intrinsic(nir_builder *b, nir_intrinsic_instr *instr,
const struct v3dv_pipeline_layout *layout)
{
switch (instr->intrinsic) {
case nir_intrinsic_load_layer_id:
/* FIXME: if layered rendering gets supported, this would need a real
* lowering
*/
nir_ssa_def_rewrite_uses(&instr->dest.ssa,
nir_src_for_ssa(nir_imm_int(b, 0)));
nir_instr_remove(&instr->instr);
return true;
case nir_intrinsic_load_push_constant:
lower_load_push_constant(b, instr, pipeline);