mirror of
https://github.com/Yours3lf/rpi-vk-driver.git
synced 2025-03-21 12:29:15 +01:00
added some allocation checks
This commit is contained in:
parent
53da52251d
commit
ff143f8f55
@ -128,12 +128,19 @@ VKAPI_ATTR VkResult VKAPI_CALL vkCreateBufferView(
|
||||
|
||||
_bufferView* bv = ALLOCATE(sizeof(_bufferView), 1, VK_SYSTEM_ALLOCATION_SCOPE_OBJECT);
|
||||
|
||||
if(!bv)
|
||||
{
|
||||
return VK_ERROR_OUT_OF_HOST_MEMORY;
|
||||
}
|
||||
|
||||
bv->buffer = pCreateInfo->buffer;
|
||||
bv->format = pCreateInfo->format;
|
||||
bv->offset = pCreateInfo->offset;
|
||||
bv->range = pCreateInfo->range;
|
||||
|
||||
*pView = bv;
|
||||
|
||||
return VK_SUCCESS;
|
||||
}
|
||||
|
||||
/*
|
||||
@ -200,7 +207,9 @@ VKAPI_ATTR VkResult VKAPI_CALL vkCreateImage(
|
||||
{
|
||||
i->queueFamiliesWithAccess = ALLOCATE(sizeof(uint32_t) * i->numQueueFamiliesWithAccess, 1, VK_SYSTEM_ALLOCATION_SCOPE_OBJECT);
|
||||
if(!i->queueFamiliesWithAccess)
|
||||
{
|
||||
return VK_ERROR_OUT_OF_HOST_MEMORY;
|
||||
}
|
||||
memcpy(i->queueFamiliesWithAccess, pCreateInfo->pQueueFamilyIndices, sizeof(uint32_t) * i->numQueueFamiliesWithAccess);
|
||||
}
|
||||
|
||||
|
@ -298,10 +298,17 @@ VKAPI_ATTR VkResult VKAPI_CALL vkCreateFence(
|
||||
|
||||
_fence* f = ALLOCATE(sizeof(_fence), 1, VK_SYSTEM_ALLOCATION_SCOPE_OBJECT);
|
||||
|
||||
if(!f)
|
||||
{
|
||||
return VK_ERROR_OUT_OF_HOST_MEMORY;
|
||||
}
|
||||
|
||||
f->seqno = 0;
|
||||
f->signaled = pCreateInfo->flags & VK_FENCE_CREATE_SIGNALED_BIT;
|
||||
|
||||
*pFence = f;
|
||||
|
||||
return VK_SUCCESS;
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -219,6 +219,10 @@ VKAPI_ATTR VkResult VKAPI_CALL vkCreateSwapchainKHR(
|
||||
if(s->images[c].concurrentAccess)
|
||||
{
|
||||
s->images[c].queueFamiliesWithAccess = ALLOCATE(sizeof(uint32_t)*s->images[c].numQueueFamiliesWithAccess, 1, VK_SYSTEM_ALLOCATION_SCOPE_OBJECT);
|
||||
if(!s->images[c].queueFamiliesWithAccess)
|
||||
{
|
||||
return VK_ERROR_OUT_OF_HOST_MEMORY;
|
||||
}
|
||||
memcpy(s->images[c].queueFamiliesWithAccess, pCreateInfo->pQueueFamilyIndices, sizeof(uint32_t)*s->images[c].numQueueFamiliesWithAccess);
|
||||
}
|
||||
s->images[c].preTransformMode = pCreateInfo->preTransform;
|
||||
|
Loading…
x
Reference in New Issue
Block a user