The information about a shader using discard/kill is interesting
to other parts of the driver, as depth states need to programmed
differently depending on this. As we don't want to deal with
NIR/TGSI differences in other parts of the driver, track this
usage in the common etna_shader_variant.
Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7396>
/* shader is larger than GPU instruction limit, thus needs icache */
bool needs_icache;
+
+ /* shader uses pixel kill/discard */
+ bool uses_discard;
};
struct etna_varying {
const struct etna_specs *specs = c->specs;
v->stage = s->info.stage;
+ v->uses_discard = s->info.fs.uses_discard;
v->num_loops = 0; /* TODO */
v->vs_id_in_reg = -1;
v->vs_pos_out_reg = -1;
/* fill in output structure */
v->stage = c->info.processor == PIPE_SHADER_FRAGMENT ? MESA_SHADER_FRAGMENT : MESA_SHADER_VERTEX;
+ v->uses_discard = c->info.uses_kill;
v->code_size = c->inst_ptr * 4;
v->code = mem_dup(c->code, c->inst_ptr * 16);
v->num_loops = c->num_loops;