asahi,agx: Select layered rendering outputs
These 2 are together Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
This commit is contained in:
@@ -2893,6 +2893,10 @@ agx_compile_shader_nir(nir_shader *nir, struct agx_shader_key *key,
|
||||
if (nir->info.stage == MESA_SHADER_VERTEX) {
|
||||
out->writes_psiz =
|
||||
nir->info.outputs_written & BITFIELD_BIT(VARYING_SLOT_PSIZ);
|
||||
|
||||
out->writes_layer_viewport =
|
||||
nir->info.outputs_written & (VARYING_BIT_LAYER | VARYING_BIT_VIEWPORT);
|
||||
|
||||
} else if (nir->info.stage == MESA_SHADER_FRAGMENT) {
|
||||
out->disable_tri_merging = nir->info.fs.needs_all_helper_invocations ||
|
||||
nir->info.fs.needs_quad_helper_invocations ||
|
||||
|
@@ -116,6 +116,9 @@ struct agx_shader_info {
|
||||
/* Does the shader write point size? */
|
||||
bool writes_psiz;
|
||||
|
||||
/* Does the shader write layer and/or viewport index? Written together */
|
||||
bool writes_layer_viewport;
|
||||
|
||||
/* Does the shader control the sample mask? */
|
||||
bool writes_sample_mask;
|
||||
|
||||
|
@@ -2848,6 +2848,8 @@ agx_encode_state(struct agx_batch *batch, uint8_t *out, bool is_lines,
|
||||
agx_ppp_push(&ppp, OUTPUT_SELECT, cfg) {
|
||||
cfg.varyings = !!fs->info.varyings.fs.nr_bindings;
|
||||
cfg.point_size = vs->info.writes_psiz;
|
||||
cfg.viewport_target = vs->info.writes_layer_viewport;
|
||||
cfg.render_target = vs->info.writes_layer_viewport;
|
||||
cfg.frag_coord_z = fs->info.varyings.fs.reads_z;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user