mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-06 11:38:05 +02:00
nir/opt_varyings: link interpolation qualifiers
Some hardware (AGX, Imagination, Arm) really want to know the interpolation qualifiers when compiling the vertex shader. Even though we need to handle this dynamic for separate shaders, we can improve performance by linking. nir_opt_varyings already has all the information to do this, so just do so. Note this has to be done in common code for Gallium, which links varyings within the GLSL linker but then presents the linked programs as separate shader objects. This models that nicely, allowing Gallium drivers to optimize without weird sidebands. Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io> Reviewed-by: Marek Olšák <maraeo@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36501>
This commit is contained in:
parent
66740d9c91
commit
e8ff9eb9cb
1 changed files with 12 additions and 0 deletions
|
|
@ -5565,4 +5565,16 @@ nir_opt_varyings_bulk(nir_shader **shaders, uint32_t num_shaders, bool spirv,
|
|||
if (nir->xfb_info)
|
||||
nir_gather_xfb_info_from_intrinsics(nir);
|
||||
}
|
||||
|
||||
/* Now that we've picked slots, link interpolation qualifiers. */
|
||||
nir_shader *fs = shaders[num_shaders - 1];
|
||||
if (fs->info.stage == MESA_SHADER_FRAGMENT) {
|
||||
nir_shader *producer = shaders[num_shaders - 2];
|
||||
|
||||
producer->info.known_interpolation_qualifiers =
|
||||
fs->info.known_interpolation_qualifiers;
|
||||
|
||||
producer->info.linear_varyings = fs->info.linear_varyings;
|
||||
producer->info.perspective_varyings = fs->info.perspective_varyings;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue