diff --git a/.pick_status.json b/.pick_status.json index 49073cda8ed..1ab54e97a2d 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -1147,7 +1147,7 @@ "description": "anv: Remove FS executables when applying the null FS optimization", "nominated": true, "nomination_type": 1, - "resolution": 0, + "resolution": 1, "main_sha": null, "because_sha": "73b3efcd59ade6b9dc8c4cce994d7fbe5c1f0cac" }, diff --git a/src/intel/vulkan/anv_pipeline.c b/src/intel/vulkan/anv_pipeline.c index 51fc1c774aa..95bc1fe3c54 100644 --- a/src/intel/vulkan/anv_pipeline.c +++ b/src/intel/vulkan/anv_pipeline.c @@ -1868,6 +1868,25 @@ done: anv_shader_bin_unref(pipeline->base.device, fs); pipeline->shaders[MESA_SHADER_FRAGMENT] = NULL; pipeline->active_stages &= ~VK_SHADER_STAGE_FRAGMENT_BIT; + + /* The per-SIMD size fragment shaders should be last in the + * executables array. Remove all of them. + */ + ASSERTED unsigned removed = 0; + + util_dynarray_foreach_reverse(&pipeline->base.executables, + struct anv_pipeline_executable, + tail) { + /* There must be at least one fragment shader. */ + assert(removed > 0 || tail->stage == MESA_SHADER_FRAGMENT); + + if (tail->stage != MESA_SHADER_FRAGMENT) + break; + + (void) util_dynarray_pop(&pipeline->base.executables, + struct anv_pipeline_executable); + removed++; + } } }