diff options
author | Dave Airlie <[email protected]> | 2016-10-14 12:59:55 +1000 |
---|---|---|
committer | Dave Airlie <[email protected]> | 2016-10-19 09:05:25 +1000 |
commit | f5daaba0fdd842bf04ede903aea3e63d10a27c6e (patch) | |
tree | 12f18b4158e66560cf13f0e4130507a3c052b5bc /src/amd/vulkan/radv_wsi_wayland.c | |
parent | 8df014c01a41012a983bd0be164600ab50300e5c (diff) |
radv: make use of shared vector helper.
This removes the vector code from radv in favour of sharing
code with anv.
Acked-by: Jason Ekstrand <[email protected]>
Signed-off-by: Dave Airlie <[email protected]>
Diffstat (limited to 'src/amd/vulkan/radv_wsi_wayland.c')
-rw-r--r-- | src/amd/vulkan/radv_wsi_wayland.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/amd/vulkan/radv_wsi_wayland.c b/src/amd/vulkan/radv_wsi_wayland.c index 739e0e32580..a1978bc5b43 100644 --- a/src/amd/vulkan/radv_wsi_wayland.c +++ b/src/amd/vulkan/radv_wsi_wayland.c @@ -30,7 +30,7 @@ #include "vk_format.h" #include <util/hash_table.h> - +#include <util/u_vector.h> #define MIN_NUM_IMAGES 2 struct wsi_wl_display { @@ -39,7 +39,7 @@ struct wsi_wl_display { struct wl_drm * drm; /* Vector of VkFormats supported */ - struct radv_vector formats; + struct u_vector formats; uint32_t capabilities; }; @@ -59,7 +59,7 @@ wsi_wl_display_add_vk_format(struct wsi_wl_display *display, VkFormat format) { /* Don't add a format that's already in the list */ VkFormat *f; - radv_vector_foreach(f, &display->formats) + u_vector_foreach(f, &display->formats) if (*f == format) return; @@ -70,7 +70,7 @@ wsi_wl_display_add_vk_format(struct wsi_wl_display *display, VkFormat format) if (!(props.optimalTilingFeatures & VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT)) return; - f = radv_vector_add(&display->formats); + f = u_vector_add(&display->formats); if (f) *f = format; } @@ -228,7 +228,7 @@ static const struct wl_registry_listener registry_listener = { static void wsi_wl_display_destroy(struct wsi_wayland *wsi, struct wsi_wl_display *display) { - radv_vector_finish(&display->formats); + u_vector_finish(&display->formats); if (display->drm) wl_drm_destroy(display->drm); radv_free(&wsi->physical_device->instance->alloc, display); @@ -248,7 +248,7 @@ wsi_wl_display_create(struct wsi_wayland *wsi, struct wl_display *wl_display) display->display = wl_display; display->physical_device = wsi->physical_device; - if (!radv_vector_init(&display->formats, sizeof(VkFormat), 8)) + if (!u_vector_init(&display->formats, sizeof(VkFormat), 8)) goto fail; struct wl_registry *registry = wl_display_get_registry(wl_display); @@ -381,7 +381,7 @@ wsi_wl_surface_get_formats(VkIcdSurfaceBase *icd_surface, struct wsi_wl_display *display = wsi_wl_get_display(device, surface->display); - uint32_t count = radv_vector_length(&display->formats); + uint32_t count = u_vector_length(&display->formats); if (pSurfaceFormats == NULL) { *pSurfaceFormatCount = count; @@ -392,7 +392,7 @@ wsi_wl_surface_get_formats(VkIcdSurfaceBase *icd_surface, *pSurfaceFormatCount = count; VkFormat *f; - radv_vector_foreach(f, &display->formats) { + u_vector_foreach(f, &display->formats) { *(pSurfaceFormats++) = (VkSurfaceFormatKHR) { .format = *f, /* TODO: We should get this from the compositor somehow */ |