anv: Process FS last when compiling graphics pipeline

Enum values for MESA_SHADER_TASK and MESA_SHADER_MESH are larger than
MESA_SHADER_FRAGMENT, so can't rely on the them for ordering anymore.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13637>
This commit is contained in:
Caio Marcelo de Oliveira Filho
2021-05-18 11:34:59 -07:00
committed by Marge Bot
parent a0109a3754
commit 71022a53e4
+20 -4
View File
@@ -1576,7 +1576,20 @@ anv_pipeline_compile_graphics(struct anv_graphics_pipeline *pipeline,
void *pipeline_ctx = ralloc_context(NULL);
for (unsigned s = 0; s < ARRAY_SIZE(pipeline->shaders); s++) {
const gl_shader_stage shader_order[] = {
MESA_SHADER_VERTEX,
MESA_SHADER_TESS_CTRL,
MESA_SHADER_TESS_EVAL,
MESA_SHADER_GEOMETRY,
MESA_SHADER_TASK,
MESA_SHADER_MESH,
MESA_SHADER_FRAGMENT,
};
for (unsigned i = 0; i < ARRAY_SIZE(shader_order); i++) {
gl_shader_stage s = shader_order[i];
if (!stages[s].entrypoint)
continue;
@@ -1621,7 +1634,8 @@ anv_pipeline_compile_graphics(struct anv_graphics_pipeline *pipeline,
/* Walk backwards to link */
struct anv_pipeline_stage *next_stage = NULL;
for (int s = ARRAY_SIZE(pipeline->shaders) - 1; s >= 0; s--) {
for (int i = ARRAY_SIZE(shader_order) - 1; i >= 0; i--) {
gl_shader_stage s = shader_order[i];
if (!stages[s].entrypoint)
continue;
@@ -1666,7 +1680,8 @@ anv_pipeline_compile_graphics(struct anv_graphics_pipeline *pipeline,
}
struct anv_pipeline_stage *prev_stage = NULL;
for (unsigned s = 0; s < ARRAY_SIZE(pipeline->shaders); s++) {
for (unsigned i = 0; i < ARRAY_SIZE(shader_order); i++) {
gl_shader_stage s = shader_order[i];
if (!stages[s].entrypoint)
continue;
@@ -1693,7 +1708,8 @@ anv_pipeline_compile_graphics(struct anv_graphics_pipeline *pipeline,
}
prev_stage = NULL;
for (unsigned s = 0; s < MESA_SHADER_STAGES; s++) {
for (unsigned i = 0; i < ARRAY_SIZE(shader_order); i++) {
gl_shader_stage s = shader_order[i];
if (!stages[s].entrypoint)
continue;