radv: allow to set dynamic sample locations to the depth decompress pass
authorSamuel Pitoiset <samuel.pitoiset@gmail.com>
Thu, 30 May 2019 09:52:56 +0000 (11:52 +0200)
committerSamuel Pitoiset <samuel.pitoiset@gmail.com>
Fri, 7 Jun 2019 11:10:55 +0000 (13:10 +0200)
If VK_EXT_sample_locations is used, the driver might need to emit
the sample locations specified during layout transitions.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-By: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
src/amd/vulkan/radv_meta_decompress.c

index fe8e114e91bf92eb3ea05860770a4a1cac0c7073..c51beb0c32d308a6ae7a10853a0bcb25cee4fc59 100644 (file)
@@ -126,6 +126,11 @@ create_pipeline(struct radv_device *device,
                goto cleanup;
        }
 
+       const VkPipelineSampleLocationsStateCreateInfoEXT sample_locs_create_info = {
+               .sType = VK_STRUCTURE_TYPE_PIPELINE_SAMPLE_LOCATIONS_STATE_CREATE_INFO_EXT,
+               .sampleLocationsEnable = false,
+       };
+
        const VkGraphicsPipelineCreateInfo pipeline_create_info = {
                .sType = VK_STRUCTURE_TYPE_GRAPHICS_PIPELINE_CREATE_INFO,
                .stageCount = 2,
@@ -168,6 +173,7 @@ create_pipeline(struct radv_device *device,
                },
                .pMultisampleState = &(VkPipelineMultisampleStateCreateInfo) {
                        .sType = VK_STRUCTURE_TYPE_PIPELINE_MULTISAMPLE_STATE_CREATE_INFO,
+                       .pNext = &sample_locs_create_info,
                        .rasterizationSamples = samples,
                        .sampleShadingEnable = false,
                        .pSampleMask = NULL,
@@ -189,10 +195,11 @@ create_pipeline(struct radv_device *device,
                },
                .pDynamicState = &(VkPipelineDynamicStateCreateInfo) {
                        .sType = VK_STRUCTURE_TYPE_PIPELINE_DYNAMIC_STATE_CREATE_INFO,
-                       .dynamicStateCount = 2,
+                       .dynamicStateCount = 3,
                        .pDynamicStates = (VkDynamicState[]) {
                                VK_DYNAMIC_STATE_VIEWPORT,
                                VK_DYNAMIC_STATE_SCISSOR,
+                               VK_DYNAMIC_STATE_SAMPLE_LOCATIONS_EXT,
                        },
                },
                .layout = layout,