anv: Drop unneeded struct keywords
authorJason Ekstrand <jason@jlekstrand.net>
Fri, 3 Jan 2020 17:20:22 +0000 (11:20 -0600)
committerJason Ekstrand <jason@jlekstrand.net>
Fri, 3 Jan 2020 17:32:34 +0000 (11:32 -0600)
All VkFoo structs are typedef'd to not need the struct keyword.  Leaving
it in there is just extra characters and breaks Vulkan's aliasing when
stuff gets promoted to core versions.  It's better to just never use
struct for VkFoo.

Reviewed-by: Caio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
src/intel/vulkan/anv_android.c
src/intel/vulkan/anv_android.h
src/intel/vulkan/anv_android_stubs.c
src/intel/vulkan/anv_descriptor_set.c
src/intel/vulkan/anv_device.c
src/intel/vulkan/anv_formats.c
src/intel/vulkan/anv_image.c
src/intel/vulkan/anv_pass.c
src/intel/vulkan/anv_private.h
src/intel/vulkan/genX_state.c

index 6a411a9b798b4612df19ffead6ac8f482cf28391..31b3f0d1139a59ca19fb8ebd417ca9168b70b4fe 100644 (file)
@@ -389,14 +389,14 @@ VkResult
 anv_image_from_external(
    VkDevice device_h,
    const VkImageCreateInfo *base_info,
-   const struct VkExternalMemoryImageCreateInfo *create_info,
+   const VkExternalMemoryImageCreateInfo *create_info,
    const VkAllocationCallbacks *alloc,
    VkImage *out_image_h)
 {
 #if ANDROID_API_LEVEL >= 26
    ANV_FROM_HANDLE(anv_device, device, device_h);
 
-   const struct VkExternalFormatANDROID *ext_info =
+   const VkExternalFormatANDROID *ext_info =
       vk_find_struct_const(base_info->pNext, EXTERNAL_FORMAT_ANDROID);
 
    if (ext_info && ext_info->externalFormat != 0) {
index d5c073126e3817d8decf2f5124c0da3329a0effd..809b0603616c2ae735201d7cae591fea42067de3 100644 (file)
@@ -40,7 +40,7 @@ VkResult anv_image_from_gralloc(VkDevice device_h,
 
 VkResult anv_image_from_external(VkDevice device_h,
                                  const VkImageCreateInfo *base_info,
-                                 const struct VkExternalMemoryImageCreateInfo *create_info,
+                                 const VkExternalMemoryImageCreateInfo *create_info,
                                  const VkAllocationCallbacks *alloc,
                                  VkImage *out_image_h);
 
index a34afc198a1e20ca80a078fb615966f49cf9b75b..3e773dfe710c82b52c435d3fec5989a38078cbb3 100644 (file)
@@ -59,7 +59,7 @@ anv_create_ahw_memory(VkDevice device_h,
 VkResult
 anv_image_from_external(VkDevice device_h,
                         const VkImageCreateInfo *base_info,
-                        const struct VkExternalMemoryImageCreateInfo *create_info,
+                        const VkExternalMemoryImageCreateInfo *create_info,
                         const VkAllocationCallbacks *alloc,
                         VkImage *out_image_h)
 {
index 020b6abd5edb12f8a396a3f926c11d6646f23420..4f458150a34e3500bba024b19a7079d929b84352 100644 (file)
@@ -985,7 +985,7 @@ anv_descriptor_set_create(struct anv_device *device,
              * will always write in the immutable sampler regardless of what
              * is in the sampler parameter.
              */
-            struct VkDescriptorImageInfo info = { };
+            VkDescriptorImageInfo info = { };
             anv_descriptor_set_write_image_view(device, set, &info,
                                                 VK_DESCRIPTOR_TYPE_SAMPLER,
                                                 b, i);
index 3b4f40a998defce5eae00546f27ab99ebaccf7c5..c6d31190a68706f2a2066fd79cfe02566bff9fcc 100644 (file)
@@ -3186,7 +3186,7 @@ VkResult anv_AllocateMemory(
       if (result != VK_SUCCESS)
          goto fail;
 
-      const struct VkImportAndroidHardwareBufferInfoANDROID import_info = {
+      const VkImportAndroidHardwareBufferInfoANDROID import_info = {
          .buffer = mem->ahw,
       };
       result = anv_import_ahw_memory(_device, mem, &import_info);
index 9431dab6012443d738e2dea99932ee1c66c5787b..1ba18191c2c18782c8af03000a5cc91d4d2dbddd 100644 (file)
@@ -1026,7 +1026,7 @@ VkResult anv_GetPhysicalDeviceImageFormatProperties2(
    const VkPhysicalDeviceExternalImageFormatInfo *external_info = NULL;
    VkExternalImageFormatProperties *external_props = NULL;
    VkSamplerYcbcrConversionImageFormatProperties *ycbcr_props = NULL;
-   struct VkAndroidHardwareBufferUsageANDROID *android_usage = NULL;
+   VkAndroidHardwareBufferUsageANDROID *android_usage = NULL;
    VkResult result;
 
    /* Extract input structs */
@@ -1221,7 +1221,7 @@ VkResult anv_CreateSamplerYcbcrConversion(
 
    /* Search for VkExternalFormatANDROID and resolve the format. */
    struct anv_format *ext_format = NULL;
-   const struct VkExternalFormatANDROID *ext_info =
+   const VkExternalFormatANDROID *ext_info =
       vk_find_struct_const(pCreateInfo->pNext, EXTERNAL_FORMAT_ANDROID);
 
    uint64_t format = ext_info ? ext_info->externalFormat : 0;
index 2e6ca82dabc045ca97c2504191a4cc92223c9a6d..f2f89a012b6fd6a39ae742f93500cc80d2f3be74 100644 (file)
@@ -745,7 +745,7 @@ anv_CreateImage(VkDevice device,
                 const VkAllocationCallbacks *pAllocator,
                 VkImage *pImage)
 {
-   const struct VkExternalMemoryImageCreateInfo *create_info =
+   const VkExternalMemoryImageCreateInfo *create_info =
       vk_find_struct_const(pCreateInfo->pNext, EXTERNAL_MEMORY_IMAGE_CREATE_INFO);
 
    if (create_info && (create_info->handleTypes &
@@ -754,7 +754,7 @@ anv_CreateImage(VkDevice device,
                                      pAllocator, pImage);
 
    bool use_external_format = false;
-   const struct VkExternalFormatANDROID *ext_format =
+   const VkExternalFormatANDROID *ext_format =
       vk_find_struct_const(pCreateInfo->pNext, EXTERNAL_FORMAT_ANDROID);
 
    /* "If externalFormat is zero, the effect is as if the
@@ -1590,7 +1590,7 @@ anv_CreateImageView(VkDevice _device,
 
    /* Check if a conversion info was passed. */
    const struct anv_format *conv_format = NULL;
-   const struct VkSamplerYcbcrConversionInfo *conv_info =
+   const VkSamplerYcbcrConversionInfo *conv_info =
       vk_find_struct_const(pCreateInfo->pNext, SAMPLER_YCBCR_CONVERSION_INFO);
 
    /* If image has an external format, the pNext chain must contain an instance of
index 94783bb36c429540dd874e5636b972e3a1d58106..067d9d55d671cab2081d1991c5941e3f838b5bb3 100644 (file)
@@ -338,7 +338,7 @@ VkResult anv_CreateRenderPass(
 
    for (uint32_t i = 0; i < pCreateInfo->dependencyCount; i++) {
       /* Convert to a Dependency2KHR */
-      struct VkSubpassDependency2KHR dep2 = {
+      VkSubpassDependency2KHR dep2 = {
          .srcSubpass       = pCreateInfo->pDependencies[i].srcSubpass,
          .dstSubpass       = pCreateInfo->pDependencies[i].dstSubpass,
          .srcStageMask     = pCreateInfo->pDependencies[i].srcStageMask,
index 32bb027142eccb2f6d63d7a55803f918f7a857c3..dd47df9a09d4cc87f092040aebac0f76d455578f 100644 (file)
@@ -3812,9 +3812,9 @@ anv_image_get_surface_for_aspect_mask(const struct anv_image *image,
 enum isl_format
 anv_isl_format_for_descriptor_type(VkDescriptorType type);
 
-static inline struct VkExtent3D
+static inline VkExtent3D
 anv_sanitize_image_extent(const VkImageType imageType,
-                          const struct VkExtent3D imageExtent)
+                          const VkExtent3D imageExtent)
 {
    switch (imageType) {
    case VK_IMAGE_TYPE_1D:
@@ -3828,9 +3828,9 @@ anv_sanitize_image_extent(const VkImageType imageType,
    }
 }
 
-static inline struct VkOffset3D
+static inline VkOffset3D
 anv_sanitize_image_offset(const VkImageType imageType,
-                          const struct VkOffset3D imageOffset)
+                          const VkOffset3D imageOffset)
 {
    switch (imageType) {
    case VK_IMAGE_TYPE_1D:
index 8ad048225a6f4b69a5984d14bf47d37b856ae83f..34c6c6bd142d9beeaa40a3d2a139ea66d7c8b2cf 100644 (file)
@@ -447,8 +447,8 @@ VkResult genX(CreateSampler)(
       }
 #if GEN_GEN >= 9
       case VK_STRUCTURE_TYPE_SAMPLER_REDUCTION_MODE_CREATE_INFO_EXT: {
-         struct VkSamplerReductionModeCreateInfoEXT *sampler_reduction =
-            (struct VkSamplerReductionModeCreateInfoEXT *) ext;
+         VkSamplerReductionModeCreateInfoEXT *sampler_reduction =
+            (VkSamplerReductionModeCreateInfoEXT *) ext;
          sampler_reduction_mode =
             vk_to_gen_sampler_reduction_mode[sampler_reduction->reductionMode];
          enable_sampler_reduction = true;