panfrost: Build explicit varying layout
Signed-off-by: Lorenzo Rossi <lorenzo.rossi@collabora.com> Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com> Acked-by: Eric R. Smith <eric.smith@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38681>
This commit is contained in:
parent
1ea08a05d0
commit
8924ecf474
1 changed files with 12 additions and 9 deletions
|
|
@ -90,14 +90,6 @@ lower_sample_mask_writes(nir_builder *b, nir_intrinsic_instr *intrin,
|
|||
return true;
|
||||
}
|
||||
|
||||
static bool
|
||||
panfrost_use_ld_var_buf(const nir_shader *ir)
|
||||
{
|
||||
const uint64_t allowed = VARYING_BIT_POS | VARYING_BIT_PSIZ |
|
||||
BITFIELD64_MASK(16) << VARYING_SLOT_VAR0;
|
||||
return (ir->info.inputs_read & ~allowed) == 0;
|
||||
}
|
||||
|
||||
static void
|
||||
panfrost_shader_compile(struct panfrost_screen *screen, const nir_shader *ir,
|
||||
struct util_debug_callback *dbg,
|
||||
|
|
@ -212,9 +204,20 @@ panfrost_shader_compile(struct panfrost_screen *screen, const nir_shader *ir,
|
|||
/* nir_opt_varyings is replacing all flat highp types with float32, we need
|
||||
* to figure out the varying types ourselves */
|
||||
inputs.trust_varying_flat_highp_types = false;
|
||||
struct pan_varying_layout varyings_layout;
|
||||
/* TODO: wire up VS layout in FS when linked together */
|
||||
if (s->info.stage == MESA_SHADER_VERTEX) {
|
||||
pan_varying_collect_formats(&varyings_layout, s,
|
||||
inputs.gpu_id,
|
||||
inputs.trust_varying_flat_highp_types, false);
|
||||
pan_build_varying_layout_sso_abi(&varyings_layout, s, inputs.gpu_id,
|
||||
inputs.fixed_varying_mask);
|
||||
inputs.varying_layout = &varyings_layout;
|
||||
}
|
||||
|
||||
if (dev->arch >= 9) {
|
||||
inputs.valhall.use_ld_var_buf = panfrost_use_ld_var_buf(s);
|
||||
inputs.valhall.use_ld_var_buf = inputs.varying_layout &&
|
||||
inputs.varying_layout->generic_size_B <= pan_ld_var_buf_off_size(dev->arch);
|
||||
/* Always enable this for GL, it avoids crashes when using unbound
|
||||
* resources. */
|
||||
inputs.robust_descriptors = true;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue