These 2 are together
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
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 ||
/* 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;
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;
}
}