radv: update VK_KHR_depth_stencil_resolve for Vulkan 1.2
authorSamuel Pitoiset <samuel.pitoiset@gmail.com>
Tue, 15 Oct 2019 07:20:48 +0000 (09:20 +0200)
committerJason Ekstrand <jason@jlekstrand.net>
Wed, 15 Jan 2020 14:42:25 +0000 (08:42 -0600)
Promoted to Vulkan 1.2 with the KHR suffix omitted.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
src/amd/vulkan/radv_device.c
src/amd/vulkan/radv_meta_resolve_cs.c
src/amd/vulkan/radv_meta_resolve_fs.c
src/amd/vulkan/radv_pass.c
src/amd/vulkan/radv_private.h

index 57b26727a780b98df63f796b58b39256541d4354..566db7d7cdca8088563d4bd092e52a4cfef56053 100644 (file)
@@ -1615,9 +1615,9 @@ void radv_GetPhysicalDeviceProperties2(
                        properties->variableSampleLocations = false;
                        break;
                }
-               case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEPTH_STENCIL_RESOLVE_PROPERTIES_KHR: {
-                       VkPhysicalDeviceDepthStencilResolvePropertiesKHR *properties =
-                               (VkPhysicalDeviceDepthStencilResolvePropertiesKHR *)ext;
+               case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEPTH_STENCIL_RESOLVE_PROPERTIES: {
+                       VkPhysicalDeviceDepthStencilResolveProperties *properties =
+                               (VkPhysicalDeviceDepthStencilResolveProperties *)ext;
 
                        /* We support all of the depth resolve modes */
                        properties->supportedDepthResolveModes =
index f1b38d3ffc8b5d4b2c429b0a4def56bc827d80da..c40c61929d2915fbc80329a7881f888130c774ee 100644 (file)
@@ -146,7 +146,7 @@ enum {
 };
 
 static const char *
-get_resolve_mode_str(VkResolveModeFlagBitsKHR resolve_mode)
+get_resolve_mode_str(VkResolveModeFlagBits resolve_mode)
 {
        switch (resolve_mode) {
        case VK_RESOLVE_MODE_SAMPLE_ZERO_BIT_KHR:
@@ -165,7 +165,7 @@ get_resolve_mode_str(VkResolveModeFlagBitsKHR resolve_mode)
 static nir_shader *
 build_depth_stencil_resolve_compute_shader(struct radv_device *dev, int samples,
                                           int index,
-                                          VkResolveModeFlagBitsKHR resolve_mode)
+                                          VkResolveModeFlagBits resolve_mode)
 {
        nir_builder b;
        char name[64];
@@ -413,7 +413,7 @@ static VkResult
 create_depth_stencil_resolve_pipeline(struct radv_device *device,
                                      int samples,
                                      int index,
-                                     VkResolveModeFlagBitsKHR resolve_mode,
+                                     VkResolveModeFlagBits resolve_mode,
                                      VkPipeline *pipeline)
 {
        VkResult result;
@@ -707,7 +707,7 @@ emit_depth_stencil_resolve(struct radv_cmd_buffer *cmd_buffer,
                           const VkOffset2D *dest_offset,
                           const VkExtent2D *resolve_extent,
                           VkImageAspectFlags aspects,
-                          VkResolveModeFlagBitsKHR resolve_mode)
+                          VkResolveModeFlagBits resolve_mode)
 {
        struct radv_device *device = cmd_buffer->device;
        const uint32_t samples = src_iview->image->info.samples;
@@ -961,7 +961,7 @@ radv_cmd_buffer_resolve_subpass_cs(struct radv_cmd_buffer *cmd_buffer)
 void
 radv_depth_stencil_resolve_subpass_cs(struct radv_cmd_buffer *cmd_buffer,
                                      VkImageAspectFlags aspects,
-                                     VkResolveModeFlagBitsKHR resolve_mode)
+                                     VkResolveModeFlagBits resolve_mode)
 {
        struct radv_framebuffer *fb = cmd_buffer->state.framebuffer;
        const struct radv_subpass *subpass = cmd_buffer->state.subpass;
index 2fb3297c899db987b982f10cea69369988146731..35a04c24a9b25c6c4a80d442f565308d9a87b478 100644 (file)
@@ -318,7 +318,7 @@ enum {
 };
 
 static const char *
-get_resolve_mode_str(VkResolveModeFlagBitsKHR resolve_mode)
+get_resolve_mode_str(VkResolveModeFlagBits resolve_mode)
 {
        switch (resolve_mode) {
        case VK_RESOLVE_MODE_SAMPLE_ZERO_BIT_KHR:
@@ -337,7 +337,7 @@ get_resolve_mode_str(VkResolveModeFlagBitsKHR resolve_mode)
 static nir_shader *
 build_depth_stencil_resolve_fragment_shader(struct radv_device *dev, int samples,
                                            int index,
-                                           VkResolveModeFlagBitsKHR resolve_mode)
+                                           VkResolveModeFlagBits resolve_mode)
 {
        nir_builder b;
        char name[64];
@@ -454,7 +454,7 @@ static VkResult
 create_depth_stencil_resolve_pipeline(struct radv_device *device,
                                      int samples_log2,
                                      int index,
-                                     VkResolveModeFlagBitsKHR resolve_mode)
+                                     VkResolveModeFlagBits resolve_mode)
 {
        VkRenderPass *render_pass;
        VkPipeline *pipeline;
@@ -885,7 +885,7 @@ emit_depth_stencil_resolve(struct radv_cmd_buffer *cmd_buffer,
                           const VkOffset2D *dst_offset,
                           const VkExtent2D *resolve_extent,
                           VkImageAspectFlags aspects,
-                          VkResolveModeFlagBitsKHR resolve_mode)
+                          VkResolveModeFlagBits resolve_mode)
 {
        struct radv_device *device = cmd_buffer->device;
        const uint32_t samples = src_iview->image->info.samples;
@@ -1181,7 +1181,7 @@ radv_cmd_buffer_resolve_subpass_fs(struct radv_cmd_buffer *cmd_buffer)
 void
 radv_depth_stencil_resolve_subpass_fs(struct radv_cmd_buffer *cmd_buffer,
                                      VkImageAspectFlags aspects,
-                                     VkResolveModeFlagBitsKHR resolve_mode)
+                                     VkResolveModeFlagBits resolve_mode)
 {
        struct radv_framebuffer *fb = cmd_buffer->state.framebuffer;
        const struct radv_subpass *subpass = cmd_buffer->state.subpass;
index 77964a00bb84c6c53d32e73650ee2672d937a084..4c3cab6855f0849df0a08445e470168dcf0f40ca 100644 (file)
@@ -338,9 +338,9 @@ VkResult radv_CreateRenderPass(
 static unsigned
 radv_num_subpass_attachments2(const VkSubpassDescription2 *desc)
 {
-       const VkSubpassDescriptionDepthStencilResolveKHR *ds_resolve =
+       const VkSubpassDescriptionDepthStencilResolve *ds_resolve =
                vk_find_struct_const(desc->pNext,
-                                    SUBPASS_DESCRIPTION_DEPTH_STENCIL_RESOLVE_KHR);
+                                    SUBPASS_DESCRIPTION_DEPTH_STENCIL_RESOLVE);
 
        return desc->inputAttachmentCount +
               desc->colorAttachmentCount +
@@ -487,9 +487,9 @@ VkResult radv_CreateRenderPass2(
                        };
                }
 
-               const VkSubpassDescriptionDepthStencilResolveKHR *ds_resolve =
+               const VkSubpassDescriptionDepthStencilResolve *ds_resolve =
                        vk_find_struct_const(desc->pNext,
-                                            SUBPASS_DESCRIPTION_DEPTH_STENCIL_RESOLVE_KHR);
+                                            SUBPASS_DESCRIPTION_DEPTH_STENCIL_RESOLVE);
 
                if (ds_resolve && ds_resolve->pDepthStencilResolveAttachment) {
                        subpass->ds_resolve_attachment = p++;
index 082a8451cc0b06656262e9ebd85941d98da0f34d..03e91cbb0e744a8221561a47db7bc122688903c7 100644 (file)
@@ -1422,11 +1422,11 @@ void radv_cmd_buffer_resolve_subpass(struct radv_cmd_buffer *cmd_buffer);
 void radv_cmd_buffer_resolve_subpass_cs(struct radv_cmd_buffer *cmd_buffer);
 void radv_depth_stencil_resolve_subpass_cs(struct radv_cmd_buffer *cmd_buffer,
                                           VkImageAspectFlags aspects,
-                                          VkResolveModeFlagBitsKHR resolve_mode);
+                                          VkResolveModeFlagBits resolve_mode);
 void radv_cmd_buffer_resolve_subpass_fs(struct radv_cmd_buffer *cmd_buffer);
 void radv_depth_stencil_resolve_subpass_fs(struct radv_cmd_buffer *cmd_buffer,
                                           VkImageAspectFlags aspects,
-                                          VkResolveModeFlagBitsKHR resolve_mode);
+                                          VkResolveModeFlagBits resolve_mode);
 void radv_emit_default_sample_locations(struct radeon_cmdbuf *cs, int nr_samples);
 unsigned radv_get_default_max_sample_dist(int log_samples);
 void radv_device_init_msaa(struct radv_device *device);
@@ -2155,8 +2155,8 @@ struct radv_subpass {
        struct radv_subpass_attachment *             resolve_attachments;
        struct radv_subpass_attachment *             depth_stencil_attachment;
        struct radv_subpass_attachment *             ds_resolve_attachment;
-       VkResolveModeFlagBitsKHR                     depth_resolve_mode;
-       VkResolveModeFlagBitsKHR                     stencil_resolve_mode;
+       VkResolveModeFlagBits                        depth_resolve_mode;
+       VkResolveModeFlagBits                        stencil_resolve_mode;
 
        /** Subpass has at least one color resolve attachment */
        bool                                         has_color_resolve;