Commit 3c7fc95f authored by Lucas Stach's avatar Lucas Stach
Browse files

etnaviv: expose shader discard usage in etna_shader_variant



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's avatarLucas Stach <l.stach@pengutronix.de>
Reviewed-by: Christian Gmeiner's avatarChristian Gmeiner <christian.gmeiner@gmail.com>
Part-of: <mesa/mesa!7396>
parent bff60d66
......@@ -127,6 +127,9 @@ struct etna_shader_variant {
/* shader is larger than GPU instruction limit, thus needs icache */
bool needs_icache;
/* shader uses pixel kill/discard */
bool uses_discard;
};
struct etna_varying {
......
......@@ -1058,6 +1058,7 @@ etna_compile_shader_nir(struct etna_shader_variant *v)
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;
......
......@@ -2471,6 +2471,7 @@ etna_compile_shader(struct etna_shader_variant *v)
/* 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;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment