vk/gen8: Don't duplicate generic pipeline setup
authorJason Ekstrand <jason.ekstrand@intel.com>
Wed, 26 Aug 2015 01:32:56 +0000 (18:32 -0700)
committerJason Ekstrand <jason.ekstrand@intel.com>
Wed, 26 Aug 2015 01:41:25 +0000 (18:41 -0700)
gen8_graphics_pipeline_create had a bunch of stuff in it that's already set
up by anv_pipeline_init.  The duplication was causing double-initialization
of a state stream and made valgrind very angry.

src/vulkan/anv_pipeline.c
src/vulkan/gen8_pipeline.c

index 39fcd235fa4cfb6f868986c30c1cb39332c241fa..9372fb318df41885638303cad01ad0ae5e29f3bd 100644 (file)
@@ -189,10 +189,11 @@ anv_pipeline_init(struct anv_pipeline *pipeline, struct anv_device *device,
                   const VkGraphicsPipelineCreateInfo *pCreateInfo,
                   const struct anv_graphics_pipeline_create_info *extra)
 {
+   VkResult result;
+
    pipeline->device = device;
    pipeline->layout = anv_pipeline_layout_from_handle(pCreateInfo->layout);
    memset(pipeline->shaders, 0, sizeof(pipeline->shaders));
-   VkResult result;
 
    result = anv_reloc_list_init(&pipeline->batch_relocs, device);
    if (result != VK_SUCCESS) {
index bd179fdc845e0355a27fee3663ae44eea8ae482f..9e87a6951b6a5b2e02e45ef6b08aa9a298c8f829 100644 (file)
@@ -312,38 +312,6 @@ gen8_graphics_pipeline_create(
    if (result != VK_SUCCESS)
       return result;
 
-   pipeline->device = device;
-   pipeline->layout = anv_pipeline_layout_from_handle(pCreateInfo->layout);
-   memset(pipeline->shaders, 0, sizeof(pipeline->shaders));
-
-   result = anv_reloc_list_init(&pipeline->batch_relocs, device);
-   if (result != VK_SUCCESS) {
-      anv_device_free(device, pipeline);
-      return result;
-   }
-   pipeline->batch.next = pipeline->batch.start = pipeline->batch_data;
-   pipeline->batch.end = pipeline->batch.start + sizeof(pipeline->batch_data);
-   pipeline->batch.relocs = &pipeline->batch_relocs;
-
-   anv_state_stream_init(&pipeline->program_stream,
-                         &device->instruction_block_pool);
-
-   for (uint32_t i = 0; i < pCreateInfo->stageCount; i++) {
-      pipeline->shaders[pCreateInfo->pStages[i].stage] =
-         anv_shader_from_handle(pCreateInfo->pStages[i].shader);
-   }
-
-   if (pCreateInfo->pTessellationState)
-      anv_finishme("VK_STRUCTURE_TYPE_PIPELINE_TESSELLATION_STATE_CREATE_INFO");
-   if (pCreateInfo->pViewportState)
-      anv_finishme("VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_STATE_CREATE_INFO");
-   if (pCreateInfo->pMultisampleState)
-      anv_finishme("VK_STRUCTURE_TYPE_PIPELINE_MULTISAMPLE_STATE_CREATE_INFO");
-
-   pipeline->use_repclear = extra && extra->use_repclear;
-
-   anv_compiler_run(device->compiler, pipeline);
-
    /* FIXME: The compiler dead-codes FS inputs when we don't have a VS, so we
     * hard code this to num_attributes - 2. This is because the attributes
     * include VUE header and position, which aren't counted as varying