anv/pipeline: Call anv_pipeline_compile_* in a loop
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
This commit is contained in:
@@ -1421,35 +1421,39 @@ anv_pipeline_init(struct anv_pipeline *pipeline,
|
|||||||
anv_pipeline_add_compiled_stage(pipeline, s, bin);
|
anv_pipeline_add_compiled_stage(pipeline, s, bin);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (stages[MESA_SHADER_VERTEX].entrypoint &&
|
for (unsigned s = 0; s < MESA_SHADER_STAGES; s++) {
|
||||||
!pipeline->shaders[MESA_SHADER_VERTEX]) {
|
if (!stages[s].entrypoint)
|
||||||
result = anv_pipeline_compile_vs(pipeline, cache, pCreateInfo,
|
continue;
|
||||||
&stages[MESA_SHADER_VERTEX]);
|
|
||||||
if (result != VK_SUCCESS)
|
|
||||||
goto compile_fail;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (stages[MESA_SHADER_TESS_EVAL].entrypoint &&
|
assert(stages[s].stage == s);
|
||||||
!pipeline->shaders[MESA_SHADER_TESS_EVAL]) {
|
|
||||||
result = anv_pipeline_compile_tcs_tes(pipeline, cache, pCreateInfo,
|
|
||||||
&stages[MESA_SHADER_TESS_CTRL],
|
|
||||||
&stages[MESA_SHADER_TESS_EVAL]);
|
|
||||||
if (result != VK_SUCCESS)
|
|
||||||
goto compile_fail;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (stages[MESA_SHADER_GEOMETRY].entrypoint &&
|
if (pipeline->shaders[s])
|
||||||
!pipeline->shaders[MESA_SHADER_GEOMETRY]) {
|
continue;
|
||||||
result = anv_pipeline_compile_gs(pipeline, cache, pCreateInfo,
|
|
||||||
&stages[MESA_SHADER_GEOMETRY]);
|
|
||||||
if (result != VK_SUCCESS)
|
|
||||||
goto compile_fail;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (stages[MESA_SHADER_FRAGMENT].entrypoint &&
|
switch (s) {
|
||||||
!pipeline->shaders[MESA_SHADER_FRAGMENT]) {
|
case MESA_SHADER_VERTEX:
|
||||||
result = anv_pipeline_compile_fs(pipeline, cache, pCreateInfo,
|
result = anv_pipeline_compile_vs(pipeline, cache, pCreateInfo,
|
||||||
&stages[MESA_SHADER_FRAGMENT]);
|
&stages[s]);
|
||||||
|
break;
|
||||||
|
case MESA_SHADER_TESS_CTRL:
|
||||||
|
/* Handled with TESS_EVAL */
|
||||||
|
break;
|
||||||
|
case MESA_SHADER_TESS_EVAL:
|
||||||
|
result = anv_pipeline_compile_tcs_tes(pipeline, cache, pCreateInfo,
|
||||||
|
&stages[MESA_SHADER_TESS_CTRL],
|
||||||
|
&stages[MESA_SHADER_TESS_EVAL]);
|
||||||
|
break;
|
||||||
|
case MESA_SHADER_GEOMETRY:
|
||||||
|
result = anv_pipeline_compile_gs(pipeline, cache, pCreateInfo,
|
||||||
|
&stages[s]);
|
||||||
|
break;
|
||||||
|
case MESA_SHADER_FRAGMENT:
|
||||||
|
result = anv_pipeline_compile_fs(pipeline, cache, pCreateInfo,
|
||||||
|
&stages[s]);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
unreachable("Invalid graphics shader stage");
|
||||||
|
}
|
||||||
if (result != VK_SUCCESS)
|
if (result != VK_SUCCESS)
|
||||||
goto compile_fail;
|
goto compile_fail;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user