1
0
mirror of https://github.com/Yours3lf/rpi-vk-driver.git synced 2025-02-20 17:54:17 +01:00

changed function usage so that the driver can expose them ifneedbe

This commit is contained in:
yours3lf 2020-05-18 22:38:57 +01:00
parent 0301ceedfa
commit 86a7834753
22 changed files with 902 additions and 895 deletions

View File

@ -18,13 +18,13 @@ static atomic_int lastSeqnoGuard = 0;
* not be used concurrently in multiple threads. That includes use via recording commands on any command buffers allocated from the pool, * not be used concurrently in multiple threads. That includes use via recording commands on any command buffers allocated from the pool,
* as well as operations that allocate, free, and reset command buffers or the pool itself. * as well as operations that allocate, free, and reset command buffers or the pool itself.
*/ */
VKAPI_ATTR VkResult VKAPI_CALL rpi_vkCreateCommandPool( VKAPI_ATTR VkResult VKAPI_CALL RPIFUNC(vkCreateCommandPool)(
VkDevice device, VkDevice device,
const VkCommandPoolCreateInfo* pCreateInfo, const VkCommandPoolCreateInfo* pCreateInfo,
const VkAllocationCallbacks* pAllocator, const VkAllocationCallbacks* pAllocator,
VkCommandPool* pCommandPool) VkCommandPool* pCommandPool)
{ {
PROFILESTART(rpi_vkCreateCommandPool); PROFILESTART(RPIFUNC(vkCreateCommandPool));
assert(device); assert(device);
assert(pCreateInfo); assert(pCreateInfo);
@ -40,7 +40,7 @@ VKAPI_ATTR VkResult VKAPI_CALL rpi_vkCreateCommandPool(
if(!cp) if(!cp)
{ {
PROFILEEND(rpi_vkCreateCommandPool); PROFILEEND(RPIFUNC(vkCreateCommandPool));
return VK_ERROR_OUT_OF_HOST_MEMORY; return VK_ERROR_OUT_OF_HOST_MEMORY;
} }
@ -67,7 +67,7 @@ VKAPI_ATTR VkResult VKAPI_CALL rpi_vkCreateCommandPool(
void* pamem = ALLOCATE(numCommandBufs * sizeof(_commandBuffer), 1, VK_SYSTEM_ALLOCATION_SCOPE_OBJECT); void* pamem = ALLOCATE(numCommandBufs * sizeof(_commandBuffer), 1, VK_SYSTEM_ALLOCATION_SCOPE_OBJECT);
if(!pamem) if(!pamem)
{ {
PROFILEEND(rpi_vkCreateCommandPool); PROFILEEND(RPIFUNC(vkCreateCommandPool));
return VK_ERROR_OUT_OF_HOST_MEMORY; return VK_ERROR_OUT_OF_HOST_MEMORY;
} }
cp->pa = createPoolAllocator(pamem, sizeof(_commandBuffer), numCommandBufs * sizeof(_commandBuffer)); cp->pa = createPoolAllocator(pamem, sizeof(_commandBuffer), numCommandBufs * sizeof(_commandBuffer));
@ -75,7 +75,7 @@ VKAPI_ATTR VkResult VKAPI_CALL rpi_vkCreateCommandPool(
void* cpamem = ALLOCATE(consecutivePoolSize, 1, VK_SYSTEM_ALLOCATION_SCOPE_OBJECT); void* cpamem = ALLOCATE(consecutivePoolSize, 1, VK_SYSTEM_ALLOCATION_SCOPE_OBJECT);
if(!cpamem) if(!cpamem)
{ {
PROFILEEND(rpi_vkCreateCommandPool); PROFILEEND(RPIFUNC(vkCreateCommandPool));
return VK_ERROR_OUT_OF_HOST_MEMORY; return VK_ERROR_OUT_OF_HOST_MEMORY;
} }
cp->cpa = createConsecutivePoolAllocator(cpamem, consecutiveBlockSize, consecutivePoolSize); cp->cpa = createConsecutivePoolAllocator(cpamem, consecutiveBlockSize, consecutivePoolSize);
@ -83,7 +83,7 @@ VKAPI_ATTR VkResult VKAPI_CALL rpi_vkCreateCommandPool(
*pCommandPool = (VkCommandPool)cp; *pCommandPool = (VkCommandPool)cp;
PROFILEEND(rpi_vkCreateCommandPool); PROFILEEND(RPIFUNC(vkCreateCommandPool));
return VK_SUCCESS; return VK_SUCCESS;
} }
@ -92,12 +92,12 @@ VKAPI_ATTR VkResult VKAPI_CALL rpi_vkCreateCommandPool(
* vkAllocateCommandBuffers can be used to create multiple command buffers. If the creation of any of those command buffers fails, * vkAllocateCommandBuffers can be used to create multiple command buffers. If the creation of any of those command buffers fails,
* the implementation must destroy all successfully created command buffer objects from this command, set all entries of the pCommandBuffers array to NULL and return the error. * the implementation must destroy all successfully created command buffer objects from this command, set all entries of the pCommandBuffers array to NULL and return the error.
*/ */
VKAPI_ATTR VkResult VKAPI_CALL rpi_vkAllocateCommandBuffers( VKAPI_ATTR VkResult VKAPI_CALL RPIFUNC(vkAllocateCommandBuffers)(
VkDevice device, VkDevice device,
const VkCommandBufferAllocateInfo* pAllocateInfo, const VkCommandBufferAllocateInfo* pAllocateInfo,
VkCommandBuffer* pCommandBuffers) VkCommandBuffer* pCommandBuffers)
{ {
PROFILESTART(rpi_vkAllocateCommandBuffers); PROFILESTART(RPIFUNC(vkAllocateCommandBuffers));
assert(device); assert(device);
assert(pAllocateInfo); assert(pAllocateInfo);
@ -201,18 +201,18 @@ VKAPI_ATTR VkResult VKAPI_CALL rpi_vkAllocateCommandBuffers(
} }
} }
PROFILEEND(rpi_vkAllocateCommandBuffers); PROFILEEND(RPIFUNC(vkAllocateCommandBuffers));
return res; return res;
} }
/* /*
* https://www.khronos.org/registry/vulkan/specs/1.1-extensions/html/vkspec.html#vkBeginCommandBuffer * https://www.khronos.org/registry/vulkan/specs/1.1-extensions/html/vkspec.html#vkBeginCommandBuffer
*/ */
VKAPI_ATTR VkResult VKAPI_CALL rpi_vkBeginCommandBuffer( VKAPI_ATTR VkResult VKAPI_CALL RPIFUNC(vkBeginCommandBuffer)(
VkCommandBuffer commandBuffer, VkCommandBuffer commandBuffer,
const VkCommandBufferBeginInfo* pBeginInfo) const VkCommandBufferBeginInfo* pBeginInfo)
{ {
PROFILESTART(rpi_vkBeginCommandBuffer); PROFILESTART(RPIFUNC(vkBeginCommandBuffer));
assert(commandBuffer); assert(commandBuffer);
assert(pBeginInfo); assert(pBeginInfo);
@ -233,10 +233,10 @@ VKAPI_ATTR VkResult VKAPI_CALL rpi_vkBeginCommandBuffer(
if((pBeginInfo->flags & VK_COMMAND_BUFFER_USAGE_ONE_TIME_SUBMIT_BIT) && if((pBeginInfo->flags & VK_COMMAND_BUFFER_USAGE_ONE_TIME_SUBMIT_BIT) &&
commandBuffer->cp->resetAble) commandBuffer->cp->resetAble)
{ {
rpi_vkResetCommandBuffer(commandBuffer, 0); RPIFUNC(vkResetCommandBuffer)(commandBuffer, 0);
} }
PROFILEEND(rpi_vkBeginCommandBuffer); PROFILEEND(RPIFUNC(vkBeginCommandBuffer));
return VK_SUCCESS; return VK_SUCCESS;
} }
@ -246,16 +246,16 @@ VKAPI_ATTR VkResult VKAPI_CALL rpi_vkBeginCommandBuffer(
* If the application wishes to further use the command buffer, the command buffer must be reset. The command buffer must have been in the recording state, * If the application wishes to further use the command buffer, the command buffer must be reset. The command buffer must have been in the recording state,
* and is moved to the executable state. * and is moved to the executable state.
*/ */
VKAPI_ATTR VkResult VKAPI_CALL rpi_vkEndCommandBuffer( VKAPI_ATTR VkResult VKAPI_CALL RPIFUNC(vkEndCommandBuffer)(
VkCommandBuffer commandBuffer) VkCommandBuffer commandBuffer)
{ {
PROFILESTART(rpi_vkEndCommandBuffer); PROFILESTART(RPIFUNC(vkEndCommandBuffer));
assert(commandBuffer); assert(commandBuffer);
commandBuffer->state = CMDBUF_STATE_EXECUTABLE; commandBuffer->state = CMDBUF_STATE_EXECUTABLE;
PROFILEEND(rpi_vkEndCommandBuffer); PROFILEEND(RPIFUNC(vkEndCommandBuffer));
return VK_SUCCESS; return VK_SUCCESS;
} }
@ -277,13 +277,13 @@ VKAPI_ATTR VkResult VKAPI_CALL rpi_vkEndCommandBuffer(
* referenced by pSubmits is unaffected by the call or its failure. If vkQueueSubmit fails in such a way that the implementation is unable to make that guarantee, * referenced by pSubmits is unaffected by the call or its failure. If vkQueueSubmit fails in such a way that the implementation is unable to make that guarantee,
* the implementation must return VK_ERROR_DEVICE_LOST. See Lost Device. * the implementation must return VK_ERROR_DEVICE_LOST. See Lost Device.
*/ */
VKAPI_ATTR VkResult VKAPI_CALL rpi_vkQueueSubmit( VKAPI_ATTR VkResult VKAPI_CALL RPIFUNC(vkQueueSubmit)(
VkQueue queue, VkQueue queue,
uint32_t submitCount, uint32_t submitCount,
const VkSubmitInfo* pSubmits, const VkSubmitInfo* pSubmits,
VkFence fence) VkFence fence)
{ {
PROFILESTART(rpi_vkQueueSubmit); PROFILESTART(RPIFUNC(vkQueueSubmit));
assert(queue); assert(queue);
@ -679,7 +679,7 @@ VKAPI_ATTR VkResult VKAPI_CALL rpi_vkQueueSubmit(
f->seqno = queue->lastEmitSeqno; f->seqno = queue->lastEmitSeqno;
} }
PROFILEEND(rpi_vkQueueSubmit); PROFILEEND(RPIFUNC(vkQueueSubmit));
return VK_SUCCESS; return VK_SUCCESS;
} }
@ -687,13 +687,13 @@ VKAPI_ATTR VkResult VKAPI_CALL rpi_vkQueueSubmit(
* https://www.khronos.org/registry/vulkan/specs/1.1-extensions/html/vkspec.html#vkFreeCommandBuffers * https://www.khronos.org/registry/vulkan/specs/1.1-extensions/html/vkspec.html#vkFreeCommandBuffers
* Any primary command buffer that is in the recording or executable state and has any element of pCommandBuffers recorded into it, becomes invalid. * Any primary command buffer that is in the recording or executable state and has any element of pCommandBuffers recorded into it, becomes invalid.
*/ */
VKAPI_ATTR void VKAPI_CALL rpi_vkFreeCommandBuffers( VKAPI_ATTR void VKAPI_CALL RPIFUNC(vkFreeCommandBuffers)(
VkDevice device, VkDevice device,
VkCommandPool commandPool, VkCommandPool commandPool,
uint32_t commandBufferCount, uint32_t commandBufferCount,
const VkCommandBuffer* pCommandBuffers) const VkCommandBuffer* pCommandBuffers)
{ {
PROFILESTART(rpi_vkFreeCommandBuffers); PROFILESTART(RPIFUNC(vkFreeCommandBuffers));
assert(device); assert(device);
assert(commandPool); assert(commandPool);
@ -713,7 +713,7 @@ VKAPI_ATTR void VKAPI_CALL rpi_vkFreeCommandBuffers(
} }
} }
PROFILEEND(rpi_vkFreeCommandBuffers); PROFILEEND(RPIFUNC(vkFreeCommandBuffers));
} }
/* /*
@ -722,12 +722,12 @@ VKAPI_ATTR void VKAPI_CALL rpi_vkFreeCommandBuffers(
* Any primary command buffer allocated from another VkCommandPool that is in the recording or executable state and has a secondary command buffer * Any primary command buffer allocated from another VkCommandPool that is in the recording or executable state and has a secondary command buffer
* allocated from commandPool recorded into it, becomes invalid. * allocated from commandPool recorded into it, becomes invalid.
*/ */
VKAPI_ATTR void VKAPI_CALL rpi_vkDestroyCommandPool( VKAPI_ATTR void VKAPI_CALL RPIFUNC(vkDestroyCommandPool)(
VkDevice device, VkDevice device,
VkCommandPool commandPool, VkCommandPool commandPool,
const VkAllocationCallbacks* pAllocator) const VkAllocationCallbacks* pAllocator)
{ {
PROFILESTART(rpi_vkDestroyCommandPool); PROFILESTART(RPIFUNC(vkDestroyCommandPool));
assert(device); assert(device);
@ -742,18 +742,18 @@ VKAPI_ATTR void VKAPI_CALL rpi_vkDestroyCommandPool(
FREE(cp); FREE(cp);
} }
PROFILEEND(rpi_vkDestroyCommandPool); PROFILEEND(RPIFUNC(vkDestroyCommandPool));
} }
/* /*
* https://www.khronos.org/registry/vulkan/specs/1.1-extensions/html/vkspec.html#vkTrimCommandPool * https://www.khronos.org/registry/vulkan/specs/1.1-extensions/html/vkspec.html#vkTrimCommandPool
*/ */
VKAPI_ATTR void VKAPI_CALL rpi_vkTrimCommandPool( VKAPI_ATTR void VKAPI_CALL RPIFUNC(vkTrimCommandPool)(
VkDevice device, VkDevice device,
VkCommandPool commandPool, VkCommandPool commandPool,
VkCommandPoolTrimFlags flags) VkCommandPoolTrimFlags flags)
{ {
PROFILESTART(rpi_vkTrimCommandPool); PROFILESTART(RPIFUNC(vkTrimCommandPool));
assert(device); assert(device);
assert(commandPool); assert(commandPool);
@ -764,18 +764,18 @@ VKAPI_ATTR void VKAPI_CALL rpi_vkTrimCommandPool(
//by reallocating to just used size //by reallocating to just used size
//kinda silly, as if you need memory afterwards we need to reallocate again... //kinda silly, as if you need memory afterwards we need to reallocate again...
PROFILEEND(rpi_vkTrimCommandPool); PROFILEEND(RPIFUNC(vkTrimCommandPool));
} }
/* /*
* https://www.khronos.org/registry/vulkan/specs/1.1-extensions/html/vkspec.html#vkResetCommandPool * https://www.khronos.org/registry/vulkan/specs/1.1-extensions/html/vkspec.html#vkResetCommandPool
*/ */
VKAPI_ATTR VkResult VKAPI_CALL rpi_vkResetCommandPool( VKAPI_ATTR VkResult VKAPI_CALL RPIFUNC(vkResetCommandPool)(
VkDevice device, VkDevice device,
VkCommandPool commandPool, VkCommandPool commandPool,
VkCommandPoolResetFlags flags) VkCommandPoolResetFlags flags)
{ {
PROFILESTART(rpi_vkResetCommandPool); PROFILESTART(RPIFUNC(vkResetCommandPool));
assert(device); assert(device);
assert(commandPool); assert(commandPool);
@ -809,17 +809,17 @@ VKAPI_ATTR VkResult VKAPI_CALL rpi_vkResetCommandPool(
//TODO reset flag --> free all pool resources //TODO reset flag --> free all pool resources
PROFILEEND(rpi_vkResetCommandPool); PROFILEEND(RPIFUNC(vkResetCommandPool));
} }
/* /*
* https://www.khronos.org/registry/vulkan/specs/1.1-extensions/html/vkspec.html#vkResetCommandBuffer * https://www.khronos.org/registry/vulkan/specs/1.1-extensions/html/vkspec.html#vkResetCommandBuffer
*/ */
VKAPI_ATTR VkResult VKAPI_CALL rpi_vkResetCommandBuffer( VKAPI_ATTR VkResult VKAPI_CALL RPIFUNC(vkResetCommandBuffer)(
VkCommandBuffer commandBuffer, VkCommandBuffer commandBuffer,
VkCommandBufferResetFlags flags) VkCommandBufferResetFlags flags)
{ {
PROFILESTART(rpi_vkResetCommandBuffer); PROFILESTART(RPIFUNC(vkResetCommandBuffer));
assert(commandBuffer); assert(commandBuffer);
@ -884,20 +884,20 @@ VKAPI_ATTR VkResult VKAPI_CALL rpi_vkResetCommandBuffer(
commandBuffer->perfmonID = 0; commandBuffer->perfmonID = 0;
PROFILEEND(rpi_vkResetCommandBuffer); PROFILEEND(RPIFUNC(vkResetCommandBuffer));
} }
VKAPI_ATTR void VKAPI_CALL rpi_vkCmdExecuteCommands( VKAPI_ATTR void VKAPI_CALL RPIFUNC(vkCmdExecuteCommands)(
VkCommandBuffer commandBuffer, VkCommandBuffer commandBuffer,
uint32_t commandBufferCount, uint32_t commandBufferCount,
const VkCommandBuffer* pCommandBuffers) const VkCommandBuffer* pCommandBuffers)
{ {
PROFILESTART(rpi_vkCmdExecuteCommands); PROFILESTART(RPIFUNC(vkCmdExecuteCommands));
PROFILEEND(rpi_vkCmdExecuteCommands); PROFILEEND(RPIFUNC(vkCmdExecuteCommands));
} }
VKAPI_ATTR void VKAPI_CALL rpi_vkCmdSetDeviceMask( VKAPI_ATTR void VKAPI_CALL RPIFUNC(vkCmdSetDeviceMask)(
VkCommandBuffer commandBuffer, VkCommandBuffer commandBuffer,
uint32_t deviceMask) uint32_t deviceMask)
{ {

View File

@ -969,7 +969,7 @@ uint32_t getPow2Pad(uint32_t n)
//////////////////////////////////////////////////// ////////////////////////////////////////////////////
//////////////////////////////////////////////////// ////////////////////////////////////////////////////
VKAPI_ATTR void VKAPI_CALL rpi_vkGetPhysicalDeviceExternalBufferProperties( VKAPI_ATTR void VKAPI_CALL RPIFUNC(vkGetPhysicalDeviceExternalBufferProperties)(
VkPhysicalDevice physicalDevice, VkPhysicalDevice physicalDevice,
const VkPhysicalDeviceExternalBufferInfo* pExternalBufferInfo, const VkPhysicalDeviceExternalBufferInfo* pExternalBufferInfo,
VkExternalBufferProperties* pExternalBufferProperties) VkExternalBufferProperties* pExternalBufferProperties)
@ -977,7 +977,7 @@ VKAPI_ATTR void VKAPI_CALL rpi_vkGetPhysicalDeviceExternalBufferProperties(
UNSUPPORTED(vkGetPhysicalDeviceExternalBufferProperties); UNSUPPORTED(vkGetPhysicalDeviceExternalBufferProperties);
} }
VKAPI_ATTR void VKAPI_CALL rpi_vkGetPhysicalDeviceExternalFenceProperties( VKAPI_ATTR void VKAPI_CALL RPIFUNC(vkGetPhysicalDeviceExternalFenceProperties)(
VkPhysicalDevice physicalDevice, VkPhysicalDevice physicalDevice,
const VkPhysicalDeviceExternalFenceInfo* pExternalFenceInfo, const VkPhysicalDeviceExternalFenceInfo* pExternalFenceInfo,
VkExternalFenceProperties* pExternalFenceProperties) VkExternalFenceProperties* pExternalFenceProperties)
@ -986,7 +986,7 @@ VKAPI_ATTR void VKAPI_CALL rpi_vkGetPhysicalDeviceExternalFenceProperties(
} }
VKAPI_ATTR void VKAPI_CALL rpi_vkGetPhysicalDeviceExternalSemaphoreProperties( VKAPI_ATTR void VKAPI_CALL RPIFUNC(vkGetPhysicalDeviceExternalSemaphoreProperties)(
VkPhysicalDevice physicalDevice, VkPhysicalDevice physicalDevice,
const VkPhysicalDeviceExternalSemaphoreInfo* pExternalSemaphoreInfo, const VkPhysicalDeviceExternalSemaphoreInfo* pExternalSemaphoreInfo,
VkExternalSemaphoreProperties* pExternalSemaphoreProperties) VkExternalSemaphoreProperties* pExternalSemaphoreProperties)
@ -994,7 +994,7 @@ VKAPI_ATTR void VKAPI_CALL rpi_vkGetPhysicalDeviceExternalSemaphoreProperties(
UNSUPPORTED(vkGetPhysicalDeviceExternalSemaphoreProperties); UNSUPPORTED(vkGetPhysicalDeviceExternalSemaphoreProperties);
} }
VKAPI_ATTR void VKAPI_CALL rpi_vkGetDeviceGroupPeerMemoryFeatures( VKAPI_ATTR void VKAPI_CALL RPIFUNC(vkGetDeviceGroupPeerMemoryFeatures)(
VkDevice device, VkDevice device,
uint32_t heapIndex, uint32_t heapIndex,
uint32_t localDeviceIndex, uint32_t localDeviceIndex,

View File

@ -1,9 +1,11 @@
#include "common.h" #include "common.h"
#include "declarations.h"
//TODO //TODO
//compute shaders need kernel support //compute shaders need kernel support
VKAPI_ATTR VkResult VKAPI_CALL rpi_vkCreateComputePipelines( VKAPI_ATTR VkResult VKAPI_CALL RPIFUNC(vkCreateComputePipelines)(
VkDevice device, VkDevice device,
VkPipelineCache pipelineCache, VkPipelineCache pipelineCache,
uint32_t createInfoCount, uint32_t createInfoCount,
@ -15,7 +17,7 @@ VKAPI_ATTR VkResult VKAPI_CALL rpi_vkCreateComputePipelines(
return UNSUPPORTED_RETURN; return UNSUPPORTED_RETURN;
} }
VKAPI_ATTR void VKAPI_CALL rpi_vkCmdDispatchIndirect( VKAPI_ATTR void VKAPI_CALL RPIFUNC(vkCmdDispatchIndirect)(
VkCommandBuffer commandBuffer, VkCommandBuffer commandBuffer,
VkBuffer buffer, VkBuffer buffer,
VkDeviceSize offset) VkDeviceSize offset)
@ -23,7 +25,7 @@ VKAPI_ATTR void VKAPI_CALL rpi_vkCmdDispatchIndirect(
UNSUPPORTED(vkCmdDispatchIndirect); UNSUPPORTED(vkCmdDispatchIndirect);
} }
VKAPI_ATTR void VKAPI_CALL rpi_vkCmdDispatch( VKAPI_ATTR void VKAPI_CALL RPIFUNC(vkCmdDispatch)(
VkCommandBuffer commandBuffer, VkCommandBuffer commandBuffer,
uint32_t groupCountX, uint32_t groupCountX,
uint32_t groupCountY, uint32_t groupCountY,
@ -32,7 +34,7 @@ VKAPI_ATTR void VKAPI_CALL rpi_vkCmdDispatch(
UNSUPPORTED(vkCmdDispatch); UNSUPPORTED(vkCmdDispatch);
} }
VKAPI_ATTR void VKAPI_CALL rpi_vkCmdDispatchBase( VKAPI_ATTR void VKAPI_CALL RPIFUNC(vkCmdDispatchBase)(
VkCommandBuffer commandBuffer, VkCommandBuffer commandBuffer,
uint32_t baseGroupX, uint32_t baseGroupX,
uint32_t baseGroupY, uint32_t baseGroupY,

View File

@ -47,19 +47,19 @@ void createFullscreenQuad(VkDevice device, VkBuffer* fsqVertexBuffer, VkDeviceMe
ci.size = vboSize; ci.size = vboSize;
ci.usage = VK_BUFFER_USAGE_VERTEX_BUFFER_BIT; ci.usage = VK_BUFFER_USAGE_VERTEX_BUFFER_BIT;
VkResult res = rpi_vkCreateBuffer(device, &ci, 0, fsqVertexBuffer); VkResult res = RPIFUNC(vkCreateBuffer)(device, &ci, 0, fsqVertexBuffer);
rpi_vkGetBufferMemoryRequirements(device, *fsqVertexBuffer, &mr); RPIFUNC(vkGetBufferMemoryRequirements)(device, *fsqVertexBuffer, &mr);
VkPhysicalDeviceMemoryProperties pdmp; VkPhysicalDeviceMemoryProperties pdmp;
rpi_vkGetPhysicalDeviceMemoryProperties(((_device*)device)->dev, &pdmp); RPIFUNC(vkGetPhysicalDeviceMemoryProperties)(((_device*)device)->dev, &pdmp);
VkMemoryAllocateInfo mai = {}; VkMemoryAllocateInfo mai = {};
mai.sType = VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_INFO; mai.sType = VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_INFO;
mai.allocationSize = mr.size; mai.allocationSize = mr.size;
mai.memoryTypeIndex = getMemoryTypeIndex(pdmp, mr.memoryTypeBits, VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT | VK_MEMORY_PROPERTY_HOST_COHERENT_BIT); mai.memoryTypeIndex = getMemoryTypeIndex(pdmp, mr.memoryTypeBits, VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT | VK_MEMORY_PROPERTY_HOST_COHERENT_BIT);
res = rpi_vkAllocateMemory(device, &mai, 0, fsqVertexBufferMemory); res = RPIFUNC(vkAllocateMemory)(device, &mai, 0, fsqVertexBufferMemory);
float vertices[] = float vertices[] =
{ {
@ -73,11 +73,11 @@ void createFullscreenQuad(VkDevice device, VkBuffer* fsqVertexBuffer, VkDeviceMe
}; };
void* data; void* data;
res = rpi_vkMapMemory(device, *fsqVertexBufferMemory, 0, mr.size, 0, &data); res = RPIFUNC(vkMapMemory)(device, *fsqVertexBufferMemory, 0, mr.size, 0, &data);
memcpy(data, vertices, vboSize); memcpy(data, vertices, vboSize);
rpi_vkUnmapMemory(device, *fsqVertexBufferMemory); RPIFUNC(vkUnmapMemory)(device, *fsqVertexBufferMemory);
res = rpi_vkBindBufferMemory(device, *fsqVertexBuffer, *fsqVertexBufferMemory, 0); res = RPIFUNC(vkBindBufferMemory)(device, *fsqVertexBuffer, *fsqVertexBufferMemory, 0);
} }
} }
@ -96,7 +96,7 @@ void createDescriptorPool(VkDevice device, VkDescriptorPool* descriptorPool)
descriptorPoolCI.maxSets = 2048; descriptorPoolCI.maxSets = 2048;
descriptorPoolCI.flags = VK_DESCRIPTOR_POOL_CREATE_FREE_DESCRIPTOR_SET_BIT; descriptorPoolCI.flags = VK_DESCRIPTOR_POOL_CREATE_FREE_DESCRIPTOR_SET_BIT;
rpi_vkCreateDescriptorPool(device, &descriptorPoolCI, 0, descriptorPool); RPIFUNC(vkCreateDescriptorPool)(device, &descriptorPoolCI, 0, descriptorPool);
} }
void createDescriptorSetLayouts(VkDevice device, VkDescriptorSetLayout* bufferDsl, VkDescriptorSetLayout* textureDsl) void createDescriptorSetLayouts(VkDevice device, VkDescriptorSetLayout* bufferDsl, VkDescriptorSetLayout* textureDsl)
@ -117,10 +117,10 @@ void createDescriptorSetLayouts(VkDevice device, VkDescriptorSetLayout* bufferDs
descriptorLayoutCI.bindingCount = 1; descriptorLayoutCI.bindingCount = 1;
descriptorLayoutCI.pBindings = &setLayoutBinding; descriptorLayoutCI.pBindings = &setLayoutBinding;
rpi_vkCreateDescriptorSetLayout(device, &descriptorLayoutCI, 0, bufferDsl); RPIFUNC(vkCreateDescriptorSetLayout)(device, &descriptorLayoutCI, 0, bufferDsl);
setLayoutBinding.descriptorType = VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER; setLayoutBinding.descriptorType = VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER;
rpi_vkCreateDescriptorSetLayout(device, &descriptorLayoutCI, 0, textureDsl); RPIFUNC(vkCreateDescriptorSetLayout)(device, &descriptorLayoutCI, 0, textureDsl);
} }
void createSampler(VkDevice device, VkSampler* nearestTextureSampler, VkSampler* linearTextureSampler) void createSampler(VkDevice device, VkSampler* nearestTextureSampler, VkSampler* linearTextureSampler)
@ -136,11 +136,11 @@ void createSampler(VkDevice device, VkSampler* nearestTextureSampler, VkSampler*
sampler.mipLodBias = 0.0f; sampler.mipLodBias = 0.0f;
sampler.compareOp = VK_COMPARE_OP_NEVER; sampler.compareOp = VK_COMPARE_OP_NEVER;
sampler.borderColor = VK_BORDER_COLOR_FLOAT_TRANSPARENT_BLACK; sampler.borderColor = VK_BORDER_COLOR_FLOAT_TRANSPARENT_BLACK;
rpi_vkCreateSampler(device, &sampler, 0, nearestTextureSampler); RPIFUNC(vkCreateSampler)(device, &sampler, 0, nearestTextureSampler);
sampler.magFilter = VK_FILTER_LINEAR; sampler.magFilter = VK_FILTER_LINEAR;
sampler.minFilter = VK_FILTER_LINEAR; sampler.minFilter = VK_FILTER_LINEAR;
rpi_vkCreateSampler(device, &sampler, 0, linearTextureSampler); RPIFUNC(vkCreateSampler)(device, &sampler, 0, linearTextureSampler);
} }
void createRendertarget(VkDevice device, uint32_t baseLayer, uint32_t baseMip, uint32_t width, uint32_t height, VkImage textureImage, VkImageView* textureView, VkRenderPass* offscreenRenderPass, VkFramebuffer* offscreenFramebuffer) void createRendertarget(VkDevice device, uint32_t baseLayer, uint32_t baseMip, uint32_t width, uint32_t height, VkImage textureImage, VkImageView* textureView, VkRenderPass* offscreenRenderPass, VkFramebuffer* offscreenFramebuffer)
@ -174,7 +174,7 @@ void createRendertarget(VkDevice device, uint32_t baseLayer, uint32_t baseMip, u
view.subresourceRange.layerCount = 1; view.subresourceRange.layerCount = 1;
view.subresourceRange.levelCount = 1; view.subresourceRange.levelCount = 1;
view.image = textureImage; view.image = textureImage;
rpi_vkCreateImageView(device, &view, 0, textureView); RPIFUNC(vkCreateImageView)(device, &view, 0, textureView);
VkAttachmentDescription attachmentDescription = {}; VkAttachmentDescription attachmentDescription = {};
attachmentDescription.format = format; attachmentDescription.format = format;
@ -219,7 +219,7 @@ void createRendertarget(VkDevice device, uint32_t baseLayer, uint32_t baseMip, u
renderPassInfo.dependencyCount = 2; renderPassInfo.dependencyCount = 2;
renderPassInfo.pDependencies = dependencies; renderPassInfo.pDependencies = dependencies;
rpi_vkCreateRenderPass(device, &renderPassInfo, 0, offscreenRenderPass); RPIFUNC(vkCreateRenderPass)(device, &renderPassInfo, 0, offscreenRenderPass);
VkImageView attachments = *textureView; VkImageView attachments = *textureView;
@ -231,7 +231,7 @@ void createRendertarget(VkDevice device, uint32_t baseLayer, uint32_t baseMip, u
framebufferCreateInfo.height = height; framebufferCreateInfo.height = height;
framebufferCreateInfo.layers = 1; framebufferCreateInfo.layers = 1;
rpi_vkCreateFramebuffer(device, &framebufferCreateInfo, 0, offscreenFramebuffer); RPIFUNC(vkCreateFramebuffer)(device, &framebufferCreateInfo, 0, offscreenFramebuffer);
} }
void createPipeline(VkDevice device, uint32_t needTexcoords, uint32_t numVertUniforms, uint32_t numFragUniforms, VkShaderModule blitShaderModule, VkDescriptorSetLayout blitDsl, VkPipelineLayout* blitPipelineLayout, VkRenderPass offscreenRenderPass, VkPipeline* blitPipeline) void createPipeline(VkDevice device, uint32_t needTexcoords, uint32_t numVertUniforms, uint32_t numFragUniforms, VkShaderModule blitShaderModule, VkDescriptorSetLayout blitDsl, VkPipelineLayout* blitPipelineLayout, VkRenderPass offscreenRenderPass, VkPipeline* blitPipeline)
@ -326,7 +326,7 @@ void createPipeline(VkDevice device, uint32_t needTexcoords, uint32_t numVertUni
pipelineLayoutCI.pSetLayouts = &blitDsl; pipelineLayoutCI.pSetLayouts = &blitDsl;
pipelineLayoutCI.pushConstantRangeCount = 2; pipelineLayoutCI.pushConstantRangeCount = 2;
pipelineLayoutCI.pPushConstantRanges = &pushConstantRanges[0]; pipelineLayoutCI.pPushConstantRanges = &pushConstantRanges[0];
rpi_vkCreatePipelineLayout(device, &pipelineLayoutCI, 0, blitPipelineLayout); RPIFUNC(vkCreatePipelineLayout)(device, &pipelineLayoutCI, 0, blitPipelineLayout);
VkDynamicState dynState = VK_DYNAMIC_STATE_VIEWPORT; VkDynamicState dynState = VK_DYNAMIC_STATE_VIEWPORT;
@ -356,7 +356,7 @@ void createPipeline(VkDevice device, uint32_t needTexcoords, uint32_t numVertUni
pipelineInfo.pDepthStencilState = &depthStencilState; pipelineInfo.pDepthStencilState = &depthStencilState;
pipelineInfo.layout = *blitPipelineLayout; pipelineInfo.layout = *blitPipelineLayout;
VkResult res = rpi_vkCreateGraphicsPipelines(device, VK_NULL_HANDLE, 1, &pipelineInfo, NULL, blitPipeline); VkResult res = RPIFUNC(vkCreateGraphicsPipelines)(device, VK_NULL_HANDLE, 1, &pipelineInfo, NULL, blitPipeline);
} }
void createBufferToTextureShaderModule(VkDevice device, VkShaderModule* blitShaderModule) void createBufferToTextureShaderModule(VkDevice device, VkShaderModule* blitShaderModule)
@ -652,7 +652,7 @@ void createBufferToTextureShaderModule(VkDevice device, VkShaderModule* blitShad
smci.sType = VK_STRUCTURE_TYPE_SHADER_MODULE_CREATE_INFO; smci.sType = VK_STRUCTURE_TYPE_SHADER_MODULE_CREATE_INFO;
smci.codeSize = sizeof(uint32_t)*6; smci.codeSize = sizeof(uint32_t)*6;
smci.pCode = spirv; smci.pCode = spirv;
rpi_vkCreateShaderModule(device, &smci, 0, blitShaderModule); RPIFUNC(vkCreateShaderModule)(device, &smci, 0, blitShaderModule);
assert(blitShaderModule); assert(blitShaderModule);
for(uint32_t c = 0; c < 4; ++c) for(uint32_t c = 0; c < 4; ++c)
@ -921,7 +921,7 @@ void createTextureToTextureShaderModule(VkDevice device, VkShaderModule* blitSha
smci.sType = VK_STRUCTURE_TYPE_SHADER_MODULE_CREATE_INFO; smci.sType = VK_STRUCTURE_TYPE_SHADER_MODULE_CREATE_INFO;
smci.codeSize = sizeof(uint32_t)*6; smci.codeSize = sizeof(uint32_t)*6;
smci.pCode = spirv; smci.pCode = spirv;
rpi_vkCreateShaderModule(device, &smci, 0, blitShaderModule); RPIFUNC(vkCreateShaderModule)(device, &smci, 0, blitShaderModule);
assert(blitShaderModule); assert(blitShaderModule);
for(uint32_t c = 0; c < 4; ++c) for(uint32_t c = 0; c < 4; ++c)
@ -943,7 +943,7 @@ void setupEmulationResources(VkDevice device)
createTextureToTextureShaderModule(device, &dev->emulTextureToTextureShaderModule); createTextureToTextureShaderModule(device, &dev->emulTextureToTextureShaderModule);
} }
VKAPI_ATTR void VKAPI_CALL rpi_vkCmdCopyBufferToImage( VKAPI_ATTR void VKAPI_CALL RPIFUNC(vkCmdCopyBufferToImage)(
VkCommandBuffer commandBuffer, VkCommandBuffer commandBuffer,
VkBuffer srcBuffer, VkBuffer srcBuffer,
VkImage dstImage, VkImage dstImage,
@ -951,7 +951,7 @@ VKAPI_ATTR void VKAPI_CALL rpi_vkCmdCopyBufferToImage(
uint32_t regionCount, uint32_t regionCount,
const VkBufferImageCopy* pRegions) const VkBufferImageCopy* pRegions)
{ {
PROFILESTART(rpi_vkCmdCopyBufferToImage); PROFILESTART(RPIFUNC(vkCmdCopyBufferToImage));
_commandBuffer* cmdBuf = commandBuffer; _commandBuffer* cmdBuf = commandBuffer;
_device* device = cmdBuf->dev; _device* device = cmdBuf->dev;
@ -975,7 +975,7 @@ VKAPI_ATTR void VKAPI_CALL rpi_vkCmdCopyBufferToImage(
bvci.format = img->format; bvci.format = img->format;
bvci.offset = pRegions[c].bufferOffset; bvci.offset = pRegions[c].bufferOffset;
bvci.range = (width * height * pixelBpp) >> 3; bvci.range = (width * height * pixelBpp) >> 3;
rpi_vkCreateBufferView(device, &bvci, 0, &texelBufferView); RPIFUNC(vkCreateBufferView)(device, &bvci, 0, &texelBufferView);
VkDescriptorSet blitDescriptorSet; VkDescriptorSet blitDescriptorSet;
VkImageView textureView; VkImageView textureView;
@ -990,7 +990,7 @@ VKAPI_ATTR void VKAPI_CALL rpi_vkCmdCopyBufferToImage(
allocInfo.descriptorPool = device->emulDescriptorPool; allocInfo.descriptorPool = device->emulDescriptorPool;
allocInfo.descriptorSetCount = 1; allocInfo.descriptorSetCount = 1;
allocInfo.pSetLayouts = &device->emulBufferDsl; allocInfo.pSetLayouts = &device->emulBufferDsl;
rpi_vkAllocateDescriptorSets(device, &allocInfo, &blitDescriptorSet); RPIFUNC(vkAllocateDescriptorSets)(device, &allocInfo, &blitDescriptorSet);
VkWriteDescriptorSet writeDescriptorSet = {}; VkWriteDescriptorSet writeDescriptorSet = {};
writeDescriptorSet.sType = VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET; writeDescriptorSet.sType = VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET;
@ -999,7 +999,7 @@ VKAPI_ATTR void VKAPI_CALL rpi_vkCmdCopyBufferToImage(
writeDescriptorSet.descriptorType = VK_DESCRIPTOR_TYPE_STORAGE_TEXEL_BUFFER; writeDescriptorSet.descriptorType = VK_DESCRIPTOR_TYPE_STORAGE_TEXEL_BUFFER;
writeDescriptorSet.pTexelBufferView = &texelBufferView; writeDescriptorSet.pTexelBufferView = &texelBufferView;
writeDescriptorSet.descriptorCount = 1; writeDescriptorSet.descriptorCount = 1;
rpi_vkUpdateDescriptorSets(device, 1, &writeDescriptorSet, 0, 0); RPIFUNC(vkUpdateDescriptorSets)(device, 1, &writeDescriptorSet, 0, 0);
createRendertarget(device, pRegions[c].imageSubresource.baseArrayLayer, pRegions[c].imageSubresource.mipLevel, width, height, img, &textureView, &offscreenRenderPass, &offscreenFramebuffer); createRendertarget(device, pRegions[c].imageSubresource.baseArrayLayer, pRegions[c].imageSubresource.mipLevel, width, height, img, &textureView, &offscreenRenderPass, &offscreenFramebuffer);
createPipeline(device, 0, 4, 5, device->emulBufferToTextureShaderModule, device->emulBufferDsl, &blitPipelineLayout, offscreenRenderPass, &blitPipeline); createPipeline(device, 0, 4, 5, device->emulBufferToTextureShaderModule, device->emulBufferDsl, &blitPipelineLayout, offscreenRenderPass, &blitPipeline);
@ -1021,9 +1021,9 @@ VKAPI_ATTR void VKAPI_CALL rpi_vkCmdCopyBufferToImage(
renderPassInfo.clearValueCount = 1; renderPassInfo.clearValueCount = 1;
renderPassInfo.pClearValues = &offscreenClearValues; renderPassInfo.pClearValues = &offscreenClearValues;
rpi_vkCmdBeginRenderPass(commandBuffer, &renderPassInfo, VK_SUBPASS_CONTENTS_INLINE); RPIFUNC(vkCmdBeginRenderPass)(commandBuffer, &renderPassInfo, VK_SUBPASS_CONTENTS_INLINE);
rpi_vkCmdBindPipeline(commandBuffer, VK_PIPELINE_BIND_POINT_GRAPHICS, blitPipeline); RPIFUNC(vkCmdBindPipeline)(commandBuffer, VK_PIPELINE_BIND_POINT_GRAPHICS, blitPipeline);
VkViewport vp = {}; VkViewport vp = {};
vp.x = 0.0f; vp.x = 0.0f;
@ -1033,12 +1033,12 @@ VKAPI_ATTR void VKAPI_CALL rpi_vkCmdCopyBufferToImage(
vp.minDepth = 0.0f; vp.minDepth = 0.0f;
vp.maxDepth = 1.0f; vp.maxDepth = 1.0f;
rpi_vkCmdSetViewport(commandBuffer, 0, 1, &vp); RPIFUNC(vkCmdSetViewport)(commandBuffer, 0, 1, &vp);
VkDeviceSize offsets = 0; VkDeviceSize offsets = 0;
rpi_vkCmdBindVertexBuffers(commandBuffer, 0, 1, &device->emulFsqVertexBuffer, &offsets ); RPIFUNC(vkCmdBindVertexBuffers)(commandBuffer, 0, 1, &device->emulFsqVertexBuffer, &offsets );
rpi_vkCmdBindDescriptorSets(commandBuffer, VK_PIPELINE_BIND_POINT_GRAPHICS, blitPipelineLayout, 0, 1, &blitDescriptorSet, 0, 0); RPIFUNC(vkCmdBindDescriptorSets)(commandBuffer, VK_PIPELINE_BIND_POINT_GRAPHICS, blitPipelineLayout, 0, 1, &blitDescriptorSet, 0, 0);
float Wcoeff = 1.0f; //1.0f / Wc = 2.0 - Wcoeff float Wcoeff = 1.0f; //1.0f / Wc = 2.0 - Wcoeff
float viewportScaleX = (float)(width) * 0.5f * 16.0f; float viewportScaleX = (float)(width) * 0.5f * 16.0f;
@ -1051,7 +1051,7 @@ VKAPI_ATTR void VKAPI_CALL rpi_vkCmdCopyBufferToImage(
vertConstants[2] = *(uint32_t*)&viewportScaleY; vertConstants[2] = *(uint32_t*)&viewportScaleY;
vertConstants[3] = *(uint32_t*)&Zs; vertConstants[3] = *(uint32_t*)&Zs;
rpi_vkCmdPushConstants(commandBuffer, blitPipelineLayout, VK_SHADER_STAGE_VERTEX_BIT, 0, sizeof(vertConstants), &vertConstants); RPIFUNC(vkCmdPushConstants)(commandBuffer, blitPipelineLayout, VK_SHADER_STAGE_VERTEX_BIT, 0, sizeof(vertConstants), &vertConstants);
float w = width; float w = width;
float bppfloat = pixelBpp; float bppfloat = pixelBpp;
@ -1062,27 +1062,27 @@ VKAPI_ATTR void VKAPI_CALL rpi_vkCmdCopyBufferToImage(
fragConstants[2] = size; fragConstants[2] = size;
fragConstants[3] = pRegions[c].bufferOffset + buf->boundOffset; fragConstants[3] = pRegions[c].bufferOffset + buf->boundOffset;
rpi_vkCmdPushConstants(commandBuffer, blitPipelineLayout, VK_SHADER_STAGE_FRAGMENT_BIT, 0, sizeof(fragConstants), &fragConstants); RPIFUNC(vkCmdPushConstants)(commandBuffer, blitPipelineLayout, VK_SHADER_STAGE_FRAGMENT_BIT, 0, sizeof(fragConstants), &fragConstants);
rpi_vkCmdDraw(commandBuffer, 6, 1, 0, 0); RPIFUNC(vkCmdDraw)(commandBuffer, 6, 1, 0, 0);
rpi_vkCmdEndRenderPass(commandBuffer); RPIFUNC(vkCmdEndRenderPass)(commandBuffer);
//free up resources //free up resources
rpi_vkDestroyPipelineLayout(device, blitPipelineLayout, 0); RPIFUNC(vkDestroyPipelineLayout)(device, blitPipelineLayout, 0);
rpi_vkDestroyPipeline(device, blitPipeline, 0); RPIFUNC(vkDestroyPipeline)(device, blitPipeline, 0);
rpi_vkFreeDescriptorSets(device, device->emulDescriptorPool, 1, &blitDescriptorSet); RPIFUNC(vkFreeDescriptorSets)(device, device->emulDescriptorPool, 1, &blitDescriptorSet);
rpi_vkDestroyImageView(device, textureView, 0); RPIFUNC(vkDestroyImageView)(device, textureView, 0);
rpi_vkDestroyRenderPass(device, offscreenRenderPass, 0); RPIFUNC(vkDestroyRenderPass)(device, offscreenRenderPass, 0);
rpi_vkDestroyFramebuffer(device, offscreenFramebuffer, 0); RPIFUNC(vkDestroyFramebuffer)(device, offscreenFramebuffer, 0);
} }
img->layout = dstImageLayout; img->layout = dstImageLayout;
PROFILEEND(rpi_vkCmdCopyBufferToImage); PROFILEEND(RPIFUNC(vkCmdCopyBufferToImage));
} }
VKAPI_ATTR void VKAPI_CALL rpi_vkCmdBlitImage( VKAPI_ATTR void VKAPI_CALL RPIFUNC(vkCmdBlitImage)(
VkCommandBuffer commandBuffer, VkCommandBuffer commandBuffer,
VkImage srcImage, VkImage srcImage,
VkImageLayout srcImageLayout, VkImageLayout srcImageLayout,
@ -1092,7 +1092,7 @@ VKAPI_ATTR void VKAPI_CALL rpi_vkCmdBlitImage(
const VkImageBlit* pRegions, const VkImageBlit* pRegions,
VkFilter filter) VkFilter filter)
{ {
PROFILESTART(rpi_vkCmdBlitImage); PROFILESTART(RPIFUNC(vkCmdBlitImage));
_commandBuffer* cmdBuf = commandBuffer; _commandBuffer* cmdBuf = commandBuffer;
_device* device = cmdBuf->dev; _device* device = cmdBuf->dev;
@ -1133,7 +1133,7 @@ VKAPI_ATTR void VKAPI_CALL rpi_vkCmdBlitImage(
samplerCI.mipLodBias = 1.0f; //disable auto lod samplerCI.mipLodBias = 1.0f; //disable auto lod
samplerCI.compareOp = VK_COMPARE_OP_NEVER; samplerCI.compareOp = VK_COMPARE_OP_NEVER;
samplerCI.borderColor = VK_BORDER_COLOR_FLOAT_TRANSPARENT_BLACK; samplerCI.borderColor = VK_BORDER_COLOR_FLOAT_TRANSPARENT_BLACK;
rpi_vkCreateSampler(device, &samplerCI, 0, &mipSampler); RPIFUNC(vkCreateSampler)(device, &samplerCI, 0, &mipSampler);
_sampler* s = mipSampler; _sampler* s = mipSampler;
VkImageViewCreateInfo view = {}; VkImageViewCreateInfo view = {};
@ -1146,7 +1146,7 @@ VKAPI_ATTR void VKAPI_CALL rpi_vkCmdBlitImage(
view.subresourceRange.layerCount = 1; view.subresourceRange.layerCount = 1;
view.subresourceRange.levelCount = srcImg->miplevels; view.subresourceRange.levelCount = srcImg->miplevels;
view.image = srcImage; view.image = srcImage;
rpi_vkCreateImageView(device, &view, 0, &srcTextureView); RPIFUNC(vkCreateImageView)(device, &view, 0, &srcTextureView);
//create blit descriptor set //create blit descriptor set
VkDescriptorSetAllocateInfo allocInfo = {}; VkDescriptorSetAllocateInfo allocInfo = {};
@ -1154,7 +1154,7 @@ VKAPI_ATTR void VKAPI_CALL rpi_vkCmdBlitImage(
allocInfo.descriptorPool = device->emulDescriptorPool; allocInfo.descriptorPool = device->emulDescriptorPool;
allocInfo.descriptorSetCount = 1; allocInfo.descriptorSetCount = 1;
allocInfo.pSetLayouts = &device->emulTextureDsl; allocInfo.pSetLayouts = &device->emulTextureDsl;
rpi_vkAllocateDescriptorSets(device, &allocInfo, &blitDescriptorSet); RPIFUNC(vkAllocateDescriptorSets)(device, &allocInfo, &blitDescriptorSet);
VkDescriptorImageInfo imageInfo; VkDescriptorImageInfo imageInfo;
imageInfo.imageView = srcTextureView; imageInfo.imageView = srcTextureView;
@ -1168,7 +1168,7 @@ VKAPI_ATTR void VKAPI_CALL rpi_vkCmdBlitImage(
writeDescriptorSet.descriptorType = VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER; writeDescriptorSet.descriptorType = VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER;
writeDescriptorSet.pImageInfo = &imageInfo; writeDescriptorSet.pImageInfo = &imageInfo;
writeDescriptorSet.descriptorCount = 1; writeDescriptorSet.descriptorCount = 1;
rpi_vkUpdateDescriptorSets(device, 1, &writeDescriptorSet, 0, 0); RPIFUNC(vkUpdateDescriptorSets)(device, 1, &writeDescriptorSet, 0, 0);
createRendertarget(device, pRegions[c].dstSubresource.baseArrayLayer, dstMipLevel, dstWidth, dstHeight, dstImage, &dstTextureView, &offscreenRenderPass, &offscreenFramebuffer); createRendertarget(device, pRegions[c].dstSubresource.baseArrayLayer, dstMipLevel, dstWidth, dstHeight, dstImage, &dstTextureView, &offscreenRenderPass, &offscreenFramebuffer);
createPipeline(device, 1, 4, 2, device->emulTextureToTextureShaderModule, device->emulTextureDsl, &blitPipelineLayout, offscreenRenderPass, &blitPipeline); createPipeline(device, 1, 4, 2, device->emulTextureToTextureShaderModule, device->emulTextureDsl, &blitPipelineLayout, offscreenRenderPass, &blitPipeline);
@ -1190,9 +1190,9 @@ VKAPI_ATTR void VKAPI_CALL rpi_vkCmdBlitImage(
renderPassInfo.clearValueCount = 1; renderPassInfo.clearValueCount = 1;
renderPassInfo.pClearValues = &offscreenClearValues; renderPassInfo.pClearValues = &offscreenClearValues;
rpi_vkCmdBeginRenderPass(commandBuffer, &renderPassInfo, VK_SUBPASS_CONTENTS_INLINE); RPIFUNC(vkCmdBeginRenderPass)(commandBuffer, &renderPassInfo, VK_SUBPASS_CONTENTS_INLINE);
rpi_vkCmdBindPipeline(commandBuffer, VK_PIPELINE_BIND_POINT_GRAPHICS, blitPipeline); RPIFUNC(vkCmdBindPipeline)(commandBuffer, VK_PIPELINE_BIND_POINT_GRAPHICS, blitPipeline);
VkViewport vp = {}; VkViewport vp = {};
vp.x = 0.0f; vp.x = 0.0f;
@ -1202,12 +1202,12 @@ VKAPI_ATTR void VKAPI_CALL rpi_vkCmdBlitImage(
vp.minDepth = 0.0f; vp.minDepth = 0.0f;
vp.maxDepth = 1.0f; vp.maxDepth = 1.0f;
rpi_vkCmdSetViewport(commandBuffer, 0, 1, &vp); RPIFUNC(vkCmdSetViewport)(commandBuffer, 0, 1, &vp);
VkDeviceSize offsets = 0; VkDeviceSize offsets = 0;
rpi_vkCmdBindVertexBuffers(commandBuffer, 0, 1, &device->emulFsqVertexBuffer, &offsets ); RPIFUNC(vkCmdBindVertexBuffers)(commandBuffer, 0, 1, &device->emulFsqVertexBuffer, &offsets );
rpi_vkCmdBindDescriptorSets(commandBuffer, VK_PIPELINE_BIND_POINT_GRAPHICS, blitPipelineLayout, 0, 1, &blitDescriptorSet, 0, 0); RPIFUNC(vkCmdBindDescriptorSets)(commandBuffer, VK_PIPELINE_BIND_POINT_GRAPHICS, blitPipelineLayout, 0, 1, &blitDescriptorSet, 0, 0);
float Wcoeff = 1.0f; //1.0f / Wc = 2.0 - Wcoeff float Wcoeff = 1.0f; //1.0f / Wc = 2.0 - Wcoeff
float viewportScaleX = (float)(dstWidth) * 0.5f * 16.0f; float viewportScaleX = (float)(dstWidth) * 0.5f * 16.0f;
@ -1220,33 +1220,33 @@ VKAPI_ATTR void VKAPI_CALL rpi_vkCmdBlitImage(
vertConstants[2] = *(uint32_t*)&viewportScaleY; vertConstants[2] = *(uint32_t*)&viewportScaleY;
vertConstants[3] = *(uint32_t*)&Zs; vertConstants[3] = *(uint32_t*)&Zs;
rpi_vkCmdPushConstants(commandBuffer, blitPipelineLayout, VK_SHADER_STAGE_VERTEX_BIT, 0, sizeof(vertConstants), &vertConstants); RPIFUNC(vkCmdPushConstants)(commandBuffer, blitPipelineLayout, VK_SHADER_STAGE_VERTEX_BIT, 0, sizeof(vertConstants), &vertConstants);
float mipBias = srcMipLevel; float mipBias = srcMipLevel;
uint32_t fragConstants[1]; uint32_t fragConstants[1];
fragConstants[0] = *(uint32_t*)&mipBias; fragConstants[0] = *(uint32_t*)&mipBias;
rpi_vkCmdPushConstants(commandBuffer, blitPipelineLayout, VK_SHADER_STAGE_FRAGMENT_BIT, 0, sizeof(fragConstants), &fragConstants); RPIFUNC(vkCmdPushConstants)(commandBuffer, blitPipelineLayout, VK_SHADER_STAGE_FRAGMENT_BIT, 0, sizeof(fragConstants), &fragConstants);
rpi_vkCmdDraw(commandBuffer, 6, 1, 0, 0); RPIFUNC(vkCmdDraw)(commandBuffer, 6, 1, 0, 0);
rpi_vkCmdEndRenderPass(commandBuffer); RPIFUNC(vkCmdEndRenderPass)(commandBuffer);
//free up resources //free up resources
rpi_vkDestroySampler(device, mipSampler, 0); RPIFUNC(vkDestroySampler)(device, mipSampler, 0);
rpi_vkDestroyPipelineLayout(device, blitPipelineLayout, 0); RPIFUNC(vkDestroyPipelineLayout)(device, blitPipelineLayout, 0);
rpi_vkDestroyPipeline(device, blitPipeline, 0); RPIFUNC(vkDestroyPipeline)(device, blitPipeline, 0);
rpi_vkFreeDescriptorSets(device, device->emulDescriptorPool, 1, &blitDescriptorSet); RPIFUNC(vkFreeDescriptorSets)(device, device->emulDescriptorPool, 1, &blitDescriptorSet);
rpi_vkDestroyImageView(device, srcTextureView, 0); RPIFUNC(vkDestroyImageView)(device, srcTextureView, 0);
rpi_vkDestroyImageView(device, dstTextureView, 0); RPIFUNC(vkDestroyImageView)(device, dstTextureView, 0);
rpi_vkDestroyRenderPass(device, offscreenRenderPass, 0); RPIFUNC(vkDestroyRenderPass)(device, offscreenRenderPass, 0);
rpi_vkDestroyFramebuffer(device, offscreenFramebuffer, 0); RPIFUNC(vkDestroyFramebuffer)(device, offscreenFramebuffer, 0);
} }
PROFILEEND(rpi_vkCmdBlitImage); PROFILEEND(RPIFUNC(vkCmdBlitImage));
} }
VKAPI_ATTR void VKAPI_CALL rpi_vkCmdResolveImage( VKAPI_ATTR void VKAPI_CALL RPIFUNC(vkCmdResolveImage)(
VkCommandBuffer commandBuffer, VkCommandBuffer commandBuffer,
VkImage srcImage, VkImage srcImage,
VkImageLayout srcImageLayout, VkImageLayout srcImageLayout,
@ -1255,12 +1255,12 @@ VKAPI_ATTR void VKAPI_CALL rpi_vkCmdResolveImage(
uint32_t regionCount, uint32_t regionCount,
const VkImageResolve* pRegions) const VkImageResolve* pRegions)
{ {
PROFILESTART(rpi_vkCmdResolveImage); PROFILESTART(RPIFUNC(vkCmdResolveImage));
//TODO //TODO
PROFILEEND(rpi_vkCmdResolveImage); PROFILEEND(RPIFUNC(vkCmdResolveImage));
} }
VKAPI_ATTR void VKAPI_CALL rpi_vkCmdCopyImageToBuffer( VKAPI_ATTR void VKAPI_CALL RPIFUNC(vkCmdCopyImageToBuffer)(
VkCommandBuffer commandBuffer, VkCommandBuffer commandBuffer,
VkImage srcImage, VkImage srcImage,
VkImageLayout srcImageLayout, VkImageLayout srcImageLayout,
@ -1268,12 +1268,12 @@ VKAPI_ATTR void VKAPI_CALL rpi_vkCmdCopyImageToBuffer(
uint32_t regionCount, uint32_t regionCount,
const VkBufferImageCopy* pRegions) const VkBufferImageCopy* pRegions)
{ {
PROFILESTART(rpi_vkCmdCopyImageToBuffer); PROFILESTART(RPIFUNC(vkCmdCopyImageToBuffer));
//TODO //TODO
PROFILEEND(rpi_vkCmdCopyImageToBuffer); PROFILEEND(RPIFUNC(vkCmdCopyImageToBuffer));
} }
VKAPI_ATTR void VKAPI_CALL rpi_vkCmdCopyImage( VKAPI_ATTR void VKAPI_CALL RPIFUNC(vkCmdCopyImage)(
VkCommandBuffer commandBuffer, VkCommandBuffer commandBuffer,
VkImage srcImage, VkImage srcImage,
VkImageLayout srcImageLayout, VkImageLayout srcImageLayout,
@ -1282,19 +1282,19 @@ VKAPI_ATTR void VKAPI_CALL rpi_vkCmdCopyImage(
uint32_t regionCount, uint32_t regionCount,
const VkImageCopy* pRegions) const VkImageCopy* pRegions)
{ {
PROFILESTART(rpi_vkCmdCopyImage); PROFILESTART(RPIFUNC(vkCmdCopyImage));
rpi_vkCmdBlitImage(commandBuffer, srcImage, srcImageLayout, dstImage, dstImageLayout, regionCount, pRegions, VK_FILTER_NEAREST); RPIFUNC(vkCmdBlitImage)(commandBuffer, srcImage, srcImageLayout, dstImage, dstImageLayout, regionCount, pRegions, VK_FILTER_NEAREST);
PROFILEEND(rpi_vkCmdCopyImage); PROFILEEND(RPIFUNC(vkCmdCopyImage));
} }
VKAPI_ATTR void VKAPI_CALL rpi_vkCmdCopyBuffer( VKAPI_ATTR void VKAPI_CALL RPIFUNC(vkCmdCopyBuffer)(
VkCommandBuffer commandBuffer, VkCommandBuffer commandBuffer,
VkBuffer srcBuffer, VkBuffer srcBuffer,
VkBuffer dstBuffer, VkBuffer dstBuffer,
uint32_t regionCount, uint32_t regionCount,
const VkBufferCopy* pRegions) const VkBufferCopy* pRegions)
{ {
PROFILESTART(rpi_vkCmdCopyBuffer); PROFILESTART(RPIFUNC(vkCmdCopyBuffer));
//TODO //TODO
PROFILEEND(rpi_vkCmdCopyImage); PROFILEEND(RPIFUNC(vkCmdCopyImage));
} }

View File

@ -7,30 +7,38 @@ extern "C" {
#define VK_NO_PROTOTYPES #define VK_NO_PROTOTYPES
#include <vulkan/vulkan.h> #include <vulkan/vulkan.h>
VKAPI_ATTR VkResult VKAPI_CALL rpi_vkCreateInstance( #define EXPOSE_DRIVER 0
#if EXPOSE_DRIVER == 0
#define RPIFUNC(x) rpi_##x
#else
#define RPIFUNC(x) x
#endif
VKAPI_ATTR VkResult VKAPI_CALL RPIFUNC(vkCreateInstance)(
const VkInstanceCreateInfo* pCreateInfo, const VkInstanceCreateInfo* pCreateInfo,
const VkAllocationCallbacks* pAllocator, const VkAllocationCallbacks* pAllocator,
VkInstance* pInstance); VkInstance* pInstance);
VKAPI_ATTR void VKAPI_CALL rpi_vkDestroyInstance( VKAPI_ATTR void VKAPI_CALL RPIFUNC(vkDestroyInstance)(
VkInstance instance, VkInstance instance,
const VkAllocationCallbacks* pAllocator); const VkAllocationCallbacks* pAllocator);
VKAPI_ATTR VkResult VKAPI_CALL rpi_vkEnumeratePhysicalDevices( VKAPI_ATTR VkResult VKAPI_CALL RPIFUNC(vkEnumeratePhysicalDevices)(
VkInstance instance, VkInstance instance,
uint32_t* pPhysicalDeviceCount, uint32_t* pPhysicalDeviceCount,
VkPhysicalDevice* pPhysicalDevices); VkPhysicalDevice* pPhysicalDevices);
VKAPI_ATTR void VKAPI_CALL rpi_vkGetPhysicalDeviceFeatures( VKAPI_ATTR void VKAPI_CALL RPIFUNC(vkGetPhysicalDeviceFeatures)(
VkPhysicalDevice physicalDevice, VkPhysicalDevice physicalDevice,
VkPhysicalDeviceFeatures* pFeatures); VkPhysicalDeviceFeatures* pFeatures);
VKAPI_ATTR void VKAPI_CALL rpi_vkGetPhysicalDeviceFormatProperties( VKAPI_ATTR void VKAPI_CALL RPIFUNC(vkGetPhysicalDeviceFormatProperties)(
VkPhysicalDevice physicalDevice, VkPhysicalDevice physicalDevice,
VkFormat format, VkFormat format,
VkFormatProperties* pFormatProperties); VkFormatProperties* pFormatProperties);
VKAPI_ATTR VkResult VKAPI_CALL rpi_vkGetPhysicalDeviceImageFormatProperties( VKAPI_ATTR VkResult VKAPI_CALL RPIFUNC(vkGetPhysicalDeviceImageFormatProperties)(
VkPhysicalDevice physicalDevice, VkPhysicalDevice physicalDevice,
VkFormat format, VkFormat format,
VkImageType type, VkImageType type,
@ -39,87 +47,87 @@ VKAPI_ATTR VkResult VKAPI_CALL rpi_vkGetPhysicalDeviceImageFormatProperties(
VkImageCreateFlags flags, VkImageCreateFlags flags,
VkImageFormatProperties* pImageFormatProperties); VkImageFormatProperties* pImageFormatProperties);
VKAPI_ATTR void VKAPI_CALL rpi_vkGetPhysicalDeviceProperties( VKAPI_ATTR void VKAPI_CALL RPIFUNC(vkGetPhysicalDeviceProperties)(
VkPhysicalDevice physicalDevice, VkPhysicalDevice physicalDevice,
VkPhysicalDeviceProperties* pProperties); VkPhysicalDeviceProperties* pProperties);
VKAPI_ATTR void VKAPI_CALL rpi_vkGetPhysicalDeviceQueueFamilyProperties( VKAPI_ATTR void VKAPI_CALL RPIFUNC(vkGetPhysicalDeviceQueueFamilyProperties)(
VkPhysicalDevice physicalDevice, VkPhysicalDevice physicalDevice,
uint32_t* pQueueFamilyPropertyCount, uint32_t* pQueueFamilyPropertyCount,
VkQueueFamilyProperties* pQueueFamilyProperties); VkQueueFamilyProperties* pQueueFamilyProperties);
VKAPI_ATTR void VKAPI_CALL rpi_vkGetPhysicalDeviceMemoryProperties( VKAPI_ATTR void VKAPI_CALL RPIFUNC(vkGetPhysicalDeviceMemoryProperties)(
VkPhysicalDevice physicalDevice, VkPhysicalDevice physicalDevice,
VkPhysicalDeviceMemoryProperties* pMemoryProperties); VkPhysicalDeviceMemoryProperties* pMemoryProperties);
VKAPI_ATTR PFN_vkVoidFunction VKAPI_CALL rpi_vkGetInstanceProcAddr( VKAPI_ATTR PFN_vkVoidFunction VKAPI_CALL RPIFUNC(vkGetInstanceProcAddr)(
VkInstance instance, VkInstance instance,
const char* pName); const char* pName);
VKAPI_ATTR PFN_vkVoidFunction VKAPI_CALL rpi_vkGetDeviceProcAddr( VKAPI_ATTR PFN_vkVoidFunction VKAPI_CALL RPIFUNC(vkGetDeviceProcAddr)(
VkDevice device, VkDevice device,
const char* pName); const char* pName);
VKAPI_ATTR VkResult VKAPI_CALL rpi_vkCreateDevice( VKAPI_ATTR VkResult VKAPI_CALL RPIFUNC(vkCreateDevice)(
VkPhysicalDevice physicalDevice, VkPhysicalDevice physicalDevice,
const VkDeviceCreateInfo* pCreateInfo, const VkDeviceCreateInfo* pCreateInfo,
const VkAllocationCallbacks* pAllocator, const VkAllocationCallbacks* pAllocator,
VkDevice* pDevice); VkDevice* pDevice);
VKAPI_ATTR void VKAPI_CALL rpi_vkDestroyDevice( VKAPI_ATTR void VKAPI_CALL RPIFUNC(vkDestroyDevice)(
VkDevice device, VkDevice device,
const VkAllocationCallbacks* pAllocator); const VkAllocationCallbacks* pAllocator);
VKAPI_ATTR VkResult VKAPI_CALL rpi_vkEnumerateInstanceExtensionProperties( VKAPI_ATTR VkResult VKAPI_CALL RPIFUNC(vkEnumerateInstanceExtensionProperties)(
const char* pLayerName, const char* pLayerName,
uint32_t* pPropertyCount, uint32_t* pPropertyCount,
VkExtensionProperties* pProperties); VkExtensionProperties* pProperties);
VKAPI_ATTR VkResult VKAPI_CALL rpi_vkEnumerateDeviceExtensionProperties( VKAPI_ATTR VkResult VKAPI_CALL RPIFUNC(vkEnumerateDeviceExtensionProperties)(
VkPhysicalDevice physicalDevice, VkPhysicalDevice physicalDevice,
const char* pLayerName, const char* pLayerName,
uint32_t* pPropertyCount, uint32_t* pPropertyCount,
VkExtensionProperties* pProperties); VkExtensionProperties* pProperties);
VKAPI_ATTR VkResult VKAPI_CALL rpi_vkEnumerateInstanceLayerProperties( VKAPI_ATTR VkResult VKAPI_CALL RPIFUNC(vkEnumerateInstanceLayerProperties)(
uint32_t* pPropertyCount, uint32_t* pPropertyCount,
VkLayerProperties* pProperties); VkLayerProperties* pProperties);
VKAPI_ATTR VkResult VKAPI_CALL rpi_vkEnumerateDeviceLayerProperties( VKAPI_ATTR VkResult VKAPI_CALL RPIFUNC(vkEnumerateDeviceLayerProperties)(
VkPhysicalDevice physicalDevice, VkPhysicalDevice physicalDevice,
uint32_t* pPropertyCount, uint32_t* pPropertyCount,
VkLayerProperties* pProperties); VkLayerProperties* pProperties);
VKAPI_ATTR void VKAPI_CALL rpi_vkGetDeviceQueue( VKAPI_ATTR void VKAPI_CALL RPIFUNC(vkGetDeviceQueue)(
VkDevice device, VkDevice device,
uint32_t queueFamilyIndex, uint32_t queueFamilyIndex,
uint32_t queueIndex, uint32_t queueIndex,
VkQueue* pQueue); VkQueue* pQueue);
VKAPI_ATTR VkResult VKAPI_CALL rpi_vkQueueSubmit( VKAPI_ATTR VkResult VKAPI_CALL RPIFUNC(vkQueueSubmit)(
VkQueue queue, VkQueue queue,
uint32_t submitCount, uint32_t submitCount,
const VkSubmitInfo* pSubmits, const VkSubmitInfo* pSubmits,
VkFence fence); VkFence fence);
VKAPI_ATTR VkResult VKAPI_CALL rpi_vkQueueWaitIdle( VKAPI_ATTR VkResult VKAPI_CALL RPIFUNC(vkQueueWaitIdle)(
VkQueue queue); VkQueue queue);
VKAPI_ATTR VkResult VKAPI_CALL rpi_vkDeviceWaitIdle( VKAPI_ATTR VkResult VKAPI_CALL RPIFUNC(vkDeviceWaitIdle)(
VkDevice device); VkDevice device);
VKAPI_ATTR VkResult VKAPI_CALL rpi_vkAllocateMemory( VKAPI_ATTR VkResult VKAPI_CALL RPIFUNC(vkAllocateMemory)(
VkDevice device, VkDevice device,
const VkMemoryAllocateInfo* pAllocateInfo, const VkMemoryAllocateInfo* pAllocateInfo,
const VkAllocationCallbacks* pAllocator, const VkAllocationCallbacks* pAllocator,
VkDeviceMemory* pMemory); VkDeviceMemory* pMemory);
VKAPI_ATTR void VKAPI_CALL rpi_vkFreeMemory( VKAPI_ATTR void VKAPI_CALL RPIFUNC(vkFreeMemory)(
VkDevice device, VkDevice device,
VkDeviceMemory memory, VkDeviceMemory memory,
const VkAllocationCallbacks* pAllocator); const VkAllocationCallbacks* pAllocator);
VKAPI_ATTR VkResult VKAPI_CALL rpi_vkMapMemory( VKAPI_ATTR VkResult VKAPI_CALL RPIFUNC(vkMapMemory)(
VkDevice device, VkDevice device,
VkDeviceMemory memory, VkDeviceMemory memory,
VkDeviceSize offset, VkDeviceSize offset,
@ -127,54 +135,54 @@ VKAPI_ATTR VkResult VKAPI_CALL rpi_vkMapMemory(
VkMemoryMapFlags flags, VkMemoryMapFlags flags,
void** ppData); void** ppData);
VKAPI_ATTR void VKAPI_CALL rpi_vkUnmapMemory( VKAPI_ATTR void VKAPI_CALL RPIFUNC(vkUnmapMemory)(
VkDevice device, VkDevice device,
VkDeviceMemory memory); VkDeviceMemory memory);
VKAPI_ATTR VkResult VKAPI_CALL rpi_vkFlushMappedMemoryRanges( VKAPI_ATTR VkResult VKAPI_CALL RPIFUNC(vkFlushMappedMemoryRanges)(
VkDevice device, VkDevice device,
uint32_t memoryRangeCount, uint32_t memoryRangeCount,
const VkMappedMemoryRange* pMemoryRanges); const VkMappedMemoryRange* pMemoryRanges);
VKAPI_ATTR VkResult VKAPI_CALL rpi_vkInvalidateMappedMemoryRanges( VKAPI_ATTR VkResult VKAPI_CALL RPIFUNC(vkInvalidateMappedMemoryRanges)(
VkDevice device, VkDevice device,
uint32_t memoryRangeCount, uint32_t memoryRangeCount,
const VkMappedMemoryRange* pMemoryRanges); const VkMappedMemoryRange* pMemoryRanges);
VKAPI_ATTR void VKAPI_CALL rpi_vkGetDeviceMemoryCommitment( VKAPI_ATTR void VKAPI_CALL RPIFUNC(vkGetDeviceMemoryCommitment)(
VkDevice device, VkDevice device,
VkDeviceMemory memory, VkDeviceMemory memory,
VkDeviceSize* pCommittedMemoryInBytes); VkDeviceSize* pCommittedMemoryInBytes);
VKAPI_ATTR VkResult VKAPI_CALL rpi_vkBindBufferMemory( VKAPI_ATTR VkResult VKAPI_CALL RPIFUNC(vkBindBufferMemory)(
VkDevice device, VkDevice device,
VkBuffer buffer, VkBuffer buffer,
VkDeviceMemory memory, VkDeviceMemory memory,
VkDeviceSize memoryOffset); VkDeviceSize memoryOffset);
VKAPI_ATTR VkResult VKAPI_CALL rpi_vkBindImageMemory( VKAPI_ATTR VkResult VKAPI_CALL RPIFUNC(vkBindImageMemory)(
VkDevice device, VkDevice device,
VkImage image, VkImage image,
VkDeviceMemory memory, VkDeviceMemory memory,
VkDeviceSize memoryOffset); VkDeviceSize memoryOffset);
VKAPI_ATTR void VKAPI_CALL rpi_vkGetBufferMemoryRequirements( VKAPI_ATTR void VKAPI_CALL RPIFUNC(vkGetBufferMemoryRequirements)(
VkDevice device, VkDevice device,
VkBuffer buffer, VkBuffer buffer,
VkMemoryRequirements* pMemoryRequirements); VkMemoryRequirements* pMemoryRequirements);
VKAPI_ATTR void VKAPI_CALL rpi_vkGetImageMemoryRequirements( VKAPI_ATTR void VKAPI_CALL RPIFUNC(vkGetImageMemoryRequirements)(
VkDevice device, VkDevice device,
VkImage image, VkImage image,
VkMemoryRequirements* pMemoryRequirements); VkMemoryRequirements* pMemoryRequirements);
VKAPI_ATTR void VKAPI_CALL rpi_vkGetImageSparseMemoryRequirements( VKAPI_ATTR void VKAPI_CALL RPIFUNC(vkGetImageSparseMemoryRequirements)(
VkDevice device, VkDevice device,
VkImage image, VkImage image,
uint32_t* pSparseMemoryRequirementCount, uint32_t* pSparseMemoryRequirementCount,
VkSparseImageMemoryRequirements* pSparseMemoryRequirements); VkSparseImageMemoryRequirements* pSparseMemoryRequirements);
VKAPI_ATTR void VKAPI_CALL rpi_vkGetPhysicalDeviceSparseImageFormatProperties( VKAPI_ATTR void VKAPI_CALL RPIFUNC(vkGetPhysicalDeviceSparseImageFormatProperties)(
VkPhysicalDevice physicalDevice, VkPhysicalDevice physicalDevice,
VkFormat format, VkFormat format,
VkImageType type, VkImageType type,
@ -184,85 +192,85 @@ VKAPI_ATTR void VKAPI_CALL rpi_vkGetPhysicalDeviceSparseImageFormatProperties(
uint32_t* pPropertyCount, uint32_t* pPropertyCount,
VkSparseImageFormatProperties* pProperties); VkSparseImageFormatProperties* pProperties);
VKAPI_ATTR VkResult VKAPI_CALL rpi_vkQueueBindSparse( VKAPI_ATTR VkResult VKAPI_CALL RPIFUNC(vkQueueBindSparse)(
VkQueue queue, VkQueue queue,
uint32_t bindInfoCount, uint32_t bindInfoCount,
const VkBindSparseInfo* pBindInfo, const VkBindSparseInfo* pBindInfo,
VkFence fence); VkFence fence);
VKAPI_ATTR VkResult VKAPI_CALL rpi_vkCreateFence( VKAPI_ATTR VkResult VKAPI_CALL RPIFUNC(vkCreateFence)(
VkDevice device, VkDevice device,
const VkFenceCreateInfo* pCreateInfo, const VkFenceCreateInfo* pCreateInfo,
const VkAllocationCallbacks* pAllocator, const VkAllocationCallbacks* pAllocator,
VkFence* pFence); VkFence* pFence);
VKAPI_ATTR void VKAPI_CALL rpi_vkDestroyFence( VKAPI_ATTR void VKAPI_CALL RPIFUNC(vkDestroyFence)(
VkDevice device, VkDevice device,
VkFence fence, VkFence fence,
const VkAllocationCallbacks* pAllocator); const VkAllocationCallbacks* pAllocator);
VKAPI_ATTR VkResult VKAPI_CALL rpi_vkResetFences( VKAPI_ATTR VkResult VKAPI_CALL RPIFUNC(vkResetFences)(
VkDevice device, VkDevice device,
uint32_t fenceCount, uint32_t fenceCount,
const VkFence* pFences); const VkFence* pFences);
VKAPI_ATTR VkResult VKAPI_CALL rpi_vkGetFenceStatus( VKAPI_ATTR VkResult VKAPI_CALL RPIFUNC(vkGetFenceStatus)(
VkDevice device, VkDevice device,
VkFence fence); VkFence fence);
VKAPI_ATTR VkResult VKAPI_CALL rpi_vkWaitForFences( VKAPI_ATTR VkResult VKAPI_CALL RPIFUNC(vkWaitForFences)(
VkDevice device, VkDevice device,
uint32_t fenceCount, uint32_t fenceCount,
const VkFence* pFences, const VkFence* pFences,
VkBool32 waitAll, VkBool32 waitAll,
uint64_t timeout); uint64_t timeout);
VKAPI_ATTR VkResult VKAPI_CALL rpi_vkCreateSemaphore( VKAPI_ATTR VkResult VKAPI_CALL RPIFUNC(vkCreateSemaphore)(
VkDevice device, VkDevice device,
const VkSemaphoreCreateInfo* pCreateInfo, const VkSemaphoreCreateInfo* pCreateInfo,
const VkAllocationCallbacks* pAllocator, const VkAllocationCallbacks* pAllocator,
VkSemaphore* pSemaphore); VkSemaphore* pSemaphore);
VKAPI_ATTR void VKAPI_CALL rpi_vkDestroySemaphore( VKAPI_ATTR void VKAPI_CALL RPIFUNC(vkDestroySemaphore)(
VkDevice device, VkDevice device,
VkSemaphore semaphore, VkSemaphore semaphore,
const VkAllocationCallbacks* pAllocator); const VkAllocationCallbacks* pAllocator);
VKAPI_ATTR VkResult VKAPI_CALL rpi_vkCreateEvent( VKAPI_ATTR VkResult VKAPI_CALL RPIFUNC(vkCreateEvent)(
VkDevice device, VkDevice device,
const VkEventCreateInfo* pCreateInfo, const VkEventCreateInfo* pCreateInfo,
const VkAllocationCallbacks* pAllocator, const VkAllocationCallbacks* pAllocator,
VkEvent* pEvent); VkEvent* pEvent);
VKAPI_ATTR void VKAPI_CALL rpi_vkDestroyEvent( VKAPI_ATTR void VKAPI_CALL RPIFUNC(vkDestroyEvent)(
VkDevice device, VkDevice device,
VkEvent event, VkEvent event,
const VkAllocationCallbacks* pAllocator); const VkAllocationCallbacks* pAllocator);
VKAPI_ATTR VkResult VKAPI_CALL rpi_vkGetEventStatus( VKAPI_ATTR VkResult VKAPI_CALL RPIFUNC(vkGetEventStatus)(
VkDevice device, VkDevice device,
VkEvent event); VkEvent event);
VKAPI_ATTR VkResult VKAPI_CALL rpi_vkSetEvent( VKAPI_ATTR VkResult VKAPI_CALL RPIFUNC(vkSetEvent)(
VkDevice device, VkDevice device,
VkEvent event); VkEvent event);
VKAPI_ATTR VkResult VKAPI_CALL rpi_vkResetEvent( VKAPI_ATTR VkResult VKAPI_CALL RPIFUNC(vkResetEvent)(
VkDevice device, VkDevice device,
VkEvent event); VkEvent event);
VKAPI_ATTR VkResult VKAPI_CALL rpi_vkCreateQueryPool( VKAPI_ATTR VkResult VKAPI_CALL RPIFUNC(vkCreateQueryPool)(
VkDevice device, VkDevice device,
const VkQueryPoolCreateInfo* pCreateInfo, const VkQueryPoolCreateInfo* pCreateInfo,
const VkAllocationCallbacks* pAllocator, const VkAllocationCallbacks* pAllocator,
VkQueryPool* pQueryPool); VkQueryPool* pQueryPool);
VKAPI_ATTR void VKAPI_CALL rpi_vkDestroyQueryPool( VKAPI_ATTR void VKAPI_CALL RPIFUNC(vkDestroyQueryPool)(
VkDevice device, VkDevice device,
VkQueryPool queryPool, VkQueryPool queryPool,
const VkAllocationCallbacks* pAllocator); const VkAllocationCallbacks* pAllocator);
VKAPI_ATTR VkResult VKAPI_CALL rpi_vkGetQueryPoolResults( VKAPI_ATTR VkResult VKAPI_CALL RPIFUNC(vkGetQueryPoolResults)(
VkDevice device, VkDevice device,
VkQueryPool queryPool, VkQueryPool queryPool,
uint32_t firstQuery, uint32_t firstQuery,
@ -272,91 +280,91 @@ VKAPI_ATTR VkResult VKAPI_CALL rpi_vkGetQueryPoolResults(
VkDeviceSize stride, VkDeviceSize stride,
VkQueryResultFlags flags); VkQueryResultFlags flags);
VKAPI_ATTR VkResult VKAPI_CALL rpi_vkCreateBuffer( VKAPI_ATTR VkResult VKAPI_CALL RPIFUNC(vkCreateBuffer)(
VkDevice device, VkDevice device,
const VkBufferCreateInfo* pCreateInfo, const VkBufferCreateInfo* pCreateInfo,
const VkAllocationCallbacks* pAllocator, const VkAllocationCallbacks* pAllocator,
VkBuffer* pBuffer); VkBuffer* pBuffer);
VKAPI_ATTR void VKAPI_CALL rpi_vkDestroyBuffer( VKAPI_ATTR void VKAPI_CALL RPIFUNC(vkDestroyBuffer)(
VkDevice device, VkDevice device,
VkBuffer buffer, VkBuffer buffer,
const VkAllocationCallbacks* pAllocator); const VkAllocationCallbacks* pAllocator);
VKAPI_ATTR VkResult VKAPI_CALL rpi_vkCreateBufferView( VKAPI_ATTR VkResult VKAPI_CALL RPIFUNC(vkCreateBufferView)(
VkDevice device, VkDevice device,
const VkBufferViewCreateInfo* pCreateInfo, const VkBufferViewCreateInfo* pCreateInfo,
const VkAllocationCallbacks* pAllocator, const VkAllocationCallbacks* pAllocator,
VkBufferView* pView); VkBufferView* pView);
VKAPI_ATTR void VKAPI_CALL rpi_vkDestroyBufferView( VKAPI_ATTR void VKAPI_CALL RPIFUNC(vkDestroyBufferView)(
VkDevice device, VkDevice device,
VkBufferView bufferView, VkBufferView bufferView,
const VkAllocationCallbacks* pAllocator); const VkAllocationCallbacks* pAllocator);
VKAPI_ATTR VkResult VKAPI_CALL rpi_vkCreateImage( VKAPI_ATTR VkResult VKAPI_CALL RPIFUNC(vkCreateImage)(
VkDevice device, VkDevice device,
const VkImageCreateInfo* pCreateInfo, const VkImageCreateInfo* pCreateInfo,
const VkAllocationCallbacks* pAllocator, const VkAllocationCallbacks* pAllocator,
VkImage* pImage); VkImage* pImage);
VKAPI_ATTR void VKAPI_CALL rpi_vkDestroyImage( VKAPI_ATTR void VKAPI_CALL RPIFUNC(vkDestroyImage)(
VkDevice device, VkDevice device,
VkImage image, VkImage image,
const VkAllocationCallbacks* pAllocator); const VkAllocationCallbacks* pAllocator);
VKAPI_ATTR void VKAPI_CALL rpi_vkGetImageSubresourceLayout( VKAPI_ATTR void VKAPI_CALL RPIFUNC(vkGetImageSubresourceLayout)(
VkDevice device, VkDevice device,
VkImage image, VkImage image,
const VkImageSubresource* pSubresource, const VkImageSubresource* pSubresource,
VkSubresourceLayout* pLayout); VkSubresourceLayout* pLayout);
VKAPI_ATTR VkResult VKAPI_CALL rpi_vkCreateImageView( VKAPI_ATTR VkResult VKAPI_CALL RPIFUNC(vkCreateImageView)(
VkDevice device, VkDevice device,
const VkImageViewCreateInfo* pCreateInfo, const VkImageViewCreateInfo* pCreateInfo,
const VkAllocationCallbacks* pAllocator, const VkAllocationCallbacks* pAllocator,
VkImageView* pView); VkImageView* pView);
VKAPI_ATTR void VKAPI_CALL rpi_vkDestroyImageView( VKAPI_ATTR void VKAPI_CALL RPIFUNC(vkDestroyImageView)(
VkDevice device, VkDevice device,
VkImageView imageView, VkImageView imageView,
const VkAllocationCallbacks* pAllocator); const VkAllocationCallbacks* pAllocator);
VKAPI_ATTR VkResult VKAPI_CALL rpi_vkCreateShaderModule( VKAPI_ATTR VkResult VKAPI_CALL RPIFUNC(vkCreateShaderModule)(
VkDevice device, VkDevice device,
const VkShaderModuleCreateInfo* pCreateInfo, const VkShaderModuleCreateInfo* pCreateInfo,
const VkAllocationCallbacks* pAllocator, const VkAllocationCallbacks* pAllocator,
VkShaderModule* pShaderModule); VkShaderModule* pShaderModule);
VKAPI_ATTR void VKAPI_CALL rpi_vkDestroyShaderModule( VKAPI_ATTR void VKAPI_CALL RPIFUNC(vkDestroyShaderModule)(
VkDevice device, VkDevice device,
VkShaderModule shaderModule, VkShaderModule shaderModule,
const VkAllocationCallbacks* pAllocator); const VkAllocationCallbacks* pAllocator);
VKAPI_ATTR VkResult VKAPI_CALL rpi_vkCreatePipelineCache( VKAPI_ATTR VkResult VKAPI_CALL RPIFUNC(vkCreatePipelineCache)(
VkDevice device, VkDevice device,
const VkPipelineCacheCreateInfo* pCreateInfo, const VkPipelineCacheCreateInfo* pCreateInfo,
const VkAllocationCallbacks* pAllocator, const VkAllocationCallbacks* pAllocator,
VkPipelineCache* pPipelineCache); VkPipelineCache* pPipelineCache);
VKAPI_ATTR void VKAPI_CALL rpi_vkDestroyPipelineCache( VKAPI_ATTR void VKAPI_CALL RPIFUNC(vkDestroyPipelineCache)(
VkDevice device, VkDevice device,
VkPipelineCache pipelineCache, VkPipelineCache pipelineCache,
const VkAllocationCallbacks* pAllocator); const VkAllocationCallbacks* pAllocator);
VKAPI_ATTR VkResult VKAPI_CALL rpi_vkGetPipelineCacheData( VKAPI_ATTR VkResult VKAPI_CALL RPIFUNC(vkGetPipelineCacheData)(
VkDevice device, VkDevice device,
VkPipelineCache pipelineCache, VkPipelineCache pipelineCache,
size_t* pDataSize, size_t* pDataSize,
void* pData); void* pData);
VKAPI_ATTR VkResult VKAPI_CALL rpi_vkMergePipelineCaches( VKAPI_ATTR VkResult VKAPI_CALL RPIFUNC(vkMergePipelineCaches)(
VkDevice device, VkDevice device,
VkPipelineCache dstCache, VkPipelineCache dstCache,
uint32_t srcCacheCount, uint32_t srcCacheCount,
const VkPipelineCache* pSrcCaches); const VkPipelineCache* pSrcCaches);
VKAPI_ATTR VkResult VKAPI_CALL rpi_vkCreateGraphicsPipelines( VKAPI_ATTR VkResult VKAPI_CALL RPIFUNC(vkCreateGraphicsPipelines)(
VkDevice device, VkDevice device,
VkPipelineCache pipelineCache, VkPipelineCache pipelineCache,
uint32_t createInfoCount, uint32_t createInfoCount,
@ -364,7 +372,7 @@ VKAPI_ATTR VkResult VKAPI_CALL rpi_vkCreateGraphicsPipelines(
const VkAllocationCallbacks* pAllocator, const VkAllocationCallbacks* pAllocator,
VkPipeline* pPipelines); VkPipeline* pPipelines);
VKAPI_ATTR VkResult VKAPI_CALL rpi_vkCreateComputePipelines( VKAPI_ATTR VkResult VKAPI_CALL RPIFUNC(vkCreateComputePipelines)(
VkDevice device, VkDevice device,
VkPipelineCache pipelineCache, VkPipelineCache pipelineCache,
uint32_t createInfoCount, uint32_t createInfoCount,
@ -372,195 +380,195 @@ VKAPI_ATTR VkResult VKAPI_CALL rpi_vkCreateComputePipelines(
const VkAllocationCallbacks* pAllocator, const VkAllocationCallbacks* pAllocator,
VkPipeline* pPipelines); VkPipeline* pPipelines);
VKAPI_ATTR void VKAPI_CALL rpi_vkDestroyPipeline( VKAPI_ATTR void VKAPI_CALL RPIFUNC(vkDestroyPipeline)(
VkDevice device, VkDevice device,
VkPipeline pipeline, VkPipeline pipeline,
const VkAllocationCallbacks* pAllocator); const VkAllocationCallbacks* pAllocator);
VKAPI_ATTR VkResult VKAPI_CALL rpi_vkCreatePipelineLayout( VKAPI_ATTR VkResult VKAPI_CALL RPIFUNC(vkCreatePipelineLayout)(
VkDevice device, VkDevice device,
const VkPipelineLayoutCreateInfo* pCreateInfo, const VkPipelineLayoutCreateInfo* pCreateInfo,
const VkAllocationCallbacks* pAllocator, const VkAllocationCallbacks* pAllocator,
VkPipelineLayout* pPipelineLayout); VkPipelineLayout* pPipelineLayout);
VKAPI_ATTR void VKAPI_CALL rpi_vkDestroyPipelineLayout( VKAPI_ATTR void VKAPI_CALL RPIFUNC(vkDestroyPipelineLayout)(
VkDevice device, VkDevice device,
VkPipelineLayout pipelineLayout, VkPipelineLayout pipelineLayout,
const VkAllocationCallbacks* pAllocator); const VkAllocationCallbacks* pAllocator);
VKAPI_ATTR VkResult VKAPI_CALL rpi_vkCreateSampler( VKAPI_ATTR VkResult VKAPI_CALL RPIFUNC(vkCreateSampler)(
VkDevice device, VkDevice device,
const VkSamplerCreateInfo* pCreateInfo, const VkSamplerCreateInfo* pCreateInfo,
const VkAllocationCallbacks* pAllocator, const VkAllocationCallbacks* pAllocator,
VkSampler* pSampler); VkSampler* pSampler);
VKAPI_ATTR void VKAPI_CALL rpi_vkDestroySampler( VKAPI_ATTR void VKAPI_CALL RPIFUNC(vkDestroySampler)(
VkDevice device, VkDevice device,
VkSampler sampler, VkSampler sampler,
const VkAllocationCallbacks* pAllocator); const VkAllocationCallbacks* pAllocator);
VKAPI_ATTR VkResult VKAPI_CALL rpi_vkCreateDescriptorSetLayout( VKAPI_ATTR VkResult VKAPI_CALL RPIFUNC(vkCreateDescriptorSetLayout)(
VkDevice device, VkDevice device,
const VkDescriptorSetLayoutCreateInfo* pCreateInfo, const VkDescriptorSetLayoutCreateInfo* pCreateInfo,
const VkAllocationCallbacks* pAllocator, const VkAllocationCallbacks* pAllocator,
VkDescriptorSetLayout* pSetLayout); VkDescriptorSetLayout* pSetLayout);
VKAPI_ATTR void VKAPI_CALL rpi_vkDestroyDescriptorSetLayout( VKAPI_ATTR void VKAPI_CALL RPIFUNC(vkDestroyDescriptorSetLayout)(
VkDevice device, VkDevice device,
VkDescriptorSetLayout descriptorSetLayout, VkDescriptorSetLayout descriptorSetLayout,
const VkAllocationCallbacks* pAllocator); const VkAllocationCallbacks* pAllocator);
VKAPI_ATTR VkResult VKAPI_CALL rpi_vkCreateDescriptorPool( VKAPI_ATTR VkResult VKAPI_CALL RPIFUNC(vkCreateDescriptorPool)(
VkDevice device, VkDevice device,
const VkDescriptorPoolCreateInfo* pCreateInfo, const VkDescriptorPoolCreateInfo* pCreateInfo,
const VkAllocationCallbacks* pAllocator, const VkAllocationCallbacks* pAllocator,
VkDescriptorPool* pDescriptorPool); VkDescriptorPool* pDescriptorPool);
VKAPI_ATTR void VKAPI_CALL rpi_vkDestroyDescriptorPool( VKAPI_ATTR void VKAPI_CALL RPIFUNC(vkDestroyDescriptorPool)(
VkDevice device, VkDevice device,
VkDescriptorPool descriptorPool, VkDescriptorPool descriptorPool,
const VkAllocationCallbacks* pAllocator); const VkAllocationCallbacks* pAllocator);
VKAPI_ATTR VkResult VKAPI_CALL rpi_vkResetDescriptorPool( VKAPI_ATTR VkResult VKAPI_CALL RPIFUNC(vkResetDescriptorPool)(
VkDevice device, VkDevice device,
VkDescriptorPool descriptorPool, VkDescriptorPool descriptorPool,
VkDescriptorPoolResetFlags flags); VkDescriptorPoolResetFlags flags);
VKAPI_ATTR VkResult VKAPI_CALL rpi_vkAllocateDescriptorSets( VKAPI_ATTR VkResult VKAPI_CALL RPIFUNC(vkAllocateDescriptorSets)(
VkDevice device, VkDevice device,
const VkDescriptorSetAllocateInfo* pAllocateInfo, const VkDescriptorSetAllocateInfo* pAllocateInfo,
VkDescriptorSet* pDescriptorSets); VkDescriptorSet* pDescriptorSets);
VKAPI_ATTR VkResult VKAPI_CALL rpi_vkFreeDescriptorSets( VKAPI_ATTR VkResult VKAPI_CALL RPIFUNC(vkFreeDescriptorSets)(
VkDevice device, VkDevice device,
VkDescriptorPool descriptorPool, VkDescriptorPool descriptorPool,
uint32_t descriptorSetCount, uint32_t descriptorSetCount,
const VkDescriptorSet* pDescriptorSets); const VkDescriptorSet* pDescriptorSets);
VKAPI_ATTR void VKAPI_CALL rpi_vkUpdateDescriptorSets( VKAPI_ATTR void VKAPI_CALL RPIFUNC(vkUpdateDescriptorSets)(
VkDevice device, VkDevice device,
uint32_t descriptorWriteCount, uint32_t descriptorWriteCount,
const VkWriteDescriptorSet* pDescriptorWrites, const VkWriteDescriptorSet* pDescriptorWrites,
uint32_t descriptorCopyCount, uint32_t descriptorCopyCount,
const VkCopyDescriptorSet* pDescriptorCopies); const VkCopyDescriptorSet* pDescriptorCopies);
VKAPI_ATTR VkResult VKAPI_CALL rpi_vkCreateFramebuffer( VKAPI_ATTR VkResult VKAPI_CALL RPIFUNC(vkCreateFramebuffer)(
VkDevice device, VkDevice device,
const VkFramebufferCreateInfo* pCreateInfo, const VkFramebufferCreateInfo* pCreateInfo,
const VkAllocationCallbacks* pAllocator, const VkAllocationCallbacks* pAllocator,
VkFramebuffer* pFramebuffer); VkFramebuffer* pFramebuffer);
VKAPI_ATTR void VKAPI_CALL rpi_vkDestroyFramebuffer( VKAPI_ATTR void VKAPI_CALL RPIFUNC(vkDestroyFramebuffer)(
VkDevice device, VkDevice device,
VkFramebuffer framebuffer, VkFramebuffer framebuffer,
const VkAllocationCallbacks* pAllocator); const VkAllocationCallbacks* pAllocator);
VKAPI_ATTR VkResult VKAPI_CALL rpi_vkCreateRenderPass( VKAPI_ATTR VkResult VKAPI_CALL RPIFUNC(vkCreateRenderPass)(
VkDevice device, VkDevice device,
const VkRenderPassCreateInfo* pCreateInfo, const VkRenderPassCreateInfo* pCreateInfo,
const VkAllocationCallbacks* pAllocator, const VkAllocationCallbacks* pAllocator,
VkRenderPass* pRenderPass); VkRenderPass* pRenderPass);
VKAPI_ATTR void VKAPI_CALL rpi_vkDestroyRenderPass( VKAPI_ATTR void VKAPI_CALL RPIFUNC(vkDestroyRenderPass)(
VkDevice device, VkDevice device,
VkRenderPass renderPass, VkRenderPass renderPass,
const VkAllocationCallbacks* pAllocator); const VkAllocationCallbacks* pAllocator);
VKAPI_ATTR void VKAPI_CALL rpi_vkGetRenderAreaGranularity( VKAPI_ATTR void VKAPI_CALL RPIFUNC(vkGetRenderAreaGranularity)(
VkDevice device, VkDevice device,
VkRenderPass renderPass, VkRenderPass renderPass,
VkExtent2D* pGranularity); VkExtent2D* pGranularity);
VKAPI_ATTR VkResult VKAPI_CALL rpi_vkCreateCommandPool( VKAPI_ATTR VkResult VKAPI_CALL RPIFUNC(vkCreateCommandPool)(
VkDevice device, VkDevice device,
const VkCommandPoolCreateInfo* pCreateInfo, const VkCommandPoolCreateInfo* pCreateInfo,
const VkAllocationCallbacks* pAllocator, const VkAllocationCallbacks* pAllocator,
VkCommandPool* pCommandPool); VkCommandPool* pCommandPool);
VKAPI_ATTR void VKAPI_CALL rpi_vkDestroyCommandPool( VKAPI_ATTR void VKAPI_CALL RPIFUNC(vkDestroyCommandPool)(
VkDevice device, VkDevice device,
VkCommandPool commandPool, VkCommandPool commandPool,
const VkAllocationCallbacks* pAllocator); const VkAllocationCallbacks* pAllocator);
VKAPI_ATTR VkResult VKAPI_CALL rpi_vkResetCommandPool( VKAPI_ATTR VkResult VKAPI_CALL RPIFUNC(vkResetCommandPool)(
VkDevice device, VkDevice device,
VkCommandPool commandPool, VkCommandPool commandPool,
VkCommandPoolResetFlags flags); VkCommandPoolResetFlags flags);
VKAPI_ATTR VkResult VKAPI_CALL rpi_vkAllocateCommandBuffers( VKAPI_ATTR VkResult VKAPI_CALL RPIFUNC(vkAllocateCommandBuffers)(
VkDevice device, VkDevice device,
const VkCommandBufferAllocateInfo* pAllocateInfo, const VkCommandBufferAllocateInfo* pAllocateInfo,
VkCommandBuffer* pCommandBuffers); VkCommandBuffer* pCommandBuffers);
VKAPI_ATTR void VKAPI_CALL rpi_vkFreeCommandBuffers( VKAPI_ATTR void VKAPI_CALL RPIFUNC(vkFreeCommandBuffers)(
VkDevice device, VkDevice device,
VkCommandPool commandPool, VkCommandPool commandPool,
uint32_t commandBufferCount, uint32_t commandBufferCount,
const VkCommandBuffer* pCommandBuffers); const VkCommandBuffer* pCommandBuffers);
VKAPI_ATTR VkResult VKAPI_CALL rpi_vkBeginCommandBuffer( VKAPI_ATTR VkResult VKAPI_CALL RPIFUNC(vkBeginCommandBuffer)(
VkCommandBuffer commandBuffer, VkCommandBuffer commandBuffer,
const VkCommandBufferBeginInfo* pBeginInfo); const VkCommandBufferBeginInfo* pBeginInfo);
VKAPI_ATTR VkResult VKAPI_CALL rpi_vkEndCommandBuffer( VKAPI_ATTR VkResult VKAPI_CALL RPIFUNC(vkEndCommandBuffer)(
VkCommandBuffer commandBuffer); VkCommandBuffer commandBuffer);
VKAPI_ATTR VkResult VKAPI_CALL rpi_vkResetCommandBuffer( VKAPI_ATTR VkResult VKAPI_CALL RPIFUNC(vkResetCommandBuffer)(
VkCommandBuffer commandBuffer, VkCommandBuffer commandBuffer,
VkCommandBufferResetFlags flags); VkCommandBufferResetFlags flags);
VKAPI_ATTR void VKAPI_CALL rpi_vkCmdBindPipeline( VKAPI_ATTR void VKAPI_CALL RPIFUNC(vkCmdBindPipeline)(
VkCommandBuffer commandBuffer, VkCommandBuffer commandBuffer,
VkPipelineBindPoint pipelineBindPoint, VkPipelineBindPoint pipelineBindPoint,
VkPipeline pipeline); VkPipeline pipeline);
VKAPI_ATTR void VKAPI_CALL rpi_vkCmdSetViewport( VKAPI_ATTR void VKAPI_CALL RPIFUNC(vkCmdSetViewport)(
VkCommandBuffer commandBuffer, VkCommandBuffer commandBuffer,
uint32_t firstViewport, uint32_t firstViewport,
uint32_t viewportCount, uint32_t viewportCount,
const VkViewport* pViewports); const VkViewport* pViewports);
VKAPI_ATTR void VKAPI_CALL rpi_vkCmdSetScissor( VKAPI_ATTR void VKAPI_CALL RPIFUNC(vkCmdSetScissor)(
VkCommandBuffer commandBuffer, VkCommandBuffer commandBuffer,
uint32_t firstScissor, uint32_t firstScissor,
uint32_t scissorCount, uint32_t scissorCount,
const VkRect2D* pScissors); const VkRect2D* pScissors);
VKAPI_ATTR void VKAPI_CALL rpi_vkCmdSetLineWidth( VKAPI_ATTR void VKAPI_CALL RPIFUNC(vkCmdSetLineWidth)(
VkCommandBuffer commandBuffer, VkCommandBuffer commandBuffer,
float lineWidth); float lineWidth);
VKAPI_ATTR void VKAPI_CALL rpi_vkCmdSetDepthBias( VKAPI_ATTR void VKAPI_CALL RPIFUNC(vkCmdSetDepthBias)(
VkCommandBuffer commandBuffer, VkCommandBuffer commandBuffer,
float depthBiasConstantFactor, float depthBiasConstantFactor,
float depthBiasClamp, float depthBiasClamp,
float depthBiasSlopeFactor); float depthBiasSlopeFactor);
VKAPI_ATTR void VKAPI_CALL rpi_vkCmdSetBlendConstants( VKAPI_ATTR void VKAPI_CALL RPIFUNC(vkCmdSetBlendConstants)(
VkCommandBuffer commandBuffer, VkCommandBuffer commandBuffer,
const float blendConstants[4]); const float blendConstants[4]);
VKAPI_ATTR void VKAPI_CALL rpi_vkCmdSetDepthBounds( VKAPI_ATTR void VKAPI_CALL RPIFUNC(vkCmdSetDepthBounds)(
VkCommandBuffer commandBuffer, VkCommandBuffer commandBuffer,
float minDepthBounds, float minDepthBounds,
float maxDepthBounds); float maxDepthBounds);
VKAPI_ATTR void VKAPI_CALL rpi_vkCmdSetStencilCompareMask( VKAPI_ATTR void VKAPI_CALL RPIFUNC(vkCmdSetStencilCompareMask)(
VkCommandBuffer commandBuffer, VkCommandBuffer commandBuffer,
VkStencilFaceFlags faceMask, VkStencilFaceFlags faceMask,
uint32_t compareMask); uint32_t compareMask);
VKAPI_ATTR void VKAPI_CALL rpi_vkCmdSetStencilWriteMask( VKAPI_ATTR void VKAPI_CALL RPIFUNC(vkCmdSetStencilWriteMask)(
VkCommandBuffer commandBuffer, VkCommandBuffer commandBuffer,
VkStencilFaceFlags faceMask, VkStencilFaceFlags faceMask,
uint32_t writeMask); uint32_t writeMask);
VKAPI_ATTR void VKAPI_CALL rpi_vkCmdSetStencilReference( VKAPI_ATTR void VKAPI_CALL RPIFUNC(vkCmdSetStencilReference)(
VkCommandBuffer commandBuffer, VkCommandBuffer commandBuffer,
VkStencilFaceFlags faceMask, VkStencilFaceFlags faceMask,
uint32_t reference); uint32_t reference);
VKAPI_ATTR void VKAPI_CALL rpi_vkCmdBindDescriptorSets( VKAPI_ATTR void VKAPI_CALL RPIFUNC(vkCmdBindDescriptorSets)(
VkCommandBuffer commandBuffer, VkCommandBuffer commandBuffer,
VkPipelineBindPoint pipelineBindPoint, VkPipelineBindPoint pipelineBindPoint,
VkPipelineLayout layout, VkPipelineLayout layout,
@ -570,27 +578,27 @@ VKAPI_ATTR void VKAPI_CALL rpi_vkCmdBindDescriptorSets(
uint32_t dynamicOffsetCount, uint32_t dynamicOffsetCount,
const uint32_t* pDynamicOffsets); const uint32_t* pDynamicOffsets);
VKAPI_ATTR void VKAPI_CALL rpi_vkCmdBindIndexBuffer( VKAPI_ATTR void VKAPI_CALL RPIFUNC(vkCmdBindIndexBuffer)(
VkCommandBuffer commandBuffer, VkCommandBuffer commandBuffer,
VkBuffer buffer, VkBuffer buffer,
VkDeviceSize offset, VkDeviceSize offset,
VkIndexType indexType); VkIndexType indexType);
VKAPI_ATTR void VKAPI_CALL rpi_vkCmdBindVertexBuffers( VKAPI_ATTR void VKAPI_CALL RPIFUNC(vkCmdBindVertexBuffers)(
VkCommandBuffer commandBuffer, VkCommandBuffer commandBuffer,
uint32_t firstBinding, uint32_t firstBinding,
uint32_t bindingCount, uint32_t bindingCount,
const VkBuffer* pBuffers, const VkBuffer* pBuffers,
const VkDeviceSize* pOffsets); const VkDeviceSize* pOffsets);
VKAPI_ATTR void VKAPI_CALL rpi_vkCmdDraw( VKAPI_ATTR void VKAPI_CALL RPIFUNC(vkCmdDraw)(
VkCommandBuffer commandBuffer, VkCommandBuffer commandBuffer,
uint32_t vertexCount, uint32_t vertexCount,
uint32_t instanceCount, uint32_t instanceCount,
uint32_t firstVertex, uint32_t firstVertex,
uint32_t firstInstance); uint32_t firstInstance);
VKAPI_ATTR void VKAPI_CALL rpi_vkCmdDrawIndexed( VKAPI_ATTR void VKAPI_CALL RPIFUNC(vkCmdDrawIndexed)(
VkCommandBuffer commandBuffer, VkCommandBuffer commandBuffer,
uint32_t indexCount, uint32_t indexCount,
uint32_t instanceCount, uint32_t instanceCount,
@ -598,39 +606,39 @@ VKAPI_ATTR void VKAPI_CALL rpi_vkCmdDrawIndexed(
int32_t vertexOffset, int32_t vertexOffset,
uint32_t firstInstance); uint32_t firstInstance);
VKAPI_ATTR void VKAPI_CALL rpi_vkCmdDrawIndirect( VKAPI_ATTR void VKAPI_CALL RPIFUNC(vkCmdDrawIndirect)(
VkCommandBuffer commandBuffer, VkCommandBuffer commandBuffer,
VkBuffer buffer, VkBuffer buffer,
VkDeviceSize offset, VkDeviceSize offset,
uint32_t drawCount, uint32_t drawCount,
uint32_t stride); uint32_t stride);
VKAPI_ATTR void VKAPI_CALL rpi_vkCmdDrawIndexedIndirect( VKAPI_ATTR void VKAPI_CALL RPIFUNC(vkCmdDrawIndexedIndirect)(
VkCommandBuffer commandBuffer, VkCommandBuffer commandBuffer,
VkBuffer buffer, VkBuffer buffer,
VkDeviceSize offset, VkDeviceSize offset,
uint32_t drawCount, uint32_t drawCount,
uint32_t stride); uint32_t stride);
VKAPI_ATTR void VKAPI_CALL rpi_vkCmdDispatch( VKAPI_ATTR void VKAPI_CALL RPIFUNC(vkCmdDispatch)(
VkCommandBuffer commandBuffer, VkCommandBuffer commandBuffer,
uint32_t groupCountX, uint32_t groupCountX,
uint32_t groupCountY, uint32_t groupCountY,
uint32_t groupCountZ); uint32_t groupCountZ);
VKAPI_ATTR void VKAPI_CALL rpi_vkCmdDispatchIndirect( VKAPI_ATTR void VKAPI_CALL RPIFUNC(vkCmdDispatchIndirect)(
VkCommandBuffer commandBuffer, VkCommandBuffer commandBuffer,
VkBuffer buffer, VkBuffer buffer,
VkDeviceSize offset); VkDeviceSize offset);
VKAPI_ATTR void VKAPI_CALL rpi_vkCmdCopyBuffer( VKAPI_ATTR void VKAPI_CALL RPIFUNC(vkCmdCopyBuffer)(
VkCommandBuffer commandBuffer, VkCommandBuffer commandBuffer,
VkBuffer srcBuffer, VkBuffer srcBuffer,
VkBuffer dstBuffer, VkBuffer dstBuffer,
uint32_t regionCount, uint32_t regionCount,
const VkBufferCopy* pRegions); const VkBufferCopy* pRegions);
VKAPI_ATTR void VKAPI_CALL rpi_vkCmdCopyImage( VKAPI_ATTR void VKAPI_CALL RPIFUNC(vkCmdCopyImage)(
VkCommandBuffer commandBuffer, VkCommandBuffer commandBuffer,
VkImage srcImage, VkImage srcImage,
VkImageLayout srcImageLayout, VkImageLayout srcImageLayout,
@ -639,7 +647,7 @@ VKAPI_ATTR void VKAPI_CALL rpi_vkCmdCopyImage(
uint32_t regionCount, uint32_t regionCount,
const VkImageCopy* pRegions); const VkImageCopy* pRegions);
VKAPI_ATTR void VKAPI_CALL rpi_vkCmdBlitImage( VKAPI_ATTR void VKAPI_CALL RPIFUNC(vkCmdBlitImage)(
VkCommandBuffer commandBuffer, VkCommandBuffer commandBuffer,
VkImage srcImage, VkImage srcImage,
VkImageLayout srcImageLayout, VkImageLayout srcImageLayout,
@ -649,7 +657,7 @@ VKAPI_ATTR void VKAPI_CALL rpi_vkCmdBlitImage(
const VkImageBlit* pRegions, const VkImageBlit* pRegions,
VkFilter filter); VkFilter filter);
VKAPI_ATTR void VKAPI_CALL rpi_vkCmdCopyBufferToImage( VKAPI_ATTR void VKAPI_CALL RPIFUNC(vkCmdCopyBufferToImage)(
VkCommandBuffer commandBuffer, VkCommandBuffer commandBuffer,
VkBuffer srcBuffer, VkBuffer srcBuffer,
VkImage dstImage, VkImage dstImage,
@ -657,7 +665,7 @@ VKAPI_ATTR void VKAPI_CALL rpi_vkCmdCopyBufferToImage(
uint32_t regionCount, uint32_t regionCount,
const VkBufferImageCopy* pRegions); const VkBufferImageCopy* pRegions);
VKAPI_ATTR void VKAPI_CALL rpi_vkCmdCopyImageToBuffer( VKAPI_ATTR void VKAPI_CALL RPIFUNC(vkCmdCopyImageToBuffer)(
VkCommandBuffer commandBuffer, VkCommandBuffer commandBuffer,
VkImage srcImage, VkImage srcImage,
VkImageLayout srcImageLayout, VkImageLayout srcImageLayout,
@ -665,21 +673,21 @@ VKAPI_ATTR void VKAPI_CALL rpi_vkCmdCopyImageToBuffer(
uint32_t regionCount, uint32_t regionCount,
const VkBufferImageCopy* pRegions); const VkBufferImageCopy* pRegions);
VKAPI_ATTR void VKAPI_CALL rpi_vkCmdUpdateBuffer( VKAPI_ATTR void VKAPI_CALL RPIFUNC(vkCmdUpdateBuffer)(
VkCommandBuffer commandBuffer, VkCommandBuffer commandBuffer,
VkBuffer dstBuffer, VkBuffer dstBuffer,
VkDeviceSize dstOffset, VkDeviceSize dstOffset,
VkDeviceSize dataSize, VkDeviceSize dataSize,
const void* pData); const void* pData);
VKAPI_ATTR void VKAPI_CALL rpi_vkCmdFillBuffer( VKAPI_ATTR void VKAPI_CALL RPIFUNC(vkCmdFillBuffer)(
VkCommandBuffer commandBuffer, VkCommandBuffer commandBuffer,
VkBuffer dstBuffer, VkBuffer dstBuffer,
VkDeviceSize dstOffset, VkDeviceSize dstOffset,
VkDeviceSize size, VkDeviceSize size,
uint32_t data); uint32_t data);
VKAPI_ATTR void VKAPI_CALL rpi_vkCmdClearColorImage( VKAPI_ATTR void VKAPI_CALL RPIFUNC(vkCmdClearColorImage)(
VkCommandBuffer commandBuffer, VkCommandBuffer commandBuffer,
VkImage image, VkImage image,
VkImageLayout imageLayout, VkImageLayout imageLayout,
@ -687,7 +695,7 @@ VKAPI_ATTR void VKAPI_CALL rpi_vkCmdClearColorImage(
uint32_t rangeCount, uint32_t rangeCount,
const VkImageSubresourceRange* pRanges); const VkImageSubresourceRange* pRanges);
VKAPI_ATTR void VKAPI_CALL rpi_vkCmdClearDepthStencilImage( VKAPI_ATTR void VKAPI_CALL RPIFUNC(vkCmdClearDepthStencilImage)(
VkCommandBuffer commandBuffer, VkCommandBuffer commandBuffer,
VkImage image, VkImage image,
VkImageLayout imageLayout, VkImageLayout imageLayout,
@ -695,14 +703,14 @@ VKAPI_ATTR void VKAPI_CALL rpi_vkCmdClearDepthStencilImage(
uint32_t rangeCount, uint32_t rangeCount,
const VkImageSubresourceRange* pRanges); const VkImageSubresourceRange* pRanges);
VKAPI_ATTR void VKAPI_CALL rpi_vkCmdClearAttachments( VKAPI_ATTR void VKAPI_CALL RPIFUNC(vkCmdClearAttachments)(
VkCommandBuffer commandBuffer, VkCommandBuffer commandBuffer,
uint32_t attachmentCount, uint32_t attachmentCount,
const VkClearAttachment* pAttachments, const VkClearAttachment* pAttachments,
uint32_t rectCount, uint32_t rectCount,
const VkClearRect* pRects); const VkClearRect* pRects);
VKAPI_ATTR void VKAPI_CALL rpi_vkCmdResolveImage( VKAPI_ATTR void VKAPI_CALL RPIFUNC(vkCmdResolveImage)(
VkCommandBuffer commandBuffer, VkCommandBuffer commandBuffer,
VkImage srcImage, VkImage srcImage,
VkImageLayout srcImageLayout, VkImageLayout srcImageLayout,
@ -711,17 +719,17 @@ VKAPI_ATTR void VKAPI_CALL rpi_vkCmdResolveImage(
uint32_t regionCount, uint32_t regionCount,
const VkImageResolve* pRegions); const VkImageResolve* pRegions);
VKAPI_ATTR void VKAPI_CALL rpi_vkCmdSetEvent( VKAPI_ATTR void VKAPI_CALL RPIFUNC(vkCmdSetEvent)(
VkCommandBuffer commandBuffer, VkCommandBuffer commandBuffer,
VkEvent event, VkEvent event,
VkPipelineStageFlags stageMask); VkPipelineStageFlags stageMask);
VKAPI_ATTR void VKAPI_CALL rpi_vkCmdResetEvent( VKAPI_ATTR void VKAPI_CALL RPIFUNC(vkCmdResetEvent)(
VkCommandBuffer commandBuffer, VkCommandBuffer commandBuffer,
VkEvent event, VkEvent event,
VkPipelineStageFlags stageMask); VkPipelineStageFlags stageMask);
VKAPI_ATTR void VKAPI_CALL rpi_vkCmdWaitEvents( VKAPI_ATTR void VKAPI_CALL RPIFUNC(vkCmdWaitEvents)(
VkCommandBuffer commandBuffer, VkCommandBuffer commandBuffer,
uint32_t eventCount, uint32_t eventCount,
const VkEvent* pEvents, const VkEvent* pEvents,
@ -734,7 +742,7 @@ VKAPI_ATTR void VKAPI_CALL rpi_vkCmdWaitEvents(
uint32_t imageMemoryBarrierCount, uint32_t imageMemoryBarrierCount,
const VkImageMemoryBarrier* pImageMemoryBarriers); const VkImageMemoryBarrier* pImageMemoryBarriers);
VKAPI_ATTR void VKAPI_CALL rpi_vkCmdPipelineBarrier( VKAPI_ATTR void VKAPI_CALL RPIFUNC(vkCmdPipelineBarrier)(
VkCommandBuffer commandBuffer, VkCommandBuffer commandBuffer,
VkPipelineStageFlags srcStageMask, VkPipelineStageFlags srcStageMask,
VkPipelineStageFlags dstStageMask, VkPipelineStageFlags dstStageMask,
@ -746,30 +754,30 @@ VKAPI_ATTR void VKAPI_CALL rpi_vkCmdPipelineBarrier(
uint32_t imageMemoryBarrierCount, uint32_t imageMemoryBarrierCount,
const VkImageMemoryBarrier* pImageMemoryBarriers); const VkImageMemoryBarrier* pImageMemoryBarriers);
VKAPI_ATTR void VKAPI_CALL rpi_vkCmdBeginQuery( VKAPI_ATTR void VKAPI_CALL RPIFUNC(vkCmdBeginQuery)(
VkCommandBuffer commandBuffer, VkCommandBuffer commandBuffer,
VkQueryPool queryPool, VkQueryPool queryPool,
uint32_t query, uint32_t query,
VkQueryControlFlags flags); VkQueryControlFlags flags);
VKAPI_ATTR void VKAPI_CALL rpi_vkCmdEndQuery( VKAPI_ATTR void VKAPI_CALL RPIFUNC(vkCmdEndQuery)(
VkCommandBuffer commandBuffer, VkCommandBuffer commandBuffer,
VkQueryPool queryPool, VkQueryPool queryPool,
uint32_t query); uint32_t query);
VKAPI_ATTR void VKAPI_CALL rpi_vkCmdResetQueryPool( VKAPI_ATTR void VKAPI_CALL RPIFUNC(vkCmdResetQueryPool)(
VkCommandBuffer commandBuffer, VkCommandBuffer commandBuffer,
VkQueryPool queryPool, VkQueryPool queryPool,
uint32_t firstQuery, uint32_t firstQuery,
uint32_t queryCount); uint32_t queryCount);
VKAPI_ATTR void VKAPI_CALL rpi_vkCmdWriteTimestamp( VKAPI_ATTR void VKAPI_CALL RPIFUNC(vkCmdWriteTimestamp)(
VkCommandBuffer commandBuffer, VkCommandBuffer commandBuffer,
VkPipelineStageFlagBits pipelineStage, VkPipelineStageFlagBits pipelineStage,
VkQueryPool queryPool, VkQueryPool queryPool,
uint32_t query); uint32_t query);
VKAPI_ATTR void VKAPI_CALL rpi_vkCmdCopyQueryPoolResults( VKAPI_ATTR void VKAPI_CALL RPIFUNC(vkCmdCopyQueryPoolResults)(
VkCommandBuffer commandBuffer, VkCommandBuffer commandBuffer,
VkQueryPool queryPool, VkQueryPool queryPool,
uint32_t firstQuery, uint32_t firstQuery,
@ -779,7 +787,7 @@ VKAPI_ATTR void VKAPI_CALL rpi_vkCmdCopyQueryPoolResults(
VkDeviceSize stride, VkDeviceSize stride,
VkQueryResultFlags flags); VkQueryResultFlags flags);
VKAPI_ATTR void VKAPI_CALL rpi_vkCmdPushConstants( VKAPI_ATTR void VKAPI_CALL RPIFUNC(vkCmdPushConstants)(
VkCommandBuffer commandBuffer, VkCommandBuffer commandBuffer,
VkPipelineLayout layout, VkPipelineLayout layout,
VkShaderStageFlags stageFlags, VkShaderStageFlags stageFlags,
@ -787,48 +795,48 @@ VKAPI_ATTR void VKAPI_CALL rpi_vkCmdPushConstants(
uint32_t size, uint32_t size,
const void* pValues); const void* pValues);
VKAPI_ATTR void VKAPI_CALL rpi_vkCmdBeginRenderPass( VKAPI_ATTR void VKAPI_CALL RPIFUNC(vkCmdBeginRenderPass)(
VkCommandBuffer commandBuffer, VkCommandBuffer commandBuffer,
const VkRenderPassBeginInfo* pRenderPassBegin, const VkRenderPassBeginInfo* pRenderPassBegin,
VkSubpassContents contents); VkSubpassContents contents);
VKAPI_ATTR void VKAPI_CALL rpi_vkCmdNextSubpass( VKAPI_ATTR void VKAPI_CALL RPIFUNC(vkCmdNextSubpass)(
VkCommandBuffer commandBuffer, VkCommandBuffer commandBuffer,
VkSubpassContents contents); VkSubpassContents contents);
VKAPI_ATTR void VKAPI_CALL rpi_vkCmdEndRenderPass( VKAPI_ATTR void VKAPI_CALL RPIFUNC(vkCmdEndRenderPass)(
VkCommandBuffer commandBuffer); VkCommandBuffer commandBuffer);
VKAPI_ATTR void VKAPI_CALL rpi_vkCmdExecuteCommands( VKAPI_ATTR void VKAPI_CALL RPIFUNC(vkCmdExecuteCommands)(
VkCommandBuffer commandBuffer, VkCommandBuffer commandBuffer,
uint32_t commandBufferCount, uint32_t commandBufferCount,
const VkCommandBuffer* pCommandBuffers); const VkCommandBuffer* pCommandBuffers);
VKAPI_ATTR VkResult VKAPI_CALL rpi_vkEnumerateInstanceVersion( VKAPI_ATTR VkResult VKAPI_CALL RPIFUNC(vkEnumerateInstanceVersion)(
uint32_t* pApiVersion); uint32_t* pApiVersion);
VKAPI_ATTR VkResult VKAPI_CALL rpi_vkBindBufferMemory2( VKAPI_ATTR VkResult VKAPI_CALL RPIFUNC(vkBindBufferMemory2)(
VkDevice device, VkDevice device,
uint32_t bindInfoCount, uint32_t bindInfoCount,
const VkBindBufferMemoryInfo* pBindInfos); const VkBindBufferMemoryInfo* pBindInfos);
VKAPI_ATTR VkResult VKAPI_CALL rpi_vkBindImageMemory2( VKAPI_ATTR VkResult VKAPI_CALL RPIFUNC(vkBindImageMemory2)(
VkDevice device, VkDevice device,
uint32_t bindInfoCount, uint32_t bindInfoCount,
const VkBindImageMemoryInfo* pBindInfos); const VkBindImageMemoryInfo* pBindInfos);
VKAPI_ATTR void VKAPI_CALL rpi_vkGetDeviceGroupPeerMemoryFeatures( VKAPI_ATTR void VKAPI_CALL RPIFUNC(vkGetDeviceGroupPeerMemoryFeatures)(
VkDevice device, VkDevice device,
uint32_t heapIndex, uint32_t heapIndex,
uint32_t localDeviceIndex, uint32_t localDeviceIndex,
uint32_t remoteDeviceIndex, uint32_t remoteDeviceIndex,
VkPeerMemoryFeatureFlags* pPeerMemoryFeatures); VkPeerMemoryFeatureFlags* pPeerMemoryFeatures);
VKAPI_ATTR void VKAPI_CALL rpi_vkCmdSetDeviceMask( VKAPI_ATTR void VKAPI_CALL RPIFUNC(vkCmdSetDeviceMask)(
VkCommandBuffer commandBuffer, VkCommandBuffer commandBuffer,
uint32_t deviceMask); uint32_t deviceMask);
VKAPI_ATTR void VKAPI_CALL rpi_vkCmdDispatchBase( VKAPI_ATTR void VKAPI_CALL RPIFUNC(vkCmdDispatchBase)(
VkCommandBuffer commandBuffer, VkCommandBuffer commandBuffer,
uint32_t baseGroupX, uint32_t baseGroupX,
uint32_t baseGroupY, uint32_t baseGroupY,
@ -837,159 +845,159 @@ VKAPI_ATTR void VKAPI_CALL rpi_vkCmdDispatchBase(
uint32_t groupCountY, uint32_t groupCountY,
uint32_t groupCountZ); uint32_t groupCountZ);
VKAPI_ATTR VkResult VKAPI_CALL rpi_vkEnumeratePhysicalDeviceGroups( VKAPI_ATTR VkResult VKAPI_CALL RPIFUNC(vkEnumeratePhysicalDeviceGroups)(
VkInstance instance, VkInstance instance,
uint32_t* pPhysicalDeviceGroupCount, uint32_t* pPhysicalDeviceGroupCount,
VkPhysicalDeviceGroupProperties* pPhysicalDeviceGroupProperties); VkPhysicalDeviceGroupProperties* pPhysicalDeviceGroupProperties);
VKAPI_ATTR void VKAPI_CALL rpi_vkGetImageMemoryRequirements2( VKAPI_ATTR void VKAPI_CALL RPIFUNC(vkGetImageMemoryRequirements2)(
VkDevice device, VkDevice device,
const VkImageMemoryRequirementsInfo2* pInfo, const VkImageMemoryRequirementsInfo2* pInfo,
VkMemoryRequirements2* pMemoryRequirements); VkMemoryRequirements2* pMemoryRequirements);
VKAPI_ATTR void VKAPI_CALL rpi_vkGetBufferMemoryRequirements2( VKAPI_ATTR void VKAPI_CALL RPIFUNC(vkGetBufferMemoryRequirements2)(
VkDevice device, VkDevice device,
const VkBufferMemoryRequirementsInfo2* pInfo, const VkBufferMemoryRequirementsInfo2* pInfo,
VkMemoryRequirements2* pMemoryRequirements); VkMemoryRequirements2* pMemoryRequirements);
VKAPI_ATTR void VKAPI_CALL rpi_vkGetImageSparseMemoryRequirements2( VKAPI_ATTR void VKAPI_CALL RPIFUNC(vkGetImageSparseMemoryRequirements2)(
VkDevice device, VkDevice device,
const VkImageSparseMemoryRequirementsInfo2* pInfo, const VkImageSparseMemoryRequirementsInfo2* pInfo,
uint32_t* pSparseMemoryRequirementCount, uint32_t* pSparseMemoryRequirementCount,
VkSparseImageMemoryRequirements2* pSparseMemoryRequirements); VkSparseImageMemoryRequirements2* pSparseMemoryRequirements);
VKAPI_ATTR void VKAPI_CALL rpi_vkGetPhysicalDeviceFeatures2( VKAPI_ATTR void VKAPI_CALL RPIFUNC(vkGetPhysicalDeviceFeatures2)(
VkPhysicalDevice physicalDevice, VkPhysicalDevice physicalDevice,
VkPhysicalDeviceFeatures2* pFeatures); VkPhysicalDeviceFeatures2* pFeatures);
VKAPI_ATTR void VKAPI_CALL rpi_vkGetPhysicalDeviceProperties2( VKAPI_ATTR void VKAPI_CALL RPIFUNC(vkGetPhysicalDeviceProperties2)(
VkPhysicalDevice physicalDevice, VkPhysicalDevice physicalDevice,
VkPhysicalDeviceProperties2* pProperties); VkPhysicalDeviceProperties2* pProperties);
VKAPI_ATTR void VKAPI_CALL rpi_vkGetPhysicalDeviceFormatProperties2( VKAPI_ATTR void VKAPI_CALL RPIFUNC(vkGetPhysicalDeviceFormatProperties2)(
VkPhysicalDevice physicalDevice, VkPhysicalDevice physicalDevice,
VkFormat format, VkFormat format,
VkFormatProperties2* pFormatProperties); VkFormatProperties2* pFormatProperties);
VKAPI_ATTR VkResult VKAPI_CALL rpi_vkGetPhysicalDeviceImageFormatProperties2( VKAPI_ATTR VkResult VKAPI_CALL RPIFUNC(vkGetPhysicalDeviceImageFormatProperties2)(
VkPhysicalDevice physicalDevice, VkPhysicalDevice physicalDevice,
const VkPhysicalDeviceImageFormatInfo2* pImageFormatInfo, const VkPhysicalDeviceImageFormatInfo2* pImageFormatInfo,
VkImageFormatProperties2* pImageFormatProperties); VkImageFormatProperties2* pImageFormatProperties);
VKAPI_ATTR void VKAPI_CALL rpi_vkGetPhysicalDeviceQueueFamilyProperties2( VKAPI_ATTR void VKAPI_CALL RPIFUNC(vkGetPhysicalDeviceQueueFamilyProperties2)(
VkPhysicalDevice physicalDevice, VkPhysicalDevice physicalDevice,
uint32_t* pQueueFamilyPropertyCount, uint32_t* pQueueFamilyPropertyCount,
VkQueueFamilyProperties2* pQueueFamilyProperties); VkQueueFamilyProperties2* pQueueFamilyProperties);
VKAPI_ATTR void VKAPI_CALL rpi_vkGetPhysicalDeviceMemoryProperties2( VKAPI_ATTR void VKAPI_CALL RPIFUNC(vkGetPhysicalDeviceMemoryProperties2)(
VkPhysicalDevice physicalDevice, VkPhysicalDevice physicalDevice,
VkPhysicalDeviceMemoryProperties2* pMemoryProperties); VkPhysicalDeviceMemoryProperties2* pMemoryProperties);
VKAPI_ATTR void VKAPI_CALL rpi_vkGetPhysicalDeviceSparseImageFormatProperties2( VKAPI_ATTR void VKAPI_CALL RPIFUNC(vkGetPhysicalDeviceSparseImageFormatProperties2)(
VkPhysicalDevice physicalDevice, VkPhysicalDevice physicalDevice,
const VkPhysicalDeviceSparseImageFormatInfo2* pFormatInfo, const VkPhysicalDeviceSparseImageFormatInfo2* pFormatInfo,
uint32_t* pPropertyCount, uint32_t* pPropertyCount,
VkSparseImageFormatProperties2* pProperties); VkSparseImageFormatProperties2* pProperties);
VKAPI_ATTR void VKAPI_CALL rpi_vkTrimCommandPool( VKAPI_ATTR void VKAPI_CALL RPIFUNC(vkTrimCommandPool)(
VkDevice device, VkDevice device,
VkCommandPool commandPool, VkCommandPool commandPool,
VkCommandPoolTrimFlags flags); VkCommandPoolTrimFlags flags);
VKAPI_ATTR void VKAPI_CALL rpi_vkGetDeviceQueue2( VKAPI_ATTR void VKAPI_CALL RPIFUNC(vkGetDeviceQueue2)(
VkDevice device, VkDevice device,
const VkDeviceQueueInfo2* pQueueInfo, const VkDeviceQueueInfo2* pQueueInfo,
VkQueue* pQueue); VkQueue* pQueue);
VKAPI_ATTR VkResult VKAPI_CALL rpi_vkCreateSamplerYcbcrConversion( VKAPI_ATTR VkResult VKAPI_CALL RPIFUNC(vkCreateSamplerYcbcrConversion)(
VkDevice device, VkDevice device,
const VkSamplerYcbcrConversionCreateInfo* pCreateInfo, const VkSamplerYcbcrConversionCreateInfo* pCreateInfo,
const VkAllocationCallbacks* pAllocator, const VkAllocationCallbacks* pAllocator,
VkSamplerYcbcrConversion* pYcbcrConversion); VkSamplerYcbcrConversion* pYcbcrConversion);
VKAPI_ATTR void VKAPI_CALL rpi_vkDestroySamplerYcbcrConversion( VKAPI_ATTR void VKAPI_CALL RPIFUNC(vkDestroySamplerYcbcrConversion)(
VkDevice device, VkDevice device,
VkSamplerYcbcrConversion ycbcrConversion, VkSamplerYcbcrConversion ycbcrConversion,
const VkAllocationCallbacks* pAllocator); const VkAllocationCallbacks* pAllocator);
VKAPI_ATTR VkResult VKAPI_CALL rpi_vkCreateDescriptorUpdateTemplate( VKAPI_ATTR VkResult VKAPI_CALL RPIFUNC(vkCreateDescriptorUpdateTemplate)(
VkDevice device, VkDevice device,
const VkDescriptorUpdateTemplateCreateInfo* pCreateInfo, const VkDescriptorUpdateTemplateCreateInfo* pCreateInfo,
const VkAllocationCallbacks* pAllocator, const VkAllocationCallbacks* pAllocator,
VkDescriptorUpdateTemplate* pDescriptorUpdateTemplate); VkDescriptorUpdateTemplate* pDescriptorUpdateTemplate);
VKAPI_ATTR void VKAPI_CALL rpi_vkDestroyDescriptorUpdateTemplate( VKAPI_ATTR void VKAPI_CALL RPIFUNC(vkDestroyDescriptorUpdateTemplate)(
VkDevice device, VkDevice device,
VkDescriptorUpdateTemplate descriptorUpdateTemplate, VkDescriptorUpdateTemplate descriptorUpdateTemplate,
const VkAllocationCallbacks* pAllocator); const VkAllocationCallbacks* pAllocator);
VKAPI_ATTR void VKAPI_CALL rpi_vkUpdateDescriptorSetWithTemplate( VKAPI_ATTR void VKAPI_CALL RPIFUNC(vkUpdateDescriptorSetWithTemplate)(
VkDevice device, VkDevice device,
VkDescriptorSet descriptorSet, VkDescriptorSet descriptorSet,
VkDescriptorUpdateTemplate descriptorUpdateTemplate, VkDescriptorUpdateTemplate descriptorUpdateTemplate,
const void* pData); const void* pData);
VKAPI_ATTR void VKAPI_CALL rpi_vkGetPhysicalDeviceExternalBufferProperties( VKAPI_ATTR void VKAPI_CALL RPIFUNC(vkGetPhysicalDeviceExternalBufferProperties)(
VkPhysicalDevice physicalDevice, VkPhysicalDevice physicalDevice,
const VkPhysicalDeviceExternalBufferInfo* pExternalBufferInfo, const VkPhysicalDeviceExternalBufferInfo* pExternalBufferInfo,
VkExternalBufferProperties* pExternalBufferProperties); VkExternalBufferProperties* pExternalBufferProperties);
VKAPI_ATTR void VKAPI_CALL rpi_vkGetPhysicalDeviceExternalFenceProperties( VKAPI_ATTR void VKAPI_CALL RPIFUNC(vkGetPhysicalDeviceExternalFenceProperties)(
VkPhysicalDevice physicalDevice, VkPhysicalDevice physicalDevice,
const VkPhysicalDeviceExternalFenceInfo* pExternalFenceInfo, const VkPhysicalDeviceExternalFenceInfo* pExternalFenceInfo,
VkExternalFenceProperties* pExternalFenceProperties); VkExternalFenceProperties* pExternalFenceProperties);
VKAPI_ATTR void VKAPI_CALL rpi_vkGetPhysicalDeviceExternalSemaphoreProperties( VKAPI_ATTR void VKAPI_CALL RPIFUNC(vkGetPhysicalDeviceExternalSemaphoreProperties)(
VkPhysicalDevice physicalDevice, VkPhysicalDevice physicalDevice,
const VkPhysicalDeviceExternalSemaphoreInfo* pExternalSemaphoreInfo, const VkPhysicalDeviceExternalSemaphoreInfo* pExternalSemaphoreInfo,
VkExternalSemaphoreProperties* pExternalSemaphoreProperties); VkExternalSemaphoreProperties* pExternalSemaphoreProperties);
VKAPI_ATTR void VKAPI_CALL rpi_vkGetDescriptorSetLayoutSupport( VKAPI_ATTR void VKAPI_CALL RPIFUNC(vkGetDescriptorSetLayoutSupport)(
VkDevice device, VkDevice device,
const VkDescriptorSetLayoutCreateInfo* pCreateInfo, const VkDescriptorSetLayoutCreateInfo* pCreateInfo,
VkDescriptorSetLayoutSupport* pSupport); VkDescriptorSetLayoutSupport* pSupport);
VKAPI_ATTR void VKAPI_CALL rpi_vkDestroySurfaceKHR( VKAPI_ATTR void VKAPI_CALL RPIFUNC(vkDestroySurfaceKHR)(
VkInstance instance, VkInstance instance,
VkSurfaceKHR surface, VkSurfaceKHR surface,
const VkAllocationCallbacks* pAllocator); const VkAllocationCallbacks* pAllocator);
VKAPI_ATTR VkResult VKAPI_CALL rpi_vkCreateSwapchainKHR( VKAPI_ATTR VkResult VKAPI_CALL RPIFUNC(vkCreateSwapchainKHR)(
VkDevice device, VkDevice device,
const VkSwapchainCreateInfoKHR* pCreateInfo, const VkSwapchainCreateInfoKHR* pCreateInfo,
const VkAllocationCallbacks* pAllocator, const VkAllocationCallbacks* pAllocator,
VkSwapchainKHR* pSwapchain); VkSwapchainKHR* pSwapchain);
VKAPI_ATTR VkResult VKAPI_CALL rpi_vkGetPhysicalDeviceSurfaceSupportKHR( VKAPI_ATTR VkResult VKAPI_CALL RPIFUNC(vkGetPhysicalDeviceSurfaceSupportKHR)(
VkPhysicalDevice physicalDevice, VkPhysicalDevice physicalDevice,
uint32_t queueFamilyIndex, uint32_t queueFamilyIndex,
VkSurfaceKHR surface, VkSurfaceKHR surface,
VkBool32* pSupported); VkBool32* pSupported);
VKAPI_ATTR VkResult VKAPI_CALL rpi_vkGetPhysicalDeviceSurfaceCapabilitiesKHR( VKAPI_ATTR VkResult VKAPI_CALL RPIFUNC(vkGetPhysicalDeviceSurfaceCapabilitiesKHR)(
VkPhysicalDevice physicalDevice, VkPhysicalDevice physicalDevice,
VkSurfaceKHR surface, VkSurfaceKHR surface,
VkSurfaceCapabilitiesKHR* pSurfaceCapabilities); VkSurfaceCapabilitiesKHR* pSurfaceCapabilities);
VKAPI_ATTR VkResult VKAPI_CALL rpi_vkGetPhysicalDeviceSurfaceFormatsKHR( VKAPI_ATTR VkResult VKAPI_CALL RPIFUNC(vkGetPhysicalDeviceSurfaceFormatsKHR)(
VkPhysicalDevice physicalDevice, VkPhysicalDevice physicalDevice,
VkSurfaceKHR surface, VkSurfaceKHR surface,
uint32_t* pSurfaceFormatCount, uint32_t* pSurfaceFormatCount,
VkSurfaceFormatKHR* pSurfaceFormats); VkSurfaceFormatKHR* pSurfaceFormats);
VKAPI_ATTR VkResult VKAPI_CALL rpi_vkGetPhysicalDeviceSurfacePresentModesKHR( VKAPI_ATTR VkResult VKAPI_CALL RPIFUNC(vkGetPhysicalDeviceSurfacePresentModesKHR)(
VkPhysicalDevice physicalDevice, VkPhysicalDevice physicalDevice,
VkSurfaceKHR surface, VkSurfaceKHR surface,
uint32_t* pPresentModeCount, uint32_t* pPresentModeCount,
VkPresentModeKHR* pPresentModes); VkPresentModeKHR* pPresentModes);
VKAPI_ATTR VkResult VKAPI_CALL rpi_vkGetSwapchainImagesKHR( VKAPI_ATTR VkResult VKAPI_CALL RPIFUNC(vkGetSwapchainImagesKHR)(
VkDevice device, VkDevice device,
VkSwapchainKHR swapchain, VkSwapchainKHR swapchain,
uint32_t* pSwapchainImageCount, uint32_t* pSwapchainImageCount,
VkImage* pSwapchainImages); VkImage* pSwapchainImages);
VKAPI_ATTR VkResult VKAPI_CALL rpi_vkAcquireNextImageKHR( VKAPI_ATTR VkResult VKAPI_CALL RPIFUNC(vkAcquireNextImageKHR)(
VkDevice device, VkDevice device,
VkSwapchainKHR swapchain, VkSwapchainKHR swapchain,
uint64_t timeout, uint64_t timeout,
@ -997,65 +1005,65 @@ VKAPI_ATTR VkResult VKAPI_CALL rpi_vkAcquireNextImageKHR(
VkFence fence, VkFence fence,
uint32_t* pImageIndex); uint32_t* pImageIndex);
VKAPI_ATTR VkResult VKAPI_CALL rpi_vkQueuePresentKHR( VKAPI_ATTR VkResult VKAPI_CALL RPIFUNC(vkQueuePresentKHR)(
VkQueue queue, VkQueue queue,
const VkPresentInfoKHR* pPresentInfo); const VkPresentInfoKHR* pPresentInfo);
VKAPI_ATTR VkResult VKAPI_CALL rpi_vkEnumeratePhysicalDeviceQueueFamilyPerformanceQueryCountersKHR( VKAPI_ATTR VkResult VKAPI_CALL RPIFUNC(vkEnumeratePhysicalDeviceQueueFamilyPerformanceQueryCountersKHR)(
VkPhysicalDevice physicalDevice, VkPhysicalDevice physicalDevice,
uint32_t queueFamilyIndex, uint32_t queueFamilyIndex,
uint32_t* pCounterCount, uint32_t* pCounterCount,
VkPerformanceCounterKHR* pCounters, VkPerformanceCounterKHR* pCounters,
VkPerformanceCounterDescriptionKHR* pCounterDescriptions); VkPerformanceCounterDescriptionKHR* pCounterDescriptions);
VKAPI_ATTR void VKAPI_CALL rpi_vkGetPhysicalDeviceQueueFamilyPerformanceQueryPassesKHR( VKAPI_ATTR void VKAPI_CALL RPIFUNC(vkGetPhysicalDeviceQueueFamilyPerformanceQueryPassesKHR)(
VkPhysicalDevice physicalDevice, VkPhysicalDevice physicalDevice,
const VkQueryPoolPerformanceCreateInfoKHR* pPerformanceQueryCreateInfo, const VkQueryPoolPerformanceCreateInfoKHR* pPerformanceQueryCreateInfo,
uint32_t* pNumPasses); uint32_t* pNumPasses);
VKAPI_ATTR VkResult VKAPI_CALL rpi_vkAcquireProfilingLockKHR( VKAPI_ATTR VkResult VKAPI_CALL RPIFUNC(vkAcquireProfilingLockKHR)(
VkDevice device, VkDevice device,
const VkAcquireProfilingLockInfoKHR* pInfo); const VkAcquireProfilingLockInfoKHR* pInfo);
VKAPI_ATTR void VKAPI_CALL rpi_vkReleaseProfilingLockKHR( VKAPI_ATTR void VKAPI_CALL RPIFUNC(vkReleaseProfilingLockKHR)(
VkDevice device); VkDevice device);
VKAPI_ATTR VkResult VKAPI_CALL rpi_vkGetPhysicalDeviceDisplayPropertiesKHR( VKAPI_ATTR VkResult VKAPI_CALL RPIFUNC(vkGetPhysicalDeviceDisplayPropertiesKHR)(
VkPhysicalDevice physicalDevice, VkPhysicalDevice physicalDevice,
uint32_t* pPropertyCount, uint32_t* pPropertyCount,
VkDisplayPropertiesKHR* pProperties); VkDisplayPropertiesKHR* pProperties);
VKAPI_ATTR VkResult VKAPI_CALL rpi_vkGetDisplayModePropertiesKHR( VKAPI_ATTR VkResult VKAPI_CALL RPIFUNC(vkGetDisplayModePropertiesKHR)(
VkPhysicalDevice physicalDevice, VkPhysicalDevice physicalDevice,
VkDisplayKHR display, VkDisplayKHR display,
uint32_t* pPropertyCount, uint32_t* pPropertyCount,
VkDisplayModePropertiesKHR* pProperties); VkDisplayModePropertiesKHR* pProperties);
VKAPI_ATTR VkResult VKAPI_CALL rpi_vkCreateDisplayModeKHR( VKAPI_ATTR VkResult VKAPI_CALL RPIFUNC(vkCreateDisplayModeKHR)(
VkPhysicalDevice physicalDevice, VkPhysicalDevice physicalDevice,
VkDisplayKHR display, VkDisplayKHR display,
const VkDisplayModeCreateInfoKHR* pCreateInfo, const VkDisplayModeCreateInfoKHR* pCreateInfo,
const VkAllocationCallbacks* pAllocator, const VkAllocationCallbacks* pAllocator,
VkDisplayModeKHR* pMode); VkDisplayModeKHR* pMode);
VKAPI_ATTR VkResult VKAPI_CALL rpi_vkCreateDisplayPlaneSurfaceKHR( VKAPI_ATTR VkResult VKAPI_CALL RPIFUNC(vkCreateDisplayPlaneSurfaceKHR)(
VkInstance instance, VkInstance instance,
const VkDisplaySurfaceCreateInfoKHR* pCreateInfo, const VkDisplaySurfaceCreateInfoKHR* pCreateInfo,
const VkAllocationCallbacks* pAllocator, const VkAllocationCallbacks* pAllocator,
VkSurfaceKHR* pSurface); VkSurfaceKHR* pSurface);
VKAPI_ATTR void VKAPI_CALL rpi_vkDestroySwapchainKHR( VKAPI_ATTR void VKAPI_CALL RPIFUNC(vkDestroySwapchainKHR)(
VkDevice device, VkDevice device,
VkSwapchainKHR swapchain, VkSwapchainKHR swapchain,
const VkAllocationCallbacks* pAllocator); const VkAllocationCallbacks* pAllocator);
VKAPI_ATTR VkResult VKAPI_CALL rpi_vkGetDisplayPlaneSupportedDisplaysKHR( VKAPI_ATTR VkResult VKAPI_CALL RPIFUNC(vkGetDisplayPlaneSupportedDisplaysKHR)(
VkPhysicalDevice physicalDevice, VkPhysicalDevice physicalDevice,
uint32_t planeIndex, uint32_t planeIndex,
uint32_t* pDisplayCount, uint32_t* pDisplayCount,
VkDisplayKHR* pDisplays); VkDisplayKHR* pDisplays);
VKAPI_ATTR VkResult VKAPI_CALL rpi_vkGetPhysicalDeviceDisplayPlanePropertiesKHR( VKAPI_ATTR VkResult VKAPI_CALL RPIFUNC(vkGetPhysicalDeviceDisplayPlanePropertiesKHR)(
VkPhysicalDevice physicalDevice, VkPhysicalDevice physicalDevice,
uint32_t* pPropertyCount, uint32_t* pPropertyCount,
VkDisplayPlanePropertiesKHR* pProperties); VkDisplayPlanePropertiesKHR* pProperties);

View File

@ -1,12 +1,14 @@
#include "common.h" #include "common.h"
VKAPI_ATTR VkResult VKAPI_CALL rpi_vkCreateDescriptorPool( #include "declarations.h"
VKAPI_ATTR VkResult VKAPI_CALL RPIFUNC(vkCreateDescriptorPool)(
VkDevice device, VkDevice device,
const VkDescriptorPoolCreateInfo* pCreateInfo, const VkDescriptorPoolCreateInfo* pCreateInfo,
const VkAllocationCallbacks* pAllocator, const VkAllocationCallbacks* pAllocator,
VkDescriptorPool* pDescriptorPool) VkDescriptorPool* pDescriptorPool)
{ {
PROFILESTART(rpi_vkCreateDescriptorPool); PROFILESTART(RPIFUNC(vkCreateDescriptorPool));
assert(device); assert(device);
assert(pCreateInfo); assert(pCreateInfo);
@ -15,7 +17,7 @@ VKAPI_ATTR VkResult VKAPI_CALL rpi_vkCreateDescriptorPool(
if(!dp) if(!dp)
{ {
PROFILEEND(rpi_vkCreateDescriptorPool); PROFILEEND(RPIFUNC(vkCreateDescriptorPool));
return VK_ERROR_OUT_OF_HOST_MEMORY; return VK_ERROR_OUT_OF_HOST_MEMORY;
} }
@ -51,7 +53,7 @@ VKAPI_ATTR VkResult VKAPI_CALL rpi_vkCreateDescriptorPool(
void* dsmem = ALLOCATE(sizeof(_descriptorSet)*pCreateInfo->maxSets, 1, VK_SYSTEM_ALLOCATION_SCOPE_OBJECT); void* dsmem = ALLOCATE(sizeof(_descriptorSet)*pCreateInfo->maxSets, 1, VK_SYSTEM_ALLOCATION_SCOPE_OBJECT);
if(!dsmem) if(!dsmem)
{ {
PROFILEEND(rpi_vkCreateDescriptorPool); PROFILEEND(RPIFUNC(vkCreateDescriptorPool));
return VK_ERROR_OUT_OF_HOST_MEMORY; return VK_ERROR_OUT_OF_HOST_MEMORY;
} }
@ -63,7 +65,7 @@ VKAPI_ATTR VkResult VKAPI_CALL rpi_vkCreateDescriptorPool(
void* memem = ALLOCATE(mapBufSize, 1, VK_SYSTEM_ALLOCATION_SCOPE_OBJECT); void* memem = ALLOCATE(mapBufSize, 1, VK_SYSTEM_ALLOCATION_SCOPE_OBJECT);
if(!memem) if(!memem)
{ {
PROFILEEND(rpi_vkCreateDescriptorPool); PROFILEEND(RPIFUNC(vkCreateDescriptorPool));
return VK_ERROR_OUT_OF_HOST_MEMORY; return VK_ERROR_OUT_OF_HOST_MEMORY;
} }
dp->mapElementCPA = createConsecutivePoolAllocator(memem, mapElemBlockSize, mapBufSize); dp->mapElementCPA = createConsecutivePoolAllocator(memem, mapElemBlockSize, mapBufSize);
@ -74,7 +76,7 @@ VKAPI_ATTR VkResult VKAPI_CALL rpi_vkCreateDescriptorPool(
void* mem = ALLOCATE(blockSize*imageDescriptorCount, 1, VK_SYSTEM_ALLOCATION_SCOPE_OBJECT); void* mem = ALLOCATE(blockSize*imageDescriptorCount, 1, VK_SYSTEM_ALLOCATION_SCOPE_OBJECT);
if(!mem) if(!mem)
{ {
PROFILEEND(rpi_vkCreateDescriptorPool); PROFILEEND(RPIFUNC(vkCreateDescriptorPool));
return VK_ERROR_OUT_OF_HOST_MEMORY; return VK_ERROR_OUT_OF_HOST_MEMORY;
} }
dp->imageDescriptorCPA = createConsecutivePoolAllocator(mem, blockSize, blockSize * imageDescriptorCount); dp->imageDescriptorCPA = createConsecutivePoolAllocator(mem, blockSize, blockSize * imageDescriptorCount);
@ -86,7 +88,7 @@ VKAPI_ATTR VkResult VKAPI_CALL rpi_vkCreateDescriptorPool(
void* mem = ALLOCATE(blockSize*bufferDescriptorCount, 1, VK_SYSTEM_ALLOCATION_SCOPE_OBJECT); void* mem = ALLOCATE(blockSize*bufferDescriptorCount, 1, VK_SYSTEM_ALLOCATION_SCOPE_OBJECT);
if(!mem) if(!mem)
{ {
PROFILEEND(rpi_vkCreateDescriptorPool); PROFILEEND(RPIFUNC(vkCreateDescriptorPool));
return VK_ERROR_OUT_OF_HOST_MEMORY; return VK_ERROR_OUT_OF_HOST_MEMORY;
} }
dp->bufferDescriptorCPA = createConsecutivePoolAllocator(mem, blockSize, blockSize * bufferDescriptorCount); dp->bufferDescriptorCPA = createConsecutivePoolAllocator(mem, blockSize, blockSize * bufferDescriptorCount);
@ -98,7 +100,7 @@ VKAPI_ATTR VkResult VKAPI_CALL rpi_vkCreateDescriptorPool(
void* mem = ALLOCATE(blockSize*texelBufferDescriptorCount, 1, VK_SYSTEM_ALLOCATION_SCOPE_OBJECT); void* mem = ALLOCATE(blockSize*texelBufferDescriptorCount, 1, VK_SYSTEM_ALLOCATION_SCOPE_OBJECT);
if(!mem) if(!mem)
{ {
PROFILEEND(rpi_vkCreateDescriptorPool); PROFILEEND(RPIFUNC(vkCreateDescriptorPool));
return VK_ERROR_OUT_OF_HOST_MEMORY; return VK_ERROR_OUT_OF_HOST_MEMORY;
} }
dp->texelBufferDescriptorCPA = createConsecutivePoolAllocator(mem, blockSize, blockSize * texelBufferDescriptorCount); dp->texelBufferDescriptorCPA = createConsecutivePoolAllocator(mem, blockSize, blockSize * texelBufferDescriptorCount);
@ -106,16 +108,16 @@ VKAPI_ATTR VkResult VKAPI_CALL rpi_vkCreateDescriptorPool(
*pDescriptorPool = dp; *pDescriptorPool = dp;
PROFILEEND(rpi_vkCreateDescriptorPool); PROFILEEND(RPIFUNC(vkCreateDescriptorPool));
return VK_SUCCESS; return VK_SUCCESS;
} }
VKAPI_ATTR VkResult VKAPI_CALL rpi_vkAllocateDescriptorSets( VKAPI_ATTR VkResult VKAPI_CALL RPIFUNC(vkAllocateDescriptorSets)(
VkDevice device, VkDevice device,
const VkDescriptorSetAllocateInfo* pAllocateInfo, const VkDescriptorSetAllocateInfo* pAllocateInfo,
VkDescriptorSet* pDescriptorSets) VkDescriptorSet* pDescriptorSets)
{ {
PROFILESTART(rpi_vkAllocateDescriptorSets); PROFILESTART(RPIFUNC(vkAllocateDescriptorSets));
assert(device); assert(device);
@ -221,17 +223,17 @@ VKAPI_ATTR VkResult VKAPI_CALL rpi_vkAllocateDescriptorSets(
} }
} }
PROFILEEND(rpi_vkAllocateDescriptorSets); PROFILEEND(RPIFUNC(vkAllocateDescriptorSets));
return VK_SUCCESS; return VK_SUCCESS;
} }
VKAPI_ATTR VkResult VKAPI_CALL rpi_vkCreateDescriptorSetLayout( VKAPI_ATTR VkResult VKAPI_CALL RPIFUNC(vkCreateDescriptorSetLayout)(
VkDevice device, VkDevice device,
const VkDescriptorSetLayoutCreateInfo* pCreateInfo, const VkDescriptorSetLayoutCreateInfo* pCreateInfo,
const VkAllocationCallbacks* pAllocator, const VkAllocationCallbacks* pAllocator,
VkDescriptorSetLayout* pSetLayout) VkDescriptorSetLayout* pSetLayout)
{ {
PROFILESTART(rpi_vkCreateDescriptorSetLayout); PROFILESTART(RPIFUNC(vkCreateDescriptorSetLayout));
assert(device); assert(device);
assert(pCreateInfo); assert(pCreateInfo);
@ -242,7 +244,7 @@ VKAPI_ATTR VkResult VKAPI_CALL rpi_vkCreateDescriptorSetLayout(
if(!dsl) if(!dsl)
{ {
PROFILEEND(rpi_vkCreateDescriptorSetLayout); PROFILEEND(RPIFUNC(vkCreateDescriptorSetLayout));
return VK_ERROR_OUT_OF_HOST_MEMORY; return VK_ERROR_OUT_OF_HOST_MEMORY;
} }
@ -250,7 +252,7 @@ VKAPI_ATTR VkResult VKAPI_CALL rpi_vkCreateDescriptorSetLayout(
if(!dsl->bindings) if(!dsl->bindings)
{ {
PROFILEEND(rpi_vkCreateDescriptorSetLayout); PROFILEEND(RPIFUNC(vkCreateDescriptorSetLayout));
return VK_ERROR_OUT_OF_HOST_MEMORY; return VK_ERROR_OUT_OF_HOST_MEMORY;
} }
@ -261,18 +263,18 @@ VKAPI_ATTR VkResult VKAPI_CALL rpi_vkCreateDescriptorSetLayout(
*pSetLayout = dsl; *pSetLayout = dsl;
PROFILEEND(rpi_vkCreateDescriptorSetLayout); PROFILEEND(RPIFUNC(vkCreateDescriptorSetLayout));
return VK_SUCCESS; return VK_SUCCESS;
} }
VKAPI_ATTR void VKAPI_CALL rpi_vkUpdateDescriptorSets( VKAPI_ATTR void VKAPI_CALL RPIFUNC(vkUpdateDescriptorSets)(
VkDevice device, VkDevice device,
uint32_t descriptorWriteCount, uint32_t descriptorWriteCount,
const VkWriteDescriptorSet* pDescriptorWrites, const VkWriteDescriptorSet* pDescriptorWrites,
uint32_t descriptorCopyCount, uint32_t descriptorCopyCount,
const VkCopyDescriptorSet* pDescriptorCopies) const VkCopyDescriptorSet* pDescriptorCopies)
{ {
PROFILESTART(rpi_vkUpdateDescriptorSets); PROFILESTART(RPIFUNC(vkUpdateDescriptorSets));
assert(device); assert(device);
@ -360,26 +362,26 @@ VKAPI_ATTR void VKAPI_CALL rpi_vkUpdateDescriptorSets(
} }
} }
PROFILEEND(rpi_vkUpdateDescriptorSets); PROFILEEND(RPIFUNC(vkUpdateDescriptorSets));
} }
VKAPI_ATTR VkResult VKAPI_CALL rpi_vkResetDescriptorPool( VKAPI_ATTR VkResult VKAPI_CALL RPIFUNC(vkResetDescriptorPool)(
VkDevice device, VkDevice device,
VkDescriptorPool descriptorPool, VkDescriptorPool descriptorPool,
VkDescriptorPoolResetFlags flags) VkDescriptorPoolResetFlags flags)
{ {
PROFILESTART(rpi_vkResetDescriptorPool); PROFILESTART(RPIFUNC(vkResetDescriptorPool));
//TODO //TODO
PROFILEEND(rpi_vkResetDescriptorPool); PROFILEEND(RPIFUNC(vkResetDescriptorPool));
return VK_SUCCESS; return VK_SUCCESS;
} }
VKAPI_ATTR void VKAPI_CALL rpi_vkDestroyDescriptorPool( VKAPI_ATTR void VKAPI_CALL RPIFUNC(vkDestroyDescriptorPool)(
VkDevice device, VkDevice device,
VkDescriptorPool descriptorPool, VkDescriptorPool descriptorPool,
const VkAllocationCallbacks* pAllocator) const VkAllocationCallbacks* pAllocator)
{ {
PROFILESTART(rpi_vkDestroyDescriptorPool); PROFILESTART(RPIFUNC(vkDestroyDescriptorPool));
assert(device); assert(device);
assert(descriptorPool); assert(descriptorPool);
@ -394,10 +396,10 @@ VKAPI_ATTR void VKAPI_CALL rpi_vkDestroyDescriptorPool(
FREE(dp); FREE(dp);
PROFILEEND(rpi_vkDestroyDescriptorPool); PROFILEEND(RPIFUNC(vkDestroyDescriptorPool));
} }
VKAPI_ATTR void VKAPI_CALL rpi_vkCmdBindDescriptorSets( VKAPI_ATTR void VKAPI_CALL RPIFUNC(vkCmdBindDescriptorSets)(
VkCommandBuffer commandBuffer, VkCommandBuffer commandBuffer,
VkPipelineBindPoint pipelineBindPoint, VkPipelineBindPoint pipelineBindPoint,
VkPipelineLayout layout, VkPipelineLayout layout,
@ -407,7 +409,7 @@ VKAPI_ATTR void VKAPI_CALL rpi_vkCmdBindDescriptorSets(
uint32_t dynamicOffsetCount, uint32_t dynamicOffsetCount,
const uint32_t* pDynamicOffsets) const uint32_t* pDynamicOffsets)
{ {
PROFILESTART(rpi_vkCmdBindDescriptorSets); PROFILESTART(RPIFUNC(vkCmdBindDescriptorSets));
//TODO dynamic offsets //TODO dynamic offsets
@ -429,15 +431,15 @@ VKAPI_ATTR void VKAPI_CALL rpi_vkCmdBindDescriptorSets(
cb->descriptorSetDirty = 1; cb->descriptorSetDirty = 1;
PROFILEEND(rpi_vkCmdBindDescriptorSets); PROFILEEND(RPIFUNC(vkCmdBindDescriptorSets));
} }
VKAPI_ATTR void VKAPI_CALL rpi_vkDestroyDescriptorSetLayout( VKAPI_ATTR void VKAPI_CALL RPIFUNC(vkDestroyDescriptorSetLayout)(
VkDevice device, VkDevice device,
VkDescriptorSetLayout descriptorSetLayout, VkDescriptorSetLayout descriptorSetLayout,
const VkAllocationCallbacks* pAllocator) const VkAllocationCallbacks* pAllocator)
{ {
PROFILESTART(rpi_vkDestroyDescriptorSetLayout); PROFILESTART(RPIFUNC(vkDestroyDescriptorSetLayout));
assert(device); assert(device);
assert(descriptorSetLayout); assert(descriptorSetLayout);
@ -448,16 +450,16 @@ VKAPI_ATTR void VKAPI_CALL rpi_vkDestroyDescriptorSetLayout(
FREE(dsl); FREE(dsl);
PROFILEEND(rpi_vkDestroyDescriptorSetLayout); PROFILEEND(RPIFUNC(vkDestroyDescriptorSetLayout));
} }
VKAPI_ATTR VkResult VKAPI_CALL rpi_vkFreeDescriptorSets( VKAPI_ATTR VkResult VKAPI_CALL RPIFUNC(vkFreeDescriptorSets)(
VkDevice device, VkDevice device,
VkDescriptorPool descriptorPool, VkDescriptorPool descriptorPool,
uint32_t descriptorSetCount, uint32_t descriptorSetCount,
const VkDescriptorSet* pDescriptorSets) const VkDescriptorSet* pDescriptorSets)
{ {
PROFILESTART(rpi_vkFreeDescriptorSets); PROFILESTART(RPIFUNC(vkFreeDescriptorSets));
assert(device); assert(device);
assert(descriptorPool); assert(descriptorPool);
@ -490,49 +492,49 @@ VKAPI_ATTR VkResult VKAPI_CALL rpi_vkFreeDescriptorSets(
poolFree(&dp->descriptorSetPA, ds); poolFree(&dp->descriptorSetPA, ds);
} }
PROFILEEND(rpi_vkFreeDescriptorSets); PROFILEEND(RPIFUNC(vkFreeDescriptorSets));
return VK_SUCCESS; return VK_SUCCESS;
} }
VKAPI_ATTR VkResult VKAPI_CALL rpi_vkCreateDescriptorUpdateTemplate( VKAPI_ATTR VkResult VKAPI_CALL RPIFUNC(vkCreateDescriptorUpdateTemplate)(
VkDevice device, VkDevice device,
const VkDescriptorUpdateTemplateCreateInfo* pCreateInfo, const VkDescriptorUpdateTemplateCreateInfo* pCreateInfo,
const VkAllocationCallbacks* pAllocator, const VkAllocationCallbacks* pAllocator,
VkDescriptorUpdateTemplate* pDescriptorUpdateTemplate) VkDescriptorUpdateTemplate* pDescriptorUpdateTemplate)
{ {
PROFILESTART(rpi_vkCreateDescriptorUpdateTemplate); PROFILESTART(RPIFUNC(vkCreateDescriptorUpdateTemplate));
//TODO //TODO
PROFILEEND(rpi_vkCreateDescriptorUpdateTemplate); PROFILEEND(RPIFUNC(vkCreateDescriptorUpdateTemplate));
} }
VKAPI_ATTR void VKAPI_CALL rpi_vkDestroyDescriptorUpdateTemplate( VKAPI_ATTR void VKAPI_CALL RPIFUNC(vkDestroyDescriptorUpdateTemplate)(
VkDevice device, VkDevice device,
VkDescriptorUpdateTemplate descriptorUpdateTemplate, VkDescriptorUpdateTemplate descriptorUpdateTemplate,
const VkAllocationCallbacks* pAllocator) const VkAllocationCallbacks* pAllocator)
{ {
PROFILESTART(rpi_vkDestroyDescriptorUpdateTemplate); PROFILESTART(RPIFUNC(vkDestroyDescriptorUpdateTemplate));
//TODO //TODO
PROFILEEND(rpi_vkDestroyDescriptorUpdateTemplate); PROFILEEND(RPIFUNC(vkDestroyDescriptorUpdateTemplate));
} }
VKAPI_ATTR void VKAPI_CALL rpi_vkUpdateDescriptorSetWithTemplate( VKAPI_ATTR void VKAPI_CALL RPIFUNC(vkUpdateDescriptorSetWithTemplate)(
VkDevice device, VkDevice device,
VkDescriptorSet descriptorSet, VkDescriptorSet descriptorSet,
VkDescriptorUpdateTemplate descriptorUpdateTemplate, VkDescriptorUpdateTemplate descriptorUpdateTemplate,
const void* pData) const void* pData)
{ {
PROFILESTART(rpi_vkUpdateDescriptorSetWithTemplate); PROFILESTART(RPIFUNC(vkUpdateDescriptorSetWithTemplate));
//TODO //TODO
PROFILEEND(rpi_vkUpdateDescriptorSetWithTemplate); PROFILEEND(RPIFUNC(vkUpdateDescriptorSetWithTemplate));
} }
VKAPI_ATTR void VKAPI_CALL rpi_vkGetDescriptorSetLayoutSupport( VKAPI_ATTR void VKAPI_CALL RPIFUNC(vkGetDescriptorSetLayoutSupport)(
VkDevice device, VkDevice device,
const VkDescriptorSetLayoutCreateInfo* pCreateInfo, const VkDescriptorSetLayoutCreateInfo* pCreateInfo,
VkDescriptorSetLayoutSupport* pSupport) VkDescriptorSetLayoutSupport* pSupport)
{ {
PROFILESTART(rpi_vkGetDescriptorSetLayoutSupport); PROFILESTART(RPIFUNC(vkGetDescriptorSetLayoutSupport));
//TODO //TODO
PROFILEEND(rpi_vkGetDescriptorSetLayoutSupport); PROFILEEND(RPIFUNC(vkGetDescriptorSetLayoutSupport));
} }

View File

@ -10,12 +10,12 @@
* If pPhysicalDeviceCount is smaller than the number of physical devices available, VK_INCOMPLETE will be returned instead of VK_SUCCESS, to indicate that not all the * If pPhysicalDeviceCount is smaller than the number of physical devices available, VK_INCOMPLETE will be returned instead of VK_SUCCESS, to indicate that not all the
* available physical devices were returned. * available physical devices were returned.
*/ */
VKAPI_ATTR VkResult VKAPI_CALL rpi_vkEnumeratePhysicalDevices( VKAPI_ATTR VkResult VKAPI_CALL RPIFUNC(vkEnumeratePhysicalDevices)(
VkInstance instance, VkInstance instance,
uint32_t* pPhysicalDeviceCount, uint32_t* pPhysicalDeviceCount,
VkPhysicalDevice* pPhysicalDevices) VkPhysicalDevice* pPhysicalDevices)
{ {
PROFILESTART(rpi_vkEnumeratePhysicalDevices); PROFILESTART(RPIFUNC(vkEnumeratePhysicalDevices));
assert(instance); assert(instance);
@ -26,7 +26,7 @@ VKAPI_ATTR VkResult VKAPI_CALL rpi_vkEnumeratePhysicalDevices(
if(!pPhysicalDevices) if(!pPhysicalDevices)
{ {
*pPhysicalDeviceCount = numGPUs; *pPhysicalDeviceCount = numGPUs;
PROFILEEND(rpi_vkEnumeratePhysicalDevices); PROFILEEND(RPIFUNC(vkEnumeratePhysicalDevices));
return VK_SUCCESS; return VK_SUCCESS;
} }
@ -42,12 +42,12 @@ VKAPI_ATTR VkResult VKAPI_CALL rpi_vkEnumeratePhysicalDevices(
if(arraySize < numGPUs) if(arraySize < numGPUs)
{ {
PROFILEEND(rpi_vkEnumeratePhysicalDevices); PROFILEEND(RPIFUNC(vkEnumeratePhysicalDevices));
return VK_INCOMPLETE; return VK_INCOMPLETE;
} }
else else
{ {
PROFILEEND(rpi_vkEnumeratePhysicalDevices); PROFILEEND(RPIFUNC(vkEnumeratePhysicalDevices));
return VK_SUCCESS; return VK_SUCCESS;
} }
} }
@ -55,11 +55,11 @@ VKAPI_ATTR VkResult VKAPI_CALL rpi_vkEnumeratePhysicalDevices(
/* /*
* https://www.khronos.org/registry/vulkan/specs/1.1-extensions/html/vkspec.html#vkGetPhysicalDeviceProperties * https://www.khronos.org/registry/vulkan/specs/1.1-extensions/html/vkspec.html#vkGetPhysicalDeviceProperties
*/ */
VKAPI_ATTR void VKAPI_CALL rpi_vkGetPhysicalDeviceProperties( VKAPI_ATTR void VKAPI_CALL RPIFUNC(vkGetPhysicalDeviceProperties)(
VkPhysicalDevice physicalDevice, VkPhysicalDevice physicalDevice,
VkPhysicalDeviceProperties* pProperties) VkPhysicalDeviceProperties* pProperties)
{ {
PROFILESTART(rpi_vkGetPhysicalDeviceProperties); PROFILESTART(RPIFUNC(vkGetPhysicalDeviceProperties));
assert(physicalDevice); assert(physicalDevice);
assert(pProperties); assert(pProperties);
@ -82,36 +82,36 @@ VKAPI_ATTR void VKAPI_CALL rpi_vkGetPhysicalDeviceProperties(
pProperties->limits = _limits; pProperties->limits = _limits;
pProperties->sparseProperties = sparseProps; pProperties->sparseProperties = sparseProps;
PROFILEEND(rpi_vkGetPhysicalDeviceProperties); PROFILEEND(RPIFUNC(vkGetPhysicalDeviceProperties));
} }
/* /*
* https://www.khronos.org/registry/vulkan/specs/1.1-extensions/html/vkspec.html#vkGetPhysicalDeviceFeatures * https://www.khronos.org/registry/vulkan/specs/1.1-extensions/html/vkspec.html#vkGetPhysicalDeviceFeatures
*/ */
VKAPI_ATTR void VKAPI_CALL rpi_vkGetPhysicalDeviceFeatures( VKAPI_ATTR void VKAPI_CALL RPIFUNC(vkGetPhysicalDeviceFeatures)(
VkPhysicalDevice physicalDevice, VkPhysicalDevice physicalDevice,
VkPhysicalDeviceFeatures* pFeatures) VkPhysicalDeviceFeatures* pFeatures)
{ {
PROFILESTART(rpi_vkGetPhysicalDeviceFeatures); PROFILESTART(RPIFUNC(vkGetPhysicalDeviceFeatures));
assert(physicalDevice); assert(physicalDevice);
assert(pFeatures); assert(pFeatures);
*pFeatures = _features; *pFeatures = _features;
PROFILEEND(rpi_vkGetPhysicalDeviceFeatures); PROFILEEND(RPIFUNC(vkGetPhysicalDeviceFeatures));
} }
/* /*
* https://www.khronos.org/registry/vulkan/specs/1.1-extensions/html/vkspec.html#vkEnumerateDeviceExtensionProperties * https://www.khronos.org/registry/vulkan/specs/1.1-extensions/html/vkspec.html#vkEnumerateDeviceExtensionProperties
*/ */
VKAPI_ATTR VkResult VKAPI_CALL rpi_vkEnumerateDeviceExtensionProperties( VKAPI_ATTR VkResult VKAPI_CALL RPIFUNC(vkEnumerateDeviceExtensionProperties)(
VkPhysicalDevice physicalDevice, VkPhysicalDevice physicalDevice,
const char* pLayerName, const char* pLayerName,
uint32_t* pPropertyCount, uint32_t* pPropertyCount,
VkExtensionProperties* pProperties) VkExtensionProperties* pProperties)
{ {
PROFILESTART(rpi_vkEnumerateDeviceExtensionProperties); PROFILESTART(RPIFUNC(vkEnumerateDeviceExtensionProperties));
assert(physicalDevice); assert(physicalDevice);
assert(pPropertyCount); assert(pPropertyCount);
@ -119,7 +119,7 @@ VKAPI_ATTR VkResult VKAPI_CALL rpi_vkEnumerateDeviceExtensionProperties(
if(!pProperties) if(!pProperties)
{ {
*pPropertyCount = numDeviceExtensions; *pPropertyCount = numDeviceExtensions;
PROFILEEND(rpi_vkEnumerateDeviceExtensionProperties); PROFILEEND(RPIFUNC(vkEnumerateDeviceExtensionProperties));
return VK_SUCCESS; return VK_SUCCESS;
} }
@ -135,11 +135,11 @@ VKAPI_ATTR VkResult VKAPI_CALL rpi_vkEnumerateDeviceExtensionProperties(
if(arraySize < numDeviceExtensions) if(arraySize < numDeviceExtensions)
{ {
PROFILEEND(rpi_vkEnumerateDeviceExtensionProperties); PROFILEEND(RPIFUNC(vkEnumerateDeviceExtensionProperties));
return VK_INCOMPLETE; return VK_INCOMPLETE;
} }
PROFILEEND(rpi_vkEnumerateDeviceExtensionProperties); PROFILEEND(RPIFUNC(vkEnumerateDeviceExtensionProperties));
return VK_SUCCESS; return VK_SUCCESS;
} }
@ -150,12 +150,12 @@ VKAPI_ATTR VkResult VKAPI_CALL rpi_vkEnumerateDeviceExtensionProperties(
* and on return the variable is overwritten with the number of structures actually written to pQueueFamilyProperties. If pQueueFamilyPropertyCount * and on return the variable is overwritten with the number of structures actually written to pQueueFamilyProperties. If pQueueFamilyPropertyCount
* is less than the number of queue families available, at most pQueueFamilyPropertyCount structures will be written. * is less than the number of queue families available, at most pQueueFamilyPropertyCount structures will be written.
*/ */
VKAPI_ATTR void VKAPI_CALL rpi_vkGetPhysicalDeviceQueueFamilyProperties( VKAPI_ATTR void VKAPI_CALL RPIFUNC(vkGetPhysicalDeviceQueueFamilyProperties)(
VkPhysicalDevice physicalDevice, VkPhysicalDevice physicalDevice,
uint32_t* pQueueFamilyPropertyCount, uint32_t* pQueueFamilyPropertyCount,
VkQueueFamilyProperties* pQueueFamilyProperties) VkQueueFamilyProperties* pQueueFamilyProperties)
{ {
PROFILESTART(rpi_vkGetPhysicalDeviceQueueFamilyProperties); PROFILESTART(RPIFUNC(vkGetPhysicalDeviceQueueFamilyProperties));
assert(physicalDevice); assert(physicalDevice);
assert(pQueueFamilyPropertyCount); assert(pQueueFamilyPropertyCount);
@ -163,7 +163,7 @@ VKAPI_ATTR void VKAPI_CALL rpi_vkGetPhysicalDeviceQueueFamilyProperties(
if(!pQueueFamilyProperties) if(!pQueueFamilyProperties)
{ {
*pQueueFamilyPropertyCount = 1; *pQueueFamilyPropertyCount = 1;
PROFILEEND(rpi_vkGetPhysicalDeviceQueueFamilyProperties); PROFILEEND(RPIFUNC(vkGetPhysicalDeviceQueueFamilyProperties));
return; return;
} }
@ -177,17 +177,17 @@ VKAPI_ATTR void VKAPI_CALL rpi_vkGetPhysicalDeviceQueueFamilyProperties(
*pQueueFamilyPropertyCount = elementsWritten; *pQueueFamilyPropertyCount = elementsWritten;
PROFILEEND(rpi_vkGetPhysicalDeviceQueueFamilyProperties); PROFILEEND(RPIFUNC(vkGetPhysicalDeviceQueueFamilyProperties));
} }
VKAPI_ATTR VkResult VKAPI_CALL rpi_vkEnumeratePhysicalDeviceQueueFamilyPerformanceQueryCountersKHR( VKAPI_ATTR VkResult VKAPI_CALL RPIFUNC(vkEnumeratePhysicalDeviceQueueFamilyPerformanceQueryCountersKHR)(
VkPhysicalDevice physicalDevice, VkPhysicalDevice physicalDevice,
uint32_t queueFamilyIndex, uint32_t queueFamilyIndex,
uint32_t* pCounterCount, uint32_t* pCounterCount,
VkPerformanceCounterKHR* pCounters, VkPerformanceCounterKHR* pCounters,
VkPerformanceCounterDescriptionKHR* pCounterDescriptions) VkPerformanceCounterDescriptionKHR* pCounterDescriptions)
{ {
PROFILESTART(rpi_vkEnumeratePhysicalDeviceQueueFamilyPerformanceQueryCountersKHR); PROFILESTART(RPIFUNC(vkEnumeratePhysicalDeviceQueueFamilyPerformanceQueryCountersKHR));
assert(physicalDevice); assert(physicalDevice);
assert(pCounterCount); assert(pCounterCount);
@ -195,7 +195,7 @@ VKAPI_ATTR VkResult VKAPI_CALL rpi_vkEnumeratePhysicalDeviceQueueFamilyPerforman
if(!pCounters && !pCounterDescriptions) if(!pCounters && !pCounterDescriptions)
{ {
*pCounterCount = numPerformanceCounterTypes; *pCounterCount = numPerformanceCounterTypes;
PROFILEEND(rpi_vkEnumeratePhysicalDeviceQueueFamilyPerformanceQueryCountersKHR); PROFILEEND(RPIFUNC(vkEnumeratePhysicalDeviceQueueFamilyPerformanceQueryCountersKHR));
return VK_SUCCESS; return VK_SUCCESS;
} }
@ -212,20 +212,20 @@ VKAPI_ATTR VkResult VKAPI_CALL rpi_vkEnumeratePhysicalDeviceQueueFamilyPerforman
if(arraySize < numPerformanceCounterTypes) if(arraySize < numPerformanceCounterTypes)
{ {
PROFILEEND(rpi_vkEnumeratePhysicalDeviceQueueFamilyPerformanceQueryCountersKHR); PROFILEEND(RPIFUNC(vkEnumeratePhysicalDeviceQueueFamilyPerformanceQueryCountersKHR));
return VK_INCOMPLETE; return VK_INCOMPLETE;
} }
PROFILEEND(rpi_vkEnumeratePhysicalDeviceQueueFamilyPerformanceQueryCountersKHR); PROFILEEND(RPIFUNC(vkEnumeratePhysicalDeviceQueueFamilyPerformanceQueryCountersKHR));
return VK_SUCCESS; return VK_SUCCESS;
} }
VKAPI_ATTR void VKAPI_CALL rpi_vkGetPhysicalDeviceQueueFamilyPerformanceQueryPassesKHR( VKAPI_ATTR void VKAPI_CALL RPIFUNC(vkGetPhysicalDeviceQueueFamilyPerformanceQueryPassesKHR)(
VkPhysicalDevice physicalDevice, VkPhysicalDevice physicalDevice,
const VkQueryPoolPerformanceCreateInfoKHR* pPerformanceQueryCreateInfo, const VkQueryPoolPerformanceCreateInfoKHR* pPerformanceQueryCreateInfo,
uint32_t* pNumPasses) uint32_t* pNumPasses)
{ {
PROFILESTART(rpi_vkGetPhysicalDeviceQueueFamilyPerformanceQueryPassesKHR); PROFILESTART(RPIFUNC(vkGetPhysicalDeviceQueueFamilyPerformanceQueryPassesKHR));
assert(physicalDevice); assert(physicalDevice);
assert(pPerformanceQueryCreateInfo); assert(pPerformanceQueryCreateInfo);
@ -233,7 +233,7 @@ VKAPI_ATTR void VKAPI_CALL rpi_vkGetPhysicalDeviceQueueFamilyPerformanceQueryPas
*pNumPasses = pPerformanceQueryCreateInfo->counterIndexCount / DRM_VC4_MAX_PERF_COUNTERS + 1; *pNumPasses = pPerformanceQueryCreateInfo->counterIndexCount / DRM_VC4_MAX_PERF_COUNTERS + 1;
PROFILEEND(rpi_vkGetPhysicalDeviceQueueFamilyPerformanceQueryPassesKHR); PROFILEEND(RPIFUNC(vkGetPhysicalDeviceQueueFamilyPerformanceQueryPassesKHR));
} }
/* /*
@ -247,13 +247,13 @@ VKAPI_ATTR void VKAPI_CALL rpi_vkGetPhysicalDeviceQueueFamilyPerformanceQueryPas
* time for the creation to succeed. Multiple logical devices can be created from the same physical device. Logical device creation may * time for the creation to succeed. Multiple logical devices can be created from the same physical device. Logical device creation may
* fail due to lack of device-specific resources (in addition to the other errors). If that occurs, vkCreateDevice will return VK_ERROR_TOO_MANY_OBJECTS. * fail due to lack of device-specific resources (in addition to the other errors). If that occurs, vkCreateDevice will return VK_ERROR_TOO_MANY_OBJECTS.
*/ */
VKAPI_ATTR VkResult VKAPI_CALL rpi_vkCreateDevice( VKAPI_ATTR VkResult VKAPI_CALL RPIFUNC(vkCreateDevice)(
VkPhysicalDevice physicalDevice, VkPhysicalDevice physicalDevice,
const VkDeviceCreateInfo* pCreateInfo, const VkDeviceCreateInfo* pCreateInfo,
const VkAllocationCallbacks* pAllocator, const VkAllocationCallbacks* pAllocator,
VkDevice* pDevice) VkDevice* pDevice)
{ {
PROFILESTART(rpi_vkCreateDevice); PROFILESTART(RPIFUNC(vkCreateDevice));
assert(physicalDevice); assert(physicalDevice);
assert(pDevice); assert(pDevice);
@ -265,7 +265,7 @@ VKAPI_ATTR VkResult VKAPI_CALL rpi_vkCreateDevice(
int findres = findDeviceExtension(pCreateInfo->ppEnabledExtensionNames[c]); int findres = findDeviceExtension(pCreateInfo->ppEnabledExtensionNames[c]);
if(findres == -1) if(findres == -1)
{ {
PROFILEEND(rpi_vkCreateDevice); PROFILEEND(RPIFUNC(vkCreateDevice));
return VK_ERROR_EXTENSION_NOT_PRESENT; return VK_ERROR_EXTENSION_NOT_PRESENT;
} }
} }
@ -280,7 +280,7 @@ VKAPI_ATTR VkResult VKAPI_CALL rpi_vkCreateDevice(
{ {
if(requestedFeatures[c] && !supportedFeatures[c]) if(requestedFeatures[c] && !supportedFeatures[c])
{ {
PROFILEEND(rpi_vkCreateDevice); PROFILEEND(RPIFUNC(vkCreateDevice));
return VK_ERROR_FEATURE_NOT_PRESENT; return VK_ERROR_FEATURE_NOT_PRESENT;
} }
} }
@ -289,7 +289,7 @@ VKAPI_ATTR VkResult VKAPI_CALL rpi_vkCreateDevice(
*pDevice = ALLOCATE(sizeof(_device), 1, VK_SYSTEM_ALLOCATION_SCOPE_DEVICE); *pDevice = ALLOCATE(sizeof(_device), 1, VK_SYSTEM_ALLOCATION_SCOPE_DEVICE);
if(!*pDevice) if(!*pDevice)
{ {
PROFILEEND(rpi_vkCreateDevice); PROFILEEND(RPIFUNC(vkCreateDevice));
return VK_ERROR_OUT_OF_HOST_MEMORY; return VK_ERROR_OUT_OF_HOST_MEMORY;
} }
@ -315,7 +315,7 @@ VKAPI_ATTR VkResult VKAPI_CALL rpi_vkCreateDevice(
{ {
if(requestedFeatures[c] && !supportedFeatures[c]) if(requestedFeatures[c] && !supportedFeatures[c])
{ {
PROFILEEND(rpi_vkCreateDevice); PROFILEEND(RPIFUNC(vkCreateDevice));
return VK_ERROR_FEATURE_NOT_PRESENT; return VK_ERROR_FEATURE_NOT_PRESENT;
} }
} }
@ -343,7 +343,7 @@ VKAPI_ATTR VkResult VKAPI_CALL rpi_vkCreateDevice(
if(!(*pDevice)->queues[pCreateInfo->pQueueCreateInfos[c].queueFamilyIndex]) if(!(*pDevice)->queues[pCreateInfo->pQueueCreateInfos[c].queueFamilyIndex])
{ {
PROFILEEND(rpi_vkCreateDevice); PROFILEEND(RPIFUNC(vkCreateDevice));
return VK_ERROR_OUT_OF_HOST_MEMORY; return VK_ERROR_OUT_OF_HOST_MEMORY;
} }
@ -361,7 +361,7 @@ VKAPI_ATTR VkResult VKAPI_CALL rpi_vkCreateDevice(
setupEmulationResources(*pDevice); setupEmulationResources(*pDevice);
setupClearEmulationResources(*pDevice); setupClearEmulationResources(*pDevice);
PROFILEEND(rpi_vkCreateDevice); PROFILEEND(RPIFUNC(vkCreateDevice));
return VK_SUCCESS; return VK_SUCCESS;
} }
@ -370,13 +370,13 @@ VKAPI_ATTR VkResult VKAPI_CALL rpi_vkCreateDevice(
* vkGetDeviceQueue must only be used to get queues that were created with the flags parameter of VkDeviceQueueCreateInfo set to zero. * vkGetDeviceQueue must only be used to get queues that were created with the flags parameter of VkDeviceQueueCreateInfo set to zero.
* To get queues that were created with a non-zero flags parameter use vkGetDeviceQueue2. * To get queues that were created with a non-zero flags parameter use vkGetDeviceQueue2.
*/ */
VKAPI_ATTR void VKAPI_CALL rpi_vkGetDeviceQueue( VKAPI_ATTR void VKAPI_CALL RPIFUNC(vkGetDeviceQueue)(
VkDevice device, VkDevice device,
uint32_t queueFamilyIndex, uint32_t queueFamilyIndex,
uint32_t queueIndex, uint32_t queueIndex,
VkQueue* pQueue) VkQueue* pQueue)
{ {
PROFILESTART(rpi_vkGetDeviceQueue); PROFILESTART(RPIFUNC(vkGetDeviceQueue));
assert(device); assert(device);
assert(pQueue); assert(pQueue);
@ -386,15 +386,15 @@ VKAPI_ATTR void VKAPI_CALL rpi_vkGetDeviceQueue(
*pQueue = &device->queues[queueFamilyIndex][queueIndex]; *pQueue = &device->queues[queueFamilyIndex][queueIndex];
PROFILEEND(rpi_vkGetDeviceQueue); PROFILEEND(RPIFUNC(vkGetDeviceQueue));
} }
VKAPI_ATTR void VKAPI_CALL rpi_vkGetDeviceQueue2( VKAPI_ATTR void VKAPI_CALL RPIFUNC(vkGetDeviceQueue2)(
VkDevice device, VkDevice device,
const VkDeviceQueueInfo2* pQueueInfo, const VkDeviceQueueInfo2* pQueueInfo,
VkQueue* pQueue) VkQueue* pQueue)
{ {
PROFILESTART(rpi_vkGetDeviceQueue2); PROFILESTART(RPIFUNC(vkGetDeviceQueue2));
assert(device); assert(device);
assert(pQueueInfo); assert(pQueueInfo);
@ -402,9 +402,9 @@ VKAPI_ATTR void VKAPI_CALL rpi_vkGetDeviceQueue2(
//TODO handle pNext //TODO handle pNext
rpi_vkGetDeviceQueue(device, pQueueInfo->queueFamilyIndex, pQueueInfo->queueIndex, pQueue); RPIFUNC(vkGetDeviceQueue)(device, pQueueInfo->queueFamilyIndex, pQueueInfo->queueIndex, pQueue);
PROFILEEND(rpi_vkGetDeviceQueue2); PROFILEEND(RPIFUNC(vkGetDeviceQueue2));
} }
/* /*
@ -413,11 +413,11 @@ VKAPI_ATTR void VKAPI_CALL rpi_vkGetDeviceQueue2(
* Prior to destroying a device, an application is responsible for destroying/freeing any Vulkan objects that were created using that device as the * Prior to destroying a device, an application is responsible for destroying/freeing any Vulkan objects that were created using that device as the
* first parameter of the corresponding vkCreate* or vkAllocate* command * first parameter of the corresponding vkCreate* or vkAllocate* command
*/ */
VKAPI_ATTR void VKAPI_CALL rpi_vkDestroyDevice( VKAPI_ATTR void VKAPI_CALL RPIFUNC(vkDestroyDevice)(
VkDevice device, VkDevice device,
const VkAllocationCallbacks* pAllocator) const VkAllocationCallbacks* pAllocator)
{ {
PROFILESTART(rpi_vkDestroyDevice); PROFILESTART(RPIFUNC(vkDestroyDevice));
_device* dev = device; _device* dev = device;
@ -433,18 +433,18 @@ VKAPI_ATTR void VKAPI_CALL rpi_vkDestroyDevice(
FREE(dev); FREE(dev);
} }
PROFILEEND(rpi_vkDestroyDevice); PROFILEEND(RPIFUNC(vkDestroyDevice));
} }
/* /*
* https://www.khronos.org/registry/vulkan/specs/1.1-extensions/html/vkspec.html#vkEnumeratePhysicalDeviceGroups * https://www.khronos.org/registry/vulkan/specs/1.1-extensions/html/vkspec.html#vkEnumeratePhysicalDeviceGroups
*/ */
VKAPI_ATTR VkResult VKAPI_CALL rpi_vkEnumeratePhysicalDeviceGroups( VKAPI_ATTR VkResult VKAPI_CALL RPIFUNC(vkEnumeratePhysicalDeviceGroups)(
VkInstance instance, VkInstance instance,
uint32_t* pPhysicalDeviceGroupCount, uint32_t* pPhysicalDeviceGroupCount,
VkPhysicalDeviceGroupProperties* pPhysicalDeviceGroupProperties) VkPhysicalDeviceGroupProperties* pPhysicalDeviceGroupProperties)
{ {
PROFILESTART(rpi_vkEnumeratePhysicalDeviceGroups); PROFILESTART(RPIFUNC(vkEnumeratePhysicalDeviceGroups));
assert(instance); assert(instance);
assert(pPhysicalDeviceGroupCount); assert(pPhysicalDeviceGroupCount);
@ -452,7 +452,7 @@ VKAPI_ATTR VkResult VKAPI_CALL rpi_vkEnumeratePhysicalDeviceGroups(
if(!pPhysicalDeviceGroupProperties) if(!pPhysicalDeviceGroupProperties)
{ {
*pPhysicalDeviceGroupCount = 1; *pPhysicalDeviceGroupCount = 1;
PROFILEEND(rpi_vkEnumeratePhysicalDeviceGroups); PROFILEEND(RPIFUNC(vkEnumeratePhysicalDeviceGroups));
return VK_SUCCESS; return VK_SUCCESS;
} }
@ -469,22 +469,22 @@ VKAPI_ATTR VkResult VKAPI_CALL rpi_vkEnumeratePhysicalDeviceGroups(
if(c < 1) if(c < 1)
{ {
PROFILEEND(rpi_vkEnumeratePhysicalDeviceGroups); PROFILEEND(RPIFUNC(vkEnumeratePhysicalDeviceGroups));
return VK_INCOMPLETE; return VK_INCOMPLETE;
} }
PROFILEEND(rpi_vkEnumeratePhysicalDeviceGroups); PROFILEEND(RPIFUNC(vkEnumeratePhysicalDeviceGroups));
return VK_SUCCESS; return VK_SUCCESS;
} }
extern VKAPI_ATTR PFN_vkVoidFunction VKAPI_CALL rpi_vkGetInstanceProcAddr(VkInstance instance, extern VKAPI_ATTR PFN_vkVoidFunction VKAPI_CALL RPIFUNC(vkGetInstanceProcAddr)(VkInstance instance,
const char* pName); const char* pName);
VKAPI_ATTR PFN_vkVoidFunction VKAPI_CALL rpi_vkGetDeviceProcAddr( VKAPI_ATTR PFN_vkVoidFunction VKAPI_CALL RPIFUNC(vkGetDeviceProcAddr)(
VkDevice device, VkDevice device,
const char* pName) const char* pName)
{ {
PROFILESTART(rpi_vkGetDeviceProcAddr); PROFILESTART(RPIFUNC(vkGetDeviceProcAddr));
if( if(
!strcmp("vkDestroyInstance", pName) || !strcmp("vkDestroyInstance", pName) ||
@ -512,27 +512,27 @@ VKAPI_ATTR PFN_vkVoidFunction VKAPI_CALL rpi_vkGetDeviceProcAddr(
!strcmp("vkGetPhysicalDeviceExternalSemaphoreProperties", pName) !strcmp("vkGetPhysicalDeviceExternalSemaphoreProperties", pName)
) )
{ {
PROFILEEND(rpi_vkGetDeviceProcAddr); PROFILEEND(RPIFUNC(vkGetDeviceProcAddr));
return 0; return 0;
} }
//there can't be any other device, so this will do fine... //there can't be any other device, so this will do fine...
_device* d = device; _device* d = device;
PFN_vkVoidFunction retval = rpi_vkGetInstanceProcAddr(d->dev->instance, pName); PFN_vkVoidFunction retval = RPIFUNC(vkGetInstanceProcAddr)(d->dev->instance, pName);
PROFILEEND(rpi_vkGetDeviceProcAddr); PROFILEEND(RPIFUNC(vkGetDeviceProcAddr));
return retval; return retval;
} }
VKAPI_ATTR void VKAPI_CALL rpi_vkGetPhysicalDeviceProperties2( VKAPI_ATTR void VKAPI_CALL RPIFUNC(vkGetPhysicalDeviceProperties2)(
VkPhysicalDevice physicalDevice, VkPhysicalDevice physicalDevice,
VkPhysicalDeviceProperties2* pProperties) VkPhysicalDeviceProperties2* pProperties)
{ {
PROFILESTART(rpi_vkGetPhysicalDeviceProperties2); PROFILESTART(RPIFUNC(vkGetPhysicalDeviceProperties2));
assert(physicalDevice); assert(physicalDevice);
assert(pProperties); assert(pProperties);
rpi_vkGetPhysicalDeviceProperties(physicalDevice, &pProperties->properties); RPIFUNC(vkGetPhysicalDeviceProperties)(physicalDevice, &pProperties->properties);
if(pProperties->pNext) if(pProperties->pNext)
{ {
@ -552,15 +552,15 @@ VKAPI_ATTR void VKAPI_CALL rpi_vkGetPhysicalDeviceProperties2(
} }
} }
PROFILEEND(rpi_vkGetPhysicalDeviceProperties2); PROFILEEND(RPIFUNC(vkGetPhysicalDeviceProperties2));
} }
VKAPI_ATTR void VKAPI_CALL rpi_vkGetPhysicalDeviceFormatProperties( VKAPI_ATTR void VKAPI_CALL RPIFUNC(vkGetPhysicalDeviceFormatProperties)(
VkPhysicalDevice physicalDevice, VkPhysicalDevice physicalDevice,
VkFormat format, VkFormat format,
VkFormatProperties* pFormatProperties) VkFormatProperties* pFormatProperties)
{ {
PROFILESTART(rpi_vkGetPhysicalDeviceFormatProperties); PROFILESTART(RPIFUNC(vkGetPhysicalDeviceFormatProperties));
assert(physicalDevice); assert(physicalDevice);
assert(pFormatProperties); assert(pFormatProperties);
@ -680,24 +680,24 @@ VKAPI_ATTR void VKAPI_CALL rpi_vkGetPhysicalDeviceFormatProperties(
break; break;
} }
PROFILEEND(rpi_vkGetPhysicalDeviceFormatProperties); PROFILEEND(RPIFUNC(vkGetPhysicalDeviceFormatProperties));
} }
VKAPI_ATTR void VKAPI_CALL rpi_vkGetPhysicalDeviceFormatProperties2( VKAPI_ATTR void VKAPI_CALL RPIFUNC(vkGetPhysicalDeviceFormatProperties2)(
VkPhysicalDevice physicalDevice, VkPhysicalDevice physicalDevice,
VkFormat format, VkFormat format,
VkFormatProperties2* pFormatProperties) VkFormatProperties2* pFormatProperties)
{ {
PROFILESTART(rpi_vkGetPhysicalDeviceFormatProperties2); PROFILESTART(RPIFUNC(vkGetPhysicalDeviceFormatProperties2));
assert(physicalDevice); assert(physicalDevice);
assert(pFormatProperties); assert(pFormatProperties);
rpi_vkGetPhysicalDeviceFormatProperties(physicalDevice, format, &pFormatProperties->formatProperties); RPIFUNC(vkGetPhysicalDeviceFormatProperties)(physicalDevice, format, &pFormatProperties->formatProperties);
PROFILEEND(rpi_vkGetPhysicalDeviceFormatProperties2); PROFILEEND(RPIFUNC(vkGetPhysicalDeviceFormatProperties2));
} }
VKAPI_ATTR VkResult VKAPI_CALL rpi_vkGetPhysicalDeviceImageFormatProperties( VKAPI_ATTR VkResult VKAPI_CALL RPIFUNC(vkGetPhysicalDeviceImageFormatProperties)(
VkPhysicalDevice physicalDevice, VkPhysicalDevice physicalDevice,
VkFormat format, VkFormat format,
VkImageType type, VkImageType type,
@ -706,7 +706,7 @@ VKAPI_ATTR VkResult VKAPI_CALL rpi_vkGetPhysicalDeviceImageFormatProperties(
VkImageCreateFlags flags, VkImageCreateFlags flags,
VkImageFormatProperties* pImageFormatProperties) VkImageFormatProperties* pImageFormatProperties)
{ {
PROFILESTART(rpi_vkGetPhysicalDeviceImageFormatProperties); PROFILESTART(RPIFUNC(vkGetPhysicalDeviceImageFormatProperties));
assert(physicalDevice); assert(physicalDevice);
assert(pImageFormatProperties); assert(pImageFormatProperties);
@ -762,7 +762,7 @@ VKAPI_ATTR VkResult VKAPI_CALL rpi_vkGetPhysicalDeviceImageFormatProperties(
if(!supported) if(!supported)
{ {
PROFILEEND(rpi_vkGetPhysicalDeviceImageFormatProperties); PROFILEEND(RPIFUNC(vkGetPhysicalDeviceImageFormatProperties));
return VK_ERROR_FORMAT_NOT_SUPPORTED; return VK_ERROR_FORMAT_NOT_SUPPORTED;
} }
@ -818,16 +818,16 @@ VKAPI_ATTR VkResult VKAPI_CALL rpi_vkGetPhysicalDeviceImageFormatProperties(
//2^31 //2^31
pImageFormatProperties->maxResourceSize = 1<<31; pImageFormatProperties->maxResourceSize = 1<<31;
PROFILEEND(rpi_vkGetPhysicalDeviceImageFormatProperties); PROFILEEND(RPIFUNC(vkGetPhysicalDeviceImageFormatProperties));
return VK_SUCCESS; return VK_SUCCESS;
} }
VKAPI_ATTR VkResult VKAPI_CALL rpi_vkGetPhysicalDeviceImageFormatProperties2( VKAPI_ATTR VkResult VKAPI_CALL RPIFUNC(vkGetPhysicalDeviceImageFormatProperties2)(
VkPhysicalDevice physicalDevice, VkPhysicalDevice physicalDevice,
const VkPhysicalDeviceImageFormatInfo2* pImageFormatInfo, const VkPhysicalDeviceImageFormatInfo2* pImageFormatInfo,
VkImageFormatProperties2* pImageFormatProperties) VkImageFormatProperties2* pImageFormatProperties)
{ {
PROFILESTART(rpi_vkGetPhysicalDeviceImageFormatProperties2); PROFILESTART(RPIFUNC(vkGetPhysicalDeviceImageFormatProperties2));
assert(physicalDevice); assert(physicalDevice);
assert(pImageFormatProperties); assert(pImageFormatProperties);
@ -835,52 +835,52 @@ VKAPI_ATTR VkResult VKAPI_CALL rpi_vkGetPhysicalDeviceImageFormatProperties2(
//TODO handle pNext //TODO handle pNext
VkResult retval = rpi_vkGetPhysicalDeviceImageFormatProperties(physicalDevice, VkResult retval = RPIFUNC(vkGetPhysicalDeviceImageFormatProperties)(physicalDevice,
pImageFormatInfo->format, pImageFormatInfo->format,
pImageFormatInfo->type, pImageFormatInfo->type,
pImageFormatInfo->tiling, pImageFormatInfo->tiling,
pImageFormatInfo->usage, pImageFormatInfo->usage,
pImageFormatInfo->flags, pImageFormatInfo->flags,
&pImageFormatProperties->imageFormatProperties); &pImageFormatProperties->imageFormatProperties);
PROFILEEND(rpi_vkGetPhysicalDeviceImageFormatProperties2); PROFILEEND(RPIFUNC(vkGetPhysicalDeviceImageFormatProperties2));
return retval; return retval;
} }
VKAPI_ATTR VkResult VKAPI_CALL rpi_vkEnumerateDeviceLayerProperties( VKAPI_ATTR VkResult VKAPI_CALL RPIFUNC(vkEnumerateDeviceLayerProperties)(
VkPhysicalDevice physicalDevice, VkPhysicalDevice physicalDevice,
uint32_t* pPropertyCount, uint32_t* pPropertyCount,
VkLayerProperties* pProperties) VkLayerProperties* pProperties)
{ {
PROFILESTART(rpi_vkEnumerateDeviceLayerProperties); PROFILESTART(RPIFUNC(vkEnumerateDeviceLayerProperties));
//deprecated, just return instance layers //deprecated, just return instance layers
VkResult retval = rpi_vkEnumerateInstanceLayerProperties(pPropertyCount, pProperties); VkResult retval = RPIFUNC(vkEnumerateInstanceLayerProperties)(pPropertyCount, pProperties);
PROFILEEND(rpi_vkEnumerateDeviceLayerProperties); PROFILEEND(RPIFUNC(vkEnumerateDeviceLayerProperties));
return retval; return retval;
} }
VKAPI_ATTR void VKAPI_CALL rpi_vkGetPhysicalDeviceFeatures2( VKAPI_ATTR void VKAPI_CALL RPIFUNC(vkGetPhysicalDeviceFeatures2)(
VkPhysicalDevice physicalDevice, VkPhysicalDevice physicalDevice,
VkPhysicalDeviceFeatures2* pFeatures) VkPhysicalDeviceFeatures2* pFeatures)
{ {
PROFILESTART(rpi_vkGetPhysicalDeviceFeatures2); PROFILESTART(RPIFUNC(vkGetPhysicalDeviceFeatures2));
assert(physicalDevice); assert(physicalDevice);
assert(pFeatures); assert(pFeatures);
rpi_vkGetPhysicalDeviceFeatures(physicalDevice, &pFeatures->features); RPIFUNC(vkGetPhysicalDeviceFeatures)(physicalDevice, &pFeatures->features);
PROFILEEND(rpi_vkGetPhysicalDeviceFeatures2); PROFILEEND(RPIFUNC(vkGetPhysicalDeviceFeatures2));
} }
VKAPI_ATTR void VKAPI_CALL rpi_vkGetPhysicalDeviceQueueFamilyProperties2( VKAPI_ATTR void VKAPI_CALL RPIFUNC(vkGetPhysicalDeviceQueueFamilyProperties2)(
VkPhysicalDevice physicalDevice, VkPhysicalDevice physicalDevice,
uint32_t* pQueueFamilyPropertyCount, uint32_t* pQueueFamilyPropertyCount,
VkQueueFamilyProperties2* pQueueFamilyProperties) VkQueueFamilyProperties2* pQueueFamilyProperties)
{ {
PROFILESTART(rpi_vkGetPhysicalDeviceQueueFamilyProperties2); PROFILESTART(RPIFUNC(vkGetPhysicalDeviceQueueFamilyProperties2));
assert(physicalDevice); assert(physicalDevice);
rpi_vkGetPhysicalDeviceQueueFamilyProperties(physicalDevice, pQueueFamilyPropertyCount, pQueueFamilyProperties); RPIFUNC(vkGetPhysicalDeviceQueueFamilyProperties)(physicalDevice, pQueueFamilyPropertyCount, pQueueFamilyProperties);
PROFILEEND(rpi_vkGetPhysicalDeviceQueueFamilyProperties2); PROFILEEND(RPIFUNC(vkGetPhysicalDeviceQueueFamilyProperties2));
} }

View File

@ -1,5 +1,7 @@
#include "common.h" #include "common.h"
#include "declarations.h"
#include "kernel/vc4_packet.h" #include "kernel/vc4_packet.h"
//returns max index //returns max index
@ -555,9 +557,9 @@ static uint32_t drawCommon(VkCommandBuffer commandBuffer, int32_t vertexOffset)
/* /*
* https://www.khronos.org/registry/vulkan/specs/1.1-extensions/html/vkspec.html#vkCmdDraw * https://www.khronos.org/registry/vulkan/specs/1.1-extensions/html/vkspec.html#vkCmdDraw
*/ */
void rpi_vkCmdDraw(VkCommandBuffer commandBuffer, uint32_t vertexCount, uint32_t instanceCount, uint32_t firstVertex, uint32_t firstInstance) void RPIFUNC(vkCmdDraw)(VkCommandBuffer commandBuffer, uint32_t vertexCount, uint32_t instanceCount, uint32_t firstVertex, uint32_t firstInstance)
{ {
PROFILESTART(rpi_vkCmdDraw); PROFILESTART(RPIFUNC(vkCmdDraw));
assert(commandBuffer); assert(commandBuffer);
@ -579,10 +581,10 @@ void rpi_vkCmdDraw(VkCommandBuffer commandBuffer, uint32_t vertexCount, uint32_t
assert(((CLMarker*)getCPAptrFromOffset(cb->binCl.CPA, cb->binCl.currMarkerOffset))->memGuard == 0xDDDDDDDD); assert(((CLMarker*)getCPAptrFromOffset(cb->binCl.CPA, cb->binCl.currMarkerOffset))->memGuard == 0xDDDDDDDD);
PROFILEEND(rpi_vkCmdDraw); PROFILEEND(RPIFUNC(vkCmdDraw));
} }
VKAPI_ATTR void VKAPI_CALL rpi_vkCmdDrawIndexed( VKAPI_ATTR void VKAPI_CALL RPIFUNC(vkCmdDrawIndexed)(
VkCommandBuffer commandBuffer, VkCommandBuffer commandBuffer,
uint32_t indexCount, uint32_t indexCount,
uint32_t instanceCount, uint32_t instanceCount,
@ -590,7 +592,7 @@ VKAPI_ATTR void VKAPI_CALL rpi_vkCmdDrawIndexed(
int32_t vertexOffset, int32_t vertexOffset,
uint32_t firstInstance) uint32_t firstInstance)
{ {
PROFILESTART(rpi_vkCmdDrawIndexed); PROFILESTART(RPIFUNC(vkCmdDrawIndexed));
assert(commandBuffer); assert(commandBuffer);
@ -629,10 +631,10 @@ VKAPI_ATTR void VKAPI_CALL rpi_vkCmdDrawIndexed(
assert(((CLMarker*)getCPAptrFromOffset(cb->binCl.CPA, cb->binCl.currMarkerOffset))->memGuard == 0xDDDDDDDD); assert(((CLMarker*)getCPAptrFromOffset(cb->binCl.CPA, cb->binCl.currMarkerOffset))->memGuard == 0xDDDDDDDD);
PROFILEEND(rpi_vkCmdDrawIndexed); PROFILEEND(RPIFUNC(vkCmdDrawIndexed));
} }
VKAPI_ATTR void VKAPI_CALL rpi_vkCmdDrawIndexedIndirect( VKAPI_ATTR void VKAPI_CALL RPIFUNC(vkCmdDrawIndexedIndirect)(
VkCommandBuffer commandBuffer, VkCommandBuffer commandBuffer,
VkBuffer buffer, VkBuffer buffer,
VkDeviceSize offset, VkDeviceSize offset,
@ -642,7 +644,7 @@ VKAPI_ATTR void VKAPI_CALL rpi_vkCmdDrawIndexedIndirect(
UNSUPPORTED(vkCmdDrawIndexedIndirect); UNSUPPORTED(vkCmdDrawIndexedIndirect);
} }
VKAPI_ATTR void VKAPI_CALL rpi_vkCmdDrawIndirect( VKAPI_ATTR void VKAPI_CALL RPIFUNC(vkCmdDrawIndirect)(
VkCommandBuffer commandBuffer, VkCommandBuffer commandBuffer,
VkBuffer buffer, VkBuffer buffer,
VkDeviceSize offset, VkDeviceSize offset,

View File

@ -4,7 +4,11 @@
#include "declarations.h" #include "declarations.h"
#define RETFUNC(f) if(!strcmp(pName, #f)) return &rpi_##f #if EXPOSE_DRIVER == 0
#define RETFUNC(f) if(!strcmp(pName, #f)) return &rpi_##f
#else
#define RETFUNC(f) if(!strcmp(pName, #f)) return &f
#endif
static uint32_t loaderVersion = -1; static uint32_t loaderVersion = -1;
@ -26,7 +30,7 @@ VKAPI_ATTR PFN_vkVoidFunction VKAPI_CALL vk_icdGetInstanceProcAddr(VkInstance in
loaderVersion = 1; loaderVersion = 1;
} }
void* ptr = rpi_vkGetInstanceProcAddr(instance, pName); void* ptr = RPIFUNC(vkGetInstanceProcAddr)(instance, pName);
return ptr; return ptr;
} }
@ -37,7 +41,7 @@ VKAPI_ATTR PFN_vkVoidFunction VKAPI_CALL vk_icdGetPhysicalDeviceProcAddr(VkInsta
void* ptr = 0; void* ptr = 0;
// if(!strcmp(pName, "vkCreateShaderModuleFromRpiAssemblyEXT")) // if(!strcmp(pName, "vkCreateShaderModuleFromRpiAssemblyEXT"))
// ptr = &rpi_vkCreateShaderModuleFromRpiAssemblyEXT; // ptr = &RPIFUNC(vkCreateShaderModuleFromRpiAssemblyEXT);
return ptr; return ptr;
} }
@ -54,19 +58,19 @@ VKAPI_ATTR PFN_vkVoidFunction VKAPI_CALL vk_icdGetPhysicalDeviceProcAddr(VkInsta
* two calls may retrieve different results if a pLayerName is available in one call but not in another. The extensions supported by a layer may also change between two calls, * two calls may retrieve different results if a pLayerName is available in one call but not in another. The extensions supported by a layer may also change between two calls,
* e.g. if the layer implementation is replaced by a different version between those calls. * e.g. if the layer implementation is replaced by a different version between those calls.
*/ */
VKAPI_ATTR VkResult VKAPI_CALL rpi_vkEnumerateInstanceExtensionProperties( VKAPI_ATTR VkResult VKAPI_CALL RPIFUNC(vkEnumerateInstanceExtensionProperties)(
const char* pLayerName, const char* pLayerName,
uint32_t* pPropertyCount, uint32_t* pPropertyCount,
VkExtensionProperties* pProperties) VkExtensionProperties* pProperties)
{ {
PROFILESTART(rpi_vkEnumerateInstanceExtensionProperties); PROFILESTART(RPIFUNC(vkEnumerateInstanceExtensionProperties));
assert(pPropertyCount); assert(pPropertyCount);
if(!pProperties) if(!pProperties)
{ {
*pPropertyCount = numInstanceExtensions; *pPropertyCount = numInstanceExtensions;
PROFILEEND(rpi_vkEnumerateInstanceExtensionProperties); PROFILEEND(RPIFUNC(vkEnumerateInstanceExtensionProperties));
return VK_SUCCESS; return VK_SUCCESS;
} }
@ -82,12 +86,12 @@ VKAPI_ATTR VkResult VKAPI_CALL rpi_vkEnumerateInstanceExtensionProperties(
if(arraySize < numInstanceExtensions) if(arraySize < numInstanceExtensions)
{ {
PROFILEEND(rpi_vkEnumerateInstanceExtensionProperties); PROFILEEND(RPIFUNC(vkEnumerateInstanceExtensionProperties));
return VK_INCOMPLETE; return VK_INCOMPLETE;
} }
else else
{ {
PROFILEEND(rpi_vkEnumerateInstanceExtensionProperties); PROFILEEND(RPIFUNC(vkEnumerateInstanceExtensionProperties));
return VK_SUCCESS; return VK_SUCCESS;
} }
} }
@ -100,12 +104,12 @@ VKAPI_ATTR VkResult VKAPI_CALL rpi_vkEnumerateInstanceExtensionProperties(
* vkCreateInstance must return VK_ERROR_EXTENSION_NOT_PRESENT. After verifying and enabling the instance layers and extensions the VkInstance object is * vkCreateInstance must return VK_ERROR_EXTENSION_NOT_PRESENT. After verifying and enabling the instance layers and extensions the VkInstance object is
* created and returned to the application. * created and returned to the application.
*/ */
VKAPI_ATTR VkResult VKAPI_CALL rpi_vkCreateInstance( VKAPI_ATTR VkResult VKAPI_CALL RPIFUNC(vkCreateInstance)(
const VkInstanceCreateInfo* pCreateInfo, const VkInstanceCreateInfo* pCreateInfo,
const VkAllocationCallbacks* pAllocator, const VkAllocationCallbacks* pAllocator,
VkInstance* pInstance) VkInstance* pInstance)
{ {
PROFILESTART(rpi_vkCreateInstance); PROFILESTART(RPIFUNC(vkCreateInstance));
assert(pInstance); assert(pInstance);
assert(pCreateInfo); assert(pCreateInfo);
@ -114,7 +118,7 @@ VKAPI_ATTR VkResult VKAPI_CALL rpi_vkCreateInstance(
if(!*pInstance) if(!*pInstance)
{ {
PROFILEEND(rpi_vkCreateInstance); PROFILEEND(RPIFUNC(vkCreateInstance));
return VK_ERROR_OUT_OF_HOST_MEMORY; return VK_ERROR_OUT_OF_HOST_MEMORY;
} }
@ -139,7 +143,7 @@ VKAPI_ATTR VkResult VKAPI_CALL rpi_vkCreateInstance(
{ {
FREE(*pInstance); FREE(*pInstance);
*pInstance = 0; *pInstance = 0;
PROFILEEND(rpi_vkCreateInstance); PROFILEEND(RPIFUNC(vkCreateInstance));
return VK_ERROR_EXTENSION_NOT_PRESENT; return VK_ERROR_EXTENSION_NOT_PRESENT;
} }
} }
@ -152,7 +156,7 @@ VKAPI_ATTR VkResult VKAPI_CALL rpi_vkCreateInstance(
if(!f) if(!f)
{ {
PROFILEEND(rpi_vkCreateInstance); PROFILEEND(RPIFUNC(vkCreateInstance));
return VK_ERROR_INITIALIZATION_FAILED; return VK_ERROR_INITIALIZATION_FAILED;
} }
@ -170,7 +174,7 @@ VKAPI_ATTR VkResult VKAPI_CALL rpi_vkCreateInstance(
strcmp(hw, "BCM2836") && strcmp(hw, "BCM2836") &&
strcmp(hw, "BCM2837")) strcmp(hw, "BCM2837"))
{ {
PROFILEEND(rpi_vkCreateInstance); PROFILEEND(RPIFUNC(vkCreateInstance));
return VK_ERROR_INITIALIZATION_FAILED; return VK_ERROR_INITIALIZATION_FAILED;
} }
@ -246,7 +250,7 @@ VKAPI_ATTR VkResult VKAPI_CALL rpi_vkCreateInstance(
assert((*pInstance)->hasThreadedFs); assert((*pInstance)->hasThreadedFs);
assert((*pInstance)->hasPerfmon); assert((*pInstance)->hasPerfmon);
PROFILEEND(rpi_vkCreateInstance); PROFILEEND(RPIFUNC(vkCreateInstance));
return VK_SUCCESS; return VK_SUCCESS;
} }
@ -254,41 +258,41 @@ VKAPI_ATTR VkResult VKAPI_CALL rpi_vkCreateInstance(
* https://www.khronos.org/registry/vulkan/specs/1.1-extensions/html/vkspec.html#vkDestroyInstance * https://www.khronos.org/registry/vulkan/specs/1.1-extensions/html/vkspec.html#vkDestroyInstance
* *
*/ */
VKAPI_ATTR void VKAPI_CALL rpi_vkDestroyInstance( VKAPI_ATTR void VKAPI_CALL RPIFUNC(vkDestroyInstance)(
VkInstance instance, VkInstance instance,
const VkAllocationCallbacks* pAllocator) const VkAllocationCallbacks* pAllocator)
{ {
PROFILESTART(rpi_vkDestroyInstance); PROFILESTART(RPIFUNC(vkDestroyInstance));
if(instance) if(instance)
{ {
closeIoctl(); closeIoctl();
FREE(instance); FREE(instance);
} }
PROFILEEND(rpi_vkDestroyInstance); PROFILEEND(RPIFUNC(vkDestroyInstance));
} }
/* /*
* https://www.khronos.org/registry/vulkan/specs/1.1-extensions/html/vkspec.html#vkEnumerateInstanceVersion * https://www.khronos.org/registry/vulkan/specs/1.1-extensions/html/vkspec.html#vkEnumerateInstanceVersion
*/ */
VKAPI_ATTR VkResult VKAPI_CALL rpi_vkEnumerateInstanceVersion( VKAPI_ATTR VkResult VKAPI_CALL RPIFUNC(vkEnumerateInstanceVersion)(
uint32_t* pApiVersion) uint32_t* pApiVersion)
{ {
PROFILESTART(rpi_vkEnumerateInstanceVersion); PROFILESTART(RPIFUNC(vkEnumerateInstanceVersion));
assert(pApiVersion); assert(pApiVersion);
*pApiVersion = VK_DRIVER_VERSION; // *pApiVersion = VK_DRIVER_VERSION; //
PROFILEEND(rpi_vkEnumerateInstanceVersion); PROFILEEND(RPIFUNC(vkEnumerateInstanceVersion));
return VK_SUCCESS; return VK_SUCCESS;
} }
/* /*
* https://www.khronos.org/registry/vulkan/specs/1.1-extensions/html/vkspec.html#vkGetInstanceProcAddr * https://www.khronos.org/registry/vulkan/specs/1.1-extensions/html/vkspec.html#vkGetInstanceProcAddr
*/ */
VKAPI_ATTR PFN_vkVoidFunction VKAPI_CALL rpi_vkGetInstanceProcAddr( VKAPI_ATTR PFN_vkVoidFunction VKAPI_CALL RPIFUNC(vkGetInstanceProcAddr)(
VkInstance instance, VkInstance instance,
const char* pName) const char* pName)
{ {
PROFILESTART(rpi_vkGetInstanceProcAddr); PROFILESTART(RPIFUNC(vkGetInstanceProcAddr));
if(!instance && !( if(!instance && !(
!strcmp(pName, "vkEnumerateInstanceVersion") || !strcmp(pName, "vkEnumerateInstanceVersion") ||
@ -297,11 +301,11 @@ VKAPI_ATTR PFN_vkVoidFunction VKAPI_CALL rpi_vkGetInstanceProcAddr(
!strcmp(pName, "vkCreateInstance") !strcmp(pName, "vkCreateInstance")
)) ))
{ {
PROFILEEND(rpi_vkGetInstanceProcAddr); PROFILEEND(RPIFUNC(vkGetInstanceProcAddr));
return 0; return 0;
} }
PROFILEEND(rpi_vkGetInstanceProcAddr); PROFILEEND(RPIFUNC(vkGetInstanceProcAddr));
RETFUNC(vkCreateInstance); RETFUNC(vkCreateInstance);
RETFUNC(vkEnumerateInstanceVersion); RETFUNC(vkEnumerateInstanceVersion);
@ -497,13 +501,13 @@ VKAPI_ATTR PFN_vkVoidFunction VKAPI_CALL rpi_vkGetInstanceProcAddr(
return 0; return 0;
} }
VKAPI_ATTR VkResult VKAPI_CALL rpi_vkEnumerateInstanceLayerProperties( VKAPI_ATTR VkResult VKAPI_CALL RPIFUNC(vkEnumerateInstanceLayerProperties)(
uint32_t* pPropertyCount, uint32_t* pPropertyCount,
VkLayerProperties* pProperties) VkLayerProperties* pProperties)
{ {
PROFILESTART(rpi_vkEnumerateInstanceLayerProperties); PROFILESTART(RPIFUNC(vkEnumerateInstanceLayerProperties));
PROFILEEND(rpi_vkEnumerateInstanceLayerProperties); PROFILEEND(RPIFUNC(vkEnumerateInstanceLayerProperties));
return VK_SUCCESS; return VK_SUCCESS;
} }

View File

@ -1,13 +1,15 @@
#include "common.h" #include "common.h"
#include "declarations.h"
#include "kernel/vc4_packet.h" #include "kernel/vc4_packet.h"
/* /*
* https://www.khronos.org/registry/vulkan/specs/1.1-extensions/html/vkspec.html#vkGetPhysicalDeviceMemoryProperties * https://www.khronos.org/registry/vulkan/specs/1.1-extensions/html/vkspec.html#vkGetPhysicalDeviceMemoryProperties
*/ */
void rpi_vkGetPhysicalDeviceMemoryProperties(VkPhysicalDevice physicalDevice, VkPhysicalDeviceMemoryProperties* pMemoryProperties) void RPIFUNC(vkGetPhysicalDeviceMemoryProperties)(VkPhysicalDevice physicalDevice, VkPhysicalDeviceMemoryProperties* pMemoryProperties)
{ {
PROFILESTART(rpi_vkGetPhysicalDeviceMemoryProperties); PROFILESTART(RPIFUNC(vkGetPhysicalDeviceMemoryProperties));
assert(physicalDevice); assert(physicalDevice);
assert(pMemoryProperties); assert(pMemoryProperties);
@ -57,15 +59,15 @@ void rpi_vkGetPhysicalDeviceMemoryProperties(VkPhysicalDevice physicalDevice, Vk
pMemoryProperties->memoryHeaps[c] = memoryHeaps[c]; pMemoryProperties->memoryHeaps[c] = memoryHeaps[c];
} }
PROFILEEND(rpi_vkGetPhysicalDeviceMemoryProperties); PROFILEEND(RPIFUNC(vkGetPhysicalDeviceMemoryProperties));
} }
/* /*
* https://www.khronos.org/registry/vulkan/specs/1.1-extensions/html/vkspec.html#vkAllocateMemory * https://www.khronos.org/registry/vulkan/specs/1.1-extensions/html/vkspec.html#vkAllocateMemory
*/ */
VkResult rpi_vkAllocateMemory(VkDevice device, const VkMemoryAllocateInfo* pAllocateInfo, const VkAllocationCallbacks* pAllocator, VkDeviceMemory* pMemory) VkResult RPIFUNC(vkAllocateMemory)(VkDevice device, const VkMemoryAllocateInfo* pAllocateInfo, const VkAllocationCallbacks* pAllocator, VkDeviceMemory* pMemory)
{ {
PROFILESTART(rpi_vkAllocateMemory); PROFILESTART(RPIFUNC(vkAllocateMemory));
assert(device); assert(device);
assert(pAllocateInfo); assert(pAllocateInfo);
@ -74,14 +76,14 @@ VkResult rpi_vkAllocateMemory(VkDevice device, const VkMemoryAllocateInfo* pAllo
uint32_t bo = vc4_bo_alloc(controlFd, pAllocateInfo->allocationSize, "vkAllocateMemory"); uint32_t bo = vc4_bo_alloc(controlFd, pAllocateInfo->allocationSize, "vkAllocateMemory");
if(!bo) if(!bo)
{ {
PROFILEEND(rpi_vkAllocateMemory); PROFILEEND(RPIFUNC(vkAllocateMemory));
return VK_ERROR_OUT_OF_DEVICE_MEMORY; return VK_ERROR_OUT_OF_DEVICE_MEMORY;
} }
_deviceMemory* mem = ALLOCATE(sizeof(_deviceMemory), 1, VK_SYSTEM_ALLOCATION_SCOPE_OBJECT); _deviceMemory* mem = ALLOCATE(sizeof(_deviceMemory), 1, VK_SYSTEM_ALLOCATION_SCOPE_OBJECT);
if(!mem) if(!mem)
{ {
PROFILEEND(rpi_vkAllocateMemory); PROFILEEND(RPIFUNC(vkAllocateMemory));
return VK_ERROR_OUT_OF_HOST_MEMORY; return VK_ERROR_OUT_OF_HOST_MEMORY;
} }
@ -94,16 +96,16 @@ VkResult rpi_vkAllocateMemory(VkDevice device, const VkMemoryAllocateInfo* pAllo
//TODO max number of allocations //TODO max number of allocations
PROFILEEND(rpi_vkAllocateMemory); PROFILEEND(RPIFUNC(vkAllocateMemory));
return VK_SUCCESS; return VK_SUCCESS;
} }
/* /*
* https://www.khronos.org/registry/vulkan/specs/1.1-extensions/html/vkspec.html#vkMapMemory * https://www.khronos.org/registry/vulkan/specs/1.1-extensions/html/vkspec.html#vkMapMemory
*/ */
VkResult rpi_vkMapMemory(VkDevice device, VkDeviceMemory memory, VkDeviceSize offset, VkDeviceSize size, VkMemoryMapFlags flags, void** ppData) VkResult RPIFUNC(vkMapMemory)(VkDevice device, VkDeviceMemory memory, VkDeviceSize offset, VkDeviceSize size, VkMemoryMapFlags flags, void** ppData)
{ {
PROFILESTART(rpi_vkMapMemory); PROFILESTART(RPIFUNC(vkMapMemory));
assert(device); assert(device);
assert(memory); assert(memory);
@ -128,7 +130,7 @@ VkResult rpi_vkMapMemory(VkDevice device, VkDeviceMemory memory, VkDeviceSize of
void* ptr = vc4_bo_map(controlFd, ((_deviceMemory*)memory)->bo, offset, size); void* ptr = vc4_bo_map(controlFd, ((_deviceMemory*)memory)->bo, offset, size);
if(!ptr) if(!ptr)
{ {
PROFILEEND(rpi_vkMapMemory); PROFILEEND(RPIFUNC(vkMapMemory));
return VK_ERROR_MEMORY_MAP_FAILED; return VK_ERROR_MEMORY_MAP_FAILED;
} }
@ -137,16 +139,16 @@ VkResult rpi_vkMapMemory(VkDevice device, VkDeviceMemory memory, VkDeviceSize of
((_deviceMemory*)memory)->mappedSize = size; ((_deviceMemory*)memory)->mappedSize = size;
*ppData = ptr; *ppData = ptr;
PROFILEEND(rpi_vkMapMemory); PROFILEEND(RPIFUNC(vkMapMemory));
return VK_SUCCESS; return VK_SUCCESS;
} }
/* /*
* https://www.khronos.org/registry/vulkan/specs/1.1-extensions/html/vkspec.html#vkUnmapMemory * https://www.khronos.org/registry/vulkan/specs/1.1-extensions/html/vkspec.html#vkUnmapMemory
*/ */
void rpi_vkUnmapMemory(VkDevice device, VkDeviceMemory memory) void RPIFUNC(vkUnmapMemory)(VkDevice device, VkDeviceMemory memory)
{ {
PROFILESTART(rpi_vkUnmapMemory); PROFILESTART(RPIFUNC(vkUnmapMemory));
assert(device); assert(device);
assert(memory); assert(memory);
@ -156,12 +158,12 @@ void rpi_vkUnmapMemory(VkDevice device, VkDeviceMemory memory)
((_deviceMemory*)memory)->mappedSize = 0; ((_deviceMemory*)memory)->mappedSize = 0;
((_deviceMemory*)memory)->mappedOffset = 0; ((_deviceMemory*)memory)->mappedOffset = 0;
PROFILEEND(rpi_vkUnmapMemory); PROFILEEND(RPIFUNC(vkUnmapMemory));
} }
void rpi_vkFreeMemory(VkDevice device, VkDeviceMemory memory, const VkAllocationCallbacks* pAllocator) void RPIFUNC(vkFreeMemory)(VkDevice device, VkDeviceMemory memory, const VkAllocationCallbacks* pAllocator)
{ {
PROFILESTART(rpi_vkFreeMemory); PROFILESTART(RPIFUNC(vkFreeMemory));
assert(device); assert(device);
@ -172,29 +174,29 @@ void rpi_vkFreeMemory(VkDevice device, VkDeviceMemory memory, const VkAllocation
FREE(mem); FREE(mem);
} }
PROFILEEND(rpi_vkFreeMemory); PROFILEEND(RPIFUNC(vkFreeMemory));
} }
/* /*
* https://www.khronos.org/registry/vulkan/specs/1.1-extensions/html/vkspec.html#vkFlushMappedMemoryRanges * https://www.khronos.org/registry/vulkan/specs/1.1-extensions/html/vkspec.html#vkFlushMappedMemoryRanges
*/ */
VKAPI_ATTR VkResult VKAPI_CALL rpi_vkFlushMappedMemoryRanges( VKAPI_ATTR VkResult VKAPI_CALL RPIFUNC(vkFlushMappedMemoryRanges)(
VkDevice device, VkDevice device,
uint32_t memoryRangeCount, uint32_t memoryRangeCount,
const VkMappedMemoryRange* pMemoryRanges) const VkMappedMemoryRange* pMemoryRanges)
{ {
PROFILESTART(rpi_vkFlushMappedMemoryRanges); PROFILESTART(RPIFUNC(vkFlushMappedMemoryRanges));
//TODO //TODO
PROFILEEND(rpi_vkFlushMappedMemoryRanges); PROFILEEND(RPIFUNC(vkFlushMappedMemoryRanges));
return VK_SUCCESS; return VK_SUCCESS;
} }
/* /*
* https://www.khronos.org/registry/vulkan/specs/1.1-extensions/html/vkspec.html#vkInvalidateMappedMemoryRanges * https://www.khronos.org/registry/vulkan/specs/1.1-extensions/html/vkspec.html#vkInvalidateMappedMemoryRanges
*/ */
VKAPI_ATTR VkResult VKAPI_CALL rpi_vkInvalidateMappedMemoryRanges( VKAPI_ATTR VkResult VKAPI_CALL RPIFUNC(vkInvalidateMappedMemoryRanges)(
VkDevice device, VkDevice device,
uint32_t memoryRangeCount, uint32_t memoryRangeCount,
const VkMappedMemoryRange* pMemoryRanges) const VkMappedMemoryRange* pMemoryRanges)
@ -204,15 +206,15 @@ VKAPI_ATTR VkResult VKAPI_CALL rpi_vkInvalidateMappedMemoryRanges(
return VK_SUCCESS; return VK_SUCCESS;
} }
VKAPI_ATTR void VKAPI_CALL rpi_vkGetPhysicalDeviceMemoryProperties2( VKAPI_ATTR void VKAPI_CALL RPIFUNC(vkGetPhysicalDeviceMemoryProperties2)(
VkPhysicalDevice physicalDevice, VkPhysicalDevice physicalDevice,
VkPhysicalDeviceMemoryProperties2* pMemoryProperties) VkPhysicalDeviceMemoryProperties2* pMemoryProperties)
{ {
assert(physicalDevice); assert(physicalDevice);
rpi_vkGetPhysicalDeviceMemoryProperties(physicalDevice, pMemoryProperties); RPIFUNC(vkGetPhysicalDeviceMemoryProperties)(physicalDevice, pMemoryProperties);
} }
VKAPI_ATTR void VKAPI_CALL rpi_vkGetDeviceMemoryCommitment( VKAPI_ATTR void VKAPI_CALL RPIFUNC(vkGetDeviceMemoryCommitment)(
VkDevice device, VkDevice device,
VkDeviceMemory memory, VkDeviceMemory memory,
VkDeviceSize* pCommittedMemoryInBytes) VkDeviceSize* pCommittedMemoryInBytes)

View File

@ -1,14 +1,16 @@
#include "common.h" #include "common.h"
#include "declarations.h"
#include "kernel/vc4_packet.h" #include "kernel/vc4_packet.h"
#include "../QPUassembler/qpu_assembler.h" #include "../QPUassembler/qpu_assembler.h"
/* /*
* https://www.khronos.org/registry/vulkan/specs/1.1-extensions/html/vkspec.html#vkCmdBindPipeline * https://www.khronos.org/registry/vulkan/specs/1.1-extensions/html/vkspec.html#vkCmdBindPipeline
*/ */
void rpi_vkCmdBindPipeline(VkCommandBuffer commandBuffer, VkPipelineBindPoint pipelineBindPoint, VkPipeline pipeline) void RPIFUNC(vkCmdBindPipeline)(VkCommandBuffer commandBuffer, VkPipelineBindPoint pipelineBindPoint, VkPipeline pipeline)
{ {
PROFILESTART(rpi_vkCmdBindPipeline); PROFILESTART(RPIFUNC(vkCmdBindPipeline));
assert(commandBuffer); assert(commandBuffer);
@ -22,7 +24,7 @@ void rpi_vkCmdBindPipeline(VkCommandBuffer commandBuffer, VkPipelineBindPoint pi
cb->computePipeline = pipeline; cb->computePipeline = pipeline;
} }
PROFILEEND(rpi_vkCmdBindPipeline); PROFILEEND(RPIFUNC(vkCmdBindPipeline));
} }
//multiple attachments //multiple attachments
@ -176,9 +178,9 @@ void patchShaderDepthStencilBlending(uint64_t** instructions, uint32_t* size, co
/* /*
* https://www.khronos.org/registry/vulkan/specs/1.1-extensions/html/vkspec.html#vkCreateGraphicsPipelines * https://www.khronos.org/registry/vulkan/specs/1.1-extensions/html/vkspec.html#vkCreateGraphicsPipelines
*/ */
VkResult rpi_vkCreateGraphicsPipelines(VkDevice device, VkPipelineCache pipelineCache, uint32_t createInfoCount, const VkGraphicsPipelineCreateInfo* pCreateInfos, const VkAllocationCallbacks* pAllocator, VkPipeline* pPipelines) VkResult RPIFUNC(vkCreateGraphicsPipelines)(VkDevice device, VkPipelineCache pipelineCache, uint32_t createInfoCount, const VkGraphicsPipelineCreateInfo* pCreateInfos, const VkAllocationCallbacks* pAllocator, VkPipeline* pPipelines)
{ {
PROFILESTART(rpi_vkCreateGraphicsPipelines); PROFILESTART(RPIFUNC(vkCreateGraphicsPipelines));
assert(device); assert(device);
assert(createInfoCount > 0); assert(createInfoCount > 0);
@ -198,7 +200,7 @@ VkResult rpi_vkCreateGraphicsPipelines(VkDevice device, VkPipelineCache pipeline
_pipeline* pip = ALLOCATE(sizeof(_pipeline), 1, VK_SYSTEM_ALLOCATION_SCOPE_OBJECT); _pipeline* pip = ALLOCATE(sizeof(_pipeline), 1, VK_SYSTEM_ALLOCATION_SCOPE_OBJECT);
if(!pip) if(!pip)
{ {
PROFILEEND(rpi_vkCreateGraphicsPipelines); PROFILEEND(RPIFUNC(vkCreateGraphicsPipelines));
return VK_ERROR_OUT_OF_HOST_MEMORY; return VK_ERROR_OUT_OF_HOST_MEMORY;
} }
@ -215,7 +217,7 @@ VkResult rpi_vkCreateGraphicsPipelines(VkDevice device, VkPipelineCache pipeline
pip->names[idx] = ALLOCATE(strlen(pCreateInfos[c].pStages[d].pName)+1, 1, VK_SYSTEM_ALLOCATION_SCOPE_OBJECT); pip->names[idx] = ALLOCATE(strlen(pCreateInfos[c].pStages[d].pName)+1, 1, VK_SYSTEM_ALLOCATION_SCOPE_OBJECT);
if(!pip->names[idx]) if(!pip->names[idx])
{ {
PROFILEEND(rpi_vkCreateGraphicsPipelines); PROFILEEND(RPIFUNC(vkCreateGraphicsPipelines));
return VK_ERROR_OUT_OF_HOST_MEMORY; return VK_ERROR_OUT_OF_HOST_MEMORY;
} }
@ -265,7 +267,7 @@ VkResult rpi_vkCreateGraphicsPipelines(VkDevice device, VkPipelineCache pipeline
pip->vertexAttributeDescriptions = ALLOCATE(sizeof(VkVertexInputAttributeDescription) * pip->vertexAttributeDescriptionCount, 1, VK_SYSTEM_ALLOCATION_SCOPE_OBJECT); pip->vertexAttributeDescriptions = ALLOCATE(sizeof(VkVertexInputAttributeDescription) * pip->vertexAttributeDescriptionCount, 1, VK_SYSTEM_ALLOCATION_SCOPE_OBJECT);
if(!pip->vertexAttributeDescriptions) if(!pip->vertexAttributeDescriptions)
{ {
PROFILEEND(rpi_vkCreateGraphicsPipelines); PROFILEEND(RPIFUNC(vkCreateGraphicsPipelines));
return VK_ERROR_OUT_OF_HOST_MEMORY; return VK_ERROR_OUT_OF_HOST_MEMORY;
} }
@ -275,7 +277,7 @@ VkResult rpi_vkCreateGraphicsPipelines(VkDevice device, VkPipelineCache pipeline
pip->vertexBindingDescriptions = ALLOCATE(sizeof(VkVertexInputBindingDescription) * pip->vertexBindingDescriptionCount, 1, VK_SYSTEM_ALLOCATION_SCOPE_OBJECT); pip->vertexBindingDescriptions = ALLOCATE(sizeof(VkVertexInputBindingDescription) * pip->vertexBindingDescriptionCount, 1, VK_SYSTEM_ALLOCATION_SCOPE_OBJECT);
if(!pip->vertexBindingDescriptions) if(!pip->vertexBindingDescriptions)
{ {
PROFILEEND(rpi_vkCreateGraphicsPipelines); PROFILEEND(RPIFUNC(vkCreateGraphicsPipelines));
return VK_ERROR_OUT_OF_HOST_MEMORY; return VK_ERROR_OUT_OF_HOST_MEMORY;
} }
@ -343,7 +345,7 @@ VkResult rpi_vkCreateGraphicsPipelines(VkDevice device, VkPipelineCache pipeline
pip->viewports = ALLOCATE(sizeof(VkViewport) * pip->viewportCount, 1, VK_SYSTEM_ALLOCATION_SCOPE_OBJECT); pip->viewports = ALLOCATE(sizeof(VkViewport) * pip->viewportCount, 1, VK_SYSTEM_ALLOCATION_SCOPE_OBJECT);
if(!pip->viewports) if(!pip->viewports)
{ {
PROFILEEND(rpi_vkCreateGraphicsPipelines); PROFILEEND(RPIFUNC(vkCreateGraphicsPipelines));
return VK_ERROR_OUT_OF_HOST_MEMORY; return VK_ERROR_OUT_OF_HOST_MEMORY;
} }
@ -357,7 +359,7 @@ VkResult rpi_vkCreateGraphicsPipelines(VkDevice device, VkPipelineCache pipeline
if(!pip->scissors) if(!pip->scissors)
{ {
PROFILEEND(rpi_vkCreateGraphicsPipelines); PROFILEEND(RPIFUNC(vkCreateGraphicsPipelines));
return VK_ERROR_OUT_OF_HOST_MEMORY; return VK_ERROR_OUT_OF_HOST_MEMORY;
} }
@ -437,7 +439,7 @@ VkResult rpi_vkCreateGraphicsPipelines(VkDevice device, VkPipelineCache pipeline
pip->attachmentBlendStates = ALLOCATE(sizeof(VkPipelineColorBlendAttachmentState) * pip->attachmentCount, 1, VK_SYSTEM_ALLOCATION_SCOPE_OBJECT); pip->attachmentBlendStates = ALLOCATE(sizeof(VkPipelineColorBlendAttachmentState) * pip->attachmentCount, 1, VK_SYSTEM_ALLOCATION_SCOPE_OBJECT);
if(!pip->attachmentBlendStates) if(!pip->attachmentBlendStates)
{ {
PROFILEEND(rpi_vkCreateGraphicsPipelines); PROFILEEND(RPIFUNC(vkCreateGraphicsPipelines));
return VK_ERROR_OUT_OF_HOST_MEMORY; return VK_ERROR_OUT_OF_HOST_MEMORY;
} }
@ -454,7 +456,7 @@ VkResult rpi_vkCreateGraphicsPipelines(VkDevice device, VkPipelineCache pipeline
pip->dynamicStates = ALLOCATE(sizeof(VkDynamicState)*pip->dynamicStateCount, 1, VK_SYSTEM_ALLOCATION_SCOPE_OBJECT); pip->dynamicStates = ALLOCATE(sizeof(VkDynamicState)*pip->dynamicStateCount, 1, VK_SYSTEM_ALLOCATION_SCOPE_OBJECT);
if(!pip->dynamicStates) if(!pip->dynamicStates)
{ {
PROFILEEND(rpi_vkCreateGraphicsPipelines); PROFILEEND(RPIFUNC(vkCreateGraphicsPipelines));
return VK_ERROR_OUT_OF_HOST_MEMORY; return VK_ERROR_OUT_OF_HOST_MEMORY;
} }
@ -475,13 +477,13 @@ VkResult rpi_vkCreateGraphicsPipelines(VkDevice device, VkPipelineCache pipeline
pPipelines[c] = pip; pPipelines[c] = pip;
} }
PROFILEEND(rpi_vkCreateGraphicsPipelines); PROFILEEND(RPIFUNC(vkCreateGraphicsPipelines));
return VK_SUCCESS; return VK_SUCCESS;
} }
void rpi_vkDestroyPipeline(VkDevice device, VkPipeline pipeline, const VkAllocationCallbacks* pAllocator) void RPIFUNC(vkDestroyPipeline)(VkDevice device, VkPipeline pipeline, const VkAllocationCallbacks* pAllocator)
{ {
PROFILESTART(rpi_vkDestroyPipeline); PROFILESTART(RPIFUNC(vkDestroyPipeline));
assert(device); assert(device);
@ -503,10 +505,10 @@ void rpi_vkDestroyPipeline(VkDevice device, VkPipeline pipeline, const VkAllocat
FREE(pip); FREE(pip);
} }
PROFILEEND(rpi_vkDestroyPipeline); PROFILEEND(RPIFUNC(vkDestroyPipeline));
} }
VKAPI_ATTR VkResult VKAPI_CALL rpi_vkMergePipelineCaches( VKAPI_ATTR VkResult VKAPI_CALL RPIFUNC(vkMergePipelineCaches)(
VkDevice device, VkDevice device,
VkPipelineCache dstCache, VkPipelineCache dstCache,
uint32_t srcCacheCount, uint32_t srcCacheCount,
@ -516,7 +518,7 @@ VKAPI_ATTR VkResult VKAPI_CALL rpi_vkMergePipelineCaches(
return UNSUPPORTED_RETURN; return UNSUPPORTED_RETURN;
} }
VKAPI_ATTR VkResult VKAPI_CALL rpi_vkGetPipelineCacheData( VKAPI_ATTR VkResult VKAPI_CALL RPIFUNC(vkGetPipelineCacheData)(
VkDevice device, VkDevice device,
VkPipelineCache pipelineCache, VkPipelineCache pipelineCache,
size_t* pDataSize, size_t* pDataSize,
@ -526,7 +528,7 @@ VKAPI_ATTR VkResult VKAPI_CALL rpi_vkGetPipelineCacheData(
return UNSUPPORTED_RETURN; return UNSUPPORTED_RETURN;
} }
VKAPI_ATTR void VKAPI_CALL rpi_vkDestroyPipelineCache( VKAPI_ATTR void VKAPI_CALL RPIFUNC(vkDestroyPipelineCache)(
VkDevice device, VkDevice device,
VkPipelineCache pipelineCache, VkPipelineCache pipelineCache,
const VkAllocationCallbacks* pAllocator) const VkAllocationCallbacks* pAllocator)
@ -534,13 +536,13 @@ VKAPI_ATTR void VKAPI_CALL rpi_vkDestroyPipelineCache(
UNSUPPORTED(vkDestroyPipelineCache); UNSUPPORTED(vkDestroyPipelineCache);
} }
VKAPI_ATTR VkResult VKAPI_CALL rpi_vkCreatePipelineLayout( VKAPI_ATTR VkResult VKAPI_CALL RPIFUNC(vkCreatePipelineLayout)(
VkDevice device, VkDevice device,
const VkPipelineLayoutCreateInfo* pCreateInfo, const VkPipelineLayoutCreateInfo* pCreateInfo,
const VkAllocationCallbacks* pAllocator, const VkAllocationCallbacks* pAllocator,
VkPipelineLayout* pPipelineLayout) VkPipelineLayout* pPipelineLayout)
{ {
PROFILESTART(rpi_vkCreatePipelineLayout); PROFILESTART(RPIFUNC(vkCreatePipelineLayout));
assert(device); assert(device);
assert(pCreateInfo); assert(pCreateInfo);
@ -550,7 +552,7 @@ VKAPI_ATTR VkResult VKAPI_CALL rpi_vkCreatePipelineLayout(
if(!pl) if(!pl)
{ {
PROFILEEND(rpi_vkCreatePipelineLayout); PROFILEEND(RPIFUNC(vkCreatePipelineLayout));
return VK_ERROR_OUT_OF_HOST_MEMORY; return VK_ERROR_OUT_OF_HOST_MEMORY;
} }
@ -562,7 +564,7 @@ VKAPI_ATTR VkResult VKAPI_CALL rpi_vkCreatePipelineLayout(
pl->setLayouts = ALLOCATE(sizeof(VkDescriptorSetLayout)*pCreateInfo->setLayoutCount, 1, VK_SYSTEM_ALLOCATION_SCOPE_OBJECT); pl->setLayouts = ALLOCATE(sizeof(VkDescriptorSetLayout)*pCreateInfo->setLayoutCount, 1, VK_SYSTEM_ALLOCATION_SCOPE_OBJECT);
if(!pl->setLayouts) if(!pl->setLayouts)
{ {
PROFILEEND(rpi_vkCreatePipelineLayout); PROFILEEND(RPIFUNC(vkCreatePipelineLayout));
return VK_ERROR_OUT_OF_HOST_MEMORY; return VK_ERROR_OUT_OF_HOST_MEMORY;
} }
@ -574,7 +576,7 @@ VKAPI_ATTR VkResult VKAPI_CALL rpi_vkCreatePipelineLayout(
pl->pushConstantRanges = ALLOCATE(sizeof(VkPushConstantRange)*pCreateInfo->pushConstantRangeCount, 1, VK_SYSTEM_ALLOCATION_SCOPE_OBJECT); pl->pushConstantRanges = ALLOCATE(sizeof(VkPushConstantRange)*pCreateInfo->pushConstantRangeCount, 1, VK_SYSTEM_ALLOCATION_SCOPE_OBJECT);
if(!pl->pushConstantRanges) if(!pl->pushConstantRanges)
{ {
PROFILEEND(rpi_vkCreatePipelineLayout); PROFILEEND(RPIFUNC(vkCreatePipelineLayout));
return VK_ERROR_OUT_OF_HOST_MEMORY; return VK_ERROR_OUT_OF_HOST_MEMORY;
} }
@ -585,16 +587,16 @@ VKAPI_ATTR VkResult VKAPI_CALL rpi_vkCreatePipelineLayout(
*pPipelineLayout = pl; *pPipelineLayout = pl;
PROFILEEND(rpi_vkCreatePipelineLayout); PROFILEEND(RPIFUNC(vkCreatePipelineLayout));
return VK_SUCCESS; return VK_SUCCESS;
} }
VKAPI_ATTR void VKAPI_CALL rpi_vkDestroyPipelineLayout( VKAPI_ATTR void VKAPI_CALL RPIFUNC(vkDestroyPipelineLayout)(
VkDevice device, VkDevice device,
VkPipelineLayout pipelineLayout, VkPipelineLayout pipelineLayout,
const VkAllocationCallbacks* pAllocator) const VkAllocationCallbacks* pAllocator)
{ {
PROFILESTART(rpi_vkDestroyPipelineLayout); PROFILESTART(RPIFUNC(vkDestroyPipelineLayout));
assert(device); assert(device);
assert(pipelineLayout); assert(pipelineLayout);
@ -607,10 +609,10 @@ VKAPI_ATTR void VKAPI_CALL rpi_vkDestroyPipelineLayout(
FREE(pl); FREE(pl);
PROFILEEND(rpi_vkDestroyPipelineLayout); PROFILEEND(RPIFUNC(vkDestroyPipelineLayout));
} }
VKAPI_ATTR VkResult VKAPI_CALL rpi_vkCreatePipelineCache( VKAPI_ATTR VkResult VKAPI_CALL RPIFUNC(vkCreatePipelineCache)(
VkDevice device, VkDevice device,
const VkPipelineCacheCreateInfo* pCreateInfo, const VkPipelineCacheCreateInfo* pCreateInfo,
const VkAllocationCallbacks* pAllocator, const VkAllocationCallbacks* pAllocator,

View File

@ -1,33 +1,35 @@
#include "common.h" #include "common.h"
#include "declarations.h"
//TODO VkPerformanceQuerySubmitInfoKHR //TODO VkPerformanceQuerySubmitInfoKHR
//TODO query test //TODO query test
VKAPI_ATTR VkResult VKAPI_CALL rpi_vkAcquireProfilingLockKHR( VKAPI_ATTR VkResult VKAPI_CALL RPIFUNC(vkAcquireProfilingLockKHR)(
VkDevice device, VkDevice device,
const VkAcquireProfilingLockInfoKHR* pInfo) const VkAcquireProfilingLockInfoKHR* pInfo)
{ {
PROFILESTART(rpi_vkAcquireProfilingLockKHR); PROFILESTART(RPIFUNC(vkAcquireProfilingLockKHR));
//TODO //TODO
PROFILEEND(rpi_vkAcquireProfilingLockKHR); PROFILEEND(RPIFUNC(vkAcquireProfilingLockKHR));
return VK_SUCCESS; return VK_SUCCESS;
} }
VKAPI_ATTR void VKAPI_CALL rpi_vkReleaseProfilingLockKHR( VKAPI_ATTR void VKAPI_CALL RPIFUNC(vkReleaseProfilingLockKHR)(
VkDevice device) VkDevice device)
{ {
PROFILESTART(rpi_vkReleaseProfilingLockKHR); PROFILESTART(RPIFUNC(vkReleaseProfilingLockKHR));
//TODO //TODO
PROFILEEND(rpi_vkReleaseProfilingLockKHR); PROFILEEND(RPIFUNC(vkReleaseProfilingLockKHR));
} }
VKAPI_ATTR VkResult VKAPI_CALL rpi_vkCreateQueryPool( VKAPI_ATTR VkResult VKAPI_CALL RPIFUNC(vkCreateQueryPool)(
VkDevice device, VkDevice device,
const VkQueryPoolCreateInfo* pCreateInfo, const VkQueryPoolCreateInfo* pCreateInfo,
const VkAllocationCallbacks* pAllocator, const VkAllocationCallbacks* pAllocator,
VkQueryPool* pQueryPool) VkQueryPool* pQueryPool)
{ {
PROFILESTART(rpi_vkCreateQueryPool); PROFILESTART(RPIFUNC(vkCreateQueryPool));
assert(device); assert(device);
assert(pQueryPool); assert(pQueryPool);
@ -70,27 +72,27 @@ VKAPI_ATTR VkResult VKAPI_CALL rpi_vkCreateQueryPool(
*pQueryPool = qp; *pQueryPool = qp;
} }
PROFILEEND(rpi_vkCreateQueryPool); PROFILEEND(RPIFUNC(vkCreateQueryPool));
return VK_SUCCESS; return VK_SUCCESS;
} }
VKAPI_ATTR void VKAPI_CALL rpi_vkCmdResetQueryPool( VKAPI_ATTR void VKAPI_CALL RPIFUNC(vkCmdResetQueryPool)(
VkCommandBuffer commandBuffer, VkCommandBuffer commandBuffer,
VkQueryPool queryPool, VkQueryPool queryPool,
uint32_t firstQuery, uint32_t firstQuery,
uint32_t queryCount) uint32_t queryCount)
{ {
PROFILESTART(rpi_vkCmdResetQueryPool); PROFILESTART(RPIFUNC(vkCmdResetQueryPool));
//TODO //TODO
PROFILEEND(rpi_vkCmdResetQueryPool); PROFILEEND(RPIFUNC(vkCmdResetQueryPool));
} }
VKAPI_ATTR void VKAPI_CALL rpi_vkDestroyQueryPool( VKAPI_ATTR void VKAPI_CALL RPIFUNC(vkDestroyQueryPool)(
VkDevice device, VkDevice device,
VkQueryPool queryPool, VkQueryPool queryPool,
const VkAllocationCallbacks* pAllocator) const VkAllocationCallbacks* pAllocator)
{ {
PROFILESTART(rpi_vkDestroyQueryPool); PROFILESTART(RPIFUNC(vkDestroyQueryPool));
assert(device); assert(device);
assert(queryPool); assert(queryPool);
@ -107,15 +109,15 @@ VKAPI_ATTR void VKAPI_CALL rpi_vkDestroyQueryPool(
FREE(qp->queryPool); FREE(qp->queryPool);
PROFILEEND(rpi_vkDestroyQueryPool); PROFILEEND(RPIFUNC(vkDestroyQueryPool));
} }
VKAPI_ATTR void VKAPI_CALL rpi_vkCmdEndQuery( VKAPI_ATTR void VKAPI_CALL RPIFUNC(vkCmdEndQuery)(
VkCommandBuffer commandBuffer, VkCommandBuffer commandBuffer,
VkQueryPool queryPool, VkQueryPool queryPool,
uint32_t query) uint32_t query)
{ {
PROFILESTART(rpi_vkCmdEndQuery); PROFILESTART(RPIFUNC(vkCmdEndQuery));
assert(commandBuffer); assert(commandBuffer);
assert(queryPool); assert(queryPool);
@ -124,16 +126,16 @@ VKAPI_ATTR void VKAPI_CALL rpi_vkCmdEndQuery(
cmdBuf->perfmonID = 0; cmdBuf->perfmonID = 0;
PROFILEEND(rpi_vkCmdEndQuery); PROFILEEND(RPIFUNC(vkCmdEndQuery));
} }
VKAPI_ATTR void VKAPI_CALL rpi_vkCmdBeginQuery( VKAPI_ATTR void VKAPI_CALL RPIFUNC(vkCmdBeginQuery)(
VkCommandBuffer commandBuffer, VkCommandBuffer commandBuffer,
VkQueryPool queryPool, VkQueryPool queryPool,
uint32_t query, uint32_t query,
VkQueryControlFlags flags) VkQueryControlFlags flags)
{ {
PROFILESTART(rpi_vkCmdBeginQuery); PROFILESTART(RPIFUNC(vkCmdBeginQuery));
assert(commandBuffer); assert(commandBuffer);
assert(queryPool); assert(queryPool);
@ -147,10 +149,10 @@ VKAPI_ATTR void VKAPI_CALL rpi_vkCmdBeginQuery(
//pass id will select the perfmon at submit //pass id will select the perfmon at submit
cmdBuf->perfmonID = qp->queryPool[query].perfmonIDs; cmdBuf->perfmonID = qp->queryPool[query].perfmonIDs;
PROFILEEND(rpi_vkCmdBeginQuery); PROFILEEND(RPIFUNC(vkCmdBeginQuery));
} }
VKAPI_ATTR void VKAPI_CALL rpi_vkCmdCopyQueryPoolResults( VKAPI_ATTR void VKAPI_CALL RPIFUNC(vkCmdCopyQueryPoolResults)(
VkCommandBuffer commandBuffer, VkCommandBuffer commandBuffer,
VkQueryPool queryPool, VkQueryPool queryPool,
uint32_t firstQuery, uint32_t firstQuery,
@ -160,14 +162,14 @@ VKAPI_ATTR void VKAPI_CALL rpi_vkCmdCopyQueryPoolResults(
VkDeviceSize stride, VkDeviceSize stride,
VkQueryResultFlags flags) VkQueryResultFlags flags)
{ {
PROFILESTART(rpi_vkCmdCopyQueryPoolResults); PROFILESTART(RPIFUNC(vkCmdCopyQueryPoolResults));
//TODO //TODO
PROFILEEND(rpi_vkCmdCopyQueryPoolResults); PROFILEEND(RPIFUNC(vkCmdCopyQueryPoolResults));
} }
VKAPI_ATTR VkResult VKAPI_CALL rpi_vkGetQueryPoolResults( VKAPI_ATTR VkResult VKAPI_CALL RPIFUNC(vkGetQueryPoolResults)(
VkDevice device, VkDevice device,
VkQueryPool queryPool, VkQueryPool queryPool,
uint32_t firstQuery, uint32_t firstQuery,
@ -177,7 +179,7 @@ VKAPI_ATTR VkResult VKAPI_CALL rpi_vkGetQueryPoolResults(
VkDeviceSize stride, VkDeviceSize stride,
VkQueryResultFlags flags) VkQueryResultFlags flags)
{ {
PROFILESTART(rpi_vkGetQueryPoolResults); PROFILESTART(RPIFUNC(vkGetQueryPoolResults));
assert(device); assert(device);
assert(queryPool); assert(queryPool);
@ -202,11 +204,11 @@ VKAPI_ATTR VkResult VKAPI_CALL rpi_vkGetQueryPoolResults(
} }
} }
PROFILEEND(rpi_vkGetQueryPoolResults); PROFILEEND(RPIFUNC(vkGetQueryPoolResults));
return VK_SUCCESS; return VK_SUCCESS;
} }
VKAPI_ATTR void VKAPI_CALL rpi_vkCmdWriteTimestamp( VKAPI_ATTR void VKAPI_CALL RPIFUNC(vkCmdWriteTimestamp)(
VkCommandBuffer commandBuffer, VkCommandBuffer commandBuffer,
VkPipelineStageFlagBits pipelineStage, VkPipelineStageFlagBits pipelineStage,
VkQueryPool queryPool, VkQueryPool queryPool,

View File

@ -1,13 +1,15 @@
#include "common.h" #include "common.h"
#include "declarations.h"
#include "kernel/vc4_packet.h" #include "kernel/vc4_packet.h"
/* /*
* https://www.khronos.org/registry/vulkan/specs/1.1-extensions/html/vkspec.html#vkCmdBeginRenderPass * https://www.khronos.org/registry/vulkan/specs/1.1-extensions/html/vkspec.html#vkCmdBeginRenderPass
*/ */
void rpi_vkCmdBeginRenderPass(VkCommandBuffer commandBuffer, const VkRenderPassBeginInfo* pRenderPassBegin, VkSubpassContents contents) void RPIFUNC(vkCmdBeginRenderPass)(VkCommandBuffer commandBuffer, const VkRenderPassBeginInfo* pRenderPassBegin, VkSubpassContents contents)
{ {
PROFILESTART(rpi_vkCmdBeginRenderPass); PROFILESTART(RPIFUNC(vkCmdBeginRenderPass));
assert(commandBuffer); assert(commandBuffer);
assert(pRenderPassBegin); assert(pRenderPassBegin);
@ -286,15 +288,15 @@ void rpi_vkCmdBeginRenderPass(VkCommandBuffer commandBuffer, const VkRenderPassB
assert(((CLMarker*)getCPAptrFromOffset(cb->binCl.CPA, cb->binCl.currMarkerOffset))->memGuard == 0xDDDDDDDD); assert(((CLMarker*)getCPAptrFromOffset(cb->binCl.CPA, cb->binCl.currMarkerOffset))->memGuard == 0xDDDDDDDD);
PROFILEEND(rpi_vkCmdBeginRenderPass); PROFILEEND(RPIFUNC(vkCmdBeginRenderPass));
} }
/* /*
* https://www.khronos.org/registry/vulkan/specs/1.1-extensions/html/vkspec.html#vkCmdEndRenderPass * https://www.khronos.org/registry/vulkan/specs/1.1-extensions/html/vkspec.html#vkCmdEndRenderPass
*/ */
void rpi_vkCmdEndRenderPass(VkCommandBuffer commandBuffer) void RPIFUNC(vkCmdEndRenderPass)(VkCommandBuffer commandBuffer)
{ {
PROFILESTART(rpi_vkCmdEndRenderPass); PROFILESTART(RPIFUNC(vkCmdEndRenderPass));
assert(commandBuffer); assert(commandBuffer);
@ -316,15 +318,15 @@ void rpi_vkCmdEndRenderPass(VkCommandBuffer commandBuffer)
assert(((CLMarker*)getCPAptrFromOffset(cb->binCl.CPA, cb->binCl.currMarkerOffset))->memGuard == 0xDDDDDDDD); assert(((CLMarker*)getCPAptrFromOffset(cb->binCl.CPA, cb->binCl.currMarkerOffset))->memGuard == 0xDDDDDDDD);
PROFILEEND(rpi_vkCmdEndRenderPass); PROFILEEND(RPIFUNC(vkCmdEndRenderPass));
} }
/* /*
* https://www.khronos.org/registry/vulkan/specs/1.1-extensions/html/vkspec.html#vkCreateRenderPass * https://www.khronos.org/registry/vulkan/specs/1.1-extensions/html/vkspec.html#vkCreateRenderPass
*/ */
VkResult rpi_vkCreateRenderPass(VkDevice device, const VkRenderPassCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkRenderPass* pRenderPass) VkResult RPIFUNC(vkCreateRenderPass)(VkDevice device, const VkRenderPassCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkRenderPass* pRenderPass)
{ {
PROFILESTART(rpi_vkCreateRenderPass); PROFILESTART(RPIFUNC(vkCreateRenderPass));
assert(device); assert(device);
assert(pCreateInfo); assert(pCreateInfo);
@ -336,7 +338,7 @@ VkResult rpi_vkCreateRenderPass(VkDevice device, const VkRenderPassCreateInfo* p
_renderpass* rp = ALLOCATE(sizeof(_renderpass), 1, VK_SYSTEM_ALLOCATION_SCOPE_OBJECT); _renderpass* rp = ALLOCATE(sizeof(_renderpass), 1, VK_SYSTEM_ALLOCATION_SCOPE_OBJECT);
if(!rp) if(!rp)
{ {
PROFILEEND(rpi_vkCreateRenderPass); PROFILEEND(RPIFUNC(vkCreateRenderPass));
return VK_ERROR_OUT_OF_HOST_MEMORY; return VK_ERROR_OUT_OF_HOST_MEMORY;
} }
@ -344,7 +346,7 @@ VkResult rpi_vkCreateRenderPass(VkDevice device, const VkRenderPassCreateInfo* p
rp->attachments = ALLOCATE(sizeof(VkAttachmentDescription)*rp->numAttachments, 1, VK_SYSTEM_ALLOCATION_SCOPE_OBJECT); rp->attachments = ALLOCATE(sizeof(VkAttachmentDescription)*rp->numAttachments, 1, VK_SYSTEM_ALLOCATION_SCOPE_OBJECT);
if(!rp->attachments) if(!rp->attachments)
{ {
PROFILEEND(rpi_vkCreateRenderPass); PROFILEEND(RPIFUNC(vkCreateRenderPass));
return VK_ERROR_OUT_OF_HOST_MEMORY; return VK_ERROR_OUT_OF_HOST_MEMORY;
} }
@ -354,7 +356,7 @@ VkResult rpi_vkCreateRenderPass(VkDevice device, const VkRenderPassCreateInfo* p
rp->subpasses = ALLOCATE(sizeof(VkSubpassDescription)*rp->numSubpasses, 1, VK_SYSTEM_ALLOCATION_SCOPE_OBJECT); rp->subpasses = ALLOCATE(sizeof(VkSubpassDescription)*rp->numSubpasses, 1, VK_SYSTEM_ALLOCATION_SCOPE_OBJECT);
if(!rp->subpasses) if(!rp->subpasses)
{ {
PROFILEEND(rpi_vkCreateRenderPass); PROFILEEND(RPIFUNC(vkCreateRenderPass));
return VK_ERROR_OUT_OF_HOST_MEMORY; return VK_ERROR_OUT_OF_HOST_MEMORY;
} }
@ -371,7 +373,7 @@ VkResult rpi_vkCreateRenderPass(VkDevice device, const VkRenderPassCreateInfo* p
rp->subpasses[c].pInputAttachments = ALLOCATE(sizeof(VkAttachmentReference)*rp->subpasses[c].inputAttachmentCount, 1, VK_SYSTEM_ALLOCATION_SCOPE_OBJECT); rp->subpasses[c].pInputAttachments = ALLOCATE(sizeof(VkAttachmentReference)*rp->subpasses[c].inputAttachmentCount, 1, VK_SYSTEM_ALLOCATION_SCOPE_OBJECT);
if(!rp->subpasses[c].pInputAttachments) if(!rp->subpasses[c].pInputAttachments)
{ {
PROFILEEND(rpi_vkCreateRenderPass); PROFILEEND(RPIFUNC(vkCreateRenderPass));
return VK_ERROR_OUT_OF_HOST_MEMORY; return VK_ERROR_OUT_OF_HOST_MEMORY;
} }
@ -387,7 +389,7 @@ VkResult rpi_vkCreateRenderPass(VkDevice device, const VkRenderPassCreateInfo* p
rp->subpasses[c].pColorAttachments = ALLOCATE(sizeof(VkAttachmentReference)*rp->subpasses[c].colorAttachmentCount, 1, VK_SYSTEM_ALLOCATION_SCOPE_OBJECT); rp->subpasses[c].pColorAttachments = ALLOCATE(sizeof(VkAttachmentReference)*rp->subpasses[c].colorAttachmentCount, 1, VK_SYSTEM_ALLOCATION_SCOPE_OBJECT);
if(!rp->subpasses[c].pColorAttachments) if(!rp->subpasses[c].pColorAttachments)
{ {
PROFILEEND(rpi_vkCreateRenderPass); PROFILEEND(RPIFUNC(vkCreateRenderPass));
return VK_ERROR_OUT_OF_HOST_MEMORY; return VK_ERROR_OUT_OF_HOST_MEMORY;
} }
@ -403,7 +405,7 @@ VkResult rpi_vkCreateRenderPass(VkDevice device, const VkRenderPassCreateInfo* p
rp->subpasses[c].pResolveAttachments = ALLOCATE(sizeof(VkAttachmentReference)*rp->subpasses[c].colorAttachmentCount, 1, VK_SYSTEM_ALLOCATION_SCOPE_OBJECT); rp->subpasses[c].pResolveAttachments = ALLOCATE(sizeof(VkAttachmentReference)*rp->subpasses[c].colorAttachmentCount, 1, VK_SYSTEM_ALLOCATION_SCOPE_OBJECT);
if(!rp->subpasses[c].pResolveAttachments) if(!rp->subpasses[c].pResolveAttachments)
{ {
PROFILEEND(rpi_vkCreateRenderPass); PROFILEEND(RPIFUNC(vkCreateRenderPass));
return VK_ERROR_OUT_OF_HOST_MEMORY; return VK_ERROR_OUT_OF_HOST_MEMORY;
} }
@ -419,7 +421,7 @@ VkResult rpi_vkCreateRenderPass(VkDevice device, const VkRenderPassCreateInfo* p
rp->subpasses[c].pDepthStencilAttachment = ALLOCATE(sizeof(VkAttachmentReference), 1, VK_SYSTEM_ALLOCATION_SCOPE_OBJECT); rp->subpasses[c].pDepthStencilAttachment = ALLOCATE(sizeof(VkAttachmentReference), 1, VK_SYSTEM_ALLOCATION_SCOPE_OBJECT);
if(!rp->subpasses[c].pDepthStencilAttachment) if(!rp->subpasses[c].pDepthStencilAttachment)
{ {
PROFILEEND(rpi_vkCreateRenderPass); PROFILEEND(RPIFUNC(vkCreateRenderPass));
return VK_ERROR_OUT_OF_HOST_MEMORY; return VK_ERROR_OUT_OF_HOST_MEMORY;
} }
@ -435,7 +437,7 @@ VkResult rpi_vkCreateRenderPass(VkDevice device, const VkRenderPassCreateInfo* p
rp->subpasses[c].pPreserveAttachments = ALLOCATE(sizeof(uint32_t)*rp->subpasses[c].preserveAttachmentCount, 1, VK_SYSTEM_ALLOCATION_SCOPE_OBJECT); rp->subpasses[c].pPreserveAttachments = ALLOCATE(sizeof(uint32_t)*rp->subpasses[c].preserveAttachmentCount, 1, VK_SYSTEM_ALLOCATION_SCOPE_OBJECT);
if(!rp->subpasses[c].pPreserveAttachments) if(!rp->subpasses[c].pPreserveAttachments)
{ {
PROFILEEND(rpi_vkCreateRenderPass); PROFILEEND(RPIFUNC(vkCreateRenderPass));
return VK_ERROR_OUT_OF_HOST_MEMORY; return VK_ERROR_OUT_OF_HOST_MEMORY;
} }
@ -451,7 +453,7 @@ VkResult rpi_vkCreateRenderPass(VkDevice device, const VkRenderPassCreateInfo* p
rp->subpassDependencies = ALLOCATE(sizeof(VkSubpassDependency)*rp->numSubpassDependencies, 1, VK_SYSTEM_ALLOCATION_SCOPE_OBJECT); rp->subpassDependencies = ALLOCATE(sizeof(VkSubpassDependency)*rp->numSubpassDependencies, 1, VK_SYSTEM_ALLOCATION_SCOPE_OBJECT);
if(!rp->subpassDependencies) if(!rp->subpassDependencies)
{ {
PROFILEEND(rpi_vkCreateRenderPass); PROFILEEND(RPIFUNC(vkCreateRenderPass));
return VK_ERROR_OUT_OF_HOST_MEMORY; return VK_ERROR_OUT_OF_HOST_MEMORY;
} }
@ -459,13 +461,13 @@ VkResult rpi_vkCreateRenderPass(VkDevice device, const VkRenderPassCreateInfo* p
*pRenderPass = rp; *pRenderPass = rp;
PROFILEEND(rpi_vkCreateRenderPass); PROFILEEND(RPIFUNC(vkCreateRenderPass));
return VK_SUCCESS; return VK_SUCCESS;
} }
void rpi_vkDestroyRenderPass(VkDevice device, VkRenderPass renderPass, const VkAllocationCallbacks* pAllocator) void RPIFUNC(vkDestroyRenderPass)(VkDevice device, VkRenderPass renderPass, const VkAllocationCallbacks* pAllocator)
{ {
PROFILESTART(rpi_vkDestroyRenderPass); PROFILESTART(RPIFUNC(vkDestroyRenderPass));
assert(device); assert(device);
@ -491,15 +493,15 @@ void rpi_vkDestroyRenderPass(VkDevice device, VkRenderPass renderPass, const VkA
FREE(rp); FREE(rp);
} }
PROFILEEND(rpi_vkDestroyRenderPass); PROFILEEND(RPIFUNC(vkDestroyRenderPass));
} }
/* /*
* https://www.khronos.org/registry/vulkan/specs/1.1-extensions/html/vkspec.html#vkCreateFramebuffer * https://www.khronos.org/registry/vulkan/specs/1.1-extensions/html/vkspec.html#vkCreateFramebuffer
*/ */
VkResult rpi_vkCreateFramebuffer(VkDevice device, const VkFramebufferCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkFramebuffer* pFramebuffer) VkResult RPIFUNC(vkCreateFramebuffer)(VkDevice device, const VkFramebufferCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkFramebuffer* pFramebuffer)
{ {
PROFILESTART(rpi_vkCreateFramebuffer); PROFILESTART(RPIFUNC(vkCreateFramebuffer));
assert(device); assert(device);
assert(pCreateInfo); assert(pCreateInfo);
@ -509,7 +511,7 @@ VkResult rpi_vkCreateFramebuffer(VkDevice device, const VkFramebufferCreateInfo*
if(!fb) if(!fb)
{ {
PROFILEEND(rpi_vkCreateFramebuffer); PROFILEEND(RPIFUNC(vkCreateFramebuffer));
return VK_ERROR_OUT_OF_HOST_MEMORY; return VK_ERROR_OUT_OF_HOST_MEMORY;
} }
@ -520,7 +522,7 @@ VkResult rpi_vkCreateFramebuffer(VkDevice device, const VkFramebufferCreateInfo*
if(!fb->attachmentViews) if(!fb->attachmentViews)
{ {
PROFILEEND(rpi_vkCreateFramebuffer); PROFILEEND(RPIFUNC(vkCreateFramebuffer));
return VK_ERROR_OUT_OF_HOST_MEMORY; return VK_ERROR_OUT_OF_HOST_MEMORY;
} }
@ -535,13 +537,13 @@ VkResult rpi_vkCreateFramebuffer(VkDevice device, const VkFramebufferCreateInfo*
*pFramebuffer = fb; *pFramebuffer = fb;
PROFILEEND(rpi_vkCreateFramebuffer); PROFILEEND(RPIFUNC(vkCreateFramebuffer));
return VK_SUCCESS; return VK_SUCCESS;
} }
void rpi_vkDestroyFramebuffer(VkDevice device, VkFramebuffer framebuffer, const VkAllocationCallbacks* pAllocator) void RPIFUNC(vkDestroyFramebuffer)(VkDevice device, VkFramebuffer framebuffer, const VkAllocationCallbacks* pAllocator)
{ {
PROFILESTART(rpi_vkDestroyFramebuffer); PROFILESTART(RPIFUNC(vkDestroyFramebuffer));
assert(device); assert(device);
@ -552,17 +554,17 @@ void rpi_vkDestroyFramebuffer(VkDevice device, VkFramebuffer framebuffer, const
FREE(fb); FREE(fb);
} }
PROFILEEND(rpi_vkDestroyFramebuffer); PROFILEEND(RPIFUNC(vkDestroyFramebuffer));
} }
/* /*
* https://www.khronos.org/registry/vulkan/specs/1.1-extensions/html/vkspec.html#vkCmdNextSubpass * https://www.khronos.org/registry/vulkan/specs/1.1-extensions/html/vkspec.html#vkCmdNextSubpass
*/ */
VKAPI_ATTR void VKAPI_CALL rpi_vkCmdNextSubpass( VKAPI_ATTR void VKAPI_CALL RPIFUNC(vkCmdNextSubpass)(
VkCommandBuffer commandBuffer, VkCommandBuffer commandBuffer,
VkSubpassContents contents) VkSubpassContents contents)
{ {
PROFILESTART(rpi_vkCmdNextSubpass); PROFILESTART(RPIFUNC(vkCmdNextSubpass));
assert(commandBuffer); assert(commandBuffer);
@ -571,18 +573,18 @@ VKAPI_ATTR void VKAPI_CALL rpi_vkCmdNextSubpass(
_commandBuffer* cb = commandBuffer; _commandBuffer* cb = commandBuffer;
//cb->currentSubpass++; //TODO check max subpass? //cb->currentSubpass++; //TODO check max subpass?
PROFILEEND(rpi_vkCmdNextSubpass); PROFILEEND(RPIFUNC(vkCmdNextSubpass));
} }
/* /*
* https://www.khronos.org/registry/vulkan/specs/1.1-extensions/html/vkspec.html#vkGetRenderAreaGranularity * https://www.khronos.org/registry/vulkan/specs/1.1-extensions/html/vkspec.html#vkGetRenderAreaGranularity
*/ */
VKAPI_ATTR void VKAPI_CALL rpi_vkGetRenderAreaGranularity( VKAPI_ATTR void VKAPI_CALL RPIFUNC(vkGetRenderAreaGranularity)(
VkDevice device, VkDevice device,
VkRenderPass renderPass, VkRenderPass renderPass,
VkExtent2D* pGranularity) VkExtent2D* pGranularity)
{ {
PROFILESTART(rpi_vkGetRenderAreaGranularity); PROFILESTART(RPIFUNC(vkGetRenderAreaGranularity));
assert(device); assert(device);
assert(renderPass); assert(renderPass);
@ -609,5 +611,5 @@ VKAPI_ATTR void VKAPI_CALL rpi_vkGetRenderAreaGranularity(
pGranularity->width = tileSizeW; pGranularity->width = tileSizeW;
pGranularity->height = tileSizeH; pGranularity->height = tileSizeH;
PROFILEEND(rpi_vkGetRenderAreaGranularity); PROFILEEND(RPIFUNC(vkGetRenderAreaGranularity));
} }

View File

@ -1,13 +1,15 @@
#include "common.h" #include "common.h"
#include "declarations.h"
#include "kernel/vc4_packet.h" #include "kernel/vc4_packet.h"
/* /*
* https://www.khronos.org/registry/vulkan/specs/1.1-extensions/html/vkspec.html#vkCreateImageView * https://www.khronos.org/registry/vulkan/specs/1.1-extensions/html/vkspec.html#vkCreateImageView
*/ */
VkResult rpi_vkCreateImageView(VkDevice device, const VkImageViewCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkImageView* pView) VkResult RPIFUNC(vkCreateImageView)(VkDevice device, const VkImageViewCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkImageView* pView)
{ {
PROFILESTART(rpi_vkCreateImageView); PROFILESTART(RPIFUNC(vkCreateImageView));
assert(device); assert(device);
assert(pCreateInfo); assert(pCreateInfo);
@ -17,7 +19,7 @@ VkResult rpi_vkCreateImageView(VkDevice device, const VkImageViewCreateInfo* pCr
if(!view) if(!view)
{ {
PROFILEEND(rpi_vkCreateImageView); PROFILEEND(RPIFUNC(vkCreateImageView));
return VK_ERROR_OUT_OF_HOST_MEMORY; return VK_ERROR_OUT_OF_HOST_MEMORY;
} }
@ -29,16 +31,16 @@ VkResult rpi_vkCreateImageView(VkDevice device, const VkImageViewCreateInfo* pCr
*pView = view; *pView = view;
PROFILEEND(rpi_vkCreateImageView); PROFILEEND(RPIFUNC(vkCreateImageView));
return VK_SUCCESS; return VK_SUCCESS;
} }
/* /*
* https://www.khronos.org/registry/vulkan/specs/1.1-extensions/html/vkspec.html#vkCreateBuffer * https://www.khronos.org/registry/vulkan/specs/1.1-extensions/html/vkspec.html#vkCreateBuffer
*/ */
VkResult rpi_vkCreateBuffer(VkDevice device, const VkBufferCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkBuffer* pBuffer) VkResult RPIFUNC(vkCreateBuffer)(VkDevice device, const VkBufferCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkBuffer* pBuffer)
{ {
PROFILESTART(rpi_vkCreateBuffer); PROFILESTART(RPIFUNC(vkCreateBuffer));
assert(device); assert(device);
assert(pCreateInfo); assert(pCreateInfo);
@ -47,7 +49,7 @@ VkResult rpi_vkCreateBuffer(VkDevice device, const VkBufferCreateInfo* pCreateIn
_buffer* buf = ALLOCATE(sizeof(_buffer), 1, VK_SYSTEM_ALLOCATION_SCOPE_OBJECT); _buffer* buf = ALLOCATE(sizeof(_buffer), 1, VK_SYSTEM_ALLOCATION_SCOPE_OBJECT);
if(!buf) if(!buf)
{ {
PROFILEEND(rpi_vkCreateBuffer); PROFILEEND(RPIFUNC(vkCreateBuffer));
return VK_ERROR_OUT_OF_HOST_MEMORY; return VK_ERROR_OUT_OF_HOST_MEMORY;
} }
@ -59,16 +61,16 @@ VkResult rpi_vkCreateBuffer(VkDevice device, const VkBufferCreateInfo* pCreateIn
*pBuffer = buf; *pBuffer = buf;
PROFILEEND(rpi_vkCreateBuffer); PROFILEEND(RPIFUNC(vkCreateBuffer));
return VK_SUCCESS; return VK_SUCCESS;
} }
/* /*
* https://www.khronos.org/registry/vulkan/specs/1.1-extensions/html/vkspec.html#vkGetBufferMemoryRequirements * https://www.khronos.org/registry/vulkan/specs/1.1-extensions/html/vkspec.html#vkGetBufferMemoryRequirements
*/ */
void rpi_vkGetBufferMemoryRequirements(VkDevice device, VkBuffer buffer, VkMemoryRequirements* pMemoryRequirements) void RPIFUNC(vkGetBufferMemoryRequirements)(VkDevice device, VkBuffer buffer, VkMemoryRequirements* pMemoryRequirements)
{ {
PROFILESTART(rpi_vkGetBufferMemoryRequirements); PROFILESTART(RPIFUNC(vkGetBufferMemoryRequirements));
assert(device); assert(device);
assert(buffer); assert(buffer);
@ -79,31 +81,31 @@ void rpi_vkGetBufferMemoryRequirements(VkDevice device, VkBuffer buffer, VkMemor
//there's only one memory type so that's gonna be it... //there's only one memory type so that's gonna be it...
pMemoryRequirements->memoryTypeBits = VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT | VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT | VK_MEMORY_PROPERTY_HOST_COHERENT_BIT; pMemoryRequirements->memoryTypeBits = VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT | VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT | VK_MEMORY_PROPERTY_HOST_COHERENT_BIT;
PROFILEEND(rpi_vkGetBufferMemoryRequirements); PROFILEEND(RPIFUNC(vkGetBufferMemoryRequirements));
} }
VKAPI_ATTR void VKAPI_CALL rpi_vkGetBufferMemoryRequirements2( VKAPI_ATTR void VKAPI_CALL RPIFUNC(vkGetBufferMemoryRequirements2)(
VkDevice device, VkDevice device,
const VkBufferMemoryRequirementsInfo2* pInfo, const VkBufferMemoryRequirementsInfo2* pInfo,
VkMemoryRequirements2* pMemoryRequirements) VkMemoryRequirements2* pMemoryRequirements)
{ {
PROFILESTART(rpi_vkGetBufferMemoryRequirements2); PROFILESTART(RPIFUNC(vkGetBufferMemoryRequirements2));
assert(device); assert(device);
assert(pInfo); assert(pInfo);
assert(pMemoryRequirements); assert(pMemoryRequirements);
rpi_vkGetBufferMemoryRequirements(device, pInfo->buffer, &pMemoryRequirements->memoryRequirements); RPIFUNC(vkGetBufferMemoryRequirements)(device, pInfo->buffer, &pMemoryRequirements->memoryRequirements);
PROFILEEND(rpi_vkGetBufferMemoryRequirements2); PROFILEEND(RPIFUNC(vkGetBufferMemoryRequirements2));
} }
/* /*
* https://www.khronos.org/registry/vulkan/specs/1.1-extensions/html/vkspec.html#vkBindBufferMemory * https://www.khronos.org/registry/vulkan/specs/1.1-extensions/html/vkspec.html#vkBindBufferMemory
*/ */
VkResult rpi_vkBindBufferMemory(VkDevice device, VkBuffer buffer, VkDeviceMemory memory, VkDeviceSize memoryOffset) VkResult RPIFUNC(vkBindBufferMemory)(VkDevice device, VkBuffer buffer, VkDeviceMemory memory, VkDeviceSize memoryOffset)
{ {
PROFILESTART(rpi_vkBindBufferMemory); PROFILESTART(RPIFUNC(vkBindBufferMemory));
assert(device); assert(device);
assert(buffer); assert(buffer);
@ -120,13 +122,13 @@ VkResult rpi_vkBindBufferMemory(VkDevice device, VkBuffer buffer, VkDeviceMemory
buf->boundMem = mem; buf->boundMem = mem;
buf->boundOffset = memoryOffset; buf->boundOffset = memoryOffset;
PROFILEEND(rpi_vkBindBufferMemory); PROFILEEND(RPIFUNC(vkBindBufferMemory));
return VK_SUCCESS; return VK_SUCCESS;
} }
void rpi_vkDestroyBuffer(VkDevice device, VkBuffer buffer, const VkAllocationCallbacks* pAllocator) void RPIFUNC(vkDestroyBuffer)(VkDevice device, VkBuffer buffer, const VkAllocationCallbacks* pAllocator)
{ {
PROFILESTART(rpi_vkDestroyBuffer); PROFILESTART(RPIFUNC(vkDestroyBuffer));
assert(device); assert(device);
@ -136,12 +138,12 @@ void rpi_vkDestroyBuffer(VkDevice device, VkBuffer buffer, const VkAllocationCal
FREE(buf); FREE(buf);
} }
PROFILEEND(rpi_vkDestroyBuffer); PROFILEEND(RPIFUNC(vkDestroyBuffer));
} }
void rpi_vkDestroyImageView(VkDevice device, VkImageView imageView, const VkAllocationCallbacks* pAllocator) void RPIFUNC(vkDestroyImageView)(VkDevice device, VkImageView imageView, const VkAllocationCallbacks* pAllocator)
{ {
PROFILESTART(rpi_vkDestroyImageView); PROFILESTART(RPIFUNC(vkDestroyImageView));
assert(device); assert(device);
@ -151,20 +153,20 @@ void rpi_vkDestroyImageView(VkDevice device, VkImageView imageView, const VkAllo
FREE(view); FREE(view);
} }
PROFILEEND(rpi_vkDestroyImageView); PROFILEEND(RPIFUNC(vkDestroyImageView));
} }
/* /*
* https://www.khronos.org/registry/vulkan/specs/1.1-extensions/html/vkspec.html#vkCreateBufferView * https://www.khronos.org/registry/vulkan/specs/1.1-extensions/html/vkspec.html#vkCreateBufferView
*/ */
VKAPI_ATTR VkResult VKAPI_CALL rpi_vkCreateBufferView( VKAPI_ATTR VkResult VKAPI_CALL RPIFUNC(vkCreateBufferView)(
VkDevice device, VkDevice device,
const VkBufferViewCreateInfo* pCreateInfo, const VkBufferViewCreateInfo* pCreateInfo,
const VkAllocationCallbacks* pAllocator, const VkAllocationCallbacks* pAllocator,
VkBufferView* pView) VkBufferView* pView)
{ {
PROFILESTART(rpi_vkCreateBufferView); PROFILESTART(RPIFUNC(vkCreateBufferView));
assert(device); assert(device);
assert(pCreateInfo); assert(pCreateInfo);
@ -174,7 +176,7 @@ VKAPI_ATTR VkResult VKAPI_CALL rpi_vkCreateBufferView(
if(!bv) if(!bv)
{ {
PROFILEEND(rpi_vkCreateBufferView); PROFILEEND(RPIFUNC(vkCreateBufferView));
return VK_ERROR_OUT_OF_HOST_MEMORY; return VK_ERROR_OUT_OF_HOST_MEMORY;
} }
@ -185,19 +187,19 @@ VKAPI_ATTR VkResult VKAPI_CALL rpi_vkCreateBufferView(
*pView = bv; *pView = bv;
PROFILEEND(rpi_vkCreateBufferView); PROFILEEND(RPIFUNC(vkCreateBufferView));
return VK_SUCCESS; return VK_SUCCESS;
} }
/* /*
* https://www.khronos.org/registry/vulkan/specs/1.1-extensions/html/vkspec.html#vkDestroyBufferView * https://www.khronos.org/registry/vulkan/specs/1.1-extensions/html/vkspec.html#vkDestroyBufferView
*/ */
VKAPI_ATTR void VKAPI_CALL rpi_vkDestroyBufferView( VKAPI_ATTR void VKAPI_CALL RPIFUNC(vkDestroyBufferView)(
VkDevice device, VkDevice device,
VkBufferView bufferView, VkBufferView bufferView,
const VkAllocationCallbacks* pAllocator) const VkAllocationCallbacks* pAllocator)
{ {
PROFILESTART(rpi_vkDestroyBufferView); PROFILESTART(RPIFUNC(vkDestroyBufferView));
assert(device); assert(device);
@ -207,19 +209,19 @@ VKAPI_ATTR void VKAPI_CALL rpi_vkDestroyBufferView(
FREE(bv); FREE(bv);
} }
PROFILEEND(rpi_vkDestroyBufferView); PROFILEEND(RPIFUNC(vkDestroyBufferView));
} }
/* /*
* https://www.khronos.org/registry/vulkan/specs/1.1-extensions/html/vkspec.html#vkCreateImage * https://www.khronos.org/registry/vulkan/specs/1.1-extensions/html/vkspec.html#vkCreateImage
*/ */
VKAPI_ATTR VkResult VKAPI_CALL rpi_vkCreateImage( VKAPI_ATTR VkResult VKAPI_CALL RPIFUNC(vkCreateImage)(
VkDevice device, VkDevice device,
const VkImageCreateInfo* pCreateInfo, const VkImageCreateInfo* pCreateInfo,
const VkAllocationCallbacks* pAllocator, const VkAllocationCallbacks* pAllocator,
VkImage* pImage) VkImage* pImage)
{ {
PROFILESTART(rpi_vkCreateImage); PROFILESTART(RPIFUNC(vkCreateImage));
assert(device); assert(device);
assert(pCreateInfo); assert(pCreateInfo);
@ -228,7 +230,7 @@ VKAPI_ATTR VkResult VKAPI_CALL rpi_vkCreateImage(
_image* i = ALLOCATE(sizeof(_image), 1, VK_SYSTEM_ALLOCATION_SCOPE_OBJECT); _image* i = ALLOCATE(sizeof(_image), 1, VK_SYSTEM_ALLOCATION_SCOPE_OBJECT);
if(!i) if(!i)
{ {
PROFILEEND(rpi_vkCreateImage); PROFILEEND(RPIFUNC(vkCreateImage));
return VK_ERROR_OUT_OF_HOST_MEMORY; return VK_ERROR_OUT_OF_HOST_MEMORY;
} }
@ -277,7 +279,7 @@ VKAPI_ATTR VkResult VKAPI_CALL rpi_vkCreateImage(
i->queueFamiliesWithAccess = ALLOCATE(sizeof(uint32_t) * i->numQueueFamiliesWithAccess, 1, VK_SYSTEM_ALLOCATION_SCOPE_OBJECT); i->queueFamiliesWithAccess = ALLOCATE(sizeof(uint32_t) * i->numQueueFamiliesWithAccess, 1, VK_SYSTEM_ALLOCATION_SCOPE_OBJECT);
if(!i->queueFamiliesWithAccess) if(!i->queueFamiliesWithAccess)
{ {
PROFILEEND(rpi_vkCreateImage); PROFILEEND(RPIFUNC(vkCreateImage));
return VK_ERROR_OUT_OF_HOST_MEMORY; return VK_ERROR_OUT_OF_HOST_MEMORY;
} }
memcpy(i->queueFamiliesWithAccess, pCreateInfo->pQueueFamilyIndices, sizeof(uint32_t) * i->numQueueFamiliesWithAccess); memcpy(i->queueFamiliesWithAccess, pCreateInfo->pQueueFamilyIndices, sizeof(uint32_t) * i->numQueueFamiliesWithAccess);
@ -290,19 +292,19 @@ VKAPI_ATTR VkResult VKAPI_CALL rpi_vkCreateImage(
*pImage = i; *pImage = i;
PROFILEEND(rpi_vkCreateImage); PROFILEEND(RPIFUNC(vkCreateImage));
return VK_SUCCESS; return VK_SUCCESS;
} }
/* /*
* https://www.khronos.org/registry/vulkan/specs/1.1-extensions/html/vkspec.html#vkDestroyImage * https://www.khronos.org/registry/vulkan/specs/1.1-extensions/html/vkspec.html#vkDestroyImage
*/ */
VKAPI_ATTR void VKAPI_CALL rpi_vkDestroyImage( VKAPI_ATTR void VKAPI_CALL RPIFUNC(vkDestroyImage)(
VkDevice device, VkDevice device,
VkImage image, VkImage image,
const VkAllocationCallbacks* pAllocator) const VkAllocationCallbacks* pAllocator)
{ {
PROFILESTART(rpi_vkDestroyImage); PROFILESTART(RPIFUNC(vkDestroyImage));
assert(device); assert(device);
@ -317,18 +319,18 @@ VKAPI_ATTR void VKAPI_CALL rpi_vkDestroyImage(
FREE(i); FREE(i);
} }
PROFILEEND(rpi_vkDestroyImage); PROFILEEND(RPIFUNC(vkDestroyImage));
} }
/* /*
* https://www.khronos.org/registry/vulkan/specs/1.1-extensions/html/vkspec.html#vkGetImageMemoryRequirements * https://www.khronos.org/registry/vulkan/specs/1.1-extensions/html/vkspec.html#vkGetImageMemoryRequirements
*/ */
VKAPI_ATTR void VKAPI_CALL rpi_vkGetImageMemoryRequirements( VKAPI_ATTR void VKAPI_CALL RPIFUNC(vkGetImageMemoryRequirements)(
VkDevice device, VkDevice device,
VkImage image, VkImage image,
VkMemoryRequirements* pMemoryRequirements) VkMemoryRequirements* pMemoryRequirements)
{ {
PROFILESTART(rpi_vkGetImageMemoryRequirements); PROFILESTART(RPIFUNC(vkGetImageMemoryRequirements));
assert(device); assert(device);
assert(image); assert(image);
@ -425,19 +427,19 @@ VKAPI_ATTR void VKAPI_CALL rpi_vkGetImageMemoryRequirements(
pMemoryRequirements->memoryTypeBits = memoryTypes[0].propertyFlags; //TODO pMemoryRequirements->memoryTypeBits = memoryTypes[0].propertyFlags; //TODO
pMemoryRequirements->size = i->size; pMemoryRequirements->size = i->size;
PROFILEEND(rpi_vkGetImageMemoryRequirements); PROFILEEND(RPIFUNC(vkGetImageMemoryRequirements));
} }
/* /*
* https://www.khronos.org/registry/vulkan/specs/1.1-extensions/html/vkspec.html#vkBindImageMemory * https://www.khronos.org/registry/vulkan/specs/1.1-extensions/html/vkspec.html#vkBindImageMemory
*/ */
VKAPI_ATTR VkResult VKAPI_CALL rpi_vkBindImageMemory( VKAPI_ATTR VkResult VKAPI_CALL RPIFUNC(vkBindImageMemory)(
VkDevice device, VkDevice device,
VkImage image, VkImage image,
VkDeviceMemory memory, VkDeviceMemory memory,
VkDeviceSize memoryOffset) VkDeviceSize memoryOffset)
{ {
PROFILESTART(rpi_vkBindImageMemory); PROFILESTART(RPIFUNC(vkBindImageMemory));
assert(device); assert(device);
assert(image); assert(image);
@ -464,16 +466,16 @@ VKAPI_ATTR VkResult VKAPI_CALL rpi_vkBindImageMemory(
int ret = vc4_bo_set_tiling(controlFd, i->boundMem->bo, DRM_FORMAT_MOD_BROADCOM_VC4_T_TILED); assert(ret); int ret = vc4_bo_set_tiling(controlFd, i->boundMem->bo, DRM_FORMAT_MOD_BROADCOM_VC4_T_TILED); assert(ret);
} }
PROFILEEND(rpi_vkBindImageMemory); PROFILEEND(RPIFUNC(vkBindImageMemory));
return VK_SUCCESS; return VK_SUCCESS;
} }
VKAPI_ATTR VkResult VKAPI_CALL rpi_vkBindBufferMemory2( VKAPI_ATTR VkResult VKAPI_CALL RPIFUNC(vkBindBufferMemory2)(
VkDevice device, VkDevice device,
uint32_t bindInfoCount, uint32_t bindInfoCount,
const VkBindBufferMemoryInfo* pBindInfos) const VkBindBufferMemoryInfo* pBindInfos)
{ {
PROFILESTART(rpi_vkBindBufferMemory2); PROFILESTART(RPIFUNC(vkBindBufferMemory2));
assert(device); assert(device);
assert(pBindInfos); assert(pBindInfos);
@ -482,38 +484,38 @@ VKAPI_ATTR VkResult VKAPI_CALL rpi_vkBindBufferMemory2(
for(uint32_t c = 0; c < bindInfoCount; ++c) for(uint32_t c = 0; c < bindInfoCount; ++c)
{ {
VkResult res = rpi_vkBindBufferMemory(device, pBindInfos[c].buffer, pBindInfos[c].memory, pBindInfos[c].memoryOffset); VkResult res = RPIFUNC(vkBindBufferMemory)(device, pBindInfos[c].buffer, pBindInfos[c].memory, pBindInfos[c].memoryOffset);
if(res != VK_SUCCESS) if(res != VK_SUCCESS)
{ {
ret = res; ret = res;
} }
} }
PROFILEEND(rpi_vkBindBufferMemory2); PROFILEEND(RPIFUNC(vkBindBufferMemory2));
return ret; return ret;
} }
VKAPI_ATTR void VKAPI_CALL rpi_vkGetImageMemoryRequirements2( VKAPI_ATTR void VKAPI_CALL RPIFUNC(vkGetImageMemoryRequirements2)(
VkDevice device, VkDevice device,
const VkImageMemoryRequirementsInfo2* pInfo, const VkImageMemoryRequirementsInfo2* pInfo,
VkMemoryRequirements2* pMemoryRequirements) VkMemoryRequirements2* pMemoryRequirements)
{ {
PROFILESTART(rpi_vkGetImageMemoryRequirements2); PROFILESTART(RPIFUNC(vkGetImageMemoryRequirements2));
assert(device); assert(device);
assert(pInfo); assert(pInfo);
assert(pMemoryRequirements); assert(pMemoryRequirements);
rpi_vkGetImageMemoryRequirements(device, pInfo->image, pMemoryRequirements); RPIFUNC(vkGetImageMemoryRequirements)(device, pInfo->image, pMemoryRequirements);
PROFILEEND(rpi_vkGetImageMemoryRequirements2); PROFILEEND(RPIFUNC(vkGetImageMemoryRequirements2));
} }
VKAPI_ATTR VkResult VKAPI_CALL rpi_vkBindImageMemory2( VKAPI_ATTR VkResult VKAPI_CALL RPIFUNC(vkBindImageMemory2)(
VkDevice device, VkDevice device,
uint32_t bindInfoCount, uint32_t bindInfoCount,
const VkBindImageMemoryInfo* pBindInfos) const VkBindImageMemoryInfo* pBindInfos)
{ {
PROFILESTART(rpi_vkBindImageMemory2); PROFILESTART(RPIFUNC(vkBindImageMemory2));
assert(device); assert(device);
assert(pBindInfos); assert(pBindInfos);
@ -522,18 +524,18 @@ VKAPI_ATTR VkResult VKAPI_CALL rpi_vkBindImageMemory2(
for(uint32_t c = 0; c < bindInfoCount; ++c) for(uint32_t c = 0; c < bindInfoCount; ++c)
{ {
VkResult res = rpi_vkBindImageMemory(device, pBindInfos[c].image, pBindInfos[c].memory, pBindInfos[c].memoryOffset); VkResult res = RPIFUNC(vkBindImageMemory)(device, pBindInfos[c].image, pBindInfos[c].memory, pBindInfos[c].memoryOffset);
if(res != VK_SUCCESS) if(res != VK_SUCCESS)
{ {
ret = res; ret = res;
} }
} }
PROFILEEND(rpi_vkBindImageMemory2); PROFILEEND(RPIFUNC(vkBindImageMemory2));
return ret; return ret;
} }
VKAPI_ATTR void VKAPI_CALL rpi_vkCmdPushConstants( VKAPI_ATTR void VKAPI_CALL RPIFUNC(vkCmdPushConstants)(
VkCommandBuffer commandBuffer, VkCommandBuffer commandBuffer,
VkPipelineLayout layout, VkPipelineLayout layout,
VkShaderStageFlags stageFlags, VkShaderStageFlags stageFlags,
@ -541,7 +543,7 @@ VKAPI_ATTR void VKAPI_CALL rpi_vkCmdPushConstants(
uint32_t size, uint32_t size,
const void* pValues) const void* pValues)
{ {
PROFILESTART(rpi_vkCmdPushConstants); PROFILESTART(RPIFUNC(vkCmdPushConstants));
assert(commandBuffer); assert(commandBuffer);
assert(layout); assert(layout);
@ -561,18 +563,18 @@ VKAPI_ATTR void VKAPI_CALL rpi_vkCmdPushConstants(
cb->pushConstantDirty = 1; cb->pushConstantDirty = 1;
PROFILEEND(rpi_vkCmdPushConstants); PROFILEEND(RPIFUNC(vkCmdPushConstants));
} }
VKAPI_ATTR void VKAPI_CALL rpi_vkGetImageSubresourceLayout( VKAPI_ATTR void VKAPI_CALL RPIFUNC(vkGetImageSubresourceLayout)(
VkDevice device, VkDevice device,
VkImage image, VkImage image,
const VkImageSubresource* pSubresource, const VkImageSubresource* pSubresource,
VkSubresourceLayout* pLayout) VkSubresourceLayout* pLayout)
{ {
PROFILESTART(rpi_vkGetImageSubresourceLayout); PROFILESTART(RPIFUNC(vkGetImageSubresourceLayout));
//TODO //TODO
PROFILEEND(rpi_vkGetImageSubresourceLayout); PROFILEEND(RPIFUNC(vkGetImageSubresourceLayout));
} }

View File

@ -1,12 +1,14 @@
#include "common.h" #include "common.h"
VKAPI_ATTR VkResult VKAPI_CALL rpi_vkCreateSampler( #include "declarations.h"
VKAPI_ATTR VkResult VKAPI_CALL RPIFUNC(vkCreateSampler)(
VkDevice device, VkDevice device,
const VkSamplerCreateInfo* pCreateInfo, const VkSamplerCreateInfo* pCreateInfo,
const VkAllocationCallbacks* pAllocator, const VkAllocationCallbacks* pAllocator,
VkSampler* pSampler) VkSampler* pSampler)
{ {
PROFILESTART(rpi_vkCreateSampler); PROFILESTART(RPIFUNC(vkCreateSampler));
assert(device); assert(device);
assert(pCreateInfo); assert(pCreateInfo);
@ -16,7 +18,7 @@ VKAPI_ATTR VkResult VKAPI_CALL rpi_vkCreateSampler(
if(!s) if(!s)
{ {
PROFILEEND(rpi_vkCreateSampler); PROFILEEND(RPIFUNC(vkCreateSampler));
return VK_ERROR_OUT_OF_HOST_MEMORY; return VK_ERROR_OUT_OF_HOST_MEMORY;
} }
@ -39,46 +41,46 @@ VKAPI_ATTR VkResult VKAPI_CALL rpi_vkCreateSampler(
*pSampler = s; *pSampler = s;
PROFILEEND(rpi_vkCreateSampler); PROFILEEND(RPIFUNC(vkCreateSampler));
return VK_SUCCESS; return VK_SUCCESS;
} }
VKAPI_ATTR void VKAPI_CALL rpi_vkDestroySampler( VKAPI_ATTR void VKAPI_CALL RPIFUNC(vkDestroySampler)(
VkDevice device, VkDevice device,
VkSampler sampler, VkSampler sampler,
const VkAllocationCallbacks* pAllocator) const VkAllocationCallbacks* pAllocator)
{ {
PROFILESTART(rpi_vkDestroySampler); PROFILESTART(RPIFUNC(vkDestroySampler));
assert(device); assert(device);
FREE(sampler); FREE(sampler);
PROFILEEND(rpi_vkDestroySampler); PROFILEEND(RPIFUNC(vkDestroySampler));
} }
VKAPI_ATTR VkResult VKAPI_CALL rpi_vkCreateSamplerYcbcrConversion( VKAPI_ATTR VkResult VKAPI_CALL RPIFUNC(vkCreateSamplerYcbcrConversion)(
VkDevice device, VkDevice device,
const VkSamplerYcbcrConversionCreateInfo* pCreateInfo, const VkSamplerYcbcrConversionCreateInfo* pCreateInfo,
const VkAllocationCallbacks* pAllocator, const VkAllocationCallbacks* pAllocator,
VkSamplerYcbcrConversion* pYcbcrConversion) VkSamplerYcbcrConversion* pYcbcrConversion)
{ {
PROFILESTART(rpi_vkCreateSamplerYcbcrConversion); PROFILESTART(RPIFUNC(vkCreateSamplerYcbcrConversion));
//TODO //TODO
PROFILEEND(rpi_vkCreateSamplerYcbcrConversion); PROFILEEND(RPIFUNC(vkCreateSamplerYcbcrConversion));
return VK_SUCCESS; return VK_SUCCESS;
} }
VKAPI_ATTR void VKAPI_CALL rpi_vkDestroySamplerYcbcrConversion( VKAPI_ATTR void VKAPI_CALL RPIFUNC(vkDestroySamplerYcbcrConversion)(
VkDevice device, VkDevice device,
VkSamplerYcbcrConversion ycbcrConversion, VkSamplerYcbcrConversion ycbcrConversion,
const VkAllocationCallbacks* pAllocator) const VkAllocationCallbacks* pAllocator)
{ {
PROFILESTART(rpi_vkDestroySamplerYcbcrConversion); PROFILESTART(RPIFUNC(vkDestroySamplerYcbcrConversion));
//TODO //TODO
PROFILEEND(rpi_vkDestroySamplerYcbcrConversion); PROFILEEND(RPIFUNC(vkDestroySamplerYcbcrConversion));
} }

View File

@ -1,5 +1,7 @@
#include "common.h" #include "common.h"
#include "declarations.h"
#include "kernel/vc4_packet.h" #include "kernel/vc4_packet.h"
#include "QPUassembler/qpu_assembler.h" #include "QPUassembler/qpu_assembler.h"
@ -13,9 +15,9 @@
/* /*
* https://www.khronos.org/registry/vulkan/specs/1.1-extensions/html/vkspec.html#vkCreateShaderModule * https://www.khronos.org/registry/vulkan/specs/1.1-extensions/html/vkspec.html#vkCreateShaderModule
*/ */
VkResult rpi_vkCreateShaderModule(VkDevice device, const VkShaderModuleCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkShaderModule* pShaderModule) VkResult RPIFUNC(vkCreateShaderModule)(VkDevice device, const VkShaderModuleCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkShaderModule* pShaderModule)
{ {
PROFILESTART(rpi_vkCreateShaderModule); PROFILESTART(RPIFUNC(vkCreateShaderModule));
uint32_t magic = pCreateInfo->pCode[2]; uint32_t magic = pCreateInfo->pCode[2];
VkRpiShaderModuleAssemblyCreateInfoEXT* ci = pCreateInfo->pCode[4]; VkRpiShaderModuleAssemblyCreateInfoEXT* ci = pCreateInfo->pCode[4];
@ -23,7 +25,7 @@ VkResult rpi_vkCreateShaderModule(VkDevice device, const VkShaderModuleCreateInf
//shader magic doesn't add up //shader magic doesn't add up
if(magic != 0x14E45250) if(magic != 0x14E45250)
{ {
PROFILEEND(rpi_vkCreateShaderModule); PROFILEEND(RPIFUNC(vkCreateShaderModule));
return VK_ERROR_OUT_OF_HOST_MEMORY; return VK_ERROR_OUT_OF_HOST_MEMORY;
} }
@ -35,7 +37,7 @@ VkResult rpi_vkCreateShaderModule(VkDevice device, const VkShaderModuleCreateInf
if(!shader) if(!shader)
{ {
PROFILEEND(rpi_vkCreateShaderModule); PROFILEEND(RPIFUNC(vkCreateShaderModule));
return VK_ERROR_OUT_OF_HOST_MEMORY; return VK_ERROR_OUT_OF_HOST_MEMORY;
} }
@ -392,7 +394,7 @@ VkResult rpi_vkCreateShaderModule(VkDevice device, const VkShaderModuleCreateInf
if(!shader->mappings[c]) if(!shader->mappings[c])
{ {
PROFILEEND(rpi_vkCreateShaderModule); PROFILEEND(RPIFUNC(vkCreateShaderModule));
return VK_ERROR_OUT_OF_HOST_MEMORY; return VK_ERROR_OUT_OF_HOST_MEMORY;
} }
@ -410,13 +412,13 @@ VkResult rpi_vkCreateShaderModule(VkDevice device, const VkShaderModuleCreateInf
*pShaderModule = shader; *pShaderModule = shader;
PROFILEEND(rpi_vkCreateShaderModule); PROFILEEND(RPIFUNC(vkCreateShaderModule));
return VK_SUCCESS; return VK_SUCCESS;
} }
void rpi_vkDestroyShaderModule(VkDevice device, VkShaderModule shaderModule, const VkAllocationCallbacks* pAllocator) void RPIFUNC(vkDestroyShaderModule)(VkDevice device, VkShaderModule shaderModule, const VkAllocationCallbacks* pAllocator)
{ {
PROFILESTART(rpi_vkDestroyShaderModule); PROFILESTART(RPIFUNC(vkDestroyShaderModule));
assert(device); assert(device);
@ -440,5 +442,5 @@ void rpi_vkDestroyShaderModule(VkDevice device, VkShaderModule shaderModule, con
FREE(shader); FREE(shader);
} }
PROFILEEND(rpi_vkDestroyShaderModule); PROFILEEND(RPIFUNC(vkDestroyShaderModule));
} }

View File

@ -1,6 +1,8 @@
#include "common.h" #include "common.h"
VKAPI_ATTR void VKAPI_CALL rpi_vkGetPhysicalDeviceSparseImageFormatProperties( #include "declarations.h"
VKAPI_ATTR void VKAPI_CALL RPIFUNC(vkGetPhysicalDeviceSparseImageFormatProperties)(
VkPhysicalDevice physicalDevice, VkPhysicalDevice physicalDevice,
VkFormat format, VkFormat format,
VkImageType type, VkImageType type,
@ -13,7 +15,7 @@ VKAPI_ATTR void VKAPI_CALL rpi_vkGetPhysicalDeviceSparseImageFormatProperties(
UNSUPPORTED(vkGetPhysicalDeviceSparseImageFormatProperties); UNSUPPORTED(vkGetPhysicalDeviceSparseImageFormatProperties);
} }
VKAPI_ATTR void VKAPI_CALL rpi_vkGetImageSparseMemoryRequirements( VKAPI_ATTR void VKAPI_CALL RPIFUNC(vkGetImageSparseMemoryRequirements)(
VkDevice device, VkDevice device,
VkImage image, VkImage image,
uint32_t* pSparseMemoryRequirementCount, uint32_t* pSparseMemoryRequirementCount,
@ -22,7 +24,7 @@ VKAPI_ATTR void VKAPI_CALL rpi_vkGetImageSparseMemoryRequirements(
UNSUPPORTED(vkGetImageSparseMemoryRequirements); UNSUPPORTED(vkGetImageSparseMemoryRequirements);
} }
VKAPI_ATTR VkResult VKAPI_CALL rpi_vkQueueBindSparse( VKAPI_ATTR VkResult VKAPI_CALL RPIFUNC(vkQueueBindSparse)(
VkQueue queue, VkQueue queue,
uint32_t bindInfoCount, uint32_t bindInfoCount,
const VkBindSparseInfo* pBindInfo, const VkBindSparseInfo* pBindInfo,
@ -32,7 +34,7 @@ VKAPI_ATTR VkResult VKAPI_CALL rpi_vkQueueBindSparse(
return UNSUPPORTED_RETURN; return UNSUPPORTED_RETURN;
} }
VKAPI_ATTR void VKAPI_CALL rpi_vkGetPhysicalDeviceSparseImageFormatProperties2( VKAPI_ATTR void VKAPI_CALL RPIFUNC(vkGetPhysicalDeviceSparseImageFormatProperties2)(
VkPhysicalDevice physicalDevice, VkPhysicalDevice physicalDevice,
const VkPhysicalDeviceSparseImageFormatInfo2* pFormatInfo, const VkPhysicalDeviceSparseImageFormatInfo2* pFormatInfo,
uint32_t* pPropertyCount, uint32_t* pPropertyCount,
@ -41,7 +43,7 @@ VKAPI_ATTR void VKAPI_CALL rpi_vkGetPhysicalDeviceSparseImageFormatProperties2(
UNSUPPORTED(vkGetPhysicalDeviceSparseImageFormatProperties2); UNSUPPORTED(vkGetPhysicalDeviceSparseImageFormatProperties2);
} }
VKAPI_ATTR void VKAPI_CALL rpi_vkGetImageSparseMemoryRequirements2( VKAPI_ATTR void VKAPI_CALL RPIFUNC(vkGetImageSparseMemoryRequirements2)(
VkDevice device, VkDevice device,
const VkImageSparseMemoryRequirementsInfo2* pInfo, const VkImageSparseMemoryRequirementsInfo2* pInfo,
uint32_t* pSparseMemoryRequirementCount, uint32_t* pSparseMemoryRequirementCount,

View File

@ -258,7 +258,7 @@ void createClearShaderModule(VkDevice device, VkShaderModule* blitShaderModule,
smci.sType = VK_STRUCTURE_TYPE_SHADER_MODULE_CREATE_INFO; smci.sType = VK_STRUCTURE_TYPE_SHADER_MODULE_CREATE_INFO;
smci.codeSize = sizeof(uint32_t)*6; smci.codeSize = sizeof(uint32_t)*6;
smci.pCode = spirv; smci.pCode = spirv;
rpi_vkCreateShaderModule(device, &smci, 0, blitShaderModule); RPIFUNC(vkCreateShaderModule)(device, &smci, 0, blitShaderModule);
assert(*blitShaderModule); assert(*blitShaderModule);
{ //assemble fs code { //assemble fs code
@ -272,7 +272,7 @@ void createClearShaderModule(VkDevice device, VkShaderModule* blitShaderModule,
assert(asm_ptrs[2]); assert(asm_ptrs[2]);
} }
rpi_vkCreateShaderModule(device, &smci, 0, blitShaderModuleNoColor); RPIFUNC(vkCreateShaderModule)(device, &smci, 0, blitShaderModuleNoColor);
assert(*blitShaderModuleNoColor); assert(*blitShaderModuleNoColor);
for(uint32_t c = 0; c < 4; ++c) for(uint32_t c = 0; c < 4; ++c)
@ -356,7 +356,7 @@ void createClearPipeline(VkDevice device, VkPipelineDepthStencilStateCreateInfo*
pipelineLayoutCI.pSetLayouts = &blitDsl; pipelineLayoutCI.pSetLayouts = &blitDsl;
pipelineLayoutCI.pushConstantRangeCount = 2; pipelineLayoutCI.pushConstantRangeCount = 2;
pipelineLayoutCI.pPushConstantRanges = &pushConstantRanges[0]; pipelineLayoutCI.pPushConstantRanges = &pushConstantRanges[0];
rpi_vkCreatePipelineLayout(device, &pipelineLayoutCI, 0, blitPipelineLayout); RPIFUNC(vkCreatePipelineLayout)(device, &pipelineLayoutCI, 0, blitPipelineLayout);
VkDynamicState dynState = VK_DYNAMIC_STATE_VIEWPORT; VkDynamicState dynState = VK_DYNAMIC_STATE_VIEWPORT;
@ -386,7 +386,7 @@ void createClearPipeline(VkDevice device, VkPipelineDepthStencilStateCreateInfo*
pipelineInfo.pDepthStencilState = dsState; pipelineInfo.pDepthStencilState = dsState;
pipelineInfo.layout = *blitPipelineLayout; pipelineInfo.layout = *blitPipelineLayout;
VkResult res = rpi_vkCreateGraphicsPipelines(device, VK_NULL_HANDLE, 1, &pipelineInfo, NULL, blitPipeline); VkResult res = RPIFUNC(vkCreateGraphicsPipelines)(device, VK_NULL_HANDLE, 1, &pipelineInfo, NULL, blitPipeline);
} }
void createClearDescriptorSetLayouts(VkDevice device, VkDescriptorSetLayout* bufferDsl) void createClearDescriptorSetLayouts(VkDevice device, VkDescriptorSetLayout* bufferDsl)
@ -399,7 +399,7 @@ void createClearDescriptorSetLayouts(VkDevice device, VkDescriptorSetLayout* buf
descriptorLayoutCI.bindingCount = 0; descriptorLayoutCI.bindingCount = 0;
descriptorLayoutCI.pBindings = 0; descriptorLayoutCI.pBindings = 0;
rpi_vkCreateDescriptorSetLayout(device, &descriptorLayoutCI, 0, bufferDsl); RPIFUNC(vkCreateDescriptorSetLayout)(device, &descriptorLayoutCI, 0, bufferDsl);
} }
void setupClearEmulationResources(VkDevice device) void setupClearEmulationResources(VkDevice device)
@ -414,9 +414,9 @@ void setupClearEmulationResources(VkDevice device)
/* /*
* https://www.khronos.org/registry/vulkan/specs/1.1-extensions/html/vkspec.html#vkCmdSetViewport * https://www.khronos.org/registry/vulkan/specs/1.1-extensions/html/vkspec.html#vkCmdSetViewport
*/ */
void rpi_vkCmdSetViewport(VkCommandBuffer commandBuffer, uint32_t firstViewport, uint32_t viewportCount, const VkViewport* pViewports) void RPIFUNC(vkCmdSetViewport)(VkCommandBuffer commandBuffer, uint32_t firstViewport, uint32_t viewportCount, const VkViewport* pViewports)
{ {
PROFILESTART(rpi_vkCmdSetViewport); PROFILESTART(RPIFUNC(vkCmdSetViewport));
assert(commandBuffer); assert(commandBuffer);
assert(firstViewport == 0); assert(firstViewport == 0);
@ -430,15 +430,15 @@ void rpi_vkCmdSetViewport(VkCommandBuffer commandBuffer, uint32_t firstViewport,
cb->viewportDirty = 1; cb->viewportDirty = 1;
PROFILEEND(rpi_vkCmdSetViewport); PROFILEEND(RPIFUNC(vkCmdSetViewport));
} }
/* /*
* https://www.khronos.org/registry/vulkan/specs/1.1-extensions/html/vkspec.html#vkCmdSetScissor * https://www.khronos.org/registry/vulkan/specs/1.1-extensions/html/vkspec.html#vkCmdSetScissor
*/ */
void rpi_vkCmdSetScissor(VkCommandBuffer commandBuffer, uint32_t firstScissor, uint32_t scissorCount, const VkRect2D* pScissors) void RPIFUNC(vkCmdSetScissor)(VkCommandBuffer commandBuffer, uint32_t firstScissor, uint32_t scissorCount, const VkRect2D* pScissors)
{ {
PROFILESTART(rpi_vkCmdSetScissor); PROFILESTART(RPIFUNC(vkCmdSetScissor));
assert(commandBuffer); assert(commandBuffer);
assert(firstScissor == 0); assert(firstScissor == 0);
@ -452,15 +452,15 @@ void rpi_vkCmdSetScissor(VkCommandBuffer commandBuffer, uint32_t firstScissor, u
cb->scissorDirty = 1; cb->scissorDirty = 1;
PROFILEEND(rpi_vkCmdSetScissor); PROFILEEND(RPIFUNC(vkCmdSetScissor));
} }
/* /*
* https://www.khronos.org/registry/vulkan/specs/1.1-extensions/html/vkspec.html#vkCmdBindVertexBuffers * https://www.khronos.org/registry/vulkan/specs/1.1-extensions/html/vkspec.html#vkCmdBindVertexBuffers
*/ */
void rpi_vkCmdBindVertexBuffers(VkCommandBuffer commandBuffer, uint32_t firstBinding, uint32_t bindingCount, const VkBuffer* pBuffers, const VkDeviceSize* pOffsets) void RPIFUNC(vkCmdBindVertexBuffers)(VkCommandBuffer commandBuffer, uint32_t firstBinding, uint32_t bindingCount, const VkBuffer* pBuffers, const VkDeviceSize* pOffsets)
{ {
PROFILESTART(rpi_vkCmdBindVertexBuffers); PROFILESTART(RPIFUNC(vkCmdBindVertexBuffers));
assert(commandBuffer); assert(commandBuffer);
@ -474,7 +474,7 @@ void rpi_vkCmdBindVertexBuffers(VkCommandBuffer commandBuffer, uint32_t firstBin
cb->vertexBufferDirty = 1; cb->vertexBufferDirty = 1;
PROFILEEND(rpi_vkCmdBindVertexBuffers); PROFILEEND(RPIFUNC(vkCmdBindVertexBuffers));
} }
/* /*
@ -482,7 +482,7 @@ void rpi_vkCmdBindVertexBuffers(VkCommandBuffer commandBuffer, uint32_t firstBin
* Color and depth/stencil images can be cleared outside a render pass instance using vkCmdClearColorImage or vkCmdClearDepthStencilImage, respectively. * Color and depth/stencil images can be cleared outside a render pass instance using vkCmdClearColorImage or vkCmdClearDepthStencilImage, respectively.
* These commands are only allowed outside of a render pass instance. * These commands are only allowed outside of a render pass instance.
*/ */
VKAPI_ATTR void VKAPI_CALL rpi_vkCmdClearColorImage( VKAPI_ATTR void VKAPI_CALL RPIFUNC(vkCmdClearColorImage)(
VkCommandBuffer commandBuffer, VkCommandBuffer commandBuffer,
VkImage image, VkImage image,
VkImageLayout imageLayout, VkImageLayout imageLayout,
@ -490,7 +490,7 @@ VKAPI_ATTR void VKAPI_CALL rpi_vkCmdClearColorImage(
uint32_t rangeCount, uint32_t rangeCount,
const VkImageSubresourceRange* pRanges) const VkImageSubresourceRange* pRanges)
{ {
PROFILESTART(rpi_vkCmdClearColorImage); PROFILESTART(RPIFUNC(vkCmdClearColorImage));
assert(commandBuffer); assert(commandBuffer);
assert(image); assert(image);
@ -566,13 +566,13 @@ VKAPI_ATTR void VKAPI_CALL rpi_vkCmdClearColorImage(
assert(((CLMarker*)getCPAptrFromOffset(commandBuffer->binCl.CPA, commandBuffer->binCl.currMarkerOffset))->memGuard == 0xDDDDDDDD); assert(((CLMarker*)getCPAptrFromOffset(commandBuffer->binCl.CPA, commandBuffer->binCl.currMarkerOffset))->memGuard == 0xDDDDDDDD);
} }
PROFILEEND(rpi_vkCmdClearColorImage); PROFILEEND(RPIFUNC(vkCmdClearColorImage));
} }
/* /*
* https://www.khronos.org/registry/vulkan/specs/1.1-extensions/html/vkspec.html#vkCmdClearDepthStencilImage * https://www.khronos.org/registry/vulkan/specs/1.1-extensions/html/vkspec.html#vkCmdClearDepthStencilImage
*/ */
VKAPI_ATTR void VKAPI_CALL rpi_vkCmdClearDepthStencilImage( VKAPI_ATTR void VKAPI_CALL RPIFUNC(vkCmdClearDepthStencilImage)(
VkCommandBuffer commandBuffer, VkCommandBuffer commandBuffer,
VkImage image, VkImage image,
VkImageLayout imageLayout, VkImageLayout imageLayout,
@ -580,7 +580,7 @@ VKAPI_ATTR void VKAPI_CALL rpi_vkCmdClearDepthStencilImage(
uint32_t rangeCount, uint32_t rangeCount,
const VkImageSubresourceRange* pRanges) const VkImageSubresourceRange* pRanges)
{ {
PROFILESTART(rpi_vkCmdClearDepthStencilImage); PROFILESTART(RPIFUNC(vkCmdClearDepthStencilImage));
assert(commandBuffer); assert(commandBuffer);
assert(image); assert(image);
@ -588,20 +588,20 @@ VKAPI_ATTR void VKAPI_CALL rpi_vkCmdClearDepthStencilImage(
//TODO //TODO
PROFILEEND(rpi_vkCmdClearDepthStencilImage); PROFILEEND(RPIFUNC(vkCmdClearDepthStencilImage));
} }
/* /*
* https://www.khronos.org/registry/vulkan/specs/1.1-extensions/html/vkspec.html#vkCmdClearAttachments * https://www.khronos.org/registry/vulkan/specs/1.1-extensions/html/vkspec.html#vkCmdClearAttachments
*/ */
VKAPI_ATTR void VKAPI_CALL rpi_vkCmdClearAttachments( VKAPI_ATTR void VKAPI_CALL RPIFUNC(vkCmdClearAttachments)(
VkCommandBuffer commandBuffer, VkCommandBuffer commandBuffer,
uint32_t attachmentCount, uint32_t attachmentCount,
const VkClearAttachment* pAttachments, const VkClearAttachment* pAttachments,
uint32_t rectCount, uint32_t rectCount,
const VkClearRect* pRects) const VkClearRect* pRects)
{ {
PROFILESTART(rpi_vkCmdClearAttachments); PROFILESTART(RPIFUNC(vkCmdClearAttachments));
assert(commandBuffer); assert(commandBuffer);
assert(pAttachments); assert(pAttachments);
@ -613,7 +613,7 @@ VKAPI_ATTR void VKAPI_CALL rpi_vkCmdClearAttachments(
if(!cmdBuf->currRenderPass) if(!cmdBuf->currRenderPass)
{ {
//no active render pass //no active render pass
PROFILEEND(rpi_vkCmdClearAttachments); PROFILEEND(RPIFUNC(vkCmdClearAttachments));
return; return;
} }
@ -669,10 +669,10 @@ VKAPI_ATTR void VKAPI_CALL rpi_vkCmdClearAttachments(
createClearPipeline(device, &dsci, clearColor ? device->emulClearShaderModule : device->emulClearNoColorShaderModule, device->emulClearDsl, &blitPipelineLayout, cmdBuf->currRenderPass, &blitPipeline); createClearPipeline(device, &dsci, clearColor ? device->emulClearShaderModule : device->emulClearNoColorShaderModule, device->emulClearDsl, &blitPipelineLayout, cmdBuf->currRenderPass, &blitPipeline);
rpi_vkCmdBindPipeline(commandBuffer, VK_PIPELINE_BIND_POINT_GRAPHICS, blitPipeline); RPIFUNC(vkCmdBindPipeline)(commandBuffer, VK_PIPELINE_BIND_POINT_GRAPHICS, blitPipeline);
VkDeviceSize offsets = 0; VkDeviceSize offsets = 0;
rpi_vkCmdBindVertexBuffers(commandBuffer, 0, 1, &device->emulFsqVertexBuffer, &offsets ); RPIFUNC(vkCmdBindVertexBuffers)(commandBuffer, 0, 1, &device->emulFsqVertexBuffer, &offsets );
uint32_t clearColorValue = 0, stencilSetup = 0, depthClearValue = 0; uint32_t clearColorValue = 0, stencilSetup = 0, depthClearValue = 0;
@ -687,7 +687,7 @@ VKAPI_ATTR void VKAPI_CALL rpi_vkCmdClearAttachments(
fragConstants[1] = stencilSetup; fragConstants[1] = stencilSetup;
fragConstants[2] = depthClearValue; fragConstants[2] = depthClearValue;
rpi_vkCmdPushConstants(commandBuffer, blitPipelineLayout, VK_SHADER_STAGE_FRAGMENT_BIT, 0, sizeof(fragConstants), &fragConstants); RPIFUNC(vkCmdPushConstants)(commandBuffer, blitPipelineLayout, VK_SHADER_STAGE_FRAGMENT_BIT, 0, sizeof(fragConstants), &fragConstants);
for(uint32_t d = 0; d < rectCount; ++d) for(uint32_t d = 0; d < rectCount; ++d)
{ {
@ -699,7 +699,7 @@ VKAPI_ATTR void VKAPI_CALL rpi_vkCmdClearAttachments(
vp.minDepth = 0.0f; vp.minDepth = 0.0f;
vp.maxDepth = 1.0f; vp.maxDepth = 1.0f;
rpi_vkCmdSetViewport(commandBuffer, 0, 1, &vp); RPIFUNC(vkCmdSetViewport)(commandBuffer, 0, 1, &vp);
float Wcoeff = 1.0f; //1.0f / Wc = 2.0 - Wcoeff float Wcoeff = 1.0f; //1.0f / Wc = 2.0 - Wcoeff
float viewportScaleX = (float)(vp.width) * 0.5f * 16.0f; float viewportScaleX = (float)(vp.width) * 0.5f * 16.0f;
@ -712,14 +712,14 @@ VKAPI_ATTR void VKAPI_CALL rpi_vkCmdClearAttachments(
vertConstants[2] = *(uint32_t*)&viewportScaleY; vertConstants[2] = *(uint32_t*)&viewportScaleY;
vertConstants[3] = *(uint32_t*)&Zs; vertConstants[3] = *(uint32_t*)&Zs;
rpi_vkCmdPushConstants(commandBuffer, blitPipelineLayout, VK_SHADER_STAGE_VERTEX_BIT, 0, sizeof(vertConstants), &vertConstants); RPIFUNC(vkCmdPushConstants)(commandBuffer, blitPipelineLayout, VK_SHADER_STAGE_VERTEX_BIT, 0, sizeof(vertConstants), &vertConstants);
rpi_vkCmdDraw(commandBuffer, 6, 1, 0, 0); RPIFUNC(vkCmdDraw)(commandBuffer, 6, 1, 0, 0);
} }
//free up resources //free up resources
rpi_vkDestroyPipelineLayout(device, blitPipelineLayout, 0); RPIFUNC(vkDestroyPipelineLayout)(device, blitPipelineLayout, 0);
rpi_vkDestroyPipeline(device, blitPipeline, 0); RPIFUNC(vkDestroyPipeline)(device, blitPipeline, 0);
} }
//restore state //restore state
@ -729,53 +729,53 @@ VKAPI_ATTR void VKAPI_CALL rpi_vkCmdClearAttachments(
memcpy(cmdBuf->pushConstantBufferVertex, oldPushConstantBufferVertex, sizeof(oldPushConstantBufferVertex)); memcpy(cmdBuf->pushConstantBufferVertex, oldPushConstantBufferVertex, sizeof(oldPushConstantBufferVertex));
memcpy(cmdBuf->pushConstantBufferPixel, oldPushConstantBufferPixel, sizeof(oldPushConstantBufferPixel)); memcpy(cmdBuf->pushConstantBufferPixel, oldPushConstantBufferPixel, sizeof(oldPushConstantBufferPixel));
PROFILEEND(rpi_vkCmdClearAttachments); PROFILEEND(RPIFUNC(vkCmdClearAttachments));
} }
/* /*
* https://www.khronos.org/registry/vulkan/specs/1.1-extensions/html/vkspec.html#vkCmdFillBuffer * https://www.khronos.org/registry/vulkan/specs/1.1-extensions/html/vkspec.html#vkCmdFillBuffer
*/ */
VKAPI_ATTR void VKAPI_CALL rpi_vkCmdFillBuffer( VKAPI_ATTR void VKAPI_CALL RPIFUNC(vkCmdFillBuffer)(
VkCommandBuffer commandBuffer, VkCommandBuffer commandBuffer,
VkBuffer dstBuffer, VkBuffer dstBuffer,
VkDeviceSize dstOffset, VkDeviceSize dstOffset,
VkDeviceSize size, VkDeviceSize size,
uint32_t data) uint32_t data)
{ {
PROFILESTART(rpi_vkCmdFillBuffer); PROFILESTART(RPIFUNC(vkCmdFillBuffer));
//TODO //TODO
PROFILEEND(rpi_vkCmdFillBuffer); PROFILEEND(RPIFUNC(vkCmdFillBuffer));
} }
/* /*
* https://www.khronos.org/registry/vulkan/specs/1.1-extensions/html/vkspec.html#vkCmdUpdateBuffer * https://www.khronos.org/registry/vulkan/specs/1.1-extensions/html/vkspec.html#vkCmdUpdateBuffer
*/ */
VKAPI_ATTR void VKAPI_CALL rpi_vkCmdUpdateBuffer( VKAPI_ATTR void VKAPI_CALL RPIFUNC(vkCmdUpdateBuffer)(
VkCommandBuffer commandBuffer, VkCommandBuffer commandBuffer,
VkBuffer dstBuffer, VkBuffer dstBuffer,
VkDeviceSize dstOffset, VkDeviceSize dstOffset,
VkDeviceSize dataSize, VkDeviceSize dataSize,
const void* pData) const void* pData)
{ {
PROFILESTART(rpi_vkCmdUpdateBuffer); PROFILESTART(RPIFUNC(vkCmdUpdateBuffer));
//TODO //TODO
PROFILEEND(rpi_vkCmdUpdateBuffer); PROFILEEND(RPIFUNC(vkCmdUpdateBuffer));
} }
/* /*
* https://www.khronos.org/registry/vulkan/specs/1.1-extensions/html/vkspec.html#vkCmdBindIndexBuffer * https://www.khronos.org/registry/vulkan/specs/1.1-extensions/html/vkspec.html#vkCmdBindIndexBuffer
*/ */
VKAPI_ATTR void VKAPI_CALL rpi_vkCmdBindIndexBuffer( VKAPI_ATTR void VKAPI_CALL RPIFUNC(vkCmdBindIndexBuffer)(
VkCommandBuffer commandBuffer, VkCommandBuffer commandBuffer,
VkBuffer buffer, VkBuffer buffer,
VkDeviceSize offset, VkDeviceSize offset,
VkIndexType indexType) VkIndexType indexType)
{ {
PROFILESTART(rpi_vkCmdBindIndexBuffer); PROFILESTART(RPIFUNC(vkCmdBindIndexBuffer));
assert(commandBuffer); assert(commandBuffer);
@ -791,17 +791,17 @@ VKAPI_ATTR void VKAPI_CALL rpi_vkCmdBindIndexBuffer(
cb->indexBufferDirty = 1; cb->indexBufferDirty = 1;
PROFILEEND(rpi_vkCmdBindIndexBuffer); PROFILEEND(RPIFUNC(vkCmdBindIndexBuffer));
} }
/* /*
* https://www.khronos.org/registry/vulkan/specs/1.1-extensions/html/vkspec.html#vkCmdSetLineWidth * https://www.khronos.org/registry/vulkan/specs/1.1-extensions/html/vkspec.html#vkCmdSetLineWidth
*/ */
VKAPI_ATTR void VKAPI_CALL rpi_vkCmdSetLineWidth( VKAPI_ATTR void VKAPI_CALL RPIFUNC(vkCmdSetLineWidth)(
VkCommandBuffer commandBuffer, VkCommandBuffer commandBuffer,
float lineWidth) float lineWidth)
{ {
PROFILESTART(rpi_vkCmdSetLineWidth); PROFILESTART(RPIFUNC(vkCmdSetLineWidth));
assert(commandBuffer); assert(commandBuffer);
@ -810,19 +810,19 @@ VKAPI_ATTR void VKAPI_CALL rpi_vkCmdSetLineWidth(
cb->lineWidthDirty = 1; cb->lineWidthDirty = 1;
PROFILEEND(rpi_vkCmdSetLineWidth); PROFILEEND(RPIFUNC(vkCmdSetLineWidth));
} }
/* /*
* https://www.khronos.org/registry/vulkan/specs/1.1-extensions/html/vkspec.html#vkCmdSetDepthBias * https://www.khronos.org/registry/vulkan/specs/1.1-extensions/html/vkspec.html#vkCmdSetDepthBias
*/ */
VKAPI_ATTR void VKAPI_CALL rpi_vkCmdSetDepthBias( VKAPI_ATTR void VKAPI_CALL RPIFUNC(vkCmdSetDepthBias)(
VkCommandBuffer commandBuffer, VkCommandBuffer commandBuffer,
float depthBiasConstantFactor, float depthBiasConstantFactor,
float depthBiasClamp, float depthBiasClamp,
float depthBiasSlopeFactor) float depthBiasSlopeFactor)
{ {
PROFILESTART(rpi_vkCmdSetDepthBias); PROFILESTART(RPIFUNC(vkCmdSetDepthBias));
assert(commandBuffer); assert(commandBuffer);
@ -833,17 +833,17 @@ VKAPI_ATTR void VKAPI_CALL rpi_vkCmdSetDepthBias(
cb->depthBiasDirty = 1; cb->depthBiasDirty = 1;
PROFILEEND(rpi_vkCmdSetDepthBias); PROFILEEND(RPIFUNC(vkCmdSetDepthBias));
} }
/* /*
* https://www.khronos.org/registry/vulkan/specs/1.1-extensions/html/vkspec.html#vkCmdSetBlendConstants * https://www.khronos.org/registry/vulkan/specs/1.1-extensions/html/vkspec.html#vkCmdSetBlendConstants
*/ */
VKAPI_ATTR void VKAPI_CALL rpi_vkCmdSetBlendConstants( VKAPI_ATTR void VKAPI_CALL RPIFUNC(vkCmdSetBlendConstants)(
VkCommandBuffer commandBuffer, VkCommandBuffer commandBuffer,
const float blendConstants[4]) const float blendConstants[4])
{ {
PROFILESTART(rpi_vkCmdSetBlendConstants); PROFILESTART(RPIFUNC(vkCmdSetBlendConstants));
assert(commandBuffer); assert(commandBuffer);
@ -852,18 +852,18 @@ VKAPI_ATTR void VKAPI_CALL rpi_vkCmdSetBlendConstants(
cb->blendConstantsDirty = 1; cb->blendConstantsDirty = 1;
PROFILEEND(rpi_vkCmdSetBlendConstants); PROFILEEND(RPIFUNC(vkCmdSetBlendConstants));
} }
/* /*
* https://www.khronos.org/registry/vulkan/specs/1.1-extensions/html/vkspec.html#vkCmdSetDepthBounds * https://www.khronos.org/registry/vulkan/specs/1.1-extensions/html/vkspec.html#vkCmdSetDepthBounds
*/ */
VKAPI_ATTR void VKAPI_CALL rpi_vkCmdSetDepthBounds( VKAPI_ATTR void VKAPI_CALL RPIFUNC(vkCmdSetDepthBounds)(
VkCommandBuffer commandBuffer, VkCommandBuffer commandBuffer,
float minDepthBounds, float minDepthBounds,
float maxDepthBounds) float maxDepthBounds)
{ {
PROFILESTART(rpi_vkCmdSetDepthBounds); PROFILESTART(RPIFUNC(vkCmdSetDepthBounds));
assert(commandBuffer); assert(commandBuffer);
@ -873,18 +873,18 @@ VKAPI_ATTR void VKAPI_CALL rpi_vkCmdSetDepthBounds(
cb->depthBoundsDirty = 1; cb->depthBoundsDirty = 1;
PROFILEEND(rpi_vkCmdSetDepthBounds); PROFILEEND(RPIFUNC(vkCmdSetDepthBounds));
} }
/* /*
* https://www.khronos.org/registry/vulkan/specs/1.1-extensions/html/vkspec.html#vkCmdSetStencilCompareMask * https://www.khronos.org/registry/vulkan/specs/1.1-extensions/html/vkspec.html#vkCmdSetStencilCompareMask
*/ */
VKAPI_ATTR void VKAPI_CALL rpi_vkCmdSetStencilCompareMask( VKAPI_ATTR void VKAPI_CALL RPIFUNC(vkCmdSetStencilCompareMask)(
VkCommandBuffer commandBuffer, VkCommandBuffer commandBuffer,
VkStencilFaceFlags faceMask, VkStencilFaceFlags faceMask,
uint32_t compareMask) uint32_t compareMask)
{ {
PROFILESTART(rpi_vkCmdSetStencilCompareMask); PROFILESTART(RPIFUNC(vkCmdSetStencilCompareMask));
assert(commandBuffer); assert(commandBuffer);
@ -902,18 +902,18 @@ VKAPI_ATTR void VKAPI_CALL rpi_vkCmdSetStencilCompareMask(
cb->stencilCompareMaskDirty = 1; cb->stencilCompareMaskDirty = 1;
PROFILEEND(rpi_vkCmdSetStencilCompareMask); PROFILEEND(RPIFUNC(vkCmdSetStencilCompareMask));
} }
/* /*
* https://www.khronos.org/registry/vulkan/specs/1.1-extensions/html/vkspec.html#vkCmdSetStencilWriteMask * https://www.khronos.org/registry/vulkan/specs/1.1-extensions/html/vkspec.html#vkCmdSetStencilWriteMask
*/ */
VKAPI_ATTR void VKAPI_CALL rpi_vkCmdSetStencilWriteMask( VKAPI_ATTR void VKAPI_CALL RPIFUNC(vkCmdSetStencilWriteMask)(
VkCommandBuffer commandBuffer, VkCommandBuffer commandBuffer,
VkStencilFaceFlags faceMask, VkStencilFaceFlags faceMask,
uint32_t writeMask) uint32_t writeMask)
{ {
PROFILESTART(rpi_vkCmdSetStencilWriteMask); PROFILESTART(RPIFUNC(vkCmdSetStencilWriteMask));
assert(commandBuffer); assert(commandBuffer);
@ -931,18 +931,18 @@ VKAPI_ATTR void VKAPI_CALL rpi_vkCmdSetStencilWriteMask(
cb->stencilWriteMaskDirty = 1; cb->stencilWriteMaskDirty = 1;
PROFILEEND(rpi_vkCmdSetStencilWriteMask); PROFILEEND(RPIFUNC(vkCmdSetStencilWriteMask));
} }
/* /*
* https://www.khronos.org/registry/vulkan/specs/1.1-extensions/html/vkspec.html#vkCmdSetStencilReference * https://www.khronos.org/registry/vulkan/specs/1.1-extensions/html/vkspec.html#vkCmdSetStencilReference
*/ */
VKAPI_ATTR void VKAPI_CALL rpi_vkCmdSetStencilReference( VKAPI_ATTR void VKAPI_CALL RPIFUNC(vkCmdSetStencilReference)(
VkCommandBuffer commandBuffer, VkCommandBuffer commandBuffer,
VkStencilFaceFlags faceMask, VkStencilFaceFlags faceMask,
uint32_t reference) uint32_t reference)
{ {
PROFILESTART(rpi_vkCmdSetStencilReference); PROFILESTART(RPIFUNC(vkCmdSetStencilReference));
assert(commandBuffer); assert(commandBuffer);
@ -960,5 +960,5 @@ VKAPI_ATTR void VKAPI_CALL rpi_vkCmdSetStencilReference(
cb->stencilReferenceDirty = 1; cb->stencilReferenceDirty = 1;
PROFILEEND(rpi_vkCmdSetStencilReference); PROFILEEND(RPIFUNC(vkCmdSetStencilReference));
} }

View File

@ -1,5 +1,7 @@
#include "common.h" #include "common.h"
#include "declarations.h"
#include "kernel/vc4_packet.h" #include "kernel/vc4_packet.h"
//----------------------------- //-----------------------------
@ -52,13 +54,13 @@
* These mechanisms indirectly enable applications to share semaphore state between two or more semaphores and other synchronization primitives across process and API boundaries. * These mechanisms indirectly enable applications to share semaphore state between two or more semaphores and other synchronization primitives across process and API boundaries.
* When created, the semaphore is in the unsignaled state. * When created, the semaphore is in the unsignaled state.
*/ */
VKAPI_ATTR VkResult VKAPI_CALL rpi_vkCreateSemaphore( VKAPI_ATTR VkResult VKAPI_CALL RPIFUNC(vkCreateSemaphore)(
VkDevice device, VkDevice device,
const VkSemaphoreCreateInfo* pCreateInfo, const VkSemaphoreCreateInfo* pCreateInfo,
const VkAllocationCallbacks* pAllocator, const VkAllocationCallbacks* pAllocator,
VkSemaphore* pSemaphore) VkSemaphore* pSemaphore)
{ {
PROFILESTART(rpi_vkCreateSemaphore); PROFILESTART(RPIFUNC(vkCreateSemaphore));
assert(device); assert(device);
assert(pSemaphore); assert(pSemaphore);
@ -67,14 +69,14 @@ VKAPI_ATTR VkResult VKAPI_CALL rpi_vkCreateSemaphore(
sem_t* s = ALLOCATE(sizeof(sem_t), 1, VK_SYSTEM_ALLOCATION_SCOPE_OBJECT); sem_t* s = ALLOCATE(sizeof(sem_t), 1, VK_SYSTEM_ALLOCATION_SCOPE_OBJECT);
if(!s) if(!s)
{ {
PROFILEEND(rpi_vkCreateSemaphore); PROFILEEND(RPIFUNC(vkCreateSemaphore));
return VK_ERROR_OUT_OF_HOST_MEMORY; return VK_ERROR_OUT_OF_HOST_MEMORY;
} }
sem_init(s, 0, 0); //create semaphore unsignalled, shared between threads sem_init(s, 0, 0); //create semaphore unsignalled, shared between threads
*pSemaphore = (VkSemaphore)s; *pSemaphore = (VkSemaphore)s;
PROFILEEND(rpi_vkCreateSemaphore); PROFILEEND(RPIFUNC(vkCreateSemaphore));
return VK_SUCCESS; return VK_SUCCESS;
} }
@ -101,7 +103,7 @@ VKAPI_ATTR VkResult VKAPI_CALL rpi_vkCreateSemaphore(
* *
* If dependencyFlags includes VK_DEPENDENCY_BY_REGION_BIT, then any dependency between framebuffer-space pipeline stages is framebuffer-local - otherwise it is framebuffer-global. * If dependencyFlags includes VK_DEPENDENCY_BY_REGION_BIT, then any dependency between framebuffer-space pipeline stages is framebuffer-local - otherwise it is framebuffer-global.
*/ */
VKAPI_ATTR void VKAPI_CALL rpi_vkCmdPipelineBarrier( VKAPI_ATTR void VKAPI_CALL RPIFUNC(vkCmdPipelineBarrier)(
VkCommandBuffer commandBuffer, VkCommandBuffer commandBuffer,
VkPipelineStageFlags srcStageMask, VkPipelineStageFlags srcStageMask,
VkPipelineStageFlags dstStageMask, VkPipelineStageFlags dstStageMask,
@ -113,7 +115,7 @@ VKAPI_ATTR void VKAPI_CALL rpi_vkCmdPipelineBarrier(
uint32_t imageMemoryBarrierCount, uint32_t imageMemoryBarrierCount,
const VkImageMemoryBarrier* pImageMemoryBarriers) const VkImageMemoryBarrier* pImageMemoryBarriers)
{ {
PROFILESTART(rpi_vkCmdPipelineBarrier); PROFILESTART(RPIFUNC(vkCmdPipelineBarrier));
assert(commandBuffer); assert(commandBuffer);
@ -201,17 +203,17 @@ VKAPI_ATTR void VKAPI_CALL rpi_vkCmdPipelineBarrier(
i->layout = pImageMemoryBarriers[c].newLayout; i->layout = pImageMemoryBarriers[c].newLayout;
} }
PROFILEEND(rpi_vkCmdPipelineBarrier); PROFILEEND(RPIFUNC(vkCmdPipelineBarrier));
} }
/* /*
* https://www.khronos.org/registry/vulkan/specs/1.1-extensions/html/vkspec.html#vkDeviceWaitIdle * https://www.khronos.org/registry/vulkan/specs/1.1-extensions/html/vkspec.html#vkDeviceWaitIdle
* vkDeviceWaitIdle is equivalent to calling vkQueueWaitIdle for all queues owned by device. * vkDeviceWaitIdle is equivalent to calling vkQueueWaitIdle for all queues owned by device.
*/ */
VKAPI_ATTR VkResult VKAPI_CALL rpi_vkDeviceWaitIdle( VKAPI_ATTR VkResult VKAPI_CALL RPIFUNC(vkDeviceWaitIdle)(
VkDevice device) VkDevice device)
{ {
PROFILESTART(rpi_vkDeviceWaitIdle); PROFILESTART(RPIFUNC(vkDeviceWaitIdle));
assert(device); assert(device);
@ -225,17 +227,17 @@ VKAPI_ATTR VkResult VKAPI_CALL rpi_vkDeviceWaitIdle(
} }
} }
PROFILEEND(rpi_vkDeviceWaitIdle); PROFILEEND(RPIFUNC(vkDeviceWaitIdle));
return VK_SUCCESS; return VK_SUCCESS;
} }
/* /*
* https://www.khronos.org/registry/vulkan/specs/1.1-extensions/html/vkspec.html#vkQueueWaitIdle * https://www.khronos.org/registry/vulkan/specs/1.1-extensions/html/vkspec.html#vkQueueWaitIdle
*/ */
VKAPI_ATTR VkResult VKAPI_CALL rpi_vkQueueWaitIdle( VKAPI_ATTR VkResult VKAPI_CALL RPIFUNC(vkQueueWaitIdle)(
VkQueue queue) VkQueue queue)
{ {
PROFILESTART(rpi_vkQueueWaitIdle); PROFILESTART(RPIFUNC(vkQueueWaitIdle));
assert(queue); assert(queue);
@ -244,19 +246,19 @@ VKAPI_ATTR VkResult VKAPI_CALL rpi_vkQueueWaitIdle(
uint64_t timeout = WAIT_TIMEOUT_INFINITE; uint64_t timeout = WAIT_TIMEOUT_INFINITE;
vc4_seqno_wait(controlFd, &lastFinishedSeqno, q->lastEmitSeqno, &timeout); vc4_seqno_wait(controlFd, &lastFinishedSeqno, q->lastEmitSeqno, &timeout);
PROFILEEND(rpi_vkQueueWaitIdle); PROFILEEND(RPIFUNC(vkQueueWaitIdle));
return VK_SUCCESS; return VK_SUCCESS;
} }
/* /*
* https://www.khronos.org/registry/vulkan/specs/1.1-extensions/html/vkspec.html#vkDestroySemaphore * https://www.khronos.org/registry/vulkan/specs/1.1-extensions/html/vkspec.html#vkDestroySemaphore
*/ */
VKAPI_ATTR void VKAPI_CALL rpi_vkDestroySemaphore( VKAPI_ATTR void VKAPI_CALL RPIFUNC(vkDestroySemaphore)(
VkDevice device, VkDevice device,
VkSemaphore semaphore, VkSemaphore semaphore,
const VkAllocationCallbacks* pAllocator) const VkAllocationCallbacks* pAllocator)
{ {
PROFILESTART(rpi_vkDestroySemaphore); PROFILESTART(RPIFUNC(vkDestroySemaphore));
assert(device); assert(device);
@ -266,19 +268,19 @@ VKAPI_ATTR void VKAPI_CALL rpi_vkDestroySemaphore(
FREE(semaphore); FREE(semaphore);
} }
PROFILEEND(rpi_vkDestroySemaphore); PROFILEEND(RPIFUNC(vkDestroySemaphore));
} }
/* /*
* https://www.khronos.org/registry/vulkan/specs/1.1-extensions/html/vkspec.html#vkCreateFence * https://www.khronos.org/registry/vulkan/specs/1.1-extensions/html/vkspec.html#vkCreateFence
*/ */
VKAPI_ATTR VkResult VKAPI_CALL rpi_vkCreateFence( VKAPI_ATTR VkResult VKAPI_CALL RPIFUNC(vkCreateFence)(
VkDevice device, VkDevice device,
const VkFenceCreateInfo* pCreateInfo, const VkFenceCreateInfo* pCreateInfo,
const VkAllocationCallbacks* pAllocator, const VkAllocationCallbacks* pAllocator,
VkFence* pFence) VkFence* pFence)
{ {
PROFILESTART(rpi_vkCreateFence); PROFILESTART(RPIFUNC(vkCreateFence));
assert(device); assert(device);
assert(pCreateInfo); assert(pCreateInfo);
@ -288,7 +290,7 @@ VKAPI_ATTR VkResult VKAPI_CALL rpi_vkCreateFence(
if(!f) if(!f)
{ {
PROFILEEND(rpi_vkCreateFence); PROFILEEND(RPIFUNC(vkCreateFence));
return VK_ERROR_OUT_OF_HOST_MEMORY; return VK_ERROR_OUT_OF_HOST_MEMORY;
} }
@ -297,19 +299,19 @@ VKAPI_ATTR VkResult VKAPI_CALL rpi_vkCreateFence(
*pFence = f; *pFence = f;
PROFILEEND(rpi_vkCreateFence); PROFILEEND(RPIFUNC(vkCreateFence));
return VK_SUCCESS; return VK_SUCCESS;
} }
/* /*
* https://www.khronos.org/registry/vulkan/specs/1.1-extensions/html/vkspec.html#vkDestroyFence * https://www.khronos.org/registry/vulkan/specs/1.1-extensions/html/vkspec.html#vkDestroyFence
*/ */
VKAPI_ATTR void VKAPI_CALL rpi_vkDestroyFence( VKAPI_ATTR void VKAPI_CALL RPIFUNC(vkDestroyFence)(
VkDevice device, VkDevice device,
VkFence fence, VkFence fence,
const VkAllocationCallbacks* pAllocator) const VkAllocationCallbacks* pAllocator)
{ {
PROFILESTART(rpi_vkDestroyFence); PROFILESTART(RPIFUNC(vkDestroyFence));
assert(device); assert(device);
@ -318,17 +320,17 @@ VKAPI_ATTR void VKAPI_CALL rpi_vkDestroyFence(
FREE(fence); FREE(fence);
} }
PROFILEEND(rpi_vkDestroyFence); PROFILEEND(RPIFUNC(vkDestroyFence));
} }
/* /*
* https://www.khronos.org/registry/vulkan/specs/1.1-extensions/html/vkspec.html#vkGetFenceStatus * https://www.khronos.org/registry/vulkan/specs/1.1-extensions/html/vkspec.html#vkGetFenceStatus
*/ */
VKAPI_ATTR VkResult VKAPI_CALL rpi_vkGetFenceStatus( VKAPI_ATTR VkResult VKAPI_CALL RPIFUNC(vkGetFenceStatus)(
VkDevice device, VkDevice device,
VkFence fence) VkFence fence)
{ {
PROFILESTART(rpi_vkGetFenceStatus); PROFILESTART(RPIFUNC(vkGetFenceStatus));
assert(device); assert(device);
assert(fence); assert(fence);
@ -338,19 +340,19 @@ VKAPI_ATTR VkResult VKAPI_CALL rpi_vkGetFenceStatus(
_fence* f = fence; _fence* f = fence;
VkResult retval = f->signaled ? VK_SUCCESS : VK_NOT_READY; VkResult retval = f->signaled ? VK_SUCCESS : VK_NOT_READY;
PROFILEEND(rpi_vkGetFenceStatus); PROFILEEND(RPIFUNC(vkGetFenceStatus));
return retval; return retval;
} }
/* /*
* https://www.khronos.org/registry/vulkan/specs/1.1-extensions/html/vkspec.html#vkResetFences * https://www.khronos.org/registry/vulkan/specs/1.1-extensions/html/vkspec.html#vkResetFences
*/ */
VKAPI_ATTR VkResult VKAPI_CALL rpi_vkResetFences( VKAPI_ATTR VkResult VKAPI_CALL RPIFUNC(vkResetFences)(
VkDevice device, VkDevice device,
uint32_t fenceCount, uint32_t fenceCount,
const VkFence* pFences) const VkFence* pFences)
{ {
PROFILESTART(rpi_vkResetFences); PROFILESTART(RPIFUNC(vkResetFences));
assert(device); assert(device);
assert(pFences); assert(pFences);
@ -363,21 +365,21 @@ VKAPI_ATTR VkResult VKAPI_CALL rpi_vkResetFences(
f->seqno = 0; f->seqno = 0;
} }
PROFILEEND(rpi_vkResetFences); PROFILEEND(RPIFUNC(vkResetFences));
return VK_SUCCESS; return VK_SUCCESS;
} }
/* /*
* https://www.khronos.org/registry/vulkan/specs/1.1-extensions/html/vkspec.html#vkWaitForFences * https://www.khronos.org/registry/vulkan/specs/1.1-extensions/html/vkspec.html#vkWaitForFences
*/ */
VKAPI_ATTR VkResult VKAPI_CALL rpi_vkWaitForFences( VKAPI_ATTR VkResult VKAPI_CALL RPIFUNC(vkWaitForFences)(
VkDevice device, VkDevice device,
uint32_t fenceCount, uint32_t fenceCount,
const VkFence* pFences, const VkFence* pFences,
VkBool32 waitAll, VkBool32 waitAll,
uint64_t timeout) uint64_t timeout)
{ {
PROFILESTART(rpi_vkWaitForFences); PROFILESTART(RPIFUNC(vkWaitForFences));
assert(device); assert(device);
assert(pFences); assert(pFences);
@ -392,11 +394,11 @@ VKAPI_ATTR VkResult VKAPI_CALL rpi_vkWaitForFences(
_fence* f = pFences[c]; _fence* f = pFences[c];
if(!f->signaled) //if any unsignaled if(!f->signaled) //if any unsignaled
{ {
PROFILEEND(rpi_vkWaitForFences); PROFILEEND(RPIFUNC(vkWaitForFences));
return VK_TIMEOUT; return VK_TIMEOUT;
} }
PROFILEEND(rpi_vkWaitForFences); PROFILEEND(RPIFUNC(vkWaitForFences));
return VK_SUCCESS; return VK_SUCCESS;
} }
} }
@ -412,7 +414,7 @@ VKAPI_ATTR VkResult VKAPI_CALL rpi_vkWaitForFences(
if(ret < 0) if(ret < 0)
{ {
PROFILEEND(rpi_vkWaitForFences); PROFILEEND(RPIFUNC(vkWaitForFences));
return VK_TIMEOUT; return VK_TIMEOUT;
} }
@ -430,11 +432,11 @@ VKAPI_ATTR VkResult VKAPI_CALL rpi_vkWaitForFences(
_fence* f = pFences[c]; _fence* f = pFences[c];
if(f->signaled) //if any signaled if(f->signaled) //if any signaled
{ {
PROFILEEND(rpi_vkWaitForFences); PROFILEEND(RPIFUNC(vkWaitForFences));
return VK_SUCCESS; return VK_SUCCESS;
} }
PROFILEEND(rpi_vkWaitForFences); PROFILEEND(RPIFUNC(vkWaitForFences));
return VK_TIMEOUT; return VK_TIMEOUT;
} }
} }
@ -455,26 +457,26 @@ VKAPI_ATTR VkResult VKAPI_CALL rpi_vkWaitForFences(
f->signaled = 1; f->signaled = 1;
f->seqno = 0; f->seqno = 0;
PROFILEEND(rpi_vkWaitForFences); PROFILEEND(RPIFUNC(vkWaitForFences));
return VK_SUCCESS; return VK_SUCCESS;
} }
else else
{ {
//already signaled //already signaled
PROFILEEND(rpi_vkWaitForFences); PROFILEEND(RPIFUNC(vkWaitForFences));
return VK_SUCCESS; return VK_SUCCESS;
} }
} }
PROFILEEND(rpi_vkWaitForFences); PROFILEEND(RPIFUNC(vkWaitForFences));
return VK_TIMEOUT; return VK_TIMEOUT;
} }
PROFILEEND(rpi_vkWaitForFences); PROFILEEND(RPIFUNC(vkWaitForFences));
return VK_SUCCESS; return VK_SUCCESS;
} }
VKAPI_ATTR void VKAPI_CALL rpi_vkCmdWaitEvents( VKAPI_ATTR void VKAPI_CALL RPIFUNC(vkCmdWaitEvents)(
VkCommandBuffer commandBuffer, VkCommandBuffer commandBuffer,
uint32_t eventCount, uint32_t eventCount,
const VkEvent* pEvents, const VkEvent* pEvents,
@ -490,7 +492,7 @@ VKAPI_ATTR void VKAPI_CALL rpi_vkCmdWaitEvents(
UNSUPPORTED(vkCmdWaitEvents); UNSUPPORTED(vkCmdWaitEvents);
} }
VKAPI_ATTR VkResult VKAPI_CALL rpi_vkGetEventStatus( VKAPI_ATTR VkResult VKAPI_CALL RPIFUNC(vkGetEventStatus)(
VkDevice device, VkDevice device,
VkEvent event) VkEvent event)
{ {
@ -498,7 +500,7 @@ VKAPI_ATTR VkResult VKAPI_CALL rpi_vkGetEventStatus(
return UNSUPPORTED_RETURN; return UNSUPPORTED_RETURN;
} }
VKAPI_ATTR void VKAPI_CALL rpi_vkDestroyEvent( VKAPI_ATTR void VKAPI_CALL RPIFUNC(vkDestroyEvent)(
VkDevice device, VkDevice device,
VkEvent event, VkEvent event,
const VkAllocationCallbacks* pAllocator) const VkAllocationCallbacks* pAllocator)
@ -506,7 +508,7 @@ VKAPI_ATTR void VKAPI_CALL rpi_vkDestroyEvent(
UNSUPPORTED(vkDestroyEvent); UNSUPPORTED(vkDestroyEvent);
} }
VKAPI_ATTR void VKAPI_CALL rpi_vkCmdResetEvent( VKAPI_ATTR void VKAPI_CALL RPIFUNC(vkCmdResetEvent)(
VkCommandBuffer commandBuffer, VkCommandBuffer commandBuffer,
VkEvent event, VkEvent event,
VkPipelineStageFlags stageMask) VkPipelineStageFlags stageMask)
@ -514,7 +516,7 @@ VKAPI_ATTR void VKAPI_CALL rpi_vkCmdResetEvent(
UNSUPPORTED(vkCmdResetEvent); UNSUPPORTED(vkCmdResetEvent);
} }
VKAPI_ATTR VkResult VKAPI_CALL rpi_vkCreateEvent( VKAPI_ATTR VkResult VKAPI_CALL RPIFUNC(vkCreateEvent)(
VkDevice device, VkDevice device,
const VkEventCreateInfo* pCreateInfo, const VkEventCreateInfo* pCreateInfo,
const VkAllocationCallbacks* pAllocator, const VkAllocationCallbacks* pAllocator,
@ -524,7 +526,7 @@ VKAPI_ATTR VkResult VKAPI_CALL rpi_vkCreateEvent(
return UNSUPPORTED_RETURN; return UNSUPPORTED_RETURN;
} }
VKAPI_ATTR VkResult VKAPI_CALL rpi_vkResetEvent( VKAPI_ATTR VkResult VKAPI_CALL RPIFUNC(vkResetEvent)(
VkDevice device, VkDevice device,
VkEvent event) VkEvent event)
{ {
@ -532,7 +534,7 @@ VKAPI_ATTR VkResult VKAPI_CALL rpi_vkResetEvent(
return UNSUPPORTED_RETURN; return UNSUPPORTED_RETURN;
} }
VKAPI_ATTR VkResult VKAPI_CALL rpi_vkSetEvent( VKAPI_ATTR VkResult VKAPI_CALL RPIFUNC(vkSetEvent)(
VkDevice device, VkDevice device,
VkEvent event) VkEvent event)
{ {
@ -540,7 +542,7 @@ VKAPI_ATTR VkResult VKAPI_CALL rpi_vkSetEvent(
return UNSUPPORTED_RETURN; return UNSUPPORTED_RETURN;
} }
VKAPI_ATTR void VKAPI_CALL rpi_vkCmdSetEvent( VKAPI_ATTR void VKAPI_CALL RPIFUNC(vkCmdSetEvent)(
VkCommandBuffer commandBuffer, VkCommandBuffer commandBuffer,
VkEvent event, VkEvent event,
VkPipelineStageFlags stageMask) VkPipelineStageFlags stageMask)

View File

@ -7,35 +7,6 @@
extern "C" { extern "C" {
#endif #endif
typedef VkResult (*PFN_vkCreateShaderModuleFromRpiAssemblyEXT)(
VkPhysicalDevice physicalDevice);
// Sooo we're not really getting the REAL VkPhysicalDevice from the Loader
// But rather a Trampoline object that points to a Terminator that finally points to
// The real object
// Therefore if we would like to pass on information in our VkPhysicalDevice object
// We need to walk this chain...
typedef struct VkRpiPhysicalDevice
{
uintptr_t loaderData;
uintptr_t customData;
} VkRpiPhysicalDevice;
typedef struct LoaderTerminator
{
uintptr_t a;
uintptr_t b;
uint8_t c;
VkRpiPhysicalDevice* physicalDevice;
} LoaderTerminator;
typedef struct LoaderTrampoline
{
uintptr_t a;
uintptr_t b;
LoaderTerminator* loaderTerminator;
} LoaderTrampoline;
/* /*
* assembly to vulkan resource mapping * assembly to vulkan resource mapping
* *

View File

@ -9,12 +9,12 @@
extern "C" { extern "C" {
#endif #endif
VKAPI_ATTR VkResult VKAPI_CALL rpi_vkGetPhysicalDeviceDisplayPlanePropertiesKHR( VKAPI_ATTR VkResult VKAPI_CALL RPIFUNC(vkGetPhysicalDeviceDisplayPlanePropertiesKHR)(
VkPhysicalDevice physicalDevice, VkPhysicalDevice physicalDevice,
uint32_t* pPropertyCount, uint32_t* pPropertyCount,
VkDisplayPlanePropertiesKHR* pProperties) VkDisplayPlanePropertiesKHR* pProperties)
{ {
PROFILESTART(rpi_vkGetPhysicalDeviceDisplayPlanePropertiesKHR); PROFILESTART(RPIFUNC(vkGetPhysicalDeviceDisplayPlanePropertiesKHR));
assert(physicalDevice); assert(physicalDevice);
assert(pPropertyCount); assert(pPropertyCount);
@ -26,7 +26,7 @@ VKAPI_ATTR VkResult VKAPI_CALL rpi_vkGetPhysicalDeviceDisplayPlanePropertiesKHR(
if(!pProperties) if(!pProperties)
{ {
*pPropertyCount = numPlanes; *pPropertyCount = numPlanes;
PROFILEEND(rpi_vkGetPhysicalDeviceDisplayPlanePropertiesKHR); PROFILEEND(RPIFUNC(vkGetPhysicalDeviceDisplayPlanePropertiesKHR));
return VK_SUCCESS; return VK_SUCCESS;
} }
@ -39,17 +39,17 @@ VKAPI_ATTR VkResult VKAPI_CALL rpi_vkGetPhysicalDeviceDisplayPlanePropertiesKHR(
pProperties[c].currentStackIndex = c; //TODO dunno? pProperties[c].currentStackIndex = c; //TODO dunno?
} }
PROFILEEND(rpi_vkGetPhysicalDeviceDisplayPlanePropertiesKHR); PROFILEEND(RPIFUNC(vkGetPhysicalDeviceDisplayPlanePropertiesKHR));
return VK_SUCCESS; return VK_SUCCESS;
} }
VKAPI_ATTR VkResult VKAPI_CALL rpi_vkGetDisplayPlaneSupportedDisplaysKHR( VKAPI_ATTR VkResult VKAPI_CALL RPIFUNC(vkGetDisplayPlaneSupportedDisplaysKHR)(
VkPhysicalDevice physicalDevice, VkPhysicalDevice physicalDevice,
uint32_t planeIndex, uint32_t planeIndex,
uint32_t* pDisplayCount, uint32_t* pDisplayCount,
VkDisplayKHR* pDisplays) VkDisplayKHR* pDisplays)
{ {
PROFILESTART(rpi_vkGetDisplayPlaneSupportedDisplaysKHR); PROFILESTART(RPIFUNC(vkGetDisplayPlaneSupportedDisplaysKHR));
assert(physicalDevice); assert(physicalDevice);
assert(pDisplayCount); assert(pDisplayCount);
@ -62,7 +62,7 @@ VKAPI_ATTR VkResult VKAPI_CALL rpi_vkGetDisplayPlaneSupportedDisplaysKHR(
{ {
*pDisplayCount = planes[planeIndex].numPossibleConnectors; *pDisplayCount = planes[planeIndex].numPossibleConnectors;
PROFILEEND(rpi_vkGetDisplayPlaneSupportedDisplaysKHR); PROFILEEND(RPIFUNC(vkGetDisplayPlaneSupportedDisplaysKHR));
return VK_SUCCESS; return VK_SUCCESS;
} }
@ -78,20 +78,20 @@ VKAPI_ATTR VkResult VKAPI_CALL rpi_vkGetDisplayPlaneSupportedDisplaysKHR(
if(arraySize < planes[planeIndex].numPossibleConnectors) if(arraySize < planes[planeIndex].numPossibleConnectors)
{ {
PROFILEEND(rpi_vkGetDisplayPlaneSupportedDisplaysKHR); PROFILEEND(RPIFUNC(vkGetDisplayPlaneSupportedDisplaysKHR));
return VK_INCOMPLETE; return VK_INCOMPLETE;
} }
PROFILEEND(rpi_vkGetDisplayPlaneSupportedDisplaysKHR); PROFILEEND(RPIFUNC(vkGetDisplayPlaneSupportedDisplaysKHR));
return VK_SUCCESS; return VK_SUCCESS;
} }
VKAPI_ATTR VkResult VKAPI_CALL rpi_vkGetPhysicalDeviceDisplayPropertiesKHR( VKAPI_ATTR VkResult VKAPI_CALL RPIFUNC(vkGetPhysicalDeviceDisplayPropertiesKHR)(
VkPhysicalDevice physicalDevice, VkPhysicalDevice physicalDevice,
uint32_t* pPropertyCount, uint32_t* pPropertyCount,
VkDisplayPropertiesKHR* pProperties) VkDisplayPropertiesKHR* pProperties)
{ {
PROFILESTART(rpi_vkGetPhysicalDeviceDisplayPropertiesKHR); PROFILESTART(RPIFUNC(vkGetPhysicalDeviceDisplayPropertiesKHR));
assert(physicalDevice); assert(physicalDevice);
assert(pPropertyCount); assert(pPropertyCount);
@ -104,7 +104,7 @@ VKAPI_ATTR VkResult VKAPI_CALL rpi_vkGetPhysicalDeviceDisplayPropertiesKHR(
{ {
*pPropertyCount = numDisplays; *pPropertyCount = numDisplays;
PROFILEEND(rpi_vkGetPhysicalDeviceDisplayPropertiesKHR); PROFILEEND(RPIFUNC(vkGetPhysicalDeviceDisplayPropertiesKHR));
return VK_SUCCESS; return VK_SUCCESS;
} }
@ -128,21 +128,21 @@ VKAPI_ATTR VkResult VKAPI_CALL rpi_vkGetPhysicalDeviceDisplayPropertiesKHR(
if(arraySize < numDisplays) if(arraySize < numDisplays)
{ {
PROFILEEND(rpi_vkGetPhysicalDeviceDisplayPropertiesKHR); PROFILEEND(RPIFUNC(vkGetPhysicalDeviceDisplayPropertiesKHR));
return VK_INCOMPLETE; return VK_INCOMPLETE;
} }
PROFILEEND(rpi_vkGetPhysicalDeviceDisplayPropertiesKHR); PROFILEEND(RPIFUNC(vkGetPhysicalDeviceDisplayPropertiesKHR));
return VK_SUCCESS; return VK_SUCCESS;
} }
VKAPI_ATTR VkResult VKAPI_CALL rpi_vkGetDisplayModePropertiesKHR( VKAPI_ATTR VkResult VKAPI_CALL RPIFUNC(vkGetDisplayModePropertiesKHR)(
VkPhysicalDevice physicalDevice, VkPhysicalDevice physicalDevice,
VkDisplayKHR display, VkDisplayKHR display,
uint32_t* pPropertyCount, uint32_t* pPropertyCount,
VkDisplayModePropertiesKHR* pProperties) VkDisplayModePropertiesKHR* pProperties)
{ {
PROFILESTART(rpi_vkGetDisplayModePropertiesKHR); PROFILESTART(RPIFUNC(vkGetDisplayModePropertiesKHR));
assert(physicalDevice); assert(physicalDevice);
assert(display); assert(display);
@ -156,7 +156,7 @@ VKAPI_ATTR VkResult VKAPI_CALL rpi_vkGetDisplayModePropertiesKHR(
{ {
*pPropertyCount = numModes; *pPropertyCount = numModes;
PROFILEEND(rpi_vkGetDisplayModePropertiesKHR); PROFILEEND(RPIFUNC(vkGetDisplayModePropertiesKHR));
return VK_SUCCESS; return VK_SUCCESS;
} }
@ -176,22 +176,22 @@ VKAPI_ATTR VkResult VKAPI_CALL rpi_vkGetDisplayModePropertiesKHR(
if(arraySize < numModes) if(arraySize < numModes)
{ {
PROFILEEND(rpi_vkGetDisplayModePropertiesKHR); PROFILEEND(RPIFUNC(vkGetDisplayModePropertiesKHR));
return VK_INCOMPLETE; return VK_INCOMPLETE;
} }
PROFILEEND(rpi_vkGetDisplayModePropertiesKHR); PROFILEEND(RPIFUNC(vkGetDisplayModePropertiesKHR));
return VK_SUCCESS; return VK_SUCCESS;
} }
VKAPI_ATTR VkResult VKAPI_CALL rpi_vkCreateDisplayModeKHR( VKAPI_ATTR VkResult VKAPI_CALL RPIFUNC(vkCreateDisplayModeKHR)(
VkPhysicalDevice physicalDevice, VkPhysicalDevice physicalDevice,
VkDisplayKHR display, VkDisplayKHR display,
const VkDisplayModeCreateInfoKHR* pCreateInfo, const VkDisplayModeCreateInfoKHR* pCreateInfo,
const VkAllocationCallbacks* pAllocator, const VkAllocationCallbacks* pAllocator,
VkDisplayModeKHR* pMode) VkDisplayModeKHR* pMode)
{ {
PROFILESTART(rpi_vkCreateDisplayModeKHR); PROFILESTART(RPIFUNC(vkCreateDisplayModeKHR));
assert(physicalDevice); assert(physicalDevice);
assert(display); assert(display);
@ -213,16 +213,16 @@ VKAPI_ATTR VkResult VKAPI_CALL rpi_vkCreateDisplayModeKHR(
} }
} }
PROFILEEND(rpi_vkCreateDisplayModeKHR); PROFILEEND(RPIFUNC(vkCreateDisplayModeKHR));
} }
VKAPI_ATTR VkResult VKAPI_CALL rpi_vkCreateDisplayPlaneSurfaceKHR( VKAPI_ATTR VkResult VKAPI_CALL RPIFUNC(vkCreateDisplayPlaneSurfaceKHR)(
VkInstance instance, VkInstance instance,
const VkDisplaySurfaceCreateInfoKHR* pCreateInfo, const VkDisplaySurfaceCreateInfoKHR* pCreateInfo,
const VkAllocationCallbacks* pAllocator, const VkAllocationCallbacks* pAllocator,
VkSurfaceKHR* pSurface) VkSurfaceKHR* pSurface)
{ {
PROFILESTART(rpi_vkCreateDisplayPlaneSurfaceKHR); PROFILESTART(RPIFUNC(vkCreateDisplayPlaneSurfaceKHR));
assert(instance); assert(instance);
assert(pSurface); assert(pSurface);
@ -235,7 +235,7 @@ VKAPI_ATTR VkResult VKAPI_CALL rpi_vkCreateDisplayPlaneSurfaceKHR(
*pSurface = surface; *pSurface = surface;
PROFILEEND(rpi_vkCreateDisplayPlaneSurfaceKHR); PROFILEEND(RPIFUNC(vkCreateDisplayPlaneSurfaceKHR));
} }
/* /*
@ -244,12 +244,12 @@ VKAPI_ATTR VkResult VKAPI_CALL rpi_vkCreateDisplayPlaneSurfaceKHR(
* and does not imply destroying the native surface, closing a window, or similar behavior * and does not imply destroying the native surface, closing a window, or similar behavior
* (but we'll do so anyways...) * (but we'll do so anyways...)
*/ */
VKAPI_ATTR void VKAPI_CALL rpi_vkDestroySurfaceKHR( VKAPI_ATTR void VKAPI_CALL RPIFUNC(vkDestroySurfaceKHR)(
VkInstance instance, VkInstance instance,
VkSurfaceKHR surface, VkSurfaceKHR surface,
const VkAllocationCallbacks* pAllocator) const VkAllocationCallbacks* pAllocator)
{ {
PROFILESTART(rpi_vkDestroySurfaceKHR); PROFILESTART(RPIFUNC(vkDestroySurfaceKHR));
assert(instance); assert(instance);
@ -260,7 +260,7 @@ VKAPI_ATTR void VKAPI_CALL rpi_vkDestroySurfaceKHR(
FREE(surface); FREE(surface);
PROFILEEND(rpi_vkDestroySurfaceKHR); PROFILEEND(RPIFUNC(vkDestroySurfaceKHR));
} }
/* /*
@ -273,12 +273,12 @@ VKAPI_ATTR void VKAPI_CALL rpi_vkDestroySurfaceKHR(
* *
* capabilities the specified device supports for a swapchain created for the surface * capabilities the specified device supports for a swapchain created for the surface
*/ */
VKAPI_ATTR VkResult VKAPI_CALL rpi_vkGetPhysicalDeviceSurfaceCapabilitiesKHR( VKAPI_ATTR VkResult VKAPI_CALL RPIFUNC(vkGetPhysicalDeviceSurfaceCapabilitiesKHR)(
VkPhysicalDevice physicalDevice, VkPhysicalDevice physicalDevice,
VkSurfaceKHR surface, VkSurfaceKHR surface,
VkSurfaceCapabilitiesKHR* pSurfaceCapabilities) VkSurfaceCapabilitiesKHR* pSurfaceCapabilities)
{ {
PROFILESTART(rpi_vkGetPhysicalDeviceSurfaceCapabilitiesKHR); PROFILESTART(RPIFUNC(vkGetPhysicalDeviceSurfaceCapabilitiesKHR));
assert(physicalDevice); assert(physicalDevice);
assert(surface); assert(surface);
@ -306,7 +306,7 @@ VKAPI_ATTR VkResult VKAPI_CALL rpi_vkGetPhysicalDeviceSurfaceCapabilitiesKHR(
VK_IMAGE_USAGE_TRANSFER_DST_BIT | //for clears VK_IMAGE_USAGE_TRANSFER_DST_BIT | //for clears
VK_IMAGE_USAGE_TRANSFER_SRC_BIT; //for screenshots VK_IMAGE_USAGE_TRANSFER_SRC_BIT; //for screenshots
PROFILEEND(rpi_vkGetPhysicalDeviceSurfaceCapabilitiesKHR); PROFILEEND(RPIFUNC(vkGetPhysicalDeviceSurfaceCapabilitiesKHR));
return VK_SUCCESS; return VK_SUCCESS;
} }
@ -319,13 +319,13 @@ VKAPI_ATTR VkResult VKAPI_CALL rpi_vkGetPhysicalDeviceSurfaceCapabilitiesKHR(
* at most pSurfaceFormatCount structures will be written. If pSurfaceFormatCount is smaller than the number of format pairs supported for the given surface, * at most pSurfaceFormatCount structures will be written. If pSurfaceFormatCount is smaller than the number of format pairs supported for the given surface,
* VK_INCOMPLETE will be returned instead of VK_SUCCESS to indicate that not all the available values were returned. * VK_INCOMPLETE will be returned instead of VK_SUCCESS to indicate that not all the available values were returned.
*/ */
VKAPI_ATTR VkResult VKAPI_CALL rpi_vkGetPhysicalDeviceSurfaceFormatsKHR( VKAPI_ATTR VkResult VKAPI_CALL RPIFUNC(vkGetPhysicalDeviceSurfaceFormatsKHR)(
VkPhysicalDevice physicalDevice, VkPhysicalDevice physicalDevice,
VkSurfaceKHR surface, VkSurfaceKHR surface,
uint32_t* pSurfaceFormatCount, uint32_t* pSurfaceFormatCount,
VkSurfaceFormatKHR* pSurfaceFormats) VkSurfaceFormatKHR* pSurfaceFormats)
{ {
PROFILESTART(rpi_vkGetPhysicalDeviceSurfaceFormatsKHR); PROFILESTART(RPIFUNC(vkGetPhysicalDeviceSurfaceFormatsKHR));
assert(physicalDevice); assert(physicalDevice);
assert(surface); assert(surface);
@ -337,7 +337,7 @@ VKAPI_ATTR VkResult VKAPI_CALL rpi_vkGetPhysicalDeviceSurfaceFormatsKHR(
{ {
*pSurfaceFormatCount = numFormats; *pSurfaceFormatCount = numFormats;
PROFILEEND(rpi_vkGetPhysicalDeviceSurfaceFormatsKHR); PROFILEEND(RPIFUNC(vkGetPhysicalDeviceSurfaceFormatsKHR));
return VK_SUCCESS; return VK_SUCCESS;
} }
@ -353,11 +353,11 @@ VKAPI_ATTR VkResult VKAPI_CALL rpi_vkGetPhysicalDeviceSurfaceFormatsKHR(
if(elementsWritten < numFormats) if(elementsWritten < numFormats)
{ {
PROFILEEND(rpi_vkGetPhysicalDeviceSurfaceFormatsKHR); PROFILEEND(RPIFUNC(vkGetPhysicalDeviceSurfaceFormatsKHR));
return VK_INCOMPLETE; return VK_INCOMPLETE;
} }
PROFILEEND(rpi_vkGetPhysicalDeviceSurfaceFormatsKHR); PROFILEEND(RPIFUNC(vkGetPhysicalDeviceSurfaceFormatsKHR));
return VK_SUCCESS; return VK_SUCCESS;
} }
@ -370,13 +370,13 @@ VKAPI_ATTR VkResult VKAPI_CALL rpi_vkGetPhysicalDeviceSurfaceFormatsKHR(
* If pPresentModeCount is smaller than the number of presentation modes supported for the given surface, VK_INCOMPLETE will be returned instead of * If pPresentModeCount is smaller than the number of presentation modes supported for the given surface, VK_INCOMPLETE will be returned instead of
* VK_SUCCESS to indicate that not all the available values were returned. * VK_SUCCESS to indicate that not all the available values were returned.
*/ */
VKAPI_ATTR VkResult VKAPI_CALL rpi_vkGetPhysicalDeviceSurfacePresentModesKHR( VKAPI_ATTR VkResult VKAPI_CALL RPIFUNC(vkGetPhysicalDeviceSurfacePresentModesKHR)(
VkPhysicalDevice physicalDevice, VkPhysicalDevice physicalDevice,
VkSurfaceKHR surface, VkSurfaceKHR surface,
uint32_t* pPresentModeCount, uint32_t* pPresentModeCount,
VkPresentModeKHR* pPresentModes) VkPresentModeKHR* pPresentModes)
{ {
PROFILESTART(rpi_vkGetPhysicalDeviceSurfacePresentModesKHR); PROFILESTART(RPIFUNC(vkGetPhysicalDeviceSurfacePresentModesKHR));
assert(physicalDevice); assert(physicalDevice);
assert(surface); assert(surface);
@ -386,7 +386,7 @@ VKAPI_ATTR VkResult VKAPI_CALL rpi_vkGetPhysicalDeviceSurfacePresentModesKHR(
{ {
*pPresentModeCount = numSupportedPresentModes; *pPresentModeCount = numSupportedPresentModes;
PROFILEEND(rpi_vkGetPhysicalDeviceSurfacePresentModesKHR); PROFILEEND(RPIFUNC(vkGetPhysicalDeviceSurfacePresentModesKHR));
return VK_SUCCESS; return VK_SUCCESS;
} }
@ -403,24 +403,24 @@ VKAPI_ATTR VkResult VKAPI_CALL rpi_vkGetPhysicalDeviceSurfacePresentModesKHR(
if(elementsWritten < numSupportedPresentModes) if(elementsWritten < numSupportedPresentModes)
{ {
PROFILEEND(rpi_vkGetPhysicalDeviceSurfacePresentModesKHR); PROFILEEND(RPIFUNC(vkGetPhysicalDeviceSurfacePresentModesKHR));
return VK_INCOMPLETE; return VK_INCOMPLETE;
} }
PROFILEEND(rpi_vkGetPhysicalDeviceSurfacePresentModesKHR); PROFILEEND(RPIFUNC(vkGetPhysicalDeviceSurfacePresentModesKHR));
return VK_SUCCESS; return VK_SUCCESS;
} }
/* /*
* https://www.khronos.org/registry/vulkan/specs/1.1-extensions/html/vkspec.html#vkCreateSwapchainKHR * https://www.khronos.org/registry/vulkan/specs/1.1-extensions/html/vkspec.html#vkCreateSwapchainKHR
*/ */
VKAPI_ATTR VkResult VKAPI_CALL rpi_vkCreateSwapchainKHR( VKAPI_ATTR VkResult VKAPI_CALL RPIFUNC(vkCreateSwapchainKHR)(
VkDevice device, VkDevice device,
const VkSwapchainCreateInfoKHR* pCreateInfo, const VkSwapchainCreateInfoKHR* pCreateInfo,
const VkAllocationCallbacks* pAllocator, const VkAllocationCallbacks* pAllocator,
VkSwapchainKHR* pSwapchain) VkSwapchainKHR* pSwapchain)
{ {
PROFILESTART(rpi_vkCreateSwapchainKHR); PROFILESTART(RPIFUNC(vkCreateSwapchainKHR));
assert(device); assert(device);
assert(pCreateInfo); assert(pCreateInfo);
@ -429,7 +429,7 @@ VKAPI_ATTR VkResult VKAPI_CALL rpi_vkCreateSwapchainKHR(
*pSwapchain = ALLOCATE(sizeof(_swapchain), 1, VK_SYSTEM_ALLOCATION_SCOPE_OBJECT); *pSwapchain = ALLOCATE(sizeof(_swapchain), 1, VK_SYSTEM_ALLOCATION_SCOPE_OBJECT);
if(!*pSwapchain) if(!*pSwapchain)
{ {
PROFILEEND(rpi_vkCreateSwapchainKHR); PROFILEEND(RPIFUNC(vkCreateSwapchainKHR));
return VK_ERROR_OUT_OF_HOST_MEMORY; return VK_ERROR_OUT_OF_HOST_MEMORY;
} }
@ -441,7 +441,7 @@ VKAPI_ATTR VkResult VKAPI_CALL rpi_vkCreateSwapchainKHR(
s->images = ALLOCATE(sizeof(_image) * pCreateInfo->minImageCount, 1, VK_SYSTEM_ALLOCATION_SCOPE_OBJECT); s->images = ALLOCATE(sizeof(_image) * pCreateInfo->minImageCount, 1, VK_SYSTEM_ALLOCATION_SCOPE_OBJECT);
if(!s->images) if(!s->images)
{ {
PROFILEEND(rpi_vkCreateSwapchainKHR); PROFILEEND(RPIFUNC(vkCreateSwapchainKHR));
return VK_ERROR_OUT_OF_HOST_MEMORY; return VK_ERROR_OUT_OF_HOST_MEMORY;
} }
@ -469,7 +469,7 @@ VKAPI_ATTR VkResult VKAPI_CALL rpi_vkCreateSwapchainKHR(
imageCreateInfo.extent.depth = 1; imageCreateInfo.extent.depth = 1;
VkImage img; VkImage img;
rpi_vkCreateImage(device, &imageCreateInfo, pAllocator, &img); RPIFUNC(vkCreateImage)(device, &imageCreateInfo, pAllocator, &img);
s->images[c] = *(_image*)img; s->images[c] = *(_image*)img;
@ -480,7 +480,7 @@ VKAPI_ATTR VkResult VKAPI_CALL rpi_vkCreateSwapchainKHR(
s->images[c].clipped = pCreateInfo->clipped; s->images[c].clipped = pCreateInfo->clipped;
VkMemoryRequirements mr; VkMemoryRequirements mr;
rpi_vkGetImageMemoryRequirements(device, &s->images[c], &mr); RPIFUNC(vkGetImageMemoryRequirements)(device, &s->images[c], &mr);
s->images[c].alignment = mr.alignment; s->images[c].alignment = mr.alignment;
@ -497,14 +497,14 @@ VKAPI_ATTR VkResult VKAPI_CALL rpi_vkCreateSwapchainKHR(
} }
VkDeviceMemory mem; VkDeviceMemory mem;
rpi_vkAllocateMemory(device, &ai, pAllocator, &mem); RPIFUNC(vkAllocateMemory)(device, &ai, pAllocator, &mem);
rpi_vkBindImageMemory(device, &s->images[c], mem, 0); RPIFUNC(vkBindImageMemory)(device, &s->images[c], mem, 0);
modeset_create_fb_for_surface(controlFd, &s->images[c], pCreateInfo->surface); assert(s->images[c].fb); modeset_create_fb_for_surface(controlFd, &s->images[c], pCreateInfo->surface); assert(s->images[c].fb);
} }
PROFILEEND(rpi_vkCreateSwapchainKHR); PROFILEEND(RPIFUNC(vkCreateSwapchainKHR));
return VK_SUCCESS; return VK_SUCCESS;
} }
@ -517,13 +517,13 @@ VKAPI_ATTR VkResult VKAPI_CALL rpi_vkCreateSwapchainKHR(
* If pSwapchainImageCount is smaller than the number of presentable images for swapchain, VK_INCOMPLETE will be returned instead of VK_SUCCESS to * If pSwapchainImageCount is smaller than the number of presentable images for swapchain, VK_INCOMPLETE will be returned instead of VK_SUCCESS to
* indicate that not all the available values were returned. * indicate that not all the available values were returned.
*/ */
VKAPI_ATTR VkResult VKAPI_CALL rpi_vkGetSwapchainImagesKHR( VKAPI_ATTR VkResult VKAPI_CALL RPIFUNC(vkGetSwapchainImagesKHR)(
VkDevice device, VkDevice device,
VkSwapchainKHR swapchain, VkSwapchainKHR swapchain,
uint32_t* pSwapchainImageCount, uint32_t* pSwapchainImageCount,
VkImage* pSwapchainImages) VkImage* pSwapchainImages)
{ {
PROFILESTART(rpi_vkGetSwapchainImagesKHR); PROFILESTART(RPIFUNC(vkGetSwapchainImagesKHR));
assert(device); assert(device);
assert(swapchain); assert(swapchain);
@ -535,7 +535,7 @@ VKAPI_ATTR VkResult VKAPI_CALL rpi_vkGetSwapchainImagesKHR(
{ {
*pSwapchainImageCount = s->numImages; *pSwapchainImageCount = s->numImages;
PROFILEEND(rpi_vkGetSwapchainImagesKHR); PROFILEEND(RPIFUNC(vkGetSwapchainImagesKHR));
return VK_SUCCESS; return VK_SUCCESS;
} }
@ -551,18 +551,18 @@ VKAPI_ATTR VkResult VKAPI_CALL rpi_vkGetSwapchainImagesKHR(
if(elementsWritten < s->numImages) if(elementsWritten < s->numImages)
{ {
PROFILEEND(rpi_vkGetSwapchainImagesKHR); PROFILEEND(RPIFUNC(vkGetSwapchainImagesKHR));
return VK_INCOMPLETE; return VK_INCOMPLETE;
} }
PROFILEEND(rpi_vkGetSwapchainImagesKHR); PROFILEEND(RPIFUNC(vkGetSwapchainImagesKHR));
return VK_SUCCESS; return VK_SUCCESS;
} }
/* /*
* https://www.khronos.org/registry/vulkan/specs/1.1-extensions/html/vkspec.html#vkAcquireNextImageKHR * https://www.khronos.org/registry/vulkan/specs/1.1-extensions/html/vkspec.html#vkAcquireNextImageKHR
*/ */
VKAPI_ATTR VkResult VKAPI_CALL rpi_vkAcquireNextImageKHR( VKAPI_ATTR VkResult VKAPI_CALL RPIFUNC(vkAcquireNextImageKHR)(
VkDevice device, VkDevice device,
VkSwapchainKHR swapchain, VkSwapchainKHR swapchain,
uint64_t timeout, uint64_t timeout,
@ -570,7 +570,7 @@ VKAPI_ATTR VkResult VKAPI_CALL rpi_vkAcquireNextImageKHR(
VkFence fence, VkFence fence,
uint32_t* pImageIndex) uint32_t* pImageIndex)
{ {
PROFILESTART(rpi_vkAcquireNextImageKHR); PROFILESTART(RPIFUNC(vkAcquireNextImageKHR));
assert(device); assert(device);
assert(swapchain); assert(swapchain);
@ -595,7 +595,7 @@ VKAPI_ATTR VkResult VKAPI_CALL rpi_vkAcquireNextImageKHR(
f->signaled = 1; f->signaled = 1;
} }
PROFILEEND(rpi_vkAcquireNextImageKHR); PROFILEEND(RPIFUNC(vkAcquireNextImageKHR));
return VK_SUCCESS; return VK_SUCCESS;
} }
@ -612,11 +612,11 @@ VKAPI_ATTR VkResult VKAPI_CALL rpi_vkAcquireNextImageKHR(
* However, if the presentation request is rejected by the presentation engine with an error VK_ERROR_OUT_OF_DATE_KHR or VK_ERROR_SURFACE_LOST_KHR, * However, if the presentation request is rejected by the presentation engine with an error VK_ERROR_OUT_OF_DATE_KHR or VK_ERROR_SURFACE_LOST_KHR,
* the set of queue operations are still considered to be enqueued and thus any semaphore to be waited on gets unsignaled when the corresponding queue operation is complete. * the set of queue operations are still considered to be enqueued and thus any semaphore to be waited on gets unsignaled when the corresponding queue operation is complete.
*/ */
VKAPI_ATTR VkResult VKAPI_CALL rpi_vkQueuePresentKHR( VKAPI_ATTR VkResult VKAPI_CALL RPIFUNC(vkQueuePresentKHR)(
VkQueue queue, VkQueue queue,
const VkPresentInfoKHR* pPresentInfo) const VkPresentInfoKHR* pPresentInfo)
{ {
PROFILESTART(rpi_vkQueuePresentKHR); PROFILESTART(RPIFUNC(vkQueuePresentKHR));
assert(queue); assert(queue);
assert(pPresentInfo); assert(pPresentInfo);
@ -634,19 +634,19 @@ VKAPI_ATTR VkResult VKAPI_CALL rpi_vkQueuePresentKHR(
s->backbufferIdx = (s->backbufferIdx + 1) % s->numImages; s->backbufferIdx = (s->backbufferIdx + 1) % s->numImages;
} }
PROFILEEND(rpi_vkQueuePresentKHR); PROFILEEND(RPIFUNC(vkQueuePresentKHR));
return VK_SUCCESS; return VK_SUCCESS;
} }
/* /*
* https://www.khronos.org/registry/vulkan/specs/1.1-extensions/html/vkspec.html#vkDestroySwapchainKHR * https://www.khronos.org/registry/vulkan/specs/1.1-extensions/html/vkspec.html#vkDestroySwapchainKHR
*/ */
VKAPI_ATTR void VKAPI_CALL rpi_vkDestroySwapchainKHR( VKAPI_ATTR void VKAPI_CALL RPIFUNC(vkDestroySwapchainKHR)(
VkDevice device, VkDevice device,
VkSwapchainKHR swapchain, VkSwapchainKHR swapchain,
const VkAllocationCallbacks* pAllocator) const VkAllocationCallbacks* pAllocator)
{ {
PROFILESTART(rpi_vkDestroySwapchainKHR); PROFILESTART(RPIFUNC(vkDestroySwapchainKHR));
assert(device); assert(device);
@ -658,7 +658,7 @@ VKAPI_ATTR void VKAPI_CALL rpi_vkDestroySwapchainKHR(
{ {
for(int c = 0; c < s->numImages; ++c) for(int c = 0; c < s->numImages; ++c)
{ {
rpi_vkFreeMemory(device, s->images[c].boundMem, 0); RPIFUNC(vkFreeMemory)(device, s->images[c].boundMem, 0);
modeset_destroy_fb(controlFd, &s->images[c]); modeset_destroy_fb(controlFd, &s->images[c]);
} }
@ -667,7 +667,7 @@ VKAPI_ATTR void VKAPI_CALL rpi_vkDestroySwapchainKHR(
FREE(s); FREE(s);
PROFILEEND(rpi_vkDestroySwapchainKHR); PROFILEEND(RPIFUNC(vkDestroySwapchainKHR));
//profilePrintResults(); //profilePrintResults();
} }
@ -676,13 +676,13 @@ VKAPI_ATTR void VKAPI_CALL rpi_vkDestroySwapchainKHR(
* https://www.khronos.org/registry/vulkan/specs/1.1-extensions/html/vkspec.html#vkGetPhysicalDeviceSurfaceSupportKHR * https://www.khronos.org/registry/vulkan/specs/1.1-extensions/html/vkspec.html#vkGetPhysicalDeviceSurfaceSupportKHR
* does this queue family support presentation to this surface? * does this queue family support presentation to this surface?
*/ */
VKAPI_ATTR VkResult VKAPI_CALL rpi_vkGetPhysicalDeviceSurfaceSupportKHR( VKAPI_ATTR VkResult VKAPI_CALL RPIFUNC(vkGetPhysicalDeviceSurfaceSupportKHR)(
VkPhysicalDevice physicalDevice, VkPhysicalDevice physicalDevice,
uint32_t queueFamilyIndex, uint32_t queueFamilyIndex,
VkSurfaceKHR surface, VkSurfaceKHR surface,
VkBool32* pSupported) VkBool32* pSupported)
{ {
PROFILESTART(rpi_vkGetPhysicalDeviceSurfaceSupportKHR); PROFILESTART(RPIFUNC(vkGetPhysicalDeviceSurfaceSupportKHR));
assert(pSupported); assert(pSupported);
assert(surface); assert(surface);
@ -695,7 +695,7 @@ VKAPI_ATTR VkResult VKAPI_CALL rpi_vkGetPhysicalDeviceSurfaceSupportKHR(
//other using /dev/dri/renderD128 which does not support modesetting, this would say false here //other using /dev/dri/renderD128 which does not support modesetting, this would say false here
*pSupported = VK_TRUE; *pSupported = VK_TRUE;
PROFILEEND(rpi_vkGetPhysicalDeviceSurfaceSupportKHR); PROFILEEND(RPIFUNC(vkGetPhysicalDeviceSurfaceSupportKHR));
return VK_SUCCESS; return VK_SUCCESS;
} }

View File

@ -8,4 +8,4 @@ target_compile_options(mintest PRIVATE -Wall -std=c++11
-march=${RPI_ARCH} -fPIC -march=${RPI_ARCH} -fPIC
) )
target_link_libraries(mintest vulkan $<TARGET_OBJECTS:QPUassembler>) target_link_libraries(mintest rpi-vk-driver)