struct radv_cmd_buffer *cmd_buffer;
VkResult result;
- cmd_buffer = radv_alloc(&pool->alloc, sizeof(*cmd_buffer), 8,
+ cmd_buffer = vk_alloc(&pool->alloc, sizeof(*cmd_buffer), 8,
VK_SYSTEM_ALLOCATION_SCOPE_OBJECT);
if (cmd_buffer == NULL)
return vk_error(VK_ERROR_OUT_OF_HOST_MEMORY);
return VK_SUCCESS;
fail:
- radv_free(&cmd_buffer->pool->alloc, cmd_buffer);
+ vk_free(&cmd_buffer->pool->alloc, cmd_buffer);
return result;
}
return;
}
- state->attachments = radv_alloc(&cmd_buffer->pool->alloc,
+ state->attachments = vk_alloc(&cmd_buffer->pool->alloc,
pass->attachment_count *
sizeof(state->attachments[0]),
8, VK_SYSTEM_ALLOCATION_SCOPE_OBJECT);
if (cmd_buffer->upload.upload_bo)
cmd_buffer->device->ws->buffer_destroy(cmd_buffer->upload.upload_bo);
cmd_buffer->device->ws->cs_destroy(cmd_buffer->cs);
- radv_free(&cmd_buffer->pool->alloc, cmd_buffer);
+ vk_free(&cmd_buffer->pool->alloc, cmd_buffer);
}
void radv_FreeCommandBuffers(
RADV_FROM_HANDLE(radv_device, device, _device);
struct radv_cmd_pool *pool;
- pool = radv_alloc2(&device->alloc, pAllocator, sizeof(*pool), 8,
+ pool = vk_alloc2(&device->alloc, pAllocator, sizeof(*pool), 8,
VK_SYSTEM_ALLOCATION_SCOPE_OBJECT);
if (pool == NULL)
return vk_error(VK_ERROR_OUT_OF_HOST_MEMORY);
radv_cmd_buffer_destroy(cmd_buffer);
}
- radv_free2(&device->alloc, pAllocator, pool);
+ vk_free2(&device->alloc, pAllocator, pool);
}
VkResult radv_ResetCommandPool(
(VkAttachmentReference){i, layout});
}
- radv_free(&cmd_buffer->pool->alloc, cmd_buffer->state.attachments);
+ vk_free(&cmd_buffer->pool->alloc, cmd_buffer->state.attachments);
cmd_buffer->state.pass = NULL;
cmd_buffer->state.subpass = NULL;
(max_binding + 1) * sizeof(set_layout->binding[0]) +
immutable_sampler_count * sizeof(struct radv_sampler *);
- set_layout = radv_alloc2(&device->alloc, pAllocator, size, 8,
+ set_layout = vk_alloc2(&device->alloc, pAllocator, size, 8,
VK_SYSTEM_ALLOCATION_SCOPE_OBJECT);
if (!set_layout)
return vk_error(VK_ERROR_OUT_OF_HOST_MEMORY);
if (!set_layout)
return;
- radv_free2(&device->alloc, pAllocator, set_layout);
+ vk_free2(&device->alloc, pAllocator, set_layout);
}
/*
assert(pCreateInfo->sType == VK_STRUCTURE_TYPE_PIPELINE_LAYOUT_CREATE_INFO);
- layout = radv_alloc2(&device->alloc, pAllocator, sizeof(*layout), 8,
+ layout = vk_alloc2(&device->alloc, pAllocator, sizeof(*layout), 8,
VK_SYSTEM_ALLOCATION_SCOPE_OBJECT);
if (layout == NULL)
return vk_error(VK_ERROR_OUT_OF_HOST_MEMORY);
if (!pipeline_layout)
return;
- radv_free2(&device->alloc, pAllocator, pipeline_layout);
+ vk_free2(&device->alloc, pAllocator, pipeline_layout);
}
#define EMPTY 1
struct radv_descriptor_set *set;
unsigned mem_size = sizeof(struct radv_descriptor_set) +
sizeof(struct radeon_winsys_bo *) * layout->buffer_count;
- set = radv_alloc2(&device->alloc, NULL, mem_size, 8,
+ set = vk_alloc2(&device->alloc, NULL, mem_size, 8,
VK_SYSTEM_ALLOCATION_SCOPE_OBJECT);
if (!set)
if (layout->dynamic_offset_count) {
unsigned size = sizeof(struct radv_descriptor_range) *
layout->dynamic_offset_count;
- set->dynamic_descriptors = radv_alloc2(&device->alloc, NULL, size, 8,
+ set->dynamic_descriptors = vk_alloc2(&device->alloc, NULL, size, 8,
VK_SYSTEM_ALLOCATION_SCOPE_OBJECT);
if (!set->dynamic_descriptors) {
- radv_free2(&device->alloc, NULL, set);
+ vk_free2(&device->alloc, NULL, set);
return vk_error(VK_ERROR_OUT_OF_HOST_MEMORY);
}
}
}
if (entry < 0) {
- radv_free2(&device->alloc, NULL, set);
+ vk_free2(&device->alloc, NULL, set);
return vk_error(VK_ERROR_OUT_OF_DEVICE_MEMORY);
}
offset = pool->free_nodes[entry].offset;
if (!radv_cmd_buffer_upload_alloc(cmd_buffer, set->size, 32,
&bo_offset,
(void**)&set->mapped_ptr)) {
- radv_free2(&device->alloc, NULL, set->dynamic_descriptors);
- radv_free2(&device->alloc, NULL, set);
+ vk_free2(&device->alloc, NULL, set->dynamic_descriptors);
+ vk_free2(&device->alloc, NULL, set);
return vk_error(VK_ERROR_OUT_OF_HOST_MEMORY);
}
pool->full_list = next;
}
if (set->dynamic_descriptors)
- radv_free2(&device->alloc, NULL, set->dynamic_descriptors);
+ vk_free2(&device->alloc, NULL, set->dynamic_descriptors);
if (!list_empty(&set->descriptor_pool))
list_del(&set->descriptor_pool);
- radv_free2(&device->alloc, NULL, set);
+ vk_free2(&device->alloc, NULL, set);
}
VkResult
int size = sizeof(struct radv_descriptor_pool) +
max_sets * sizeof(struct radv_descriptor_pool_free_node);
uint64_t bo_size = 0;
- pool = radv_alloc2(&device->alloc, pAllocator, size, 8,
+ pool = vk_alloc2(&device->alloc, pAllocator, size, 8,
VK_SYSTEM_ALLOCATION_SCOPE_OBJECT);
if (!pool)
return vk_error(VK_ERROR_OUT_OF_HOST_MEMORY);
if (pool->bo)
device->ws->buffer_destroy(pool->bo);
- radv_free2(&device->alloc, pAllocator, pool);
+ vk_free2(&device->alloc, pAllocator, pool);
}
VkResult radv_ResetDescriptorPool(
return vk_error(VK_ERROR_EXTENSION_NOT_PRESENT);
}
- instance = radv_alloc2(&default_alloc, pAllocator, sizeof(*instance), 8,
+ instance = vk_alloc2(&default_alloc, pAllocator, sizeof(*instance), 8,
VK_SYSTEM_ALLOCATION_SCOPE_INSTANCE);
if (!instance)
return vk_error(VK_ERROR_OUT_OF_HOST_MEMORY);
_mesa_locale_fini();
- radv_free(&instance->alloc, instance);
+ vk_free(&instance->alloc, instance);
}
VkResult radv_EnumeratePhysicalDevices(
return vk_error(VK_ERROR_EXTENSION_NOT_PRESENT);
}
- device = radv_alloc2(&physical_device->instance->alloc, pAllocator,
+ device = vk_alloc2(&physical_device->instance->alloc, pAllocator,
sizeof(*device), 8,
VK_SYSTEM_ALLOCATION_SCOPE_DEVICE);
if (!device)
*pDevice = radv_device_to_handle(device);
return VK_SUCCESS;
fail_free:
- radv_free(&device->alloc, device);
+ vk_free(&device->alloc, device);
return result;
}
radv_queue_finish(&device->queue);
radv_device_finish_meta(device);
- radv_free(&device->alloc, device);
+ vk_free(&device->alloc, device);
}
VkResult radv_EnumerateInstanceExtensionProperties(
return VK_SUCCESS;
}
- mem = radv_alloc2(&device->alloc, pAllocator, sizeof(*mem), 8,
+ mem = vk_alloc2(&device->alloc, pAllocator, sizeof(*mem), 8,
VK_SYSTEM_ALLOCATION_SCOPE_OBJECT);
if (mem == NULL)
return vk_error(VK_ERROR_OUT_OF_HOST_MEMORY);
return VK_SUCCESS;
fail:
- radv_free2(&device->alloc, pAllocator, mem);
+ vk_free2(&device->alloc, pAllocator, mem);
return result;
}
device->ws->buffer_destroy(mem->bo);
mem->bo = NULL;
- radv_free2(&device->alloc, pAllocator, mem);
+ vk_free2(&device->alloc, pAllocator, mem);
}
VkResult radv_MapMemory(
VkFence* pFence)
{
RADV_FROM_HANDLE(radv_device, device, _device);
- struct radv_fence *fence = radv_alloc2(&device->alloc, pAllocator,
+ struct radv_fence *fence = vk_alloc2(&device->alloc, pAllocator,
sizeof(*fence), 8,
VK_SYSTEM_ALLOCATION_SCOPE_OBJECT);
if (!fence)
return;
device->ws->destroy_fence(fence->fence);
- radv_free2(&device->alloc, pAllocator, fence);
+ vk_free2(&device->alloc, pAllocator, fence);
}
static uint64_t radv_get_absolute_timeout(uint64_t timeout)
VkEvent* pEvent)
{
RADV_FROM_HANDLE(radv_device, device, _device);
- struct radv_event *event = radv_alloc2(&device->alloc, pAllocator,
+ struct radv_event *event = vk_alloc2(&device->alloc, pAllocator,
sizeof(*event), 8,
VK_SYSTEM_ALLOCATION_SCOPE_OBJECT);
RADEON_DOMAIN_GTT,
RADEON_FLAG_CPU_ACCESS);
if (!event->bo) {
- radv_free2(&device->alloc, pAllocator, event);
+ vk_free2(&device->alloc, pAllocator, event);
return VK_ERROR_OUT_OF_DEVICE_MEMORY;
}
if (!event)
return;
device->ws->buffer_destroy(event->bo);
- radv_free2(&device->alloc, pAllocator, event);
+ vk_free2(&device->alloc, pAllocator, event);
}
VkResult radv_GetEventStatus(
assert(pCreateInfo->sType == VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO);
- buffer = radv_alloc2(&device->alloc, pAllocator, sizeof(*buffer), 8,
+ buffer = vk_alloc2(&device->alloc, pAllocator, sizeof(*buffer), 8,
VK_SYSTEM_ALLOCATION_SCOPE_OBJECT);
if (buffer == NULL)
return vk_error(VK_ERROR_OUT_OF_HOST_MEMORY);
if (!buffer)
return;
- radv_free2(&device->alloc, pAllocator, buffer);
+ vk_free2(&device->alloc, pAllocator, buffer);
}
static inline unsigned
size_t size = sizeof(*framebuffer) +
sizeof(struct radv_attachment_info) * pCreateInfo->attachmentCount;
- framebuffer = radv_alloc2(&device->alloc, pAllocator, size, 8,
+ framebuffer = vk_alloc2(&device->alloc, pAllocator, size, 8,
VK_SYSTEM_ALLOCATION_SCOPE_OBJECT);
if (framebuffer == NULL)
return vk_error(VK_ERROR_OUT_OF_HOST_MEMORY);
if (!fb)
return;
- radv_free2(&device->alloc, pAllocator, fb);
+ vk_free2(&device->alloc, pAllocator, fb);
}
static unsigned radv_tex_wrap(VkSamplerAddressMode address_mode)
assert(pCreateInfo->sType == VK_STRUCTURE_TYPE_SAMPLER_CREATE_INFO);
- sampler = radv_alloc2(&device->alloc, pAllocator, sizeof(*sampler), 8,
+ sampler = vk_alloc2(&device->alloc, pAllocator, sizeof(*sampler), 8,
VK_SYSTEM_ALLOCATION_SCOPE_OBJECT);
if (!sampler)
return vk_error(VK_ERROR_OUT_OF_HOST_MEMORY);
if (!sampler)
return;
- radv_free2(&device->alloc, pAllocator, sampler);
+ vk_free2(&device->alloc, pAllocator, sampler);
}
radv_assert(pCreateInfo->extent.height > 0);
radv_assert(pCreateInfo->extent.depth > 0);
- image = radv_alloc2(&device->alloc, alloc, sizeof(*image), 8,
+ image = vk_alloc2(&device->alloc, alloc, sizeof(*image), 8,
VK_SYSTEM_ALLOCATION_SCOPE_OBJECT);
if (!image)
return vk_error(VK_ERROR_OUT_OF_HOST_MEMORY);
if (!_image)
return;
- radv_free2(&device->alloc, pAllocator, radv_image_from_handle(_image));
+ vk_free2(&device->alloc, pAllocator, radv_image_from_handle(_image));
}
void radv_GetImageSubresourceLayout(
RADV_FROM_HANDLE(radv_device, device, _device);
struct radv_image_view *view;
- view = radv_alloc2(&device->alloc, pAllocator, sizeof(*view), 8,
+ view = vk_alloc2(&device->alloc, pAllocator, sizeof(*view), 8,
VK_SYSTEM_ALLOCATION_SCOPE_OBJECT);
if (view == NULL)
return vk_error(VK_ERROR_OUT_OF_HOST_MEMORY);
if (!iview)
return;
- radv_free2(&device->alloc, pAllocator, iview);
+ vk_free2(&device->alloc, pAllocator, iview);
}
void radv_buffer_view_init(struct radv_buffer_view *view,
RADV_FROM_HANDLE(radv_device, device, _device);
struct radv_buffer_view *view;
- view = radv_alloc2(&device->alloc, pAllocator, sizeof(*view), 8,
+ view = vk_alloc2(&device->alloc, pAllocator, sizeof(*view), 8,
VK_SYSTEM_ALLOCATION_SCOPE_OBJECT);
if (!view)
return vk_error(VK_ERROR_OUT_OF_HOST_MEMORY);
if (!view)
return;
- radv_free2(&device->alloc, pAllocator, view);
+ vk_free2(&device->alloc, pAllocator, view);
}
attachments_offset = size;
size += pCreateInfo->attachmentCount * sizeof(pass->attachments[0]);
- pass = radv_alloc2(&device->alloc, pAllocator, size, 8,
+ pass = vk_alloc2(&device->alloc, pAllocator, size, 8,
VK_SYSTEM_ALLOCATION_SCOPE_OBJECT);
if (pass == NULL)
return vk_error(VK_ERROR_OUT_OF_HOST_MEMORY);
if (subpass_attachment_count) {
pass->subpass_attachments =
- radv_alloc2(&device->alloc, pAllocator,
+ vk_alloc2(&device->alloc, pAllocator,
subpass_attachment_count * sizeof(VkAttachmentReference), 8,
VK_SYSTEM_ALLOCATION_SCOPE_OBJECT);
if (pass->subpass_attachments == NULL) {
- radv_free2(&device->alloc, pAllocator, pass);
+ vk_free2(&device->alloc, pAllocator, pass);
return vk_error(VK_ERROR_OUT_OF_HOST_MEMORY);
}
} else
if (!_pass)
return;
- radv_free2(&device->alloc, pAllocator, pass->subpass_attachments);
- radv_free2(&device->alloc, pAllocator, pass);
+ vk_free2(&device->alloc, pAllocator, pass->subpass_attachments);
+ vk_free2(&device->alloc, pAllocator, pass);
}
void radv_GetRenderAreaGranularity(
assert(pCreateInfo->sType == VK_STRUCTURE_TYPE_SHADER_MODULE_CREATE_INFO);
assert(pCreateInfo->flags == 0);
- module = radv_alloc2(&device->alloc, pAllocator,
+ module = vk_alloc2(&device->alloc, pAllocator,
sizeof(*module) + pCreateInfo->codeSize, 8,
VK_SYSTEM_ALLOCATION_SCOPE_OBJECT);
if (module == NULL)
if (!module)
return;
- radv_free2(&device->alloc, pAllocator, module);
+ vk_free2(&device->alloc, pAllocator, module);
}
void radv_DestroyPipeline(
if (pipeline->shaders[i])
radv_shader_variant_destroy(device, pipeline->shaders[i]);
- radv_free2(&device->alloc, pAllocator, pipeline);
+ vk_free2(&device->alloc, pAllocator, pipeline);
}
struct radv_pipeline *pipeline;
VkResult result;
- pipeline = radv_alloc2(&device->alloc, pAllocator, sizeof(*pipeline), 8,
+ pipeline = vk_alloc2(&device->alloc, pAllocator, sizeof(*pipeline), 8,
VK_SYSTEM_ALLOCATION_SCOPE_OBJECT);
if (pipeline == NULL)
return vk_error(VK_ERROR_OUT_OF_HOST_MEMORY);
result = radv_pipeline_init(pipeline, device, cache,
pCreateInfo, extra, pAllocator);
if (result != VK_SUCCESS) {
- radv_free2(&device->alloc, pAllocator, pipeline);
+ vk_free2(&device->alloc, pAllocator, pipeline);
return result;
}
struct radv_pipeline *pipeline;
bool dump = getenv("RADV_DUMP_SHADERS");
- pipeline = radv_alloc2(&device->alloc, pAllocator, sizeof(*pipeline), 8,
+ pipeline = vk_alloc2(&device->alloc, pAllocator, sizeof(*pipeline), 8,
VK_SYSTEM_ALLOCATION_SCOPE_OBJECT);
if (pipeline == NULL)
return vk_error(VK_ERROR_OUT_OF_HOST_MEMORY);
if (cache->hash_table[i]->variant)
radv_shader_variant_destroy(cache->device,
cache->hash_table[i]->variant);
- radv_free(&cache->alloc, cache->hash_table[i]);
+ vk_free(&cache->alloc, cache->hash_table[i]);
}
pthread_mutex_destroy(&cache->mutex);
free(cache->hash_table);
return variant;
}
- entry = radv_alloc(&cache->alloc, sizeof(*entry) + code_size, 8,
+ entry = vk_alloc(&cache->alloc, sizeof(*entry) + code_size, 8,
VK_SYSTEM_ALLOCATION_SCOPE_CACHE);
if (!entry) {
pthread_mutex_unlock(&cache->mutex);
if(end - p < sizeof(*entry) + entry->code_size)
break;
- dest_entry = radv_alloc(&cache->alloc, sizeof(*entry) + entry->code_size,
+ dest_entry = vk_alloc(&cache->alloc, sizeof(*entry) + entry->code_size,
8, VK_SYSTEM_ALLOCATION_SCOPE_CACHE);
if (dest_entry) {
memcpy(dest_entry, entry, sizeof(*entry) + entry->code_size);
assert(pCreateInfo->sType == VK_STRUCTURE_TYPE_PIPELINE_CACHE_CREATE_INFO);
assert(pCreateInfo->flags == 0);
- cache = radv_alloc2(&device->alloc, pAllocator,
+ cache = vk_alloc2(&device->alloc, pAllocator,
sizeof(*cache), 8,
VK_SYSTEM_ALLOCATION_SCOPE_OBJECT);
if (cache == NULL)
return;
radv_pipeline_cache_finish(cache);
- radv_free2(&device->alloc, pAllocator, cache);
+ vk_free2(&device->alloc, pAllocator, cache);
}
VkResult radv_GetPipelineCacheData(
#include "compiler/shader_enums.h"
#include "util/macros.h"
#include "util/list.h"
+#include "util/vk_alloc.h"
#include "main/macros.h"
+
#include "radv_radeon_winsys.h"
#include "ac_binary.h"
#include "ac_nir_to_llvm.h"
extern struct radv_dispatch_table dtable;
-static inline void *
-radv_alloc(const VkAllocationCallbacks *alloc,
- size_t size, size_t align,
- VkSystemAllocationScope scope)
-{
- return alloc->pfnAllocation(alloc->pUserData, size, align, scope);
-}
-
-static inline void *
-radv_realloc(const VkAllocationCallbacks *alloc,
- void *ptr, size_t size, size_t align,
- VkSystemAllocationScope scope)
-{
- return alloc->pfnReallocation(alloc->pUserData, ptr, size, align, scope);
-}
-
-static inline void
-radv_free(const VkAllocationCallbacks *alloc, void *data)
-{
- alloc->pfnFree(alloc->pUserData, data);
-}
-
-static inline void *
-radv_alloc2(const VkAllocationCallbacks *parent_alloc,
- const VkAllocationCallbacks *alloc,
- size_t size, size_t align,
- VkSystemAllocationScope scope)
-{
- if (alloc)
- return radv_alloc(alloc, size, align, scope);
- else
- return radv_alloc(parent_alloc, size, align, scope);
-}
-
-static inline void
-radv_free2(const VkAllocationCallbacks *parent_alloc,
- const VkAllocationCallbacks *alloc,
- void *data)
-{
- if (alloc)
- radv_free(alloc, data);
- else
- radv_free(parent_alloc, data);
-}
-
struct radv_wsi_interaface;
#define VK_ICD_WSI_PLATFORM_MAX 5
{
RADV_FROM_HANDLE(radv_device, device, _device);
uint64_t size;
- struct radv_query_pool *pool = radv_alloc2(&device->alloc, pAllocator,
+ struct radv_query_pool *pool = vk_alloc2(&device->alloc, pAllocator,
sizeof(*pool), 8,
VK_SYSTEM_ALLOCATION_SCOPE_OBJECT);
64, RADEON_DOMAIN_GTT, 0);
if (!pool->bo) {
- radv_free2(&device->alloc, pAllocator, pool);
+ vk_free2(&device->alloc, pAllocator, pool);
return VK_ERROR_OUT_OF_DEVICE_MEMORY;
}
if (!pool->ptr) {
device->ws->buffer_destroy(pool->bo);
- radv_free2(&device->alloc, pAllocator, pool);
+ vk_free2(&device->alloc, pAllocator, pool);
return VK_ERROR_OUT_OF_DEVICE_MEMORY;
}
memset(pool->ptr, 0, size);
return;
device->ws->buffer_destroy(pool->bo);
- radv_free2(&device->alloc, pAllocator, pool);
+ vk_free2(&device->alloc, pAllocator, pool);
}
VkResult radv_GetQueryPoolResults(
RADV_FROM_HANDLE(radv_instance, instance, _instance);
RADV_FROM_HANDLE(_VkIcdSurfaceBase, surface, _surface);
- radv_free2(&instance->alloc, pAllocator, surface);
+ vk_free2(&instance->alloc, pAllocator, surface);
}
VkResult radv_GetPhysicalDeviceSurfaceSupportKHR(
u_vector_finish(&display->formats);
if (display->drm)
wl_drm_destroy(display->drm);
- radv_free(&wsi->physical_device->instance->alloc, display);
+ vk_free(&wsi->physical_device->instance->alloc, display);
}
static struct wsi_wl_display *
wsi_wl_display_create(struct wsi_wayland *wsi, struct wl_display *wl_display)
{
struct wsi_wl_display *display =
- radv_alloc(&wsi->physical_device->instance->alloc, sizeof(*display), 8,
+ vk_alloc(&wsi->physical_device->instance->alloc, sizeof(*display), 8,
VK_SYSTEM_ALLOCATION_SCOPE_INSTANCE);
if (!display)
return NULL;
VkIcdSurfaceWayland *surface;
- surface = radv_alloc2(&instance->alloc, pAllocator, sizeof *surface, 8,
+ surface = vk_alloc2(&instance->alloc, pAllocator, sizeof *surface, 8,
VK_SYSTEM_ALLOCATION_SCOPE_OBJECT);
if (surface == NULL)
return vk_error(VK_ERROR_OUT_OF_HOST_MEMORY);
wsi_wl_image_finish(chain, &chain->images[i], pAllocator);
}
- radv_free2(&chain->base.device->alloc, pAllocator, chain);
+ vk_free2(&chain->base.device->alloc, pAllocator, chain);
return VK_SUCCESS;
}
num_images = MAX2(num_images, 4);
size_t size = sizeof(*chain) + num_images * sizeof(chain->images[0]);
- chain = radv_alloc2(&device->alloc, pAllocator, size, 8,
+ chain = vk_alloc2(&device->alloc, pAllocator, size, 8,
VK_SYSTEM_ALLOCATION_SCOPE_OBJECT);
if (chain == NULL)
return vk_error(VK_ERROR_OUT_OF_HOST_MEMORY);
struct wsi_wayland *wsi;
VkResult result;
- wsi = radv_alloc(&device->instance->alloc, sizeof(*wsi), 8,
+ wsi = vk_alloc(&device->instance->alloc, sizeof(*wsi), 8,
VK_SYSTEM_ALLOCATION_SCOPE_INSTANCE);
if (!wsi) {
result = vk_error(VK_ERROR_OUT_OF_HOST_MEMORY);
pthread_mutex_destroy(&wsi->mutex);
fail_alloc:
- radv_free(&device->instance->alloc, wsi);
+ vk_free(&device->instance->alloc, wsi);
fail:
device->wsi[VK_ICD_WSI_PLATFORM_WAYLAND] = NULL;
pthread_mutex_destroy(&wsi->mutex);
- radv_free(&device->instance->alloc, wsi);
+ vk_free(&device->instance->alloc, wsi);
}
}
xcb_query_extension_reply_t *dri3_reply, *pres_reply;
struct wsi_x11_connection *wsi_conn =
- radv_alloc(&device->instance->alloc, sizeof(*wsi_conn), 8,
+ vk_alloc(&device->instance->alloc, sizeof(*wsi_conn), 8,
VK_SYSTEM_ALLOCATION_SCOPE_INSTANCE);
if (!wsi_conn)
return NULL;
if (dri3_reply == NULL || pres_reply == NULL) {
free(dri3_reply);
free(pres_reply);
- radv_free(&device->instance->alloc, wsi_conn);
+ vk_free(&device->instance->alloc, wsi_conn);
return NULL;
}
wsi_x11_connection_destroy(struct radv_physical_device *device,
struct wsi_x11_connection *conn)
{
- radv_free(&device->instance->alloc, conn);
+ vk_free(&device->instance->alloc, conn);
}
static struct wsi_x11_connection *
VkIcdSurfaceXcb *surface;
- surface = radv_alloc2(&instance->alloc, pAllocator, sizeof *surface, 8,
+ surface = vk_alloc2(&instance->alloc, pAllocator, sizeof *surface, 8,
VK_SYSTEM_ALLOCATION_SCOPE_OBJECT);
if (surface == NULL)
return vk_error(VK_ERROR_OUT_OF_HOST_MEMORY);
VkIcdSurfaceXlib *surface;
- surface = radv_alloc2(&instance->alloc, pAllocator, sizeof *surface, 8,
+ surface = vk_alloc2(&instance->alloc, pAllocator, sizeof *surface, 8,
VK_SYSTEM_ALLOCATION_SCOPE_OBJECT);
if (surface == NULL)
return vk_error(VK_ERROR_OUT_OF_HOST_MEMORY);
xcb_unregister_for_special_event(chain->conn, chain->special_event);
- radv_free2(&chain->base.device->alloc, pAllocator, chain);
+ vk_free2(&chain->base.device->alloc, pAllocator, chain);
return VK_SUCCESS;
}
num_images = MAX2(num_images, 4);
size_t size = sizeof(*chain) + num_images * sizeof(chain->images[0]);
- chain = radv_alloc2(&device->alloc, pAllocator, size, 8,
+ chain = vk_alloc2(&device->alloc, pAllocator, size, 8,
VK_SYSTEM_ALLOCATION_SCOPE_OBJECT);
if (chain == NULL)
return vk_error(VK_ERROR_OUT_OF_HOST_MEMORY);
fail_register:
xcb_unregister_for_special_event(chain->conn, chain->special_event);
- radv_free2(&device->alloc, pAllocator, chain);
+ vk_free2(&device->alloc, pAllocator, chain);
return result;
}
struct wsi_x11 *wsi;
VkResult result;
- wsi = radv_alloc(&device->instance->alloc, sizeof(*wsi), 8,
+ wsi = vk_alloc(&device->instance->alloc, sizeof(*wsi), 8,
VK_SYSTEM_ALLOCATION_SCOPE_INSTANCE);
if (!wsi) {
result = vk_error(VK_ERROR_OUT_OF_HOST_MEMORY);
fail_mutex:
pthread_mutex_destroy(&wsi->mutex);
fail_alloc:
- radv_free(&device->instance->alloc, wsi);
+ vk_free(&device->instance->alloc, wsi);
fail:
device->wsi[VK_ICD_WSI_PLATFORM_XCB] = NULL;
device->wsi[VK_ICD_WSI_PLATFORM_XLIB] = NULL;
pthread_mutex_destroy(&wsi->mutex);
- radv_free(&device->instance->alloc, wsi);
+ vk_free(&device->instance->alloc, wsi);
}
}