anv: Use a separate field in the pipeline for compute shader
[mesa.git] / src / intel / vulkan / genX_pipeline.c
index c5c5e73874ec8128a8707837872411d8117cb76b..95fabdaf158264d6a0c8a6cf4c833a12dc0612ac 100644 (file)
@@ -2251,12 +2251,9 @@ compute_pipeline_create(
 
    pipeline->mem_ctx = ralloc_context(NULL);
    pipeline->flags = pCreateInfo->flags;
+   pipeline->cs = NULL;
 
-   /* When we free the pipeline, we detect stages based on the NULL status
-    * of various prog_data pointers.  Make them NULL by default.
-    */
-   memset(pipeline->shaders, 0, sizeof(pipeline->shaders));
-   pipeline->num_executables = 0;
+   util_dynarray_init(&pipeline->executables, pipeline->mem_ctx);
 
    assert(pCreateInfo->stage.stage == VK_SHADER_STAGE_COMPUTE_BIT);
    pipeline->active_stages |= VK_SHADER_STAGE_COMPUTE_BIT;
@@ -2289,8 +2286,7 @@ compute_pipeline_create(
 
    const uint32_t subslices = MAX2(device->physical->subslice_total, 1);
 
-   const struct anv_shader_bin *cs_bin =
-      pipeline->shaders[MESA_SHADER_COMPUTE];
+   const struct anv_shader_bin *cs_bin = pipeline->cs;
 
    anv_batch_emit(&pipeline->batch, GENX(MEDIA_VFE_STATE), vfe) {
 #if GEN_GEN > 7