bug 12921: Memory callback (WIP)
The per-object allocator is ignored for now.
https://cvs.khronos.org/bugzilla/show_bug.cgi?id=12921
diff --git a/icd/intel/buf.c b/icd/intel/buf.c
index a776828..2e2c176 100644
--- a/icd/intel/buf.c
+++ b/icd/intel/buf.c
@@ -91,6 +91,7 @@
ICD_EXPORT VkResult VKAPI vkCreateBuffer(
VkDevice device,
const VkBufferCreateInfo* pCreateInfo,
+ const VkAllocCallbacks* pAllocator,
VkBuffer* pBuffer)
{
struct intel_dev *dev = intel_dev(device);
@@ -100,10 +101,10 @@
ICD_EXPORT void VKAPI vkDestroyBuffer(
VkDevice device,
- VkBuffer buffer)
-
- {
+ VkBuffer buffer,
+ const VkAllocCallbacks* pAllocator)
+{
struct intel_obj *obj = intel_obj(buffer);
obj->destroy(obj);
- }
+}
diff --git a/icd/intel/cmd.c b/icd/intel/cmd.c
index 6d71433..4ee3c15 100644
--- a/icd/intel/cmd.c
+++ b/icd/intel/cmd.c
@@ -194,7 +194,7 @@
struct intel_cmd_item *items;
items = intel_alloc(cmd, sizeof(writer->items[0]) * new_alloc,
- 0, VK_SYSTEM_ALLOC_TYPE_DEBUG);
+ 0, VK_SYSTEM_ALLOC_SCOPE_OBJECT);
if (!items) {
writer->item_used = 0;
cmd_fail(cmd, VK_ERROR_OUT_OF_HOST_MEMORY);
@@ -296,7 +296,7 @@
*/
cmd->reloc_count = dev->gpu->batch_buffer_reloc_count;
cmd->relocs = intel_alloc(cmd, sizeof(cmd->relocs[0]) * cmd->reloc_count,
- 4096, VK_SYSTEM_ALLOC_TYPE_INTERNAL);
+ 4096, VK_SYSTEM_ALLOC_SCOPE_OBJECT);
if (!cmd->relocs) {
intel_cmd_destroy(cmd);
return VK_ERROR_OUT_OF_HOST_MEMORY;
@@ -472,6 +472,7 @@
ICD_EXPORT VkResult VKAPI vkCreateCommandPool(
VkDevice device,
const VkCmdPoolCreateInfo* pCreateInfo,
+ const VkAllocCallbacks* pAllocator,
VkCmdPool* pCmdPool)
{
struct intel_dev *dev = intel_dev(device);
@@ -482,7 +483,8 @@
ICD_EXPORT void VKAPI vkDestroyCommandPool(
VkDevice device,
- VkCmdPool cmdPool)
+ VkCmdPool cmdPool,
+ const VkAllocCallbacks* pAllocator)
{
}
diff --git a/icd/intel/cmd_pipeline.c b/icd/intel/cmd_pipeline.c
index 28c92b2..e654369 100644
--- a/icd/intel/cmd_pipeline.c
+++ b/icd/intel/cmd_pipeline.c
@@ -2099,7 +2099,7 @@
void *entries;
entries = intel_alloc(cmd, sizeof(cache->entries[0]) * count, 0,
- VK_SYSTEM_ALLOC_TYPE_INTERNAL);
+ VK_SYSTEM_ALLOC_SCOPE_OBJECT);
if (entries) {
if (cache->entries) {
memcpy(entries, cache->entries,
@@ -3300,7 +3300,7 @@
data->set_offsets = intel_alloc(cmd,
sizeof(data->set_offsets[0]) * pipeline_layout->layout_count,
- sizeof(data->set_offsets[0]), VK_SYSTEM_ALLOC_TYPE_INTERNAL);
+ sizeof(data->set_offsets[0]), VK_SYSTEM_ALLOC_SCOPE_OBJECT);
if (!data->set_offsets) {
cmd_fail(cmd, VK_ERROR_OUT_OF_HOST_MEMORY);
data->set_offset_count = 0;
@@ -3316,7 +3316,7 @@
data->dynamic_offsets = intel_alloc(cmd,
sizeof(data->dynamic_offsets[0]) * pipeline_layout->total_dynamic_desc_count,
- sizeof(data->dynamic_offsets[0]), VK_SYSTEM_ALLOC_TYPE_INTERNAL);
+ sizeof(data->dynamic_offsets[0]), VK_SYSTEM_ALLOC_SCOPE_OBJECT);
if (!data->dynamic_offsets) {
cmd_fail(cmd, VK_ERROR_OUT_OF_HOST_MEMORY);
data->dynamic_offset_count = 0;
diff --git a/icd/intel/compiler/pipeline/pipeline_compiler_interface.cpp b/icd/intel/compiler/pipeline/pipeline_compiler_interface.cpp
index 23d7144..75e34e6 100644
--- a/icd/intel/compiler/pipeline/pipeline_compiler_interface.cpp
+++ b/icd/intel/compiler/pipeline/pipeline_compiler_interface.cpp
@@ -345,12 +345,12 @@
static inline void *pipe_interface_alloc(const void *handle,
size_t size, size_t alignment,
- VkSystemAllocType type)
+ VkSystemAllocScope scope)
{
if (standaloneCompiler)
return calloc(size, sizeof(char));
else
- return intel_alloc(handle, size, alignment, type);
+ return intel_alloc(handle, size, alignment, scope);
}
static void rmap_destroy(const struct intel_gpu *gpu,
@@ -369,7 +369,7 @@
uint32_t surface_count, i;
rmap = (struct intel_pipeline_rmap *)
- pipe_interface_alloc(gpu, sizeof(*rmap), 0, VK_SYSTEM_ALLOC_TYPE_INTERNAL);
+ pipe_interface_alloc(gpu, sizeof(*rmap), 0, VK_SYSTEM_ALLOC_SCOPE_OBJECT);
if (!rmap)
return NULL;
@@ -390,7 +390,7 @@
rmap->slots = (struct intel_pipeline_rmap_slot *)
pipe_interface_alloc(gpu, sizeof(rmap->slots[0]) * rmap->slot_count,
- 0, VK_SYSTEM_ALLOC_TYPE_INTERNAL);
+ 0, VK_SYSTEM_ALLOC_SCOPE_OBJECT);
if (!rmap->slots) {
pipe_interface_free(gpu, rmap);
return NULL;
@@ -638,7 +638,7 @@
{
pipe_shader->codeSize = get_vs_program_size(brw->shader_prog);
- pipe_shader->pCode = pipe_interface_alloc(gpu, pipe_shader->codeSize, 0, VK_SYSTEM_ALLOC_TYPE_INTERNAL_SHADER);
+ pipe_shader->pCode = pipe_interface_alloc(gpu, pipe_shader->codeSize, 0, VK_SYSTEM_ALLOC_SCOPE_OBJECT);
if (!pipe_shader->pCode) {
status = VK_ERROR_OUT_OF_HOST_MEMORY;
@@ -709,7 +709,7 @@
{
pipe_shader->codeSize = get_gs_program_size(brw->shader_prog);
- pipe_shader->pCode = pipe_interface_alloc(gpu, pipe_shader->codeSize, 0, VK_SYSTEM_ALLOC_TYPE_INTERNAL_SHADER);
+ pipe_shader->pCode = pipe_interface_alloc(gpu, pipe_shader->codeSize, 0, VK_SYSTEM_ALLOC_SCOPE_OBJECT);
if (!pipe_shader->pCode) {
status = VK_ERROR_OUT_OF_HOST_MEMORY;
@@ -786,7 +786,7 @@
pipe_shader->codeSize = get_wm_program_size(brw->shader_prog);
- pipe_shader->pCode = pipe_interface_alloc(gpu, pipe_shader->codeSize, 0, VK_SYSTEM_ALLOC_TYPE_INTERNAL_SHADER);
+ pipe_shader->pCode = pipe_interface_alloc(gpu, pipe_shader->codeSize, 0, VK_SYSTEM_ALLOC_SCOPE_OBJECT);
if (!pipe_shader->pCode) {
status = VK_ERROR_OUT_OF_HOST_MEMORY;
diff --git a/icd/intel/compiler/pipeline/pipeline_compiler_interface_meta.cpp b/icd/intel/compiler/pipeline/pipeline_compiler_interface_meta.cpp
index bc1bf47..40053e8 100644
--- a/icd/intel/compiler/pipeline/pipeline_compiler_interface_meta.cpp
+++ b/icd/intel/compiler/pipeline/pipeline_compiler_interface_meta.cpp
@@ -621,7 +621,7 @@
prog = get_program(&prog_size, stderr);
- code = intel_alloc(gpu, prog_size, 0, VK_SYSTEM_ALLOC_TYPE_INTERNAL);
+ code = intel_alloc(gpu, prog_size, 0, VK_SYSTEM_ALLOC_SCOPE_DEVICE);
if (!code)
return NULL;
diff --git a/icd/intel/compiler/shader/standalone_utils.c b/icd/intel/compiler/shader/standalone_utils.c
index bb70706..4c96fd2 100644
--- a/icd/intel/compiler/shader/standalone_utils.c
+++ b/icd/intel/compiler/shader/standalone_utils.c
@@ -38,11 +38,11 @@
void *intel_alloc(const void *handle,
size_t size, size_t alignment,
- VkSystemAllocType type)
+ VkSystemAllocScope scope)
{
assert(intel_handle_validate(handle));
return icd_instance_alloc(((const struct intel_handle *) handle)->instance->icd,
- size, alignment, type);
+ size, alignment, scope);
}
void intel_free(const void *handle, void *ptr)
diff --git a/icd/intel/desc.c b/icd/intel/desc.c
index ab50390..7fa9653 100644
--- a/icd/intel/desc.c
+++ b/icd/intel/desc.c
@@ -121,7 +121,7 @@
const uint32_t sampler_count = 1024*1024;
struct intel_desc_region *region;
- region = intel_alloc(dev, sizeof(*region), 0, VK_SYSTEM_ALLOC_TYPE_INTERNAL);
+ region = intel_alloc(dev, sizeof(*region), 0, VK_SYSTEM_ALLOC_SCOPE_DEVICE);
if (!region)
return VK_ERROR_OUT_OF_HOST_MEMORY;
@@ -134,14 +134,14 @@
region->sampler_desc_size * sampler_count);
region->surfaces = intel_alloc(dev, region->size.surface,
- 64, VK_SYSTEM_ALLOC_TYPE_INTERNAL);
+ 64, VK_SYSTEM_ALLOC_SCOPE_DEVICE);
if (!region->surfaces) {
intel_free(dev, region);
return VK_ERROR_OUT_OF_HOST_MEMORY;
}
region->samplers = intel_alloc(dev, region->size.sampler,
- 64, VK_SYSTEM_ALLOC_TYPE_INTERNAL);
+ 64, VK_SYSTEM_ALLOC_SCOPE_DEVICE);
if (!region->samplers) {
intel_free(dev, region->surfaces);
intel_free(dev, region);
@@ -562,7 +562,7 @@
/* allocate bindings */
layout->bindings = intel_alloc(layout, sizeof(layout->bindings[0]) *
- info->bindingCount, 0, VK_SYSTEM_ALLOC_TYPE_INTERNAL);
+ info->bindingCount, 0, VK_SYSTEM_ALLOC_SCOPE_OBJECT);
if (!layout->bindings)
return VK_ERROR_OUT_OF_HOST_MEMORY;
@@ -618,7 +618,7 @@
} else {
binding->immutable_samplers = intel_alloc(layout,
sizeof(binding->immutable_samplers[0]) * lb->arraySize,
- 0, VK_SYSTEM_ALLOC_TYPE_INTERNAL);
+ 0, VK_SYSTEM_ALLOC_SCOPE_OBJECT);
if (!binding->immutable_samplers)
return VK_ERROR_OUT_OF_HOST_MEMORY;
@@ -705,7 +705,7 @@
pipeline_layout->layouts = intel_alloc(pipeline_layout,
sizeof(pipeline_layout->layouts[0]) * count,
- 0, VK_SYSTEM_ALLOC_TYPE_INTERNAL);
+ 0, VK_SYSTEM_ALLOC_SCOPE_OBJECT);
if (!pipeline_layout->layouts) {
intel_pipeline_layout_destroy(pipeline_layout);
return VK_ERROR_OUT_OF_HOST_MEMORY;
@@ -713,7 +713,7 @@
pipeline_layout->dynamic_desc_indices = intel_alloc(pipeline_layout,
sizeof(pipeline_layout->dynamic_desc_indices[0]) * count,
- 0, VK_SYSTEM_ALLOC_TYPE_INTERNAL);
+ 0, VK_SYSTEM_ALLOC_SCOPE_OBJECT);
if (!pipeline_layout->dynamic_desc_indices) {
intel_pipeline_layout_destroy(pipeline_layout);
return VK_ERROR_OUT_OF_HOST_MEMORY;
@@ -748,6 +748,7 @@
ICD_EXPORT VkResult VKAPI vkCreateDescriptorSetLayout(
VkDevice device,
const VkDescriptorSetLayoutCreateInfo* pCreateInfo,
+ const VkAllocCallbacks* pAllocator,
VkDescriptorSetLayout* pSetLayout)
{
struct intel_dev *dev = intel_dev(device);
@@ -758,7 +759,8 @@
ICD_EXPORT void VKAPI vkDestroyDescriptorSetLayout(
VkDevice device,
- VkDescriptorSetLayout descriptorSetLayout)
+ VkDescriptorSetLayout descriptorSetLayout,
+ const VkAllocCallbacks* pAllocator)
{
struct intel_obj *obj = intel_obj(descriptorSetLayout);
@@ -769,6 +771,7 @@
ICD_EXPORT VkResult VKAPI vkCreatePipelineLayout(
VkDevice device,
const VkPipelineLayoutCreateInfo* pCreateInfo,
+ const VkAllocCallbacks* pAllocator,
VkPipelineLayout* pPipelineLayout)
{
struct intel_dev *dev = intel_dev(device);
@@ -780,7 +783,8 @@
ICD_EXPORT void VKAPI vkDestroyPipelineLayout(
VkDevice device,
- VkPipelineLayout pipelineLayout)
+ VkPipelineLayout pipelineLayout,
+ const VkAllocCallbacks* pAllocator)
{
struct intel_obj *obj = intel_obj(pipelineLayout);
@@ -791,6 +795,7 @@
ICD_EXPORT VkResult VKAPI vkCreateDescriptorPool(
VkDevice device,
const VkDescriptorPoolCreateInfo* pCreateInfo,
+ const VkAllocCallbacks* pAllocator,
VkDescriptorPool* pDescriptorPool)
{
struct intel_dev *dev = intel_dev(device);
@@ -801,7 +806,8 @@
ICD_EXPORT void VKAPI vkDestroyDescriptorPool(
VkDevice device,
- VkDescriptorPool descriptorPool)
+ VkDescriptorPool descriptorPool,
+ const VkAllocCallbacks* pAllocator)
{
struct intel_obj *obj = intel_obj(descriptorPool);
diff --git a/icd/intel/dev.c b/icd/intel/dev.c
index 4e41752..3ebcaf3 100644
--- a/icd/intel/dev.c
+++ b/icd/intel/dev.c
@@ -212,6 +212,7 @@
ICD_EXPORT VkResult VKAPI vkCreateDevice(
VkPhysicalDevice gpu_,
const VkDeviceCreateInfo* pCreateInfo,
+ const VkAllocCallbacks* pAllocator,
VkDevice* pDevice)
{
struct intel_gpu *gpu = intel_gpu(gpu_);
@@ -220,7 +221,8 @@
}
ICD_EXPORT void VKAPI vkDestroyDevice(
- VkDevice device)
+ VkDevice device,
+ const VkAllocCallbacks* pAllocator)
{
struct intel_dev *dev = intel_dev(device);
diff --git a/icd/intel/event.c b/icd/intel/event.c
index f2ac3d6..e254c60 100644
--- a/icd/intel/event.c
+++ b/icd/intel/event.c
@@ -142,6 +142,7 @@
ICD_EXPORT VkResult VKAPI vkCreateEvent(
VkDevice device,
const VkEventCreateInfo* pCreateInfo,
+ const VkAllocCallbacks* pAllocator,
VkEvent* pEvent)
{
struct intel_dev *dev = intel_dev(device);
@@ -152,7 +153,8 @@
ICD_EXPORT void VKAPI vkDestroyEvent(
VkDevice device,
- VkEvent event)
+ VkEvent event,
+ const VkAllocCallbacks* pAllocator)
{
struct intel_obj *obj = intel_obj(event);
diff --git a/icd/intel/fb.c b/icd/intel/fb.c
index 2950c47..5a21546 100644
--- a/icd/intel/fb.c
+++ b/icd/intel/fb.c
@@ -38,6 +38,7 @@
VkResult intel_fb_create(struct intel_dev *dev,
const VkFramebufferCreateInfo *info,
+ const VkAllocCallbacks *allocator,
struct intel_fb **fb_ret)
{
struct intel_fb *fb;
@@ -50,7 +51,7 @@
fb->view_count = info->attachmentCount;
fb->views = intel_alloc(fb, sizeof(fb->views[0]) * fb->view_count, 0,
- VK_SYSTEM_ALLOC_TYPE_INTERNAL);
+ VK_SYSTEM_ALLOC_SCOPE_OBJECT);
if (!fb->views) {
intel_fb_destroy(fb);
return VK_ERROR_OUT_OF_HOST_MEMORY;
@@ -97,6 +98,7 @@
VkResult intel_render_pass_create(struct intel_dev *dev,
const VkRenderPassCreateInfo *info,
+ const VkAllocCallbacks *allocator,
struct intel_render_pass **rp_ret)
{
struct intel_render_pass *rp;
@@ -116,7 +118,7 @@
rp->attachments = intel_alloc(rp,
sizeof(rp->attachments[0]) * rp->attachment_count +
sizeof(rp->subpasses[0]) * rp->subpass_count, 0,
- VK_SYSTEM_ALLOC_TYPE_INTERNAL);
+ VK_SYSTEM_ALLOC_SCOPE_OBJECT);
if (!rp->attachments) {
intel_render_pass_destroy(rp);
return VK_ERROR_OUT_OF_HOST_MEMORY;
@@ -199,17 +201,19 @@
ICD_EXPORT VkResult VKAPI vkCreateFramebuffer(
VkDevice device,
const VkFramebufferCreateInfo* pCreateInfo,
+ const VkAllocCallbacks* pAllocator,
VkFramebuffer* pFramebuffer)
{
struct intel_dev *dev = intel_dev(device);
- return intel_fb_create(dev, pCreateInfo,
+ return intel_fb_create(dev, pCreateInfo, pAllocator,
(struct intel_fb **) pFramebuffer);
}
ICD_EXPORT void VKAPI vkDestroyFramebuffer(
VkDevice device,
- VkFramebuffer framebuffer)
+ VkFramebuffer framebuffer,
+ const VkAllocCallbacks* pAllocator)
{
struct intel_obj *obj = intel_obj(framebuffer);
@@ -220,18 +224,19 @@
ICD_EXPORT VkResult VKAPI vkCreateRenderPass(
VkDevice device,
const VkRenderPassCreateInfo* pCreateInfo,
+ const VkAllocCallbacks* pAllocator,
VkRenderPass* pRenderPass)
{
struct intel_dev *dev = intel_dev(device);
- return intel_render_pass_create(dev, pCreateInfo,
+ return intel_render_pass_create(dev, pCreateInfo, pAllocator,
(struct intel_render_pass **) pRenderPass);
}
ICD_EXPORT void VKAPI vkDestroyRenderPass(
VkDevice device,
- VkRenderPass renderPass)
-
+ VkRenderPass renderPass,
+ const VkAllocCallbacks* pAllocator)
{
struct intel_obj *obj = intel_obj(renderPass);
diff --git a/icd/intel/fb.h b/icd/intel/fb.h
index eca65d2..fade414 100644
--- a/icd/intel/fb.h
+++ b/icd/intel/fb.h
@@ -96,13 +96,15 @@
}
VkResult intel_fb_create(struct intel_dev *dev,
- const VkFramebufferCreateInfo *pInfo,
- struct intel_fb **fb_ret);
+ const VkFramebufferCreateInfo *pInfo,
+ const VkAllocCallbacks *allocator,
+ struct intel_fb **fb_ret);
void intel_fb_destroy(struct intel_fb *fb);
VkResult intel_render_pass_create(struct intel_dev *dev,
- const VkRenderPassCreateInfo *pInfo,
- struct intel_render_pass **rp_ret);
+ const VkRenderPassCreateInfo *pInfo,
+ const VkAllocCallbacks *allocator,
+ struct intel_render_pass **rp_ret);
void intel_render_pass_destroy(struct intel_render_pass *rp);
#endif /* FB_H */
diff --git a/icd/intel/fence.c b/icd/intel/fence.c
index 91eaaf1..5669650 100644
--- a/icd/intel/fence.c
+++ b/icd/intel/fence.c
@@ -120,6 +120,7 @@
ICD_EXPORT VkResult VKAPI vkCreateFence(
VkDevice device,
const VkFenceCreateInfo* pCreateInfo,
+ const VkAllocCallbacks* pAllocator,
VkFence* pFence)
{
struct intel_dev *dev = intel_dev(device);
@@ -130,7 +131,8 @@
ICD_EXPORT void VKAPI vkDestroyFence(
VkDevice device,
- VkFence fence)
+ VkFence fence,
+ const VkAllocCallbacks* pAllocator)
{
struct intel_obj *obj = intel_obj(fence);
diff --git a/icd/intel/gpu.c b/icd/intel/gpu.c
index 223baf1..3a192e2 100644
--- a/icd/intel/gpu.c
+++ b/icd/intel/gpu.c
@@ -157,7 +157,7 @@
return VK_ERROR_INITIALIZATION_FAILED;
}
- gpu = intel_alloc(instance, sizeof(*gpu), 0, VK_SYSTEM_ALLOC_TYPE_API_OBJECT);
+ gpu = intel_alloc(instance, sizeof(*gpu), 0, VK_SYSTEM_ALLOC_SCOPE_INSTANCE);
if (!gpu)
return VK_ERROR_OUT_OF_HOST_MEMORY;
@@ -171,7 +171,7 @@
render_len = (render_node) ? strlen(render_node) : 0;
gpu->primary_node = intel_alloc(gpu, primary_len + 1 +
- ((render_len) ? (render_len + 1) : 0), 0, VK_SYSTEM_ALLOC_TYPE_INTERNAL);
+ ((render_len) ? (render_len + 1) : 0), 0, VK_SYSTEM_ALLOC_SCOPE_INSTANCE);
if (!gpu->primary_node) {
intel_free(instance, gpu);
return VK_ERROR_OUT_OF_HOST_MEMORY;
diff --git a/icd/intel/img.c b/icd/intel/img.c
index 9322973..1a72a5d 100644
--- a/icd/intel/img.c
+++ b/icd/intel/img.c
@@ -60,6 +60,7 @@
VkResult intel_img_create(struct intel_dev *dev,
const VkImageCreateInfo *info,
+ const VkAllocCallbacks *allocator,
bool scanout,
struct intel_img **img_ret)
{
@@ -93,7 +94,7 @@
VkImageCreateInfo s8_info;
img->s8_layout = intel_alloc(img, sizeof(*img->s8_layout), 0,
- VK_SYSTEM_ALLOC_TYPE_INTERNAL);
+ VK_SYSTEM_ALLOC_SCOPE_OBJECT);
if (!img->s8_layout) {
intel_img_destroy(img);
return VK_ERROR_OUT_OF_HOST_MEMORY;
@@ -142,17 +143,19 @@
ICD_EXPORT VkResult VKAPI vkCreateImage(
VkDevice device,
const VkImageCreateInfo* pCreateInfo,
+ const VkAllocCallbacks* pAllocator,
VkImage* pImage)
{
struct intel_dev *dev = intel_dev(device);
- return intel_img_create(dev, pCreateInfo, false,
+ return intel_img_create(dev, pCreateInfo, pAllocator, false,
(struct intel_img **) pImage);
}
ICD_EXPORT void VKAPI vkDestroyImage(
VkDevice device,
- VkImage image)
+ VkImage image,
+ const VkAllocCallbacks* pAllocator)
{
struct intel_obj *obj = intel_obj(image);
diff --git a/icd/intel/img.h b/icd/intel/img.h
index 9a79e47..b583dfe 100644
--- a/icd/intel/img.h
+++ b/icd/intel/img.h
@@ -70,9 +70,10 @@
}
VkResult intel_img_create(struct intel_dev *dev,
- const VkImageCreateInfo *info,
- bool scanout,
- struct intel_img **img_ret);
+ const VkImageCreateInfo *info,
+ const VkAllocCallbacks *allocator,
+ bool scanout,
+ struct intel_img **img_ret);
void intel_img_destroy(struct intel_img *img);
diff --git a/icd/intel/instance.c b/icd/intel/instance.c
index 890a513..bff0551 100644
--- a/icd/intel/instance.c
+++ b/icd/intel/instance.c
@@ -35,11 +35,11 @@
void *intel_alloc(const void *handle,
size_t size, size_t alignment,
- VkSystemAllocType type)
+ VkSystemAllocScope scope)
{
assert(intel_handle_validate(handle));
return icd_instance_alloc(((const struct intel_handle *) handle)->instance->icd,
- size, alignment, type);
+ size, alignment, scope);
}
void intel_free(const void *handle, void *ptr)
@@ -146,6 +146,7 @@
static VkResult intel_instance_create(
const VkInstanceCreateInfo* info,
+ const VkAllocCallbacks* allocator,
struct intel_instance **pInstance)
{
struct intel_instance *instance;
@@ -154,12 +155,12 @@
intel_debug_init();
- icd = icd_instance_create(info->pAppInfo, info->pAllocCb);
+ icd = icd_instance_create(info->pAppInfo, allocator);
if (!icd)
return VK_ERROR_OUT_OF_HOST_MEMORY;
instance = icd_instance_alloc(icd, sizeof(*instance), 0,
- VK_SYSTEM_ALLOC_TYPE_API_OBJECT);
+ VK_SYSTEM_ALLOC_SCOPE_INSTANCE);
if (!instance) {
icd_instance_destroy(icd);
return VK_ERROR_OUT_OF_HOST_MEMORY;
@@ -219,13 +220,16 @@
ICD_EXPORT VkResult VKAPI vkCreateInstance(
const VkInstanceCreateInfo* pCreateInfo,
+ const VkAllocCallbacks* pAllocator,
VkInstance* pInstance)
{
- return intel_instance_create(pCreateInfo, (struct intel_instance **) pInstance);
+ return intel_instance_create(pCreateInfo, pAllocator,
+ (struct intel_instance **) pInstance);
}
ICD_EXPORT void VKAPI vkDestroyInstance(
- VkInstance pInstance)
+ VkInstance pInstance,
+ const VkAllocCallbacks* pAllocator)
{
struct intel_instance *instance = intel_instance(pInstance);
diff --git a/icd/intel/intel.h b/icd/intel/intel.h
index e324f24..9628bb1 100644
--- a/icd/intel/intel.h
+++ b/icd/intel/intel.h
@@ -126,7 +126,7 @@
void *intel_alloc(const void *handle,
size_t size, size_t alignment,
- VkSystemAllocType type);
+ VkSystemAllocScope scope);
void intel_free(const void *handle, void *ptr);
diff --git a/icd/intel/kmd/winsys_drm.c b/icd/intel/kmd/winsys_drm.c
index 2c8a2b8..edc6e70 100644
--- a/icd/intel/kmd/winsys_drm.c
+++ b/icd/intel/kmd/winsys_drm.c
@@ -168,7 +168,7 @@
struct intel_winsys *winsys;
winsys = icd_instance_alloc(instance, sizeof(*winsys), 0,
- VK_SYSTEM_ALLOC_TYPE_INTERNAL);
+ VK_SYSTEM_ALLOC_SCOPE_INSTANCE);
if (!winsys)
return NULL;
diff --git a/icd/intel/mem.c b/icd/intel/mem.c
index 21936a5..b5e70a0 100644
--- a/icd/intel/mem.c
+++ b/icd/intel/mem.c
@@ -65,6 +65,7 @@
ICD_EXPORT VkResult VKAPI vkAllocMemory(
VkDevice device,
const VkMemoryAllocInfo* pAllocInfo,
+ const VkAllocCallbacks* pAllocator,
VkDeviceMemory* pMem)
{
struct intel_dev *dev = intel_dev(device);
@@ -74,7 +75,8 @@
ICD_EXPORT void VKAPI vkFreeMemory(
VkDevice device,
- VkDeviceMemory mem_)
+ VkDeviceMemory mem_,
+ const VkAllocCallbacks* pAllocator)
{
struct intel_mem *mem = intel_mem(mem_);
diff --git a/icd/intel/obj.c b/icd/intel/obj.c
index 27135b9..a1c61a3 100644
--- a/icd/intel/obj.c
+++ b/icd/intel/obj.c
@@ -137,7 +137,7 @@
if (shallow_copy) {
dbg->create_info = intel_alloc(handle, shallow_copy, 0,
- VK_SYSTEM_ALLOC_TYPE_DEBUG);
+ VK_SYSTEM_ALLOC_SCOPE_OBJECT);
if (!dbg->create_info)
return false;
@@ -152,7 +152,7 @@
size = sizeof(*src);
dbg->create_info_size = size;
- dst = intel_alloc(handle, size, 0, VK_SYSTEM_ALLOC_TYPE_DEBUG);
+ dst = intel_alloc(handle, size, 0, VK_SYSTEM_ALLOC_SCOPE_OBJECT);
if (!dst)
return false;
memcpy(dst, src, sizeof(*src));
@@ -182,7 +182,7 @@
size += strlen(src->ppEnabledExtensionNames[i]) + 1;
}
- dst = intel_alloc(handle, size, 0, VK_SYSTEM_ALLOC_TYPE_DEBUG);
+ dst = intel_alloc(handle, size, 0, VK_SYSTEM_ALLOC_SCOPE_OBJECT);
if (!dst)
return false;
@@ -239,7 +239,7 @@
assert(dbg_size >= sizeof(*dbg));
- dbg = intel_alloc(handle, dbg_size, 0, VK_SYSTEM_ALLOC_TYPE_DEBUG);
+ dbg = intel_alloc(handle, dbg_size, 0, VK_SYSTEM_ALLOC_SCOPE_OBJECT);
if (!dbg)
return NULL;
@@ -284,7 +284,7 @@
assert(obj_size >= sizeof(*base));
- base = intel_alloc(handle, obj_size, 0, VK_SYSTEM_ALLOC_TYPE_API_OBJECT);
+ base = intel_alloc(handle, obj_size, 0, VK_SYSTEM_ALLOC_SCOPE_OBJECT);
if (!base)
return NULL;
diff --git a/icd/intel/pipeline.c b/icd/intel/pipeline.c
index 503e771..62f4860 100644
--- a/icd/intel/pipeline.c
+++ b/icd/intel/pipeline.c
@@ -207,7 +207,7 @@
struct intel_pipeline_shader *sh;
VkResult ret;
- sh = intel_alloc(dev, sizeof(*sh), 0, VK_SYSTEM_ALLOC_TYPE_INTERNAL);
+ sh = intel_alloc(dev, sizeof(*sh), 0, VK_SYSTEM_ALLOC_SCOPE_DEVICE);
if (!sh)
return NULL;
memset(sh, 0, sizeof(*sh));
@@ -1350,6 +1350,7 @@
ICD_EXPORT VkResult VKAPI vkCreatePipelineCache(
VkDevice device,
const VkPipelineCacheCreateInfo* pCreateInfo,
+ const VkAllocCallbacks* pAllocator,
VkPipelineCache* pPipelineCache)
{
@@ -1360,7 +1361,8 @@
void VKAPI vkDestroyPipelineCache(
VkDevice device,
- VkPipelineCache pipelineCache)
+ VkPipelineCache pipelineCache,
+ const VkAllocCallbacks* pAllocator)
{
}
@@ -1387,6 +1389,7 @@
VkPipelineCache pipelineCache,
uint32_t createInfoCount,
const VkGraphicsPipelineCreateInfo* pCreateInfos,
+ const VkAllocCallbacks* pAllocator,
VkPipeline* pPipelines)
{
struct intel_dev *dev = intel_dev(device);
@@ -1415,6 +1418,7 @@
VkPipelineCache pipelineCache,
uint32_t createInfoCount,
const VkComputePipelineCreateInfo* pCreateInfos,
+ const VkAllocCallbacks* pAllocator,
VkPipeline* pPipelines)
{
return VK_ERROR_VALIDATION_FAILED;
@@ -1422,7 +1426,8 @@
ICD_EXPORT void VKAPI vkDestroyPipeline(
VkDevice device,
- VkPipeline pipeline)
+ VkPipeline pipeline,
+ const VkAllocCallbacks* pAllocator)
{
struct intel_obj *obj = intel_obj(pipeline);
diff --git a/icd/intel/query.c b/icd/intel/query.c
index 9cb6af2..88c647b 100644
--- a/icd/intel/query.c
+++ b/icd/intel/query.c
@@ -219,6 +219,7 @@
ICD_EXPORT VkResult VKAPI vkCreateQueryPool(
VkDevice device,
const VkQueryPoolCreateInfo* pCreateInfo,
+ const VkAllocCallbacks* pAllocator,
VkQueryPool* pQueryPool)
{
struct intel_dev *dev = intel_dev(device);
@@ -229,7 +230,8 @@
ICD_EXPORT void VKAPI vkDestroyQueryPool(
VkDevice device,
- VkQueryPool queryPool)
+ VkQueryPool queryPool,
+ const VkAllocCallbacks* pAllocator)
{
struct intel_obj *obj = intel_obj(queryPool);
diff --git a/icd/intel/queue.c b/icd/intel/queue.c
index 5565a5f..7a47e28 100644
--- a/icd/intel/queue.c
+++ b/icd/intel/queue.c
@@ -439,6 +439,7 @@
ICD_EXPORT VkResult VKAPI vkCreateSemaphore(
VkDevice device,
const VkSemaphoreCreateInfo *pCreateInfo,
+ const VkAllocCallbacks* pAllocator,
VkSemaphore *pSemaphore)
{
/*
@@ -459,7 +460,8 @@
ICD_EXPORT void VKAPI vkDestroySemaphore(
VkDevice device,
- VkSemaphore semaphore)
+ VkSemaphore semaphore,
+ const VkAllocCallbacks* pAllocator)
{
struct intel_obj *obj = intel_obj(semaphore);
obj->destroy(obj);
diff --git a/icd/intel/sampler.c b/icd/intel/sampler.c
index 493d097..e5b946b 100644
--- a/icd/intel/sampler.c
+++ b/icd/intel/sampler.c
@@ -398,6 +398,7 @@
ICD_EXPORT VkResult VKAPI vkCreateSampler(
VkDevice device,
const VkSamplerCreateInfo* pCreateInfo,
+ const VkAllocCallbacks* pAllocator,
VkSampler* pSampler)
{
struct intel_dev *dev = intel_dev(device);
@@ -408,7 +409,8 @@
ICD_EXPORT void VKAPI vkDestroySampler(
VkDevice device,
- VkSampler sampler)
+ VkSampler sampler,
+ const VkAllocCallbacks* pAllocator)
{
struct intel_obj *obj = intel_obj(sampler);
diff --git a/icd/intel/shader.c b/icd/intel/shader.c
index 9965d7e..d8a3146 100644
--- a/icd/intel/shader.c
+++ b/icd/intel/shader.c
@@ -68,6 +68,7 @@
ICD_EXPORT VkResult VKAPI vkCreateShaderModule(
VkDevice device,
const VkShaderModuleCreateInfo* pCreateInfo,
+ const VkAllocCallbacks* pAllocator,
VkShaderModule* pShaderModule)
{
struct intel_dev *dev = intel_dev(device);
@@ -77,7 +78,8 @@
ICD_EXPORT void VKAPI vkDestroyShaderModule(
VkDevice device,
- VkShaderModule shaderModule)
+ VkShaderModule shaderModule,
+ const VkAllocCallbacks* pAllocator)
{
struct intel_obj *obj = intel_obj(shaderModule);
@@ -127,6 +129,7 @@
ICD_EXPORT VkResult VKAPI vkCreateShader(
VkDevice device,
const VkShaderCreateInfo* pCreateInfo,
+ const VkAllocCallbacks* pAllocator,
VkShader* pShader)
{
struct intel_dev *dev = intel_dev(device);
@@ -136,7 +139,8 @@
ICD_EXPORT void VKAPI vkDestroyShader(
VkDevice device,
- VkShader shader)
+ VkShader shader,
+ const VkAllocCallbacks* pAllocator)
{
struct intel_obj *obj = intel_obj(shader);
diff --git a/icd/intel/view.c b/icd/intel/view.c
index 8593f53..b246927 100644
--- a/icd/intel/view.c
+++ b/icd/intel/view.c
@@ -1356,6 +1356,7 @@
ICD_EXPORT VkResult VKAPI vkCreateBufferView(
VkDevice device,
const VkBufferViewCreateInfo* pCreateInfo,
+ const VkAllocCallbacks* pAllocator,
VkBufferView* pView)
{
struct intel_dev *dev = intel_dev(device);
@@ -1366,7 +1367,8 @@
ICD_EXPORT void VKAPI vkDestroyBufferView(
VkDevice device,
- VkBufferView bufferView)
+ VkBufferView bufferView,
+ const VkAllocCallbacks* pAllocator)
{
struct intel_obj *obj = intel_obj(bufferView);
@@ -1377,6 +1379,7 @@
ICD_EXPORT VkResult VKAPI vkCreateImageView(
VkDevice device,
const VkImageViewCreateInfo* pCreateInfo,
+ const VkAllocCallbacks* pAllocator,
VkImageView* pView)
{
struct intel_dev *dev = intel_dev(device);
@@ -1387,7 +1390,8 @@
ICD_EXPORT void VKAPI vkDestroyImageView(
VkDevice device,
- VkImageView imageView)
+ VkImageView imageView,
+ const VkAllocCallbacks* pAllocator)
{
struct intel_obj *obj = intel_obj(imageView);
diff --git a/icd/intel/wsi_x11.c b/icd/intel/wsi_x11.c
index dbcd2d6..77fe2f4 100644
--- a/icd/intel/wsi_x11.c
+++ b/icd/intel/wsi_x11.c
@@ -409,7 +409,7 @@
xcb_pixmap_t pixmap;
VkResult ret;
- ret = intel_img_create(dev, img_info, true, &img);
+ ret = intel_img_create(dev, img_info, NULL, true, &img);
if (ret != VK_SUCCESS)
return NULL;
@@ -456,12 +456,12 @@
uint32_t i;
images = intel_alloc(sc, sizeof(*images) * info->minImageCount,
- 0, VK_SYSTEM_ALLOC_TYPE_INTERNAL);
+ 0, VK_SYSTEM_ALLOC_SCOPE_OBJECT);
if (!images)
return false;
image_state = intel_alloc(
sc, sizeof(intel_x11_swap_chain_image_state) * info->minImageCount,
- 0, VK_SYSTEM_ALLOC_TYPE_INTERNAL);
+ 0, VK_SYSTEM_ALLOC_SCOPE_OBJECT);
if (!image_state) {
for (i = 0; i < info->minImageCount; i++) {
intel_img_destroy(images[i]);
@@ -471,7 +471,7 @@
}
present_queue = intel_alloc(
sc, sizeof(uint32_t) * info->minImageCount,
- 0, VK_SYSTEM_ALLOC_TYPE_INTERNAL);
+ 0, VK_SYSTEM_ALLOC_SCOPE_OBJECT);
if (!present_queue) {
for (i = 0; i < info->minImageCount; i++) {
intel_img_destroy(images[i]);
@@ -786,7 +786,7 @@
close(fd);
- sc = intel_alloc(dev, sizeof(*sc), 0, VK_SYSTEM_ALLOC_TYPE_API_OBJECT);
+ sc = intel_alloc(dev, sizeof(*sc), 0, VK_SYSTEM_ALLOC_SCOPE_OBJECT);
if (!sc)
return VK_ERROR_OUT_OF_HOST_MEMORY;
@@ -843,7 +843,7 @@
{
struct intel_x11_img_data *data;
- data = intel_alloc(img, sizeof(*data), 0, VK_SYSTEM_ALLOC_TYPE_INTERNAL);
+ data = intel_alloc(img, sizeof(*data), 0, VK_SYSTEM_ALLOC_SCOPE_OBJECT);
if (!data)
return VK_ERROR_OUT_OF_HOST_MEMORY;
@@ -872,7 +872,7 @@
{
struct intel_x11_fence_data *data;
- data = intel_alloc(fence, sizeof(*data), 0, VK_SYSTEM_ALLOC_TYPE_INTERNAL);
+ data = intel_alloc(fence, sizeof(*data), 0, VK_SYSTEM_ALLOC_SCOPE_OBJECT);
if (!data)
return VK_ERROR_OUT_OF_HOST_MEMORY;