summaryrefslogtreecommitdiffstats
path: root/src/amd/vulkan/radv_meta_decompress.c
diff options
context:
space:
mode:
authorSamuel Pitoiset <[email protected]>2017-12-18 19:38:52 +0100
committerSamuel Pitoiset <[email protected]>2017-12-19 21:22:06 +0100
commit3595a116489d6f3b2f7fd2aa3eeff6376b82beb2 (patch)
tree63fc25857786bbee91979e096e16d053f4c485ba /src/amd/vulkan/radv_meta_decompress.c
parent8b5fe4b2b4cd44021c2acf4880dd7840f99191b0 (diff)
radv: create pipeline layout objects for all meta operations
They are dummy objects but the spec requires layout to not be NULL, this just makes sure we are creating valid pipeline layout objects. This will allow us to remove some useless checks. Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Bas Nieuwenhuizen <[email protected]>
Diffstat (limited to 'src/amd/vulkan/radv_meta_decompress.c')
-rw-r--r--src/amd/vulkan/radv_meta_decompress.c28
1 files changed, 28 insertions, 0 deletions
diff --git a/src/amd/vulkan/radv_meta_decompress.c b/src/amd/vulkan/radv_meta_decompress.c
index b86f3925cf7..7a5681414ff 100644
--- a/src/amd/vulkan/radv_meta_decompress.c
+++ b/src/amd/vulkan/radv_meta_decompress.c
@@ -76,10 +76,28 @@ create_pass(struct radv_device *device,
}
static VkResult
+create_pipeline_layout(struct radv_device *device, VkPipelineLayout *layout)
+{
+ VkPipelineLayoutCreateInfo pl_create_info = {
+ .sType = VK_STRUCTURE_TYPE_PIPELINE_LAYOUT_CREATE_INFO,
+ .setLayoutCount = 0,
+ .pSetLayouts = NULL,
+ .pushConstantRangeCount = 0,
+ .pPushConstantRanges = NULL,
+ };
+
+ return radv_CreatePipelineLayout(radv_device_to_handle(device),
+ &pl_create_info,
+ &device->meta_state.alloc,
+ layout);
+}
+
+static VkResult
create_pipeline(struct radv_device *device,
VkShaderModule vs_module_h,
uint32_t samples,
VkRenderPass pass,
+ VkPipelineLayout layout,
VkPipeline *decompress_pipeline,
VkPipeline *resummarize_pipeline)
{
@@ -165,6 +183,7 @@ create_pipeline(struct radv_device *device,
VK_DYNAMIC_STATE_SCISSOR,
},
},
+ .layout = layout,
.renderPass = pass,
.subpass = 0,
};
@@ -212,6 +231,9 @@ radv_device_finish_meta_depth_decomp_state(struct radv_device *device)
radv_DestroyRenderPass(radv_device_to_handle(device),
state->depth_decomp[i].pass,
&state->alloc);
+ radv_DestroyPipelineLayout(radv_device_to_handle(device),
+ state->depth_decomp[i].p_layout,
+ &state->alloc);
radv_DestroyPipeline(radv_device_to_handle(device),
state->depth_decomp[i].decompress_pipeline,
&state->alloc);
@@ -243,8 +265,14 @@ radv_device_init_meta_depth_decomp_state(struct radv_device *device)
if (res != VK_SUCCESS)
goto fail;
+ res = create_pipeline_layout(device,
+ &state->depth_decomp[i].p_layout);
+ if (res != VK_SUCCESS)
+ goto fail;
+
res = create_pipeline(device, vs_module_h, samples,
state->depth_decomp[i].pass,
+ state->depth_decomp[i].p_layout,
&state->depth_decomp[i].decompress_pipeline,
&state->depth_decomp[i].resummarize_pipeline);
if (res != VK_SUCCESS)