mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-07 07:08:04 +02:00
pan: Remove dead code for sso_abi builder and fixed_varyings
Now that the SSO ABI is never used we can remove it with all of the plumbing code required to find the fixed varyings bits. Signed-off-by: Lorenzo Rossi <lorenzo.rossi@collabora.com> Acked-by: Eric R. Smith <eric.smith@collabora.com> Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38681>
This commit is contained in:
parent
a06b15f761
commit
7fc6af99ea
3 changed files with 1 additions and 72 deletions
|
|
@ -120,14 +120,9 @@ panfrost_shader_compile(struct panfrost_screen *screen, const nir_shader *ir,
|
||||||
};
|
};
|
||||||
|
|
||||||
/* Lower this early so the backends don't have to worry about it */
|
/* Lower this early so the backends don't have to worry about it */
|
||||||
if (s->info.stage == MESA_SHADER_FRAGMENT) {
|
if (s->info.stage == MESA_SHADER_VERTEX) {
|
||||||
inputs.fixed_varying_mask =
|
|
||||||
pan_get_fixed_varying_mask(s->info.inputs_read);
|
|
||||||
} else if (s->info.stage == MESA_SHADER_VERTEX) {
|
|
||||||
/* No IDVS for internal XFB shaders */
|
/* No IDVS for internal XFB shaders */
|
||||||
inputs.no_idvs = s->info.has_transform_feedback_varyings;
|
inputs.no_idvs = s->info.has_transform_feedback_varyings;
|
||||||
inputs.fixed_varying_mask =
|
|
||||||
pan_get_fixed_varying_mask(s->info.outputs_written);
|
|
||||||
|
|
||||||
if (s->info.has_transform_feedback_varyings) {
|
if (s->info.has_transform_feedback_varyings) {
|
||||||
NIR_PASS(_, s, nir_opt_constant_folding);
|
NIR_PASS(_, s, nir_opt_constant_folding);
|
||||||
|
|
@ -153,8 +148,6 @@ panfrost_shader_compile(struct panfrost_screen *screen, const nir_shader *ir,
|
||||||
if (key->fs.clip_plane_enable) {
|
if (key->fs.clip_plane_enable) {
|
||||||
NIR_PASS(_, s, nir_lower_clip_fs, key->fs.clip_plane_enable,
|
NIR_PASS(_, s, nir_lower_clip_fs, key->fs.clip_plane_enable,
|
||||||
false, true);
|
false, true);
|
||||||
inputs.fixed_varying_mask =
|
|
||||||
pan_get_fixed_varying_mask(s->info.inputs_read);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (key->fs.line_smooth) {
|
if (key->fs.line_smooth) {
|
||||||
|
|
|
||||||
|
|
@ -116,16 +116,6 @@ struct pan_compile_inputs {
|
||||||
/* Mask of UBOs that may be moved to push constants */
|
/* Mask of UBOs that may be moved to push constants */
|
||||||
uint32_t pushable_ubos;
|
uint32_t pushable_ubos;
|
||||||
|
|
||||||
/* Used on Valhall.
|
|
||||||
*
|
|
||||||
* Bit mask of special desktop-only varyings (e.g VARYING_SLOT_TEX0)
|
|
||||||
* written by the previous stage (fragment shader) or written by this
|
|
||||||
* stage (vertex shader). Bits are slots from gl_varying_slot.
|
|
||||||
*
|
|
||||||
* For modern APIs (GLES or VK), this should be 0.
|
|
||||||
*/
|
|
||||||
uint32_t fixed_varying_mask;
|
|
||||||
|
|
||||||
/* Varying layout in memory, if known */
|
/* Varying layout in memory, if known */
|
||||||
const struct pan_varying_layout *varying_layout;
|
const struct pan_varying_layout *varying_layout;
|
||||||
|
|
||||||
|
|
@ -268,13 +258,6 @@ pan_varying_layout_slot_at(const struct pan_varying_layout *layout,
|
||||||
return slot;
|
return slot;
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline uint32_t
|
|
||||||
pan_get_fixed_varying_mask(unsigned varyings_used)
|
|
||||||
{
|
|
||||||
return (varyings_used & BITFIELD_MASK(VARYING_SLOT_VAR0)) &
|
|
||||||
~VARYING_BIT_POS & ~PAN_ATTRIB_VARYING_BITS;
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline void
|
static inline void
|
||||||
pan_varying_layout_require_format(const struct pan_varying_layout *layout)
|
pan_varying_layout_require_format(const struct pan_varying_layout *layout)
|
||||||
{
|
{
|
||||||
|
|
@ -294,16 +277,6 @@ pan_varying_layout_require_layout(const struct pan_varying_layout *layout)
|
||||||
enum pipe_format
|
enum pipe_format
|
||||||
pan_varying_format(nir_alu_type type, unsigned ncomps);
|
pan_varying_format(nir_alu_type type, unsigned ncomps);
|
||||||
|
|
||||||
/** Builds a varying layout according to the SSO ABI we developed for OpenGL.
|
|
||||||
*
|
|
||||||
* This can be called on either shader stage and the two varying layouts are
|
|
||||||
* guaranteed to match if the same fixed_varyings are passed into both.
|
|
||||||
*/
|
|
||||||
void
|
|
||||||
pan_build_varying_layout_sso_abi(struct pan_varying_layout *layout,
|
|
||||||
nir_shader *nir, unsigned gpu_id,
|
|
||||||
uint32_t fixed_varyings);
|
|
||||||
|
|
||||||
void
|
void
|
||||||
pan_build_varying_layout_compact(struct pan_varying_layout *layout,
|
pan_build_varying_layout_compact(struct pan_varying_layout *layout,
|
||||||
nir_shader *nir, unsigned gpu_id);
|
nir_shader *nir, unsigned gpu_id);
|
||||||
|
|
|
||||||
|
|
@ -379,43 +379,6 @@ pan_varying_collect_formats(struct pan_varying_layout *layout, nir_shader *nir,
|
||||||
layout->known |= PAN_VARYING_FORMAT_KNOWN;
|
layout->known |= PAN_VARYING_FORMAT_KNOWN;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
|
||||||
pan_build_varying_layout_sso_abi(struct pan_varying_layout *layout,
|
|
||||||
nir_shader *nir, unsigned gpu_id,
|
|
||||||
uint32_t fixed_varyings)
|
|
||||||
{
|
|
||||||
pan_varying_layout_require_format(layout);
|
|
||||||
|
|
||||||
const unsigned gpu_arch = pan_arch(gpu_id);
|
|
||||||
unsigned generic_size_B = 0;
|
|
||||||
for (unsigned i = 0; i < layout->count; i++) {
|
|
||||||
struct pan_varying_slot *slot = &layout->slots[i];
|
|
||||||
if (pan_varying_slot_is_empty(slot))
|
|
||||||
continue;
|
|
||||||
|
|
||||||
if (slot->section != PAN_VARYING_SECTION_GENERIC) {
|
|
||||||
ASSERTED const struct pan_varying_slot hw_slot =
|
|
||||||
hw_varying_slot(gpu_arch, nir->info.stage, slot->location);
|
|
||||||
|
|
||||||
assert(memcmp(slot, &hw_slot, sizeof(*slot)) == 0);
|
|
||||||
} else {
|
|
||||||
unsigned offset =
|
|
||||||
bi_varying_base_bytes(slot->location, fixed_varyings);
|
|
||||||
assert(offset < (1 << 11));
|
|
||||||
|
|
||||||
const unsigned bit_size = nir_alu_type_get_type_size(slot->alu_type);
|
|
||||||
const unsigned size = slot->ncomps * (bit_size / 8);
|
|
||||||
generic_size_B = MAX2(generic_size_B, offset + size);
|
|
||||||
|
|
||||||
assert(slot->offset == -1);
|
|
||||||
assert(offset < 4096);
|
|
||||||
slot->offset = offset;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
layout->generic_size_B = generic_size_B;
|
|
||||||
layout->known |= PAN_VARYING_LAYOUT_KNOWN;
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
void
|
||||||
pan_build_varying_layout_compact(struct pan_varying_layout *layout,
|
pan_build_varying_layout_compact(struct pan_varying_layout *layout,
|
||||||
nir_shader *nir, unsigned gpu_id)
|
nir_shader *nir, unsigned gpu_id)
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue