radv: Add extra struct to image view creation.
authorBas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Sun, 4 Aug 2019 23:07:04 +0000 (01:07 +0200)
committerBas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Wed, 7 Aug 2019 00:13:07 +0000 (02:13 +0200)
For extra args. Unlike image creation, I'm not embedding the vk
struct in there, so all the inline structs can be kept.

Reviewed-by: Dave Airlie <airlied@redhat.com>
12 files changed:
src/amd/vulkan/radv_image.c
src/amd/vulkan/radv_meta_blit.c
src/amd/vulkan/radv_meta_blit2d.c
src/amd/vulkan/radv_meta_bufimage.c
src/amd/vulkan/radv_meta_clear.c
src/amd/vulkan/radv_meta_decompress.c
src/amd/vulkan/radv_meta_fast_clear.c
src/amd/vulkan/radv_meta_fmask_expand.c
src/amd/vulkan/radv_meta_resolve.c
src/amd/vulkan/radv_meta_resolve_cs.c
src/amd/vulkan/radv_meta_resolve_fs.c
src/amd/vulkan/radv_private.h

index 0c34e2961548263d598aa0370afb198f9a5980f3..8654e7f382cb929aa5ab296302715c519402d6b4 100644 (file)
@@ -1488,7 +1488,8 @@ radv_get_aspect_format(struct radv_image *image, VkImageAspectFlags mask)
 void
 radv_image_view_init(struct radv_image_view *iview,
                     struct radv_device *device,
-                    const VkImageViewCreateInfo* pCreateInfo)
+                    const VkImageViewCreateInfo* pCreateInfo,
+                    const struct radv_image_view_extra_create_info* extra_create_info)
 {
        RADV_FROM_HANDLE(radv_image, image, pCreateInfo->image);
        const VkImageSubresourceRange *range = &pCreateInfo->subresourceRange;
@@ -1766,7 +1767,7 @@ radv_CreateImageView(VkDevice _device,
        if (view == NULL)
                return vk_error(device->instance, VK_ERROR_OUT_OF_HOST_MEMORY);
 
-       radv_image_view_init(view, device, pCreateInfo);
+       radv_image_view_init(view, device, pCreateInfo, NULL);
 
        *pView = radv_image_view_to_handle(view);
 
index eb131e68fd12719d6399123781fcd1969bc23215..16c5b93c093bb96883896116c2c1de017de77c5b 100644 (file)
@@ -660,7 +660,7 @@ void radv_CmdBlitImage(
                                                             .baseArrayLayer = dest_array_slice,
                                                             .layerCount = 1
                                                     },
-                                            });
+                                            }, NULL);
                        radv_image_view_init(&src_iview, cmd_buffer->device,
                                             &(VkImageViewCreateInfo) {
                                                .sType = VK_STRUCTURE_TYPE_IMAGE_VIEW_CREATE_INFO,
@@ -674,7 +674,7 @@ void radv_CmdBlitImage(
                                                        .baseArrayLayer = src_array_slice,
                                                        .layerCount = 1
                                                },
-                                       });
+                                       }, NULL);
                        meta_emit_blit(cmd_buffer,
                                       src_image, &src_iview, srcImageLayout,
                                       src_offset_0, src_offset_1,
index 8142faef5f80bcb002c644a39de233588e0d4768..de3d5791611e5b567a98f00ed402a3c1b50eb98b 100644 (file)
@@ -79,7 +79,7 @@ create_iview(struct radv_cmd_buffer *cmd_buffer,
                                             .baseArrayLayer = surf->layer,
                                             .layerCount = 1
                                     },
-                            });
+                            }, NULL);
 }
 
 static void
index a2a62798c339bf12f4855b3d365080c55146e263..89bb8535b098e2f0e6fa096ef8b2bcb921a00c4f 100644 (file)
@@ -1552,7 +1552,7 @@ create_iview(struct radv_cmd_buffer *cmd_buffer,
                                             .baseArrayLayer = surf->layer,
                                             .layerCount = 1
                                     },
-                            });
+                            }, NULL);
 }
 
 static void
index 6003fa515035bad64602a89b3734eeaa703b1ba6..2b47570b213488f9c6deb88641ef2946f95ef3be 100644 (file)
@@ -1896,7 +1896,7 @@ radv_clear_image_layer(struct radv_cmd_buffer *cmd_buffer,
                                             .baseArrayLayer = range->baseArrayLayer + layer,
                                             .layerCount = 1
                                     },
-                            });
+                            }, NULL);
 
        VkFramebuffer fb;
        radv_CreateFramebuffer(device_h,
@@ -2026,7 +2026,7 @@ radv_fast_clear_range(struct radv_cmd_buffer *cmd_buffer,
                                        .baseArrayLayer = range->baseArrayLayer,
                                        .layerCount = range->layerCount,
                                   },
-                            });
+                            }, NULL);
 
        VkClearRect clear_rect = {
                .rect = {
index fa5de24314a9ab086566d3602da2b75cd62f925c..027ab299c150bbfca1fbc3a23ce409c657642390 100644 (file)
@@ -433,7 +433,7 @@ static void radv_process_depth_image_inplace(struct radv_cmd_buffer *cmd_buffer,
                                                     .baseArrayLayer = subresourceRange->baseArrayLayer + layer,
                                                     .layerCount = 1,
                                             },
-                                    });
+                                    }, NULL);
 
 
                VkFramebuffer fb_h;
index d601686f8f6a21360a1bbc2f6f044a2c70885162..6aaa85e5834de3b77bcf68d0e7861842fe63366d 100644 (file)
@@ -590,7 +590,7 @@ radv_process_color_image_layer(struct radv_cmd_buffer *cmd_buffer,
                                        .baseArrayLayer = range->baseArrayLayer + layer,
                                        .layerCount = 1,
                                 },
-                             });
+                             }, NULL);
 
        VkFramebuffer fb_h;
        radv_CreateFramebuffer(radv_device_to_handle(device),
@@ -832,7 +832,7 @@ radv_decompress_dcc_compute(struct radv_cmd_buffer *cmd_buffer,
                                                                .baseArrayLayer = subresourceRange->baseArrayLayer + s,
                                                                .layerCount = 1
                                                             },
-                                            });
+                                            }, NULL);
 
                        radv_meta_push_descriptor_set(cmd_buffer,
                                                      VK_PIPELINE_BIND_POINT_COMPUTE,
index 7f3cbb2a6a6e246bbd718a390b7c542ea5d02583..a8dd4cf6966bcae9452756ae620e1d2f14517595 100644 (file)
@@ -139,7 +139,7 @@ radv_expand_fmask_image_inplace(struct radv_cmd_buffer *cmd_buffer,
                                                     .baseArrayLayer = subresourceRange->baseArrayLayer + l,
                                                     .layerCount = 1,
                                             },
-                                    });
+                                    }, NULL);
 
                radv_meta_push_descriptor_set(cmd_buffer,
                                              VK_PIPELINE_BIND_POINT_COMPUTE,
index 063c48c8f1bbadf9565c3bb52ebe697625b52fed..dc5c2c65ecde949e331d590a8530e35a98102a37 100644 (file)
@@ -551,7 +551,7 @@ void radv_CmdResolveImage(
                                                             .baseArrayLayer = src_base_layer + layer,
                                                             .layerCount = 1,
                                                     },
-                                            });
+                                            }, NULL);
 
                        struct radv_image_view dest_iview;
                        radv_image_view_init(&dest_iview, cmd_buffer->device,
@@ -567,7 +567,7 @@ void radv_CmdResolveImage(
                                                             .baseArrayLayer = dest_base_layer + layer,
                                                             .layerCount = 1,
                                                     },
-                                             });
+                                             }, NULL);
 
                        VkFramebuffer fb_h;
                        radv_CreateFramebuffer(device_h,
index ef240a9c06514f46b4ca2ed08dd44e734654213f..f3bdfdbbd11bc8cbd47508ab507906adb6b04ad2 100644 (file)
@@ -863,7 +863,7 @@ void radv_meta_resolve_compute_image(struct radv_cmd_buffer *cmd_buffer,
                                                             .baseArrayLayer = src_base_layer + layer,
                                                             .layerCount = 1,
                                                     },
-                                            });
+                                            }, NULL);
 
                        struct radv_image_view dest_iview;
                        radv_image_view_init(&dest_iview, cmd_buffer->device,
@@ -879,7 +879,7 @@ void radv_meta_resolve_compute_image(struct radv_cmd_buffer *cmd_buffer,
                                                             .baseArrayLayer = dest_base_layer + layer,
                                                             .layerCount = 1,
                                                     },
-                                            });
+                                            }, NULL);
 
                        emit_resolve(cmd_buffer,
                                     &src_iview,
@@ -1011,7 +1011,7 @@ radv_depth_stencil_resolve_subpass_cs(struct radv_cmd_buffer *cmd_buffer,
                                                .baseArrayLayer = src_iview->base_layer + layer,
                                                .layerCount = 1,
                                        },
-                                    });
+                                    }, NULL);
 
                struct radv_image_view tdst_iview;
                radv_image_view_init(&tdst_iview, cmd_buffer->device,
@@ -1027,7 +1027,7 @@ radv_depth_stencil_resolve_subpass_cs(struct radv_cmd_buffer *cmd_buffer,
                                                .baseArrayLayer = dst_iview->base_layer + layer,
                                                .layerCount = 1,
                                        },
-                                    });
+                                    }, NULL);
 
                emit_depth_stencil_resolve(cmd_buffer, &tsrc_iview, &tdst_iview,
                                           &(VkOffset2D) { 0, 0 },
index 1d6427b73fb1982f1bce0023f7f2021b42aee5e4..2068f39a2b996871075e032c266b4a818c40e7ff 100644 (file)
@@ -1050,7 +1050,7 @@ void radv_meta_resolve_fragment_image(struct radv_cmd_buffer *cmd_buffer,
                                                             .baseArrayLayer = src_base_layer + layer,
                                                             .layerCount = 1,
                                                     },
-                                            });
+                                            }, NULL);
 
                        struct radv_image_view dest_iview;
                        radv_image_view_init(&dest_iview, cmd_buffer->device,
@@ -1066,7 +1066,7 @@ void radv_meta_resolve_fragment_image(struct radv_cmd_buffer *cmd_buffer,
                                                             .baseArrayLayer = dest_base_layer + layer,
                                                             .layerCount = 1,
                                                     },
-                                            });
+                                            }, NULL);
 
 
                        VkFramebuffer fb;
@@ -1228,7 +1228,7 @@ radv_depth_stencil_resolve_subpass_fs(struct radv_cmd_buffer *cmd_buffer,
                                        .baseArrayLayer = 0,
                                        .layerCount = 1,
                                },
-                             });
+                             }, NULL);
 
        emit_depth_stencil_resolve(cmd_buffer, &tsrc_iview, dst_iview,
                                   &(VkOffset2D) { 0, 0 },
index 2e7d6975ca71234fc068e62940cc49a25d1bc849..fbc4542cd729dbf70948937bdeee1a64715f90a8 100644 (file)
@@ -1882,9 +1882,13 @@ radv_image_from_gralloc(VkDevice device_h,
                        const VkAllocationCallbacks *alloc,
                        VkImage *out_image_h);
 
+struct radv_image_view_extra_create_info {
+};
+
 void radv_image_view_init(struct radv_image_view *view,
                          struct radv_device *device,
-                         const VkImageViewCreateInfo* pCreateInfo);
+                         const VkImageViewCreateInfo *pCreateInfo,
+                         const struct radv_image_view_extra_create_info* extra_create_info);
 
 VkFormat radv_get_aspect_format(struct radv_image *image, VkImageAspectFlags mask);