mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-01-09 14:50:11 +01:00
asahi: Rename no colour output to tag write disable
Comparison with PowerVR's XML shows that this is the actual name... And it needs to be set a bit more carefully than "no colour output" in order to get correct behaviour for depth-only passes that use sample mask / discard. Fix the name first, the extra conditions will come when they're needed for multisampling. Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22891>
This commit is contained in:
parent
e13f9caa25
commit
87e57eae09
4 changed files with 10 additions and 6 deletions
|
|
@ -2376,7 +2376,8 @@ agx_compile_shader_nir(nir_shader *nir, struct agx_shader_key *key,
|
|||
out->writes_psiz =
|
||||
nir->info.outputs_written & BITFIELD_BIT(VARYING_SLOT_PSIZ);
|
||||
} else if (nir->info.stage == MESA_SHADER_FRAGMENT) {
|
||||
out->no_colour_output = !(nir->info.outputs_written >> FRAG_RESULT_DATA0);
|
||||
out->tag_write_disable =
|
||||
!(nir->info.outputs_written >> FRAG_RESULT_DATA0);
|
||||
out->disable_tri_merging = nir->info.fs.needs_all_helper_invocations ||
|
||||
nir->info.fs.needs_quad_helper_invocations ||
|
||||
nir->info.writes_memory;
|
||||
|
|
|
|||
|
|
@ -100,8 +100,11 @@ struct agx_shader_info {
|
|||
/* Depth layout, never equal to NONE */
|
||||
enum gl_frag_depth_layout depth_layout;
|
||||
|
||||
/* Is colour output omitted? */
|
||||
bool no_colour_output;
|
||||
/* Based only the compiled shader, should tag writes be disabled? This is set
|
||||
* based on what is outputted. Note if rasterizer discard is used, that needs
|
||||
* to disable tag writes regardless of this flag.
|
||||
*/
|
||||
bool tag_write_disable;
|
||||
|
||||
/* Shader is incompatible with triangle merging */
|
||||
bool disable_tri_merging;
|
||||
|
|
|
|||
|
|
@ -439,7 +439,7 @@
|
|||
<field name="Depth bias enable" size="1" start="17" type="bool"/>
|
||||
<field name="Stencil test enable" size="1" start="18" type="bool"/>
|
||||
<field name="Two-sided stencil" size="1" start="19" type="bool"/>
|
||||
<field name="No colour output" size="1" start="21" type="bool"/>
|
||||
<field name="Tag write disable" size="1" start="21" type="bool"/>
|
||||
<field name="Sample mask after depth/stencil" size="1" start="25" type="bool"/>
|
||||
<field name="Disable tri merging" size="1" start="26" type="bool"/>
|
||||
<field name="Pass type" size="3" start="29" type="Pass type"/>
|
||||
|
|
|
|||
|
|
@ -2332,8 +2332,8 @@ agx_encode_state(struct agx_batch *batch, uint8_t *out, bool is_lines,
|
|||
/* This avoids broken derivatives along primitive edges */
|
||||
cfg.disable_tri_merging =
|
||||
(is_lines || is_points || ctx->fs->info.disable_tri_merging);
|
||||
cfg.no_colour_output = ctx->fs->info.no_colour_output ||
|
||||
ctx->rast->base.rasterizer_discard;
|
||||
cfg.tag_write_disable = ctx->fs->info.tag_write_disable ||
|
||||
ctx->rast->base.rasterizer_discard;
|
||||
cfg.pass_type = agx_pass_type_for_shader(&ctx->fs->info);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue