1
0
mirror of https://github.com/Yours3lf/rpi-vk-driver.git synced 2025-02-19 16:54:18 +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,
* 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,
const VkCommandPoolCreateInfo* pCreateInfo,
const VkAllocationCallbacks* pAllocator,
VkCommandPool* pCommandPool)
{
PROFILESTART(rpi_vkCreateCommandPool);
PROFILESTART(RPIFUNC(vkCreateCommandPool));
assert(device);
assert(pCreateInfo);
@ -40,7 +40,7 @@ VKAPI_ATTR VkResult VKAPI_CALL rpi_vkCreateCommandPool(
if(!cp)
{
PROFILEEND(rpi_vkCreateCommandPool);
PROFILEEND(RPIFUNC(vkCreateCommandPool));
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);
if(!pamem)
{
PROFILEEND(rpi_vkCreateCommandPool);
PROFILEEND(RPIFUNC(vkCreateCommandPool));
return VK_ERROR_OUT_OF_HOST_MEMORY;
}
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);
if(!cpamem)
{
PROFILEEND(rpi_vkCreateCommandPool);
PROFILEEND(RPIFUNC(vkCreateCommandPool));
return VK_ERROR_OUT_OF_HOST_MEMORY;
}
cp->cpa = createConsecutivePoolAllocator(cpamem, consecutiveBlockSize, consecutivePoolSize);
@ -83,7 +83,7 @@ VKAPI_ATTR VkResult VKAPI_CALL rpi_vkCreateCommandPool(
*pCommandPool = (VkCommandPool)cp;
PROFILEEND(rpi_vkCreateCommandPool);
PROFILEEND(RPIFUNC(vkCreateCommandPool));
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,
* 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,
const VkCommandBufferAllocateInfo* pAllocateInfo,
VkCommandBuffer* pCommandBuffers)
{
PROFILESTART(rpi_vkAllocateCommandBuffers);
PROFILESTART(RPIFUNC(vkAllocateCommandBuffers));
assert(device);
assert(pAllocateInfo);
@ -201,18 +201,18 @@ VKAPI_ATTR VkResult VKAPI_CALL rpi_vkAllocateCommandBuffers(
}
}
PROFILEEND(rpi_vkAllocateCommandBuffers);
PROFILEEND(RPIFUNC(vkAllocateCommandBuffers));
return res;
}
/*
* 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,
const VkCommandBufferBeginInfo* pBeginInfo)
{
PROFILESTART(rpi_vkBeginCommandBuffer);
PROFILESTART(RPIFUNC(vkBeginCommandBuffer));
assert(commandBuffer);
assert(pBeginInfo);
@ -233,10 +233,10 @@ VKAPI_ATTR VkResult VKAPI_CALL rpi_vkBeginCommandBuffer(
if((pBeginInfo->flags & VK_COMMAND_BUFFER_USAGE_ONE_TIME_SUBMIT_BIT) &&
commandBuffer->cp->resetAble)
{
rpi_vkResetCommandBuffer(commandBuffer, 0);
RPIFUNC(vkResetCommandBuffer)(commandBuffer, 0);
}
PROFILEEND(rpi_vkBeginCommandBuffer);
PROFILEEND(RPIFUNC(vkBeginCommandBuffer));
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,
* and is moved to the executable state.
*/
VKAPI_ATTR VkResult VKAPI_CALL rpi_vkEndCommandBuffer(
VKAPI_ATTR VkResult VKAPI_CALL RPIFUNC(vkEndCommandBuffer)(
VkCommandBuffer commandBuffer)
{
PROFILESTART(rpi_vkEndCommandBuffer);
PROFILESTART(RPIFUNC(vkEndCommandBuffer));
assert(commandBuffer);
commandBuffer->state = CMDBUF_STATE_EXECUTABLE;
PROFILEEND(rpi_vkEndCommandBuffer);
PROFILEEND(RPIFUNC(vkEndCommandBuffer));
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,
* 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,
uint32_t submitCount,
const VkSubmitInfo* pSubmits,
VkFence fence)
{
PROFILESTART(rpi_vkQueueSubmit);
PROFILESTART(RPIFUNC(vkQueueSubmit));
assert(queue);
@ -679,7 +679,7 @@ VKAPI_ATTR VkResult VKAPI_CALL rpi_vkQueueSubmit(
f->seqno = queue->lastEmitSeqno;
}
PROFILEEND(rpi_vkQueueSubmit);
PROFILEEND(RPIFUNC(vkQueueSubmit));
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
* 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,
VkCommandPool commandPool,
uint32_t commandBufferCount,
const VkCommandBuffer* pCommandBuffers)
{
PROFILESTART(rpi_vkFreeCommandBuffers);
PROFILESTART(RPIFUNC(vkFreeCommandBuffers));
assert(device);
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
* allocated from commandPool recorded into it, becomes invalid.
*/
VKAPI_ATTR void VKAPI_CALL rpi_vkDestroyCommandPool(
VKAPI_ATTR void VKAPI_CALL RPIFUNC(vkDestroyCommandPool)(
VkDevice device,
VkCommandPool commandPool,
const VkAllocationCallbacks* pAllocator)
{
PROFILESTART(rpi_vkDestroyCommandPool);
PROFILESTART(RPIFUNC(vkDestroyCommandPool));
assert(device);
@ -742,18 +742,18 @@ VKAPI_ATTR void VKAPI_CALL rpi_vkDestroyCommandPool(
FREE(cp);
}
PROFILEEND(rpi_vkDestroyCommandPool);
PROFILEEND(RPIFUNC(vkDestroyCommandPool));
}
/*
* 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,
VkCommandPool commandPool,
VkCommandPoolTrimFlags flags)
{
PROFILESTART(rpi_vkTrimCommandPool);
PROFILESTART(RPIFUNC(vkTrimCommandPool));
assert(device);
assert(commandPool);
@ -764,18 +764,18 @@ VKAPI_ATTR void VKAPI_CALL rpi_vkTrimCommandPool(
//by reallocating to just used size
//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
*/
VKAPI_ATTR VkResult VKAPI_CALL rpi_vkResetCommandPool(
VKAPI_ATTR VkResult VKAPI_CALL RPIFUNC(vkResetCommandPool)(
VkDevice device,
VkCommandPool commandPool,
VkCommandPoolResetFlags flags)
{
PROFILESTART(rpi_vkResetCommandPool);
PROFILESTART(RPIFUNC(vkResetCommandPool));
assert(device);
assert(commandPool);
@ -809,17 +809,17 @@ VKAPI_ATTR VkResult VKAPI_CALL rpi_vkResetCommandPool(
//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
*/
VKAPI_ATTR VkResult VKAPI_CALL rpi_vkResetCommandBuffer(
VKAPI_ATTR VkResult VKAPI_CALL RPIFUNC(vkResetCommandBuffer)(
VkCommandBuffer commandBuffer,
VkCommandBufferResetFlags flags)
{
PROFILESTART(rpi_vkResetCommandBuffer);
PROFILESTART(RPIFUNC(vkResetCommandBuffer));
assert(commandBuffer);
@ -884,20 +884,20 @@ VKAPI_ATTR VkResult VKAPI_CALL rpi_vkResetCommandBuffer(
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,
uint32_t commandBufferCount,
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,
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,
const VkPhysicalDeviceExternalBufferInfo* pExternalBufferInfo,
VkExternalBufferProperties* pExternalBufferProperties)
@ -977,7 +977,7 @@ VKAPI_ATTR void VKAPI_CALL rpi_vkGetPhysicalDeviceExternalBufferProperties(
UNSUPPORTED(vkGetPhysicalDeviceExternalBufferProperties);
}
VKAPI_ATTR void VKAPI_CALL rpi_vkGetPhysicalDeviceExternalFenceProperties(
VKAPI_ATTR void VKAPI_CALL RPIFUNC(vkGetPhysicalDeviceExternalFenceProperties)(
VkPhysicalDevice physicalDevice,
const VkPhysicalDeviceExternalFenceInfo* pExternalFenceInfo,
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,
const VkPhysicalDeviceExternalSemaphoreInfo* pExternalSemaphoreInfo,
VkExternalSemaphoreProperties* pExternalSemaphoreProperties)
@ -994,7 +994,7 @@ VKAPI_ATTR void VKAPI_CALL rpi_vkGetPhysicalDeviceExternalSemaphoreProperties(
UNSUPPORTED(vkGetPhysicalDeviceExternalSemaphoreProperties);
}
VKAPI_ATTR void VKAPI_CALL rpi_vkGetDeviceGroupPeerMemoryFeatures(
VKAPI_ATTR void VKAPI_CALL RPIFUNC(vkGetDeviceGroupPeerMemoryFeatures)(
VkDevice device,
uint32_t heapIndex,
uint32_t localDeviceIndex,

View File

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

View File

@ -47,19 +47,19 @@ void createFullscreenQuad(VkDevice device, VkBuffer* fsqVertexBuffer, VkDeviceMe
ci.size = vboSize;
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;
rpi_vkGetPhysicalDeviceMemoryProperties(((_device*)device)->dev, &pdmp);
RPIFUNC(vkGetPhysicalDeviceMemoryProperties)(((_device*)device)->dev, &pdmp);
VkMemoryAllocateInfo mai = {};
mai.sType = VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_INFO;
mai.allocationSize = mr.size;
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[] =
{
@ -73,11 +73,11 @@ void createFullscreenQuad(VkDevice device, VkBuffer* fsqVertexBuffer, VkDeviceMe
};
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);
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.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)
@ -117,10 +117,10 @@ void createDescriptorSetLayouts(VkDevice device, VkDescriptorSetLayout* bufferDs
descriptorLayoutCI.bindingCount = 1;
descriptorLayoutCI.pBindings = &setLayoutBinding;
rpi_vkCreateDescriptorSetLayout(device, &descriptorLayoutCI, 0, bufferDsl);
RPIFUNC(vkCreateDescriptorSetLayout)(device, &descriptorLayoutCI, 0, bufferDsl);
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)
@ -136,11 +136,11 @@ void createSampler(VkDevice device, VkSampler* nearestTextureSampler, VkSampler*
sampler.mipLodBias = 0.0f;
sampler.compareOp = VK_COMPARE_OP_NEVER;
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.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)
@ -174,7 +174,7 @@ void createRendertarget(VkDevice device, uint32_t baseLayer, uint32_t baseMip, u
view.subresourceRange.layerCount = 1;
view.subresourceRange.levelCount = 1;
view.image = textureImage;
rpi_vkCreateImageView(device, &view, 0, textureView);
RPIFUNC(vkCreateImageView)(device, &view, 0, textureView);
VkAttachmentDescription attachmentDescription = {};
attachmentDescription.format = format;
@ -219,7 +219,7 @@ void createRendertarget(VkDevice device, uint32_t baseLayer, uint32_t baseMip, u
renderPassInfo.dependencyCount = 2;
renderPassInfo.pDependencies = dependencies;
rpi_vkCreateRenderPass(device, &renderPassInfo, 0, offscreenRenderPass);
RPIFUNC(vkCreateRenderPass)(device, &renderPassInfo, 0, offscreenRenderPass);
VkImageView attachments = *textureView;
@ -231,7 +231,7 @@ void createRendertarget(VkDevice device, uint32_t baseLayer, uint32_t baseMip, u
framebufferCreateInfo.height = height;
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)
@ -326,7 +326,7 @@ void createPipeline(VkDevice device, uint32_t needTexcoords, uint32_t numVertUni
pipelineLayoutCI.pSetLayouts = &blitDsl;
pipelineLayoutCI.pushConstantRangeCount = 2;
pipelineLayoutCI.pPushConstantRanges = &pushConstantRanges[0];
rpi_vkCreatePipelineLayout(device, &pipelineLayoutCI, 0, blitPipelineLayout);
RPIFUNC(vkCreatePipelineLayout)(device, &pipelineLayoutCI, 0, blitPipelineLayout);
VkDynamicState dynState = VK_DYNAMIC_STATE_VIEWPORT;
@ -356,7 +356,7 @@ void createPipeline(VkDevice device, uint32_t needTexcoords, uint32_t numVertUni
pipelineInfo.pDepthStencilState = &depthStencilState;
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)
@ -652,7 +652,7 @@ void createBufferToTextureShaderModule(VkDevice device, VkShaderModule* blitShad
smci.sType = VK_STRUCTURE_TYPE_SHADER_MODULE_CREATE_INFO;
smci.codeSize = sizeof(uint32_t)*6;
smci.pCode = spirv;
rpi_vkCreateShaderModule(device, &smci, 0, blitShaderModule);
RPIFUNC(vkCreateShaderModule)(device, &smci, 0, blitShaderModule);
assert(blitShaderModule);
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.codeSize = sizeof(uint32_t)*6;
smci.pCode = spirv;
rpi_vkCreateShaderModule(device, &smci, 0, blitShaderModule);
RPIFUNC(vkCreateShaderModule)(device, &smci, 0, blitShaderModule);
assert(blitShaderModule);
for(uint32_t c = 0; c < 4; ++c)
@ -943,7 +943,7 @@ void setupEmulationResources(VkDevice device)
createTextureToTextureShaderModule(device, &dev->emulTextureToTextureShaderModule);
}
VKAPI_ATTR void VKAPI_CALL rpi_vkCmdCopyBufferToImage(
VKAPI_ATTR void VKAPI_CALL RPIFUNC(vkCmdCopyBufferToImage)(
VkCommandBuffer commandBuffer,
VkBuffer srcBuffer,
VkImage dstImage,
@ -951,7 +951,7 @@ VKAPI_ATTR void VKAPI_CALL rpi_vkCmdCopyBufferToImage(
uint32_t regionCount,
const VkBufferImageCopy* pRegions)
{
PROFILESTART(rpi_vkCmdCopyBufferToImage);
PROFILESTART(RPIFUNC(vkCmdCopyBufferToImage));
_commandBuffer* cmdBuf = commandBuffer;
_device* device = cmdBuf->dev;
@ -975,7 +975,7 @@ VKAPI_ATTR void VKAPI_CALL rpi_vkCmdCopyBufferToImage(
bvci.format = img->format;
bvci.offset = pRegions[c].bufferOffset;
bvci.range = (width * height * pixelBpp) >> 3;
rpi_vkCreateBufferView(device, &bvci, 0, &texelBufferView);
RPIFUNC(vkCreateBufferView)(device, &bvci, 0, &texelBufferView);
VkDescriptorSet blitDescriptorSet;
VkImageView textureView;
@ -990,7 +990,7 @@ VKAPI_ATTR void VKAPI_CALL rpi_vkCmdCopyBufferToImage(
allocInfo.descriptorPool = device->emulDescriptorPool;
allocInfo.descriptorSetCount = 1;
allocInfo.pSetLayouts = &device->emulBufferDsl;
rpi_vkAllocateDescriptorSets(device, &allocInfo, &blitDescriptorSet);
RPIFUNC(vkAllocateDescriptorSets)(device, &allocInfo, &blitDescriptorSet);
VkWriteDescriptorSet writeDescriptorSet = {};
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.pTexelBufferView = &texelBufferView;
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);
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.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 = {};
vp.x = 0.0f;
@ -1033,12 +1033,12 @@ VKAPI_ATTR void VKAPI_CALL rpi_vkCmdCopyBufferToImage(
vp.minDepth = 0.0f;
vp.maxDepth = 1.0f;
rpi_vkCmdSetViewport(commandBuffer, 0, 1, &vp);
RPIFUNC(vkCmdSetViewport)(commandBuffer, 0, 1, &vp);
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 viewportScaleX = (float)(width) * 0.5f * 16.0f;
@ -1051,7 +1051,7 @@ VKAPI_ATTR void VKAPI_CALL rpi_vkCmdCopyBufferToImage(
vertConstants[2] = *(uint32_t*)&viewportScaleY;
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 bppfloat = pixelBpp;
@ -1062,27 +1062,27 @@ VKAPI_ATTR void VKAPI_CALL rpi_vkCmdCopyBufferToImage(
fragConstants[2] = size;
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
rpi_vkDestroyPipelineLayout(device, blitPipelineLayout, 0);
rpi_vkDestroyPipeline(device, blitPipeline, 0);
rpi_vkFreeDescriptorSets(device, device->emulDescriptorPool, 1, &blitDescriptorSet);
rpi_vkDestroyImageView(device, textureView, 0);
rpi_vkDestroyRenderPass(device, offscreenRenderPass, 0);
rpi_vkDestroyFramebuffer(device, offscreenFramebuffer, 0);
RPIFUNC(vkDestroyPipelineLayout)(device, blitPipelineLayout, 0);
RPIFUNC(vkDestroyPipeline)(device, blitPipeline, 0);
RPIFUNC(vkFreeDescriptorSets)(device, device->emulDescriptorPool, 1, &blitDescriptorSet);
RPIFUNC(vkDestroyImageView)(device, textureView, 0);
RPIFUNC(vkDestroyRenderPass)(device, offscreenRenderPass, 0);
RPIFUNC(vkDestroyFramebuffer)(device, offscreenFramebuffer, 0);
}
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,
VkImage srcImage,
VkImageLayout srcImageLayout,
@ -1092,7 +1092,7 @@ VKAPI_ATTR void VKAPI_CALL rpi_vkCmdBlitImage(
const VkImageBlit* pRegions,
VkFilter filter)
{
PROFILESTART(rpi_vkCmdBlitImage);
PROFILESTART(RPIFUNC(vkCmdBlitImage));
_commandBuffer* cmdBuf = commandBuffer;
_device* device = cmdBuf->dev;
@ -1133,7 +1133,7 @@ VKAPI_ATTR void VKAPI_CALL rpi_vkCmdBlitImage(
samplerCI.mipLodBias = 1.0f; //disable auto lod
samplerCI.compareOp = VK_COMPARE_OP_NEVER;
samplerCI.borderColor = VK_BORDER_COLOR_FLOAT_TRANSPARENT_BLACK;
rpi_vkCreateSampler(device, &samplerCI, 0, &mipSampler);
RPIFUNC(vkCreateSampler)(device, &samplerCI, 0, &mipSampler);
_sampler* s = mipSampler;
VkImageViewCreateInfo view = {};
@ -1146,7 +1146,7 @@ VKAPI_ATTR void VKAPI_CALL rpi_vkCmdBlitImage(
view.subresourceRange.layerCount = 1;
view.subresourceRange.levelCount = srcImg->miplevels;
view.image = srcImage;
rpi_vkCreateImageView(device, &view, 0, &srcTextureView);
RPIFUNC(vkCreateImageView)(device, &view, 0, &srcTextureView);
//create blit descriptor set
VkDescriptorSetAllocateInfo allocInfo = {};
@ -1154,7 +1154,7 @@ VKAPI_ATTR void VKAPI_CALL rpi_vkCmdBlitImage(
allocInfo.descriptorPool = device->emulDescriptorPool;
allocInfo.descriptorSetCount = 1;
allocInfo.pSetLayouts = &device->emulTextureDsl;
rpi_vkAllocateDescriptorSets(device, &allocInfo, &blitDescriptorSet);
RPIFUNC(vkAllocateDescriptorSets)(device, &allocInfo, &blitDescriptorSet);
VkDescriptorImageInfo imageInfo;
imageInfo.imageView = srcTextureView;
@ -1168,7 +1168,7 @@ VKAPI_ATTR void VKAPI_CALL rpi_vkCmdBlitImage(
writeDescriptorSet.descriptorType = VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER;
writeDescriptorSet.pImageInfo = &imageInfo;
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);
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.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 = {};
vp.x = 0.0f;
@ -1202,12 +1202,12 @@ VKAPI_ATTR void VKAPI_CALL rpi_vkCmdBlitImage(
vp.minDepth = 0.0f;
vp.maxDepth = 1.0f;
rpi_vkCmdSetViewport(commandBuffer, 0, 1, &vp);
RPIFUNC(vkCmdSetViewport)(commandBuffer, 0, 1, &vp);
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 viewportScaleX = (float)(dstWidth) * 0.5f * 16.0f;
@ -1220,33 +1220,33 @@ VKAPI_ATTR void VKAPI_CALL rpi_vkCmdBlitImage(
vertConstants[2] = *(uint32_t*)&viewportScaleY;
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;
uint32_t fragConstants[1];
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
rpi_vkDestroySampler(device, mipSampler, 0);
rpi_vkDestroyPipelineLayout(device, blitPipelineLayout, 0);
rpi_vkDestroyPipeline(device, blitPipeline, 0);
rpi_vkFreeDescriptorSets(device, device->emulDescriptorPool, 1, &blitDescriptorSet);
rpi_vkDestroyImageView(device, srcTextureView, 0);
rpi_vkDestroyImageView(device, dstTextureView, 0);
rpi_vkDestroyRenderPass(device, offscreenRenderPass, 0);
rpi_vkDestroyFramebuffer(device, offscreenFramebuffer, 0);
RPIFUNC(vkDestroySampler)(device, mipSampler, 0);
RPIFUNC(vkDestroyPipelineLayout)(device, blitPipelineLayout, 0);
RPIFUNC(vkDestroyPipeline)(device, blitPipeline, 0);
RPIFUNC(vkFreeDescriptorSets)(device, device->emulDescriptorPool, 1, &blitDescriptorSet);
RPIFUNC(vkDestroyImageView)(device, srcTextureView, 0);
RPIFUNC(vkDestroyImageView)(device, dstTextureView, 0);
RPIFUNC(vkDestroyRenderPass)(device, offscreenRenderPass, 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,
VkImage srcImage,
VkImageLayout srcImageLayout,
@ -1255,12 +1255,12 @@ VKAPI_ATTR void VKAPI_CALL rpi_vkCmdResolveImage(
uint32_t regionCount,
const VkImageResolve* pRegions)
{
PROFILESTART(rpi_vkCmdResolveImage);
PROFILESTART(RPIFUNC(vkCmdResolveImage));
//TODO
PROFILEEND(rpi_vkCmdResolveImage);
PROFILEEND(RPIFUNC(vkCmdResolveImage));
}
VKAPI_ATTR void VKAPI_CALL rpi_vkCmdCopyImageToBuffer(
VKAPI_ATTR void VKAPI_CALL RPIFUNC(vkCmdCopyImageToBuffer)(
VkCommandBuffer commandBuffer,
VkImage srcImage,
VkImageLayout srcImageLayout,
@ -1268,12 +1268,12 @@ VKAPI_ATTR void VKAPI_CALL rpi_vkCmdCopyImageToBuffer(
uint32_t regionCount,
const VkBufferImageCopy* pRegions)
{
PROFILESTART(rpi_vkCmdCopyImageToBuffer);
PROFILESTART(RPIFUNC(vkCmdCopyImageToBuffer));
//TODO
PROFILEEND(rpi_vkCmdCopyImageToBuffer);
PROFILEEND(RPIFUNC(vkCmdCopyImageToBuffer));
}
VKAPI_ATTR void VKAPI_CALL rpi_vkCmdCopyImage(
VKAPI_ATTR void VKAPI_CALL RPIFUNC(vkCmdCopyImage)(
VkCommandBuffer commandBuffer,
VkImage srcImage,
VkImageLayout srcImageLayout,
@ -1282,19 +1282,19 @@ VKAPI_ATTR void VKAPI_CALL rpi_vkCmdCopyImage(
uint32_t regionCount,
const VkImageCopy* pRegions)
{
PROFILESTART(rpi_vkCmdCopyImage);
rpi_vkCmdBlitImage(commandBuffer, srcImage, srcImageLayout, dstImage, dstImageLayout, regionCount, pRegions, VK_FILTER_NEAREST);
PROFILEEND(rpi_vkCmdCopyImage);
PROFILESTART(RPIFUNC(vkCmdCopyImage));
RPIFUNC(vkCmdBlitImage)(commandBuffer, srcImage, srcImageLayout, dstImage, dstImageLayout, regionCount, pRegions, VK_FILTER_NEAREST);
PROFILEEND(RPIFUNC(vkCmdCopyImage));
}
VKAPI_ATTR void VKAPI_CALL rpi_vkCmdCopyBuffer(
VKAPI_ATTR void VKAPI_CALL RPIFUNC(vkCmdCopyBuffer)(
VkCommandBuffer commandBuffer,
VkBuffer srcBuffer,
VkBuffer dstBuffer,
uint32_t regionCount,
const VkBufferCopy* pRegions)
{
PROFILESTART(rpi_vkCmdCopyBuffer);
PROFILESTART(RPIFUNC(vkCmdCopyBuffer));
//TODO
PROFILEEND(rpi_vkCmdCopyImage);
PROFILEEND(RPIFUNC(vkCmdCopyImage));
}

View File

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

View File

@ -1,12 +1,14 @@
#include "common.h"
VKAPI_ATTR VkResult VKAPI_CALL rpi_vkCreateDescriptorPool(
#include "declarations.h"
VKAPI_ATTR VkResult VKAPI_CALL RPIFUNC(vkCreateDescriptorPool)(
VkDevice device,
const VkDescriptorPoolCreateInfo* pCreateInfo,
const VkAllocationCallbacks* pAllocator,
VkDescriptorPool* pDescriptorPool)
{
PROFILESTART(rpi_vkCreateDescriptorPool);
PROFILESTART(RPIFUNC(vkCreateDescriptorPool));
assert(device);
assert(pCreateInfo);
@ -15,7 +17,7 @@ VKAPI_ATTR VkResult VKAPI_CALL rpi_vkCreateDescriptorPool(
if(!dp)
{
PROFILEEND(rpi_vkCreateDescriptorPool);
PROFILEEND(RPIFUNC(vkCreateDescriptorPool));
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);
if(!dsmem)
{
PROFILEEND(rpi_vkCreateDescriptorPool);
PROFILEEND(RPIFUNC(vkCreateDescriptorPool));
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);
if(!memem)
{
PROFILEEND(rpi_vkCreateDescriptorPool);
PROFILEEND(RPIFUNC(vkCreateDescriptorPool));
return VK_ERROR_OUT_OF_HOST_MEMORY;
}
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);
if(!mem)
{
PROFILEEND(rpi_vkCreateDescriptorPool);
PROFILEEND(RPIFUNC(vkCreateDescriptorPool));
return VK_ERROR_OUT_OF_HOST_MEMORY;
}
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);
if(!mem)
{
PROFILEEND(rpi_vkCreateDescriptorPool);
PROFILEEND(RPIFUNC(vkCreateDescriptorPool));
return VK_ERROR_OUT_OF_HOST_MEMORY;
}
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);
if(!mem)
{
PROFILEEND(rpi_vkCreateDescriptorPool);
PROFILEEND(RPIFUNC(vkCreateDescriptorPool));
return VK_ERROR_OUT_OF_HOST_MEMORY;
}
dp->texelBufferDescriptorCPA = createConsecutivePoolAllocator(mem, blockSize, blockSize * texelBufferDescriptorCount);
@ -106,16 +108,16 @@ VKAPI_ATTR VkResult VKAPI_CALL rpi_vkCreateDescriptorPool(
*pDescriptorPool = dp;
PROFILEEND(rpi_vkCreateDescriptorPool);
PROFILEEND(RPIFUNC(vkCreateDescriptorPool));
return VK_SUCCESS;
}
VKAPI_ATTR VkResult VKAPI_CALL rpi_vkAllocateDescriptorSets(
VKAPI_ATTR VkResult VKAPI_CALL RPIFUNC(vkAllocateDescriptorSets)(
VkDevice device,
const VkDescriptorSetAllocateInfo* pAllocateInfo,
VkDescriptorSet* pDescriptorSets)
{
PROFILESTART(rpi_vkAllocateDescriptorSets);
PROFILESTART(RPIFUNC(vkAllocateDescriptorSets));
assert(device);
@ -221,17 +223,17 @@ VKAPI_ATTR VkResult VKAPI_CALL rpi_vkAllocateDescriptorSets(
}
}
PROFILEEND(rpi_vkAllocateDescriptorSets);
PROFILEEND(RPIFUNC(vkAllocateDescriptorSets));
return VK_SUCCESS;
}
VKAPI_ATTR VkResult VKAPI_CALL rpi_vkCreateDescriptorSetLayout(
VKAPI_ATTR VkResult VKAPI_CALL RPIFUNC(vkCreateDescriptorSetLayout)(
VkDevice device,
const VkDescriptorSetLayoutCreateInfo* pCreateInfo,
const VkAllocationCallbacks* pAllocator,
VkDescriptorSetLayout* pSetLayout)
{
PROFILESTART(rpi_vkCreateDescriptorSetLayout);
PROFILESTART(RPIFUNC(vkCreateDescriptorSetLayout));
assert(device);
assert(pCreateInfo);
@ -242,7 +244,7 @@ VKAPI_ATTR VkResult VKAPI_CALL rpi_vkCreateDescriptorSetLayout(
if(!dsl)
{
PROFILEEND(rpi_vkCreateDescriptorSetLayout);
PROFILEEND(RPIFUNC(vkCreateDescriptorSetLayout));
return VK_ERROR_OUT_OF_HOST_MEMORY;
}
@ -250,7 +252,7 @@ VKAPI_ATTR VkResult VKAPI_CALL rpi_vkCreateDescriptorSetLayout(
if(!dsl->bindings)
{
PROFILEEND(rpi_vkCreateDescriptorSetLayout);
PROFILEEND(RPIFUNC(vkCreateDescriptorSetLayout));
return VK_ERROR_OUT_OF_HOST_MEMORY;
}
@ -261,18 +263,18 @@ VKAPI_ATTR VkResult VKAPI_CALL rpi_vkCreateDescriptorSetLayout(
*pSetLayout = dsl;
PROFILEEND(rpi_vkCreateDescriptorSetLayout);
PROFILEEND(RPIFUNC(vkCreateDescriptorSetLayout));
return VK_SUCCESS;
}
VKAPI_ATTR void VKAPI_CALL rpi_vkUpdateDescriptorSets(
VKAPI_ATTR void VKAPI_CALL RPIFUNC(vkUpdateDescriptorSets)(
VkDevice device,
uint32_t descriptorWriteCount,
const VkWriteDescriptorSet* pDescriptorWrites,
uint32_t descriptorCopyCount,
const VkCopyDescriptorSet* pDescriptorCopies)
{
PROFILESTART(rpi_vkUpdateDescriptorSets);
PROFILESTART(RPIFUNC(vkUpdateDescriptorSets));
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,
VkDescriptorPool descriptorPool,
VkDescriptorPoolResetFlags flags)
{
PROFILESTART(rpi_vkResetDescriptorPool);
PROFILESTART(RPIFUNC(vkResetDescriptorPool));
//TODO
PROFILEEND(rpi_vkResetDescriptorPool);
PROFILEEND(RPIFUNC(vkResetDescriptorPool));
return VK_SUCCESS;
}
VKAPI_ATTR void VKAPI_CALL rpi_vkDestroyDescriptorPool(
VKAPI_ATTR void VKAPI_CALL RPIFUNC(vkDestroyDescriptorPool)(
VkDevice device,
VkDescriptorPool descriptorPool,
const VkAllocationCallbacks* pAllocator)
{
PROFILESTART(rpi_vkDestroyDescriptorPool);
PROFILESTART(RPIFUNC(vkDestroyDescriptorPool));
assert(device);
assert(descriptorPool);
@ -394,10 +396,10 @@ VKAPI_ATTR void VKAPI_CALL rpi_vkDestroyDescriptorPool(
FREE(dp);
PROFILEEND(rpi_vkDestroyDescriptorPool);
PROFILEEND(RPIFUNC(vkDestroyDescriptorPool));
}
VKAPI_ATTR void VKAPI_CALL rpi_vkCmdBindDescriptorSets(
VKAPI_ATTR void VKAPI_CALL RPIFUNC(vkCmdBindDescriptorSets)(
VkCommandBuffer commandBuffer,
VkPipelineBindPoint pipelineBindPoint,
VkPipelineLayout layout,
@ -407,7 +409,7 @@ VKAPI_ATTR void VKAPI_CALL rpi_vkCmdBindDescriptorSets(
uint32_t dynamicOffsetCount,
const uint32_t* pDynamicOffsets)
{
PROFILESTART(rpi_vkCmdBindDescriptorSets);
PROFILESTART(RPIFUNC(vkCmdBindDescriptorSets));
//TODO dynamic offsets
@ -429,15 +431,15 @@ VKAPI_ATTR void VKAPI_CALL rpi_vkCmdBindDescriptorSets(
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,
VkDescriptorSetLayout descriptorSetLayout,
const VkAllocationCallbacks* pAllocator)
{
PROFILESTART(rpi_vkDestroyDescriptorSetLayout);
PROFILESTART(RPIFUNC(vkDestroyDescriptorSetLayout));
assert(device);
assert(descriptorSetLayout);
@ -448,16 +450,16 @@ VKAPI_ATTR void VKAPI_CALL rpi_vkDestroyDescriptorSetLayout(
FREE(dsl);
PROFILEEND(rpi_vkDestroyDescriptorSetLayout);
PROFILEEND(RPIFUNC(vkDestroyDescriptorSetLayout));
}
VKAPI_ATTR VkResult VKAPI_CALL rpi_vkFreeDescriptorSets(
VKAPI_ATTR VkResult VKAPI_CALL RPIFUNC(vkFreeDescriptorSets)(
VkDevice device,
VkDescriptorPool descriptorPool,
uint32_t descriptorSetCount,
const VkDescriptorSet* pDescriptorSets)
{
PROFILESTART(rpi_vkFreeDescriptorSets);
PROFILESTART(RPIFUNC(vkFreeDescriptorSets));
assert(device);
assert(descriptorPool);
@ -490,49 +492,49 @@ VKAPI_ATTR VkResult VKAPI_CALL rpi_vkFreeDescriptorSets(
poolFree(&dp->descriptorSetPA, ds);
}
PROFILEEND(rpi_vkFreeDescriptorSets);
PROFILEEND(RPIFUNC(vkFreeDescriptorSets));
return VK_SUCCESS;
}
VKAPI_ATTR VkResult VKAPI_CALL rpi_vkCreateDescriptorUpdateTemplate(
VKAPI_ATTR VkResult VKAPI_CALL RPIFUNC(vkCreateDescriptorUpdateTemplate)(
VkDevice device,
const VkDescriptorUpdateTemplateCreateInfo* pCreateInfo,
const VkAllocationCallbacks* pAllocator,
VkDescriptorUpdateTemplate* pDescriptorUpdateTemplate)
{
PROFILESTART(rpi_vkCreateDescriptorUpdateTemplate);
PROFILESTART(RPIFUNC(vkCreateDescriptorUpdateTemplate));
//TODO
PROFILEEND(rpi_vkCreateDescriptorUpdateTemplate);
PROFILEEND(RPIFUNC(vkCreateDescriptorUpdateTemplate));
}
VKAPI_ATTR void VKAPI_CALL rpi_vkDestroyDescriptorUpdateTemplate(
VKAPI_ATTR void VKAPI_CALL RPIFUNC(vkDestroyDescriptorUpdateTemplate)(
VkDevice device,
VkDescriptorUpdateTemplate descriptorUpdateTemplate,
const VkAllocationCallbacks* pAllocator)
{
PROFILESTART(rpi_vkDestroyDescriptorUpdateTemplate);
PROFILESTART(RPIFUNC(vkDestroyDescriptorUpdateTemplate));
//TODO
PROFILEEND(rpi_vkDestroyDescriptorUpdateTemplate);
PROFILEEND(RPIFUNC(vkDestroyDescriptorUpdateTemplate));
}
VKAPI_ATTR void VKAPI_CALL rpi_vkUpdateDescriptorSetWithTemplate(
VKAPI_ATTR void VKAPI_CALL RPIFUNC(vkUpdateDescriptorSetWithTemplate)(
VkDevice device,
VkDescriptorSet descriptorSet,
VkDescriptorUpdateTemplate descriptorUpdateTemplate,
const void* pData)
{
PROFILESTART(rpi_vkUpdateDescriptorSetWithTemplate);
PROFILESTART(RPIFUNC(vkUpdateDescriptorSetWithTemplate));
//TODO
PROFILEEND(rpi_vkUpdateDescriptorSetWithTemplate);
PROFILEEND(RPIFUNC(vkUpdateDescriptorSetWithTemplate));
}
VKAPI_ATTR void VKAPI_CALL rpi_vkGetDescriptorSetLayoutSupport(
VKAPI_ATTR void VKAPI_CALL RPIFUNC(vkGetDescriptorSetLayoutSupport)(
VkDevice device,
const VkDescriptorSetLayoutCreateInfo* pCreateInfo,
VkDescriptorSetLayoutSupport* pSupport)
{
PROFILESTART(rpi_vkGetDescriptorSetLayoutSupport);
PROFILESTART(RPIFUNC(vkGetDescriptorSetLayoutSupport));
//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
* available physical devices were returned.
*/
VKAPI_ATTR VkResult VKAPI_CALL rpi_vkEnumeratePhysicalDevices(
VKAPI_ATTR VkResult VKAPI_CALL RPIFUNC(vkEnumeratePhysicalDevices)(
VkInstance instance,
uint32_t* pPhysicalDeviceCount,
VkPhysicalDevice* pPhysicalDevices)
{
PROFILESTART(rpi_vkEnumeratePhysicalDevices);
PROFILESTART(RPIFUNC(vkEnumeratePhysicalDevices));
assert(instance);
@ -26,7 +26,7 @@ VKAPI_ATTR VkResult VKAPI_CALL rpi_vkEnumeratePhysicalDevices(
if(!pPhysicalDevices)
{
*pPhysicalDeviceCount = numGPUs;
PROFILEEND(rpi_vkEnumeratePhysicalDevices);
PROFILEEND(RPIFUNC(vkEnumeratePhysicalDevices));
return VK_SUCCESS;
}
@ -42,12 +42,12 @@ VKAPI_ATTR VkResult VKAPI_CALL rpi_vkEnumeratePhysicalDevices(
if(arraySize < numGPUs)
{
PROFILEEND(rpi_vkEnumeratePhysicalDevices);
PROFILEEND(RPIFUNC(vkEnumeratePhysicalDevices));
return VK_INCOMPLETE;
}
else
{
PROFILEEND(rpi_vkEnumeratePhysicalDevices);
PROFILEEND(RPIFUNC(vkEnumeratePhysicalDevices));
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
*/
VKAPI_ATTR void VKAPI_CALL rpi_vkGetPhysicalDeviceProperties(
VKAPI_ATTR void VKAPI_CALL RPIFUNC(vkGetPhysicalDeviceProperties)(
VkPhysicalDevice physicalDevice,
VkPhysicalDeviceProperties* pProperties)
{
PROFILESTART(rpi_vkGetPhysicalDeviceProperties);
PROFILESTART(RPIFUNC(vkGetPhysicalDeviceProperties));
assert(physicalDevice);
assert(pProperties);
@ -82,36 +82,36 @@ VKAPI_ATTR void VKAPI_CALL rpi_vkGetPhysicalDeviceProperties(
pProperties->limits = _limits;
pProperties->sparseProperties = sparseProps;
PROFILEEND(rpi_vkGetPhysicalDeviceProperties);
PROFILEEND(RPIFUNC(vkGetPhysicalDeviceProperties));
}
/*
* 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,
VkPhysicalDeviceFeatures* pFeatures)
{
PROFILESTART(rpi_vkGetPhysicalDeviceFeatures);
PROFILESTART(RPIFUNC(vkGetPhysicalDeviceFeatures));
assert(physicalDevice);
assert(pFeatures);
*pFeatures = _features;
PROFILEEND(rpi_vkGetPhysicalDeviceFeatures);
PROFILEEND(RPIFUNC(vkGetPhysicalDeviceFeatures));
}
/*
* 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,
const char* pLayerName,
uint32_t* pPropertyCount,
VkExtensionProperties* pProperties)
{
PROFILESTART(rpi_vkEnumerateDeviceExtensionProperties);
PROFILESTART(RPIFUNC(vkEnumerateDeviceExtensionProperties));
assert(physicalDevice);
assert(pPropertyCount);
@ -119,7 +119,7 @@ VKAPI_ATTR VkResult VKAPI_CALL rpi_vkEnumerateDeviceExtensionProperties(
if(!pProperties)
{
*pPropertyCount = numDeviceExtensions;
PROFILEEND(rpi_vkEnumerateDeviceExtensionProperties);
PROFILEEND(RPIFUNC(vkEnumerateDeviceExtensionProperties));
return VK_SUCCESS;
}
@ -135,11 +135,11 @@ VKAPI_ATTR VkResult VKAPI_CALL rpi_vkEnumerateDeviceExtensionProperties(
if(arraySize < numDeviceExtensions)
{
PROFILEEND(rpi_vkEnumerateDeviceExtensionProperties);
PROFILEEND(RPIFUNC(vkEnumerateDeviceExtensionProperties));
return VK_INCOMPLETE;
}
PROFILEEND(rpi_vkEnumerateDeviceExtensionProperties);
PROFILEEND(RPIFUNC(vkEnumerateDeviceExtensionProperties));
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
* 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,
uint32_t* pQueueFamilyPropertyCount,
VkQueueFamilyProperties* pQueueFamilyProperties)
{
PROFILESTART(rpi_vkGetPhysicalDeviceQueueFamilyProperties);
PROFILESTART(RPIFUNC(vkGetPhysicalDeviceQueueFamilyProperties));
assert(physicalDevice);
assert(pQueueFamilyPropertyCount);
@ -163,7 +163,7 @@ VKAPI_ATTR void VKAPI_CALL rpi_vkGetPhysicalDeviceQueueFamilyProperties(
if(!pQueueFamilyProperties)
{
*pQueueFamilyPropertyCount = 1;
PROFILEEND(rpi_vkGetPhysicalDeviceQueueFamilyProperties);
PROFILEEND(RPIFUNC(vkGetPhysicalDeviceQueueFamilyProperties));
return;
}
@ -177,17 +177,17 @@ VKAPI_ATTR void VKAPI_CALL rpi_vkGetPhysicalDeviceQueueFamilyProperties(
*pQueueFamilyPropertyCount = elementsWritten;
PROFILEEND(rpi_vkGetPhysicalDeviceQueueFamilyProperties);
PROFILEEND(RPIFUNC(vkGetPhysicalDeviceQueueFamilyProperties));
}
VKAPI_ATTR VkResult VKAPI_CALL rpi_vkEnumeratePhysicalDeviceQueueFamilyPerformanceQueryCountersKHR(
VKAPI_ATTR VkResult VKAPI_CALL RPIFUNC(vkEnumeratePhysicalDeviceQueueFamilyPerformanceQueryCountersKHR)(
VkPhysicalDevice physicalDevice,
uint32_t queueFamilyIndex,
uint32_t* pCounterCount,
VkPerformanceCounterKHR* pCounters,
VkPerformanceCounterDescriptionKHR* pCounterDescriptions)
{
PROFILESTART(rpi_vkEnumeratePhysicalDeviceQueueFamilyPerformanceQueryCountersKHR);
PROFILESTART(RPIFUNC(vkEnumeratePhysicalDeviceQueueFamilyPerformanceQueryCountersKHR));
assert(physicalDevice);
assert(pCounterCount);
@ -195,7 +195,7 @@ VKAPI_ATTR VkResult VKAPI_CALL rpi_vkEnumeratePhysicalDeviceQueueFamilyPerforman
if(!pCounters && !pCounterDescriptions)
{
*pCounterCount = numPerformanceCounterTypes;
PROFILEEND(rpi_vkEnumeratePhysicalDeviceQueueFamilyPerformanceQueryCountersKHR);
PROFILEEND(RPIFUNC(vkEnumeratePhysicalDeviceQueueFamilyPerformanceQueryCountersKHR));
return VK_SUCCESS;
}
@ -212,20 +212,20 @@ VKAPI_ATTR VkResult VKAPI_CALL rpi_vkEnumeratePhysicalDeviceQueueFamilyPerforman
if(arraySize < numPerformanceCounterTypes)
{
PROFILEEND(rpi_vkEnumeratePhysicalDeviceQueueFamilyPerformanceQueryCountersKHR);
PROFILEEND(RPIFUNC(vkEnumeratePhysicalDeviceQueueFamilyPerformanceQueryCountersKHR));
return VK_INCOMPLETE;
}
PROFILEEND(rpi_vkEnumeratePhysicalDeviceQueueFamilyPerformanceQueryCountersKHR);
PROFILEEND(RPIFUNC(vkEnumeratePhysicalDeviceQueueFamilyPerformanceQueryCountersKHR));
return VK_SUCCESS;
}
VKAPI_ATTR void VKAPI_CALL rpi_vkGetPhysicalDeviceQueueFamilyPerformanceQueryPassesKHR(
VKAPI_ATTR void VKAPI_CALL RPIFUNC(vkGetPhysicalDeviceQueueFamilyPerformanceQueryPassesKHR)(
VkPhysicalDevice physicalDevice,
const VkQueryPoolPerformanceCreateInfoKHR* pPerformanceQueryCreateInfo,
uint32_t* pNumPasses)
{
PROFILESTART(rpi_vkGetPhysicalDeviceQueueFamilyPerformanceQueryPassesKHR);
PROFILESTART(RPIFUNC(vkGetPhysicalDeviceQueueFamilyPerformanceQueryPassesKHR));
assert(physicalDevice);
assert(pPerformanceQueryCreateInfo);
@ -233,7 +233,7 @@ VKAPI_ATTR void VKAPI_CALL rpi_vkGetPhysicalDeviceQueueFamilyPerformanceQueryPas
*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
* 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,
const VkDeviceCreateInfo* pCreateInfo,
const VkAllocationCallbacks* pAllocator,
VkDevice* pDevice)
{
PROFILESTART(rpi_vkCreateDevice);
PROFILESTART(RPIFUNC(vkCreateDevice));
assert(physicalDevice);
assert(pDevice);
@ -265,7 +265,7 @@ VKAPI_ATTR VkResult VKAPI_CALL rpi_vkCreateDevice(
int findres = findDeviceExtension(pCreateInfo->ppEnabledExtensionNames[c]);
if(findres == -1)
{
PROFILEEND(rpi_vkCreateDevice);
PROFILEEND(RPIFUNC(vkCreateDevice));
return VK_ERROR_EXTENSION_NOT_PRESENT;
}
}
@ -280,7 +280,7 @@ VKAPI_ATTR VkResult VKAPI_CALL rpi_vkCreateDevice(
{
if(requestedFeatures[c] && !supportedFeatures[c])
{
PROFILEEND(rpi_vkCreateDevice);
PROFILEEND(RPIFUNC(vkCreateDevice));
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);
if(!*pDevice)
{
PROFILEEND(rpi_vkCreateDevice);
PROFILEEND(RPIFUNC(vkCreateDevice));
return VK_ERROR_OUT_OF_HOST_MEMORY;
}
@ -315,7 +315,7 @@ VKAPI_ATTR VkResult VKAPI_CALL rpi_vkCreateDevice(
{
if(requestedFeatures[c] && !supportedFeatures[c])
{
PROFILEEND(rpi_vkCreateDevice);
PROFILEEND(RPIFUNC(vkCreateDevice));
return VK_ERROR_FEATURE_NOT_PRESENT;
}
}
@ -343,7 +343,7 @@ VKAPI_ATTR VkResult VKAPI_CALL rpi_vkCreateDevice(
if(!(*pDevice)->queues[pCreateInfo->pQueueCreateInfos[c].queueFamilyIndex])
{
PROFILEEND(rpi_vkCreateDevice);
PROFILEEND(RPIFUNC(vkCreateDevice));
return VK_ERROR_OUT_OF_HOST_MEMORY;
}
@ -361,7 +361,7 @@ VKAPI_ATTR VkResult VKAPI_CALL rpi_vkCreateDevice(
setupEmulationResources(*pDevice);
setupClearEmulationResources(*pDevice);
PROFILEEND(rpi_vkCreateDevice);
PROFILEEND(RPIFUNC(vkCreateDevice));
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.
* 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,
uint32_t queueFamilyIndex,
uint32_t queueIndex,
VkQueue* pQueue)
{
PROFILESTART(rpi_vkGetDeviceQueue);
PROFILESTART(RPIFUNC(vkGetDeviceQueue));
assert(device);
assert(pQueue);
@ -386,15 +386,15 @@ VKAPI_ATTR void VKAPI_CALL rpi_vkGetDeviceQueue(
*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,
const VkDeviceQueueInfo2* pQueueInfo,
VkQueue* pQueue)
{
PROFILESTART(rpi_vkGetDeviceQueue2);
PROFILESTART(RPIFUNC(vkGetDeviceQueue2));
assert(device);
assert(pQueueInfo);
@ -402,9 +402,9 @@ VKAPI_ATTR void VKAPI_CALL rpi_vkGetDeviceQueue2(
//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
* 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,
const VkAllocationCallbacks* pAllocator)
{
PROFILESTART(rpi_vkDestroyDevice);
PROFILESTART(RPIFUNC(vkDestroyDevice));
_device* dev = device;
@ -433,18 +433,18 @@ VKAPI_ATTR void VKAPI_CALL rpi_vkDestroyDevice(
FREE(dev);
}
PROFILEEND(rpi_vkDestroyDevice);
PROFILEEND(RPIFUNC(vkDestroyDevice));
}
/*
* 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,
uint32_t* pPhysicalDeviceGroupCount,
VkPhysicalDeviceGroupProperties* pPhysicalDeviceGroupProperties)
{
PROFILESTART(rpi_vkEnumeratePhysicalDeviceGroups);
PROFILESTART(RPIFUNC(vkEnumeratePhysicalDeviceGroups));
assert(instance);
assert(pPhysicalDeviceGroupCount);
@ -452,7 +452,7 @@ VKAPI_ATTR VkResult VKAPI_CALL rpi_vkEnumeratePhysicalDeviceGroups(
if(!pPhysicalDeviceGroupProperties)
{
*pPhysicalDeviceGroupCount = 1;
PROFILEEND(rpi_vkEnumeratePhysicalDeviceGroups);
PROFILEEND(RPIFUNC(vkEnumeratePhysicalDeviceGroups));
return VK_SUCCESS;
}
@ -469,22 +469,22 @@ VKAPI_ATTR VkResult VKAPI_CALL rpi_vkEnumeratePhysicalDeviceGroups(
if(c < 1)
{
PROFILEEND(rpi_vkEnumeratePhysicalDeviceGroups);
PROFILEEND(RPIFUNC(vkEnumeratePhysicalDeviceGroups));
return VK_INCOMPLETE;
}
PROFILEEND(rpi_vkEnumeratePhysicalDeviceGroups);
PROFILEEND(RPIFUNC(vkEnumeratePhysicalDeviceGroups));
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);
VKAPI_ATTR PFN_vkVoidFunction VKAPI_CALL rpi_vkGetDeviceProcAddr(
VKAPI_ATTR PFN_vkVoidFunction VKAPI_CALL RPIFUNC(vkGetDeviceProcAddr)(
VkDevice device,
const char* pName)
{
PROFILESTART(rpi_vkGetDeviceProcAddr);
PROFILESTART(RPIFUNC(vkGetDeviceProcAddr));
if(
!strcmp("vkDestroyInstance", pName) ||
@ -512,27 +512,27 @@ VKAPI_ATTR PFN_vkVoidFunction VKAPI_CALL rpi_vkGetDeviceProcAddr(
!strcmp("vkGetPhysicalDeviceExternalSemaphoreProperties", pName)
)
{
PROFILEEND(rpi_vkGetDeviceProcAddr);
PROFILEEND(RPIFUNC(vkGetDeviceProcAddr));
return 0;
}
//there can't be any other device, so this will do fine...
_device* d = device;
PFN_vkVoidFunction retval = rpi_vkGetInstanceProcAddr(d->dev->instance, pName);
PROFILEEND(rpi_vkGetDeviceProcAddr);
PFN_vkVoidFunction retval = RPIFUNC(vkGetInstanceProcAddr)(d->dev->instance, pName);
PROFILEEND(RPIFUNC(vkGetDeviceProcAddr));
return retval;
}
VKAPI_ATTR void VKAPI_CALL rpi_vkGetPhysicalDeviceProperties2(
VKAPI_ATTR void VKAPI_CALL RPIFUNC(vkGetPhysicalDeviceProperties2)(
VkPhysicalDevice physicalDevice,
VkPhysicalDeviceProperties2* pProperties)
{
PROFILESTART(rpi_vkGetPhysicalDeviceProperties2);
PROFILESTART(RPIFUNC(vkGetPhysicalDeviceProperties2));
assert(physicalDevice);
assert(pProperties);
rpi_vkGetPhysicalDeviceProperties(physicalDevice, &pProperties->properties);
RPIFUNC(vkGetPhysicalDeviceProperties)(physicalDevice, &pProperties->properties);
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,
VkFormat format,
VkFormatProperties* pFormatProperties)
{
PROFILESTART(rpi_vkGetPhysicalDeviceFormatProperties);
PROFILESTART(RPIFUNC(vkGetPhysicalDeviceFormatProperties));
assert(physicalDevice);
assert(pFormatProperties);
@ -680,24 +680,24 @@ VKAPI_ATTR void VKAPI_CALL rpi_vkGetPhysicalDeviceFormatProperties(
break;
}
PROFILEEND(rpi_vkGetPhysicalDeviceFormatProperties);
PROFILEEND(RPIFUNC(vkGetPhysicalDeviceFormatProperties));
}
VKAPI_ATTR void VKAPI_CALL rpi_vkGetPhysicalDeviceFormatProperties2(
VKAPI_ATTR void VKAPI_CALL RPIFUNC(vkGetPhysicalDeviceFormatProperties2)(
VkPhysicalDevice physicalDevice,
VkFormat format,
VkFormatProperties2* pFormatProperties)
{
PROFILESTART(rpi_vkGetPhysicalDeviceFormatProperties2);
PROFILESTART(RPIFUNC(vkGetPhysicalDeviceFormatProperties2));
assert(physicalDevice);
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,
VkFormat format,
VkImageType type,
@ -706,7 +706,7 @@ VKAPI_ATTR VkResult VKAPI_CALL rpi_vkGetPhysicalDeviceImageFormatProperties(
VkImageCreateFlags flags,
VkImageFormatProperties* pImageFormatProperties)
{
PROFILESTART(rpi_vkGetPhysicalDeviceImageFormatProperties);
PROFILESTART(RPIFUNC(vkGetPhysicalDeviceImageFormatProperties));
assert(physicalDevice);
assert(pImageFormatProperties);
@ -762,7 +762,7 @@ VKAPI_ATTR VkResult VKAPI_CALL rpi_vkGetPhysicalDeviceImageFormatProperties(
if(!supported)
{
PROFILEEND(rpi_vkGetPhysicalDeviceImageFormatProperties);
PROFILEEND(RPIFUNC(vkGetPhysicalDeviceImageFormatProperties));
return VK_ERROR_FORMAT_NOT_SUPPORTED;
}
@ -818,16 +818,16 @@ VKAPI_ATTR VkResult VKAPI_CALL rpi_vkGetPhysicalDeviceImageFormatProperties(
//2^31
pImageFormatProperties->maxResourceSize = 1<<31;
PROFILEEND(rpi_vkGetPhysicalDeviceImageFormatProperties);
PROFILEEND(RPIFUNC(vkGetPhysicalDeviceImageFormatProperties));
return VK_SUCCESS;
}
VKAPI_ATTR VkResult VKAPI_CALL rpi_vkGetPhysicalDeviceImageFormatProperties2(
VKAPI_ATTR VkResult VKAPI_CALL RPIFUNC(vkGetPhysicalDeviceImageFormatProperties2)(
VkPhysicalDevice physicalDevice,
const VkPhysicalDeviceImageFormatInfo2* pImageFormatInfo,
VkImageFormatProperties2* pImageFormatProperties)
{
PROFILESTART(rpi_vkGetPhysicalDeviceImageFormatProperties2);
PROFILESTART(RPIFUNC(vkGetPhysicalDeviceImageFormatProperties2));
assert(physicalDevice);
assert(pImageFormatProperties);
@ -835,52 +835,52 @@ VKAPI_ATTR VkResult VKAPI_CALL rpi_vkGetPhysicalDeviceImageFormatProperties2(
//TODO handle pNext
VkResult retval = rpi_vkGetPhysicalDeviceImageFormatProperties(physicalDevice,
VkResult retval = RPIFUNC(vkGetPhysicalDeviceImageFormatProperties)(physicalDevice,
pImageFormatInfo->format,
pImageFormatInfo->type,
pImageFormatInfo->tiling,
pImageFormatInfo->usage,
pImageFormatInfo->flags,
&pImageFormatProperties->imageFormatProperties);
PROFILEEND(rpi_vkGetPhysicalDeviceImageFormatProperties2);
PROFILEEND(RPIFUNC(vkGetPhysicalDeviceImageFormatProperties2));
return retval;
}
VKAPI_ATTR VkResult VKAPI_CALL rpi_vkEnumerateDeviceLayerProperties(
VKAPI_ATTR VkResult VKAPI_CALL RPIFUNC(vkEnumerateDeviceLayerProperties)(
VkPhysicalDevice physicalDevice,
uint32_t* pPropertyCount,
VkLayerProperties* pProperties)
{
PROFILESTART(rpi_vkEnumerateDeviceLayerProperties);
PROFILESTART(RPIFUNC(vkEnumerateDeviceLayerProperties));
//deprecated, just return instance layers
VkResult retval = rpi_vkEnumerateInstanceLayerProperties(pPropertyCount, pProperties);
PROFILEEND(rpi_vkEnumerateDeviceLayerProperties);
VkResult retval = RPIFUNC(vkEnumerateInstanceLayerProperties)(pPropertyCount, pProperties);
PROFILEEND(RPIFUNC(vkEnumerateDeviceLayerProperties));
return retval;
}
VKAPI_ATTR void VKAPI_CALL rpi_vkGetPhysicalDeviceFeatures2(
VKAPI_ATTR void VKAPI_CALL RPIFUNC(vkGetPhysicalDeviceFeatures2)(
VkPhysicalDevice physicalDevice,
VkPhysicalDeviceFeatures2* pFeatures)
{
PROFILESTART(rpi_vkGetPhysicalDeviceFeatures2);
PROFILESTART(RPIFUNC(vkGetPhysicalDeviceFeatures2));
assert(physicalDevice);
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,
uint32_t* pQueueFamilyPropertyCount,
VkQueueFamilyProperties2* pQueueFamilyProperties)
{
PROFILESTART(rpi_vkGetPhysicalDeviceQueueFamilyProperties2);
PROFILESTART(RPIFUNC(vkGetPhysicalDeviceQueueFamilyProperties2));
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 "declarations.h"
#include "kernel/vc4_packet.h"
//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
*/
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);
@ -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);
PROFILEEND(rpi_vkCmdDraw);
PROFILEEND(RPIFUNC(vkCmdDraw));
}
VKAPI_ATTR void VKAPI_CALL rpi_vkCmdDrawIndexed(
VKAPI_ATTR void VKAPI_CALL RPIFUNC(vkCmdDrawIndexed)(
VkCommandBuffer commandBuffer,
uint32_t indexCount,
uint32_t instanceCount,
@ -590,7 +592,7 @@ VKAPI_ATTR void VKAPI_CALL rpi_vkCmdDrawIndexed(
int32_t vertexOffset,
uint32_t firstInstance)
{
PROFILESTART(rpi_vkCmdDrawIndexed);
PROFILESTART(RPIFUNC(vkCmdDrawIndexed));
assert(commandBuffer);
@ -629,10 +631,10 @@ VKAPI_ATTR void VKAPI_CALL rpi_vkCmdDrawIndexed(
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,
VkBuffer buffer,
VkDeviceSize offset,
@ -642,7 +644,7 @@ VKAPI_ATTR void VKAPI_CALL rpi_vkCmdDrawIndexedIndirect(
UNSUPPORTED(vkCmdDrawIndexedIndirect);
}
VKAPI_ATTR void VKAPI_CALL rpi_vkCmdDrawIndirect(
VKAPI_ATTR void VKAPI_CALL RPIFUNC(vkCmdDrawIndirect)(
VkCommandBuffer commandBuffer,
VkBuffer buffer,
VkDeviceSize offset,

View File

@ -4,7 +4,11 @@
#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;
@ -26,7 +30,7 @@ VKAPI_ATTR PFN_vkVoidFunction VKAPI_CALL vk_icdGetInstanceProcAddr(VkInstance in
loaderVersion = 1;
}
void* ptr = rpi_vkGetInstanceProcAddr(instance, pName);
void* ptr = RPIFUNC(vkGetInstanceProcAddr)(instance, pName);
return ptr;
}
@ -37,7 +41,7 @@ VKAPI_ATTR PFN_vkVoidFunction VKAPI_CALL vk_icdGetPhysicalDeviceProcAddr(VkInsta
void* ptr = 0;
// if(!strcmp(pName, "vkCreateShaderModuleFromRpiAssemblyEXT"))
// ptr = &rpi_vkCreateShaderModuleFromRpiAssemblyEXT;
// ptr = &RPIFUNC(vkCreateShaderModuleFromRpiAssemblyEXT);
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,
* 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,
uint32_t* pPropertyCount,
VkExtensionProperties* pProperties)
{
PROFILESTART(rpi_vkEnumerateInstanceExtensionProperties);
PROFILESTART(RPIFUNC(vkEnumerateInstanceExtensionProperties));
assert(pPropertyCount);
if(!pProperties)
{
*pPropertyCount = numInstanceExtensions;
PROFILEEND(rpi_vkEnumerateInstanceExtensionProperties);
PROFILEEND(RPIFUNC(vkEnumerateInstanceExtensionProperties));
return VK_SUCCESS;
}
@ -82,12 +86,12 @@ VKAPI_ATTR VkResult VKAPI_CALL rpi_vkEnumerateInstanceExtensionProperties(
if(arraySize < numInstanceExtensions)
{
PROFILEEND(rpi_vkEnumerateInstanceExtensionProperties);
PROFILEEND(RPIFUNC(vkEnumerateInstanceExtensionProperties));
return VK_INCOMPLETE;
}
else
{
PROFILEEND(rpi_vkEnumerateInstanceExtensionProperties);
PROFILEEND(RPIFUNC(vkEnumerateInstanceExtensionProperties));
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
* created and returned to the application.
*/
VKAPI_ATTR VkResult VKAPI_CALL rpi_vkCreateInstance(
VKAPI_ATTR VkResult VKAPI_CALL RPIFUNC(vkCreateInstance)(
const VkInstanceCreateInfo* pCreateInfo,
const VkAllocationCallbacks* pAllocator,
VkInstance* pInstance)
{
PROFILESTART(rpi_vkCreateInstance);
PROFILESTART(RPIFUNC(vkCreateInstance));
assert(pInstance);
assert(pCreateInfo);
@ -114,7 +118,7 @@ VKAPI_ATTR VkResult VKAPI_CALL rpi_vkCreateInstance(
if(!*pInstance)
{
PROFILEEND(rpi_vkCreateInstance);
PROFILEEND(RPIFUNC(vkCreateInstance));
return VK_ERROR_OUT_OF_HOST_MEMORY;
}
@ -139,7 +143,7 @@ VKAPI_ATTR VkResult VKAPI_CALL rpi_vkCreateInstance(
{
FREE(*pInstance);
*pInstance = 0;
PROFILEEND(rpi_vkCreateInstance);
PROFILEEND(RPIFUNC(vkCreateInstance));
return VK_ERROR_EXTENSION_NOT_PRESENT;
}
}
@ -152,7 +156,7 @@ VKAPI_ATTR VkResult VKAPI_CALL rpi_vkCreateInstance(
if(!f)
{
PROFILEEND(rpi_vkCreateInstance);
PROFILEEND(RPIFUNC(vkCreateInstance));
return VK_ERROR_INITIALIZATION_FAILED;
}
@ -170,7 +174,7 @@ VKAPI_ATTR VkResult VKAPI_CALL rpi_vkCreateInstance(
strcmp(hw, "BCM2836") &&
strcmp(hw, "BCM2837"))
{
PROFILEEND(rpi_vkCreateInstance);
PROFILEEND(RPIFUNC(vkCreateInstance));
return VK_ERROR_INITIALIZATION_FAILED;
}
@ -246,7 +250,7 @@ VKAPI_ATTR VkResult VKAPI_CALL rpi_vkCreateInstance(
assert((*pInstance)->hasThreadedFs);
assert((*pInstance)->hasPerfmon);
PROFILEEND(rpi_vkCreateInstance);
PROFILEEND(RPIFUNC(vkCreateInstance));
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
*
*/
VKAPI_ATTR void VKAPI_CALL rpi_vkDestroyInstance(
VKAPI_ATTR void VKAPI_CALL RPIFUNC(vkDestroyInstance)(
VkInstance instance,
const VkAllocationCallbacks* pAllocator)
{
PROFILESTART(rpi_vkDestroyInstance);
PROFILESTART(RPIFUNC(vkDestroyInstance));
if(instance)
{
closeIoctl();
FREE(instance);
}
PROFILEEND(rpi_vkDestroyInstance);
PROFILEEND(RPIFUNC(vkDestroyInstance));
}
/*
* 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)
{
PROFILESTART(rpi_vkEnumerateInstanceVersion);
PROFILESTART(RPIFUNC(vkEnumerateInstanceVersion));
assert(pApiVersion);
*pApiVersion = VK_DRIVER_VERSION; //
PROFILEEND(rpi_vkEnumerateInstanceVersion);
PROFILEEND(RPIFUNC(vkEnumerateInstanceVersion));
return VK_SUCCESS;
}
/*
* 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,
const char* pName)
{
PROFILESTART(rpi_vkGetInstanceProcAddr);
PROFILESTART(RPIFUNC(vkGetInstanceProcAddr));
if(!instance && !(
!strcmp(pName, "vkEnumerateInstanceVersion") ||
@ -297,11 +301,11 @@ VKAPI_ATTR PFN_vkVoidFunction VKAPI_CALL rpi_vkGetInstanceProcAddr(
!strcmp(pName, "vkCreateInstance")
))
{
PROFILEEND(rpi_vkGetInstanceProcAddr);
PROFILEEND(RPIFUNC(vkGetInstanceProcAddr));
return 0;
}
PROFILEEND(rpi_vkGetInstanceProcAddr);
PROFILEEND(RPIFUNC(vkGetInstanceProcAddr));
RETFUNC(vkCreateInstance);
RETFUNC(vkEnumerateInstanceVersion);
@ -497,13 +501,13 @@ VKAPI_ATTR PFN_vkVoidFunction VKAPI_CALL rpi_vkGetInstanceProcAddr(
return 0;
}
VKAPI_ATTR VkResult VKAPI_CALL rpi_vkEnumerateInstanceLayerProperties(
VKAPI_ATTR VkResult VKAPI_CALL RPIFUNC(vkEnumerateInstanceLayerProperties)(
uint32_t* pPropertyCount,
VkLayerProperties* pProperties)
{
PROFILESTART(rpi_vkEnumerateInstanceLayerProperties);
PROFILESTART(RPIFUNC(vkEnumerateInstanceLayerProperties));
PROFILEEND(rpi_vkEnumerateInstanceLayerProperties);
PROFILEEND(RPIFUNC(vkEnumerateInstanceLayerProperties));
return VK_SUCCESS;
}

View File

@ -1,13 +1,15 @@
#include "common.h"
#include "declarations.h"
#include "kernel/vc4_packet.h"
/*
* 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(pMemoryProperties);
@ -57,15 +59,15 @@ void rpi_vkGetPhysicalDeviceMemoryProperties(VkPhysicalDevice physicalDevice, Vk
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
*/
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(pAllocateInfo);
@ -74,14 +76,14 @@ VkResult rpi_vkAllocateMemory(VkDevice device, const VkMemoryAllocateInfo* pAllo
uint32_t bo = vc4_bo_alloc(controlFd, pAllocateInfo->allocationSize, "vkAllocateMemory");
if(!bo)
{
PROFILEEND(rpi_vkAllocateMemory);
PROFILEEND(RPIFUNC(vkAllocateMemory));
return VK_ERROR_OUT_OF_DEVICE_MEMORY;
}
_deviceMemory* mem = ALLOCATE(sizeof(_deviceMemory), 1, VK_SYSTEM_ALLOCATION_SCOPE_OBJECT);
if(!mem)
{
PROFILEEND(rpi_vkAllocateMemory);
PROFILEEND(RPIFUNC(vkAllocateMemory));
return VK_ERROR_OUT_OF_HOST_MEMORY;
}
@ -94,16 +96,16 @@ VkResult rpi_vkAllocateMemory(VkDevice device, const VkMemoryAllocateInfo* pAllo
//TODO max number of allocations
PROFILEEND(rpi_vkAllocateMemory);
PROFILEEND(RPIFUNC(vkAllocateMemory));
return VK_SUCCESS;
}
/*
* 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(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);
if(!ptr)
{
PROFILEEND(rpi_vkMapMemory);
PROFILEEND(RPIFUNC(vkMapMemory));
return VK_ERROR_MEMORY_MAP_FAILED;
}
@ -137,16 +139,16 @@ VkResult rpi_vkMapMemory(VkDevice device, VkDeviceMemory memory, VkDeviceSize of
((_deviceMemory*)memory)->mappedSize = size;
*ppData = ptr;
PROFILEEND(rpi_vkMapMemory);
PROFILEEND(RPIFUNC(vkMapMemory));
return VK_SUCCESS;
}
/*
* 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(memory);
@ -156,12 +158,12 @@ void rpi_vkUnmapMemory(VkDevice device, VkDeviceMemory memory)
((_deviceMemory*)memory)->mappedSize = 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);
@ -172,29 +174,29 @@ void rpi_vkFreeMemory(VkDevice device, VkDeviceMemory memory, const VkAllocation
FREE(mem);
}
PROFILEEND(rpi_vkFreeMemory);
PROFILEEND(RPIFUNC(vkFreeMemory));
}
/*
* 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,
uint32_t memoryRangeCount,
const VkMappedMemoryRange* pMemoryRanges)
{
PROFILESTART(rpi_vkFlushMappedMemoryRanges);
PROFILESTART(RPIFUNC(vkFlushMappedMemoryRanges));
//TODO
PROFILEEND(rpi_vkFlushMappedMemoryRanges);
PROFILEEND(RPIFUNC(vkFlushMappedMemoryRanges));
return VK_SUCCESS;
}
/*
* 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,
uint32_t memoryRangeCount,
const VkMappedMemoryRange* pMemoryRanges)
@ -204,15 +206,15 @@ VKAPI_ATTR VkResult VKAPI_CALL rpi_vkInvalidateMappedMemoryRanges(
return VK_SUCCESS;
}
VKAPI_ATTR void VKAPI_CALL rpi_vkGetPhysicalDeviceMemoryProperties2(
VKAPI_ATTR void VKAPI_CALL RPIFUNC(vkGetPhysicalDeviceMemoryProperties2)(
VkPhysicalDevice physicalDevice,
VkPhysicalDeviceMemoryProperties2* pMemoryProperties)
{
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,
VkDeviceMemory memory,
VkDeviceSize* pCommittedMemoryInBytes)

View File

@ -1,14 +1,16 @@
#include "common.h"
#include "declarations.h"
#include "kernel/vc4_packet.h"
#include "../QPUassembler/qpu_assembler.h"
/*
* 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);
@ -22,7 +24,7 @@ void rpi_vkCmdBindPipeline(VkCommandBuffer commandBuffer, VkPipelineBindPoint pi
cb->computePipeline = pipeline;
}
PROFILEEND(rpi_vkCmdBindPipeline);
PROFILEEND(RPIFUNC(vkCmdBindPipeline));
}
//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
*/
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(createInfoCount > 0);
@ -198,7 +200,7 @@ VkResult rpi_vkCreateGraphicsPipelines(VkDevice device, VkPipelineCache pipeline
_pipeline* pip = ALLOCATE(sizeof(_pipeline), 1, VK_SYSTEM_ALLOCATION_SCOPE_OBJECT);
if(!pip)
{
PROFILEEND(rpi_vkCreateGraphicsPipelines);
PROFILEEND(RPIFUNC(vkCreateGraphicsPipelines));
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);
if(!pip->names[idx])
{
PROFILEEND(rpi_vkCreateGraphicsPipelines);
PROFILEEND(RPIFUNC(vkCreateGraphicsPipelines));
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);
if(!pip->vertexAttributeDescriptions)
{
PROFILEEND(rpi_vkCreateGraphicsPipelines);
PROFILEEND(RPIFUNC(vkCreateGraphicsPipelines));
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);
if(!pip->vertexBindingDescriptions)
{
PROFILEEND(rpi_vkCreateGraphicsPipelines);
PROFILEEND(RPIFUNC(vkCreateGraphicsPipelines));
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);
if(!pip->viewports)
{
PROFILEEND(rpi_vkCreateGraphicsPipelines);
PROFILEEND(RPIFUNC(vkCreateGraphicsPipelines));
return VK_ERROR_OUT_OF_HOST_MEMORY;
}
@ -357,7 +359,7 @@ VkResult rpi_vkCreateGraphicsPipelines(VkDevice device, VkPipelineCache pipeline
if(!pip->scissors)
{
PROFILEEND(rpi_vkCreateGraphicsPipelines);
PROFILEEND(RPIFUNC(vkCreateGraphicsPipelines));
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);
if(!pip->attachmentBlendStates)
{
PROFILEEND(rpi_vkCreateGraphicsPipelines);
PROFILEEND(RPIFUNC(vkCreateGraphicsPipelines));
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);
if(!pip->dynamicStates)
{
PROFILEEND(rpi_vkCreateGraphicsPipelines);
PROFILEEND(RPIFUNC(vkCreateGraphicsPipelines));
return VK_ERROR_OUT_OF_HOST_MEMORY;
}
@ -475,13 +477,13 @@ VkResult rpi_vkCreateGraphicsPipelines(VkDevice device, VkPipelineCache pipeline
pPipelines[c] = pip;
}
PROFILEEND(rpi_vkCreateGraphicsPipelines);
PROFILEEND(RPIFUNC(vkCreateGraphicsPipelines));
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);
@ -503,10 +505,10 @@ void rpi_vkDestroyPipeline(VkDevice device, VkPipeline pipeline, const VkAllocat
FREE(pip);
}
PROFILEEND(rpi_vkDestroyPipeline);
PROFILEEND(RPIFUNC(vkDestroyPipeline));
}
VKAPI_ATTR VkResult VKAPI_CALL rpi_vkMergePipelineCaches(
VKAPI_ATTR VkResult VKAPI_CALL RPIFUNC(vkMergePipelineCaches)(
VkDevice device,
VkPipelineCache dstCache,
uint32_t srcCacheCount,
@ -516,7 +518,7 @@ VKAPI_ATTR VkResult VKAPI_CALL rpi_vkMergePipelineCaches(
return UNSUPPORTED_RETURN;
}
VKAPI_ATTR VkResult VKAPI_CALL rpi_vkGetPipelineCacheData(
VKAPI_ATTR VkResult VKAPI_CALL RPIFUNC(vkGetPipelineCacheData)(
VkDevice device,
VkPipelineCache pipelineCache,
size_t* pDataSize,
@ -526,7 +528,7 @@ VKAPI_ATTR VkResult VKAPI_CALL rpi_vkGetPipelineCacheData(
return UNSUPPORTED_RETURN;
}
VKAPI_ATTR void VKAPI_CALL rpi_vkDestroyPipelineCache(
VKAPI_ATTR void VKAPI_CALL RPIFUNC(vkDestroyPipelineCache)(
VkDevice device,
VkPipelineCache pipelineCache,
const VkAllocationCallbacks* pAllocator)
@ -534,13 +536,13 @@ VKAPI_ATTR void VKAPI_CALL rpi_vkDestroyPipelineCache(
UNSUPPORTED(vkDestroyPipelineCache);
}
VKAPI_ATTR VkResult VKAPI_CALL rpi_vkCreatePipelineLayout(
VKAPI_ATTR VkResult VKAPI_CALL RPIFUNC(vkCreatePipelineLayout)(
VkDevice device,
const VkPipelineLayoutCreateInfo* pCreateInfo,
const VkAllocationCallbacks* pAllocator,
VkPipelineLayout* pPipelineLayout)
{
PROFILESTART(rpi_vkCreatePipelineLayout);
PROFILESTART(RPIFUNC(vkCreatePipelineLayout));
assert(device);
assert(pCreateInfo);
@ -550,7 +552,7 @@ VKAPI_ATTR VkResult VKAPI_CALL rpi_vkCreatePipelineLayout(
if(!pl)
{
PROFILEEND(rpi_vkCreatePipelineLayout);
PROFILEEND(RPIFUNC(vkCreatePipelineLayout));
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);
if(!pl->setLayouts)
{
PROFILEEND(rpi_vkCreatePipelineLayout);
PROFILEEND(RPIFUNC(vkCreatePipelineLayout));
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);
if(!pl->pushConstantRanges)
{
PROFILEEND(rpi_vkCreatePipelineLayout);
PROFILEEND(RPIFUNC(vkCreatePipelineLayout));
return VK_ERROR_OUT_OF_HOST_MEMORY;
}
@ -585,16 +587,16 @@ VKAPI_ATTR VkResult VKAPI_CALL rpi_vkCreatePipelineLayout(
*pPipelineLayout = pl;
PROFILEEND(rpi_vkCreatePipelineLayout);
PROFILEEND(RPIFUNC(vkCreatePipelineLayout));
return VK_SUCCESS;
}
VKAPI_ATTR void VKAPI_CALL rpi_vkDestroyPipelineLayout(
VKAPI_ATTR void VKAPI_CALL RPIFUNC(vkDestroyPipelineLayout)(
VkDevice device,
VkPipelineLayout pipelineLayout,
const VkAllocationCallbacks* pAllocator)
{
PROFILESTART(rpi_vkDestroyPipelineLayout);
PROFILESTART(RPIFUNC(vkDestroyPipelineLayout));
assert(device);
assert(pipelineLayout);
@ -607,10 +609,10 @@ VKAPI_ATTR void VKAPI_CALL rpi_vkDestroyPipelineLayout(
FREE(pl);
PROFILEEND(rpi_vkDestroyPipelineLayout);
PROFILEEND(RPIFUNC(vkDestroyPipelineLayout));
}
VKAPI_ATTR VkResult VKAPI_CALL rpi_vkCreatePipelineCache(
VKAPI_ATTR VkResult VKAPI_CALL RPIFUNC(vkCreatePipelineCache)(
VkDevice device,
const VkPipelineCacheCreateInfo* pCreateInfo,
const VkAllocationCallbacks* pAllocator,

View File

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

View File

@ -1,13 +1,15 @@
#include "common.h"
#include "declarations.h"
#include "kernel/vc4_packet.h"
/*
* 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(pRenderPassBegin);
@ -286,15 +288,15 @@ void rpi_vkCmdBeginRenderPass(VkCommandBuffer commandBuffer, const VkRenderPassB
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
*/
void rpi_vkCmdEndRenderPass(VkCommandBuffer commandBuffer)
void RPIFUNC(vkCmdEndRenderPass)(VkCommandBuffer commandBuffer)
{
PROFILESTART(rpi_vkCmdEndRenderPass);
PROFILESTART(RPIFUNC(vkCmdEndRenderPass));
assert(commandBuffer);
@ -316,15 +318,15 @@ void rpi_vkCmdEndRenderPass(VkCommandBuffer commandBuffer)
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
*/
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(pCreateInfo);
@ -336,7 +338,7 @@ VkResult rpi_vkCreateRenderPass(VkDevice device, const VkRenderPassCreateInfo* p
_renderpass* rp = ALLOCATE(sizeof(_renderpass), 1, VK_SYSTEM_ALLOCATION_SCOPE_OBJECT);
if(!rp)
{
PROFILEEND(rpi_vkCreateRenderPass);
PROFILEEND(RPIFUNC(vkCreateRenderPass));
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);
if(!rp->attachments)
{
PROFILEEND(rpi_vkCreateRenderPass);
PROFILEEND(RPIFUNC(vkCreateRenderPass));
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);
if(!rp->subpasses)
{
PROFILEEND(rpi_vkCreateRenderPass);
PROFILEEND(RPIFUNC(vkCreateRenderPass));
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);
if(!rp->subpasses[c].pInputAttachments)
{
PROFILEEND(rpi_vkCreateRenderPass);
PROFILEEND(RPIFUNC(vkCreateRenderPass));
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);
if(!rp->subpasses[c].pColorAttachments)
{
PROFILEEND(rpi_vkCreateRenderPass);
PROFILEEND(RPIFUNC(vkCreateRenderPass));
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);
if(!rp->subpasses[c].pResolveAttachments)
{
PROFILEEND(rpi_vkCreateRenderPass);
PROFILEEND(RPIFUNC(vkCreateRenderPass));
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);
if(!rp->subpasses[c].pDepthStencilAttachment)
{
PROFILEEND(rpi_vkCreateRenderPass);
PROFILEEND(RPIFUNC(vkCreateRenderPass));
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);
if(!rp->subpasses[c].pPreserveAttachments)
{
PROFILEEND(rpi_vkCreateRenderPass);
PROFILEEND(RPIFUNC(vkCreateRenderPass));
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);
if(!rp->subpassDependencies)
{
PROFILEEND(rpi_vkCreateRenderPass);
PROFILEEND(RPIFUNC(vkCreateRenderPass));
return VK_ERROR_OUT_OF_HOST_MEMORY;
}
@ -459,13 +461,13 @@ VkResult rpi_vkCreateRenderPass(VkDevice device, const VkRenderPassCreateInfo* p
*pRenderPass = rp;
PROFILEEND(rpi_vkCreateRenderPass);
PROFILEEND(RPIFUNC(vkCreateRenderPass));
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);
@ -491,15 +493,15 @@ void rpi_vkDestroyRenderPass(VkDevice device, VkRenderPass renderPass, const VkA
FREE(rp);
}
PROFILEEND(rpi_vkDestroyRenderPass);
PROFILEEND(RPIFUNC(vkDestroyRenderPass));
}
/*
* 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(pCreateInfo);
@ -509,7 +511,7 @@ VkResult rpi_vkCreateFramebuffer(VkDevice device, const VkFramebufferCreateInfo*
if(!fb)
{
PROFILEEND(rpi_vkCreateFramebuffer);
PROFILEEND(RPIFUNC(vkCreateFramebuffer));
return VK_ERROR_OUT_OF_HOST_MEMORY;
}
@ -520,7 +522,7 @@ VkResult rpi_vkCreateFramebuffer(VkDevice device, const VkFramebufferCreateInfo*
if(!fb->attachmentViews)
{
PROFILEEND(rpi_vkCreateFramebuffer);
PROFILEEND(RPIFUNC(vkCreateFramebuffer));
return VK_ERROR_OUT_OF_HOST_MEMORY;
}
@ -535,13 +537,13 @@ VkResult rpi_vkCreateFramebuffer(VkDevice device, const VkFramebufferCreateInfo*
*pFramebuffer = fb;
PROFILEEND(rpi_vkCreateFramebuffer);
PROFILEEND(RPIFUNC(vkCreateFramebuffer));
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);
@ -552,17 +554,17 @@ void rpi_vkDestroyFramebuffer(VkDevice device, VkFramebuffer framebuffer, const
FREE(fb);
}
PROFILEEND(rpi_vkDestroyFramebuffer);
PROFILEEND(RPIFUNC(vkDestroyFramebuffer));
}
/*
* 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,
VkSubpassContents contents)
{
PROFILESTART(rpi_vkCmdNextSubpass);
PROFILESTART(RPIFUNC(vkCmdNextSubpass));
assert(commandBuffer);
@ -571,18 +573,18 @@ VKAPI_ATTR void VKAPI_CALL rpi_vkCmdNextSubpass(
_commandBuffer* cb = commandBuffer;
//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
*/
VKAPI_ATTR void VKAPI_CALL rpi_vkGetRenderAreaGranularity(
VKAPI_ATTR void VKAPI_CALL RPIFUNC(vkGetRenderAreaGranularity)(
VkDevice device,
VkRenderPass renderPass,
VkExtent2D* pGranularity)
{
PROFILESTART(rpi_vkGetRenderAreaGranularity);
PROFILESTART(RPIFUNC(vkGetRenderAreaGranularity));
assert(device);
assert(renderPass);
@ -609,5 +611,5 @@ VKAPI_ATTR void VKAPI_CALL rpi_vkGetRenderAreaGranularity(
pGranularity->width = tileSizeW;
pGranularity->height = tileSizeH;
PROFILEEND(rpi_vkGetRenderAreaGranularity);
PROFILEEND(RPIFUNC(vkGetRenderAreaGranularity));
}

View File

@ -1,13 +1,15 @@
#include "common.h"
#include "declarations.h"
#include "kernel/vc4_packet.h"
/*
* 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(pCreateInfo);
@ -17,7 +19,7 @@ VkResult rpi_vkCreateImageView(VkDevice device, const VkImageViewCreateInfo* pCr
if(!view)
{
PROFILEEND(rpi_vkCreateImageView);
PROFILEEND(RPIFUNC(vkCreateImageView));
return VK_ERROR_OUT_OF_HOST_MEMORY;
}
@ -29,16 +31,16 @@ VkResult rpi_vkCreateImageView(VkDevice device, const VkImageViewCreateInfo* pCr
*pView = view;
PROFILEEND(rpi_vkCreateImageView);
PROFILEEND(RPIFUNC(vkCreateImageView));
return VK_SUCCESS;
}
/*
* 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(pCreateInfo);
@ -47,7 +49,7 @@ VkResult rpi_vkCreateBuffer(VkDevice device, const VkBufferCreateInfo* pCreateIn
_buffer* buf = ALLOCATE(sizeof(_buffer), 1, VK_SYSTEM_ALLOCATION_SCOPE_OBJECT);
if(!buf)
{
PROFILEEND(rpi_vkCreateBuffer);
PROFILEEND(RPIFUNC(vkCreateBuffer));
return VK_ERROR_OUT_OF_HOST_MEMORY;
}
@ -59,16 +61,16 @@ VkResult rpi_vkCreateBuffer(VkDevice device, const VkBufferCreateInfo* pCreateIn
*pBuffer = buf;
PROFILEEND(rpi_vkCreateBuffer);
PROFILEEND(RPIFUNC(vkCreateBuffer));
return VK_SUCCESS;
}
/*
* 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(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...
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,
const VkBufferMemoryRequirementsInfo2* pInfo,
VkMemoryRequirements2* pMemoryRequirements)
{
PROFILESTART(rpi_vkGetBufferMemoryRequirements2);
PROFILESTART(RPIFUNC(vkGetBufferMemoryRequirements2));
assert(device);
assert(pInfo);
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
*/
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(buffer);
@ -120,13 +122,13 @@ VkResult rpi_vkBindBufferMemory(VkDevice device, VkBuffer buffer, VkDeviceMemory
buf->boundMem = mem;
buf->boundOffset = memoryOffset;
PROFILEEND(rpi_vkBindBufferMemory);
PROFILEEND(RPIFUNC(vkBindBufferMemory));
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);
@ -136,12 +138,12 @@ void rpi_vkDestroyBuffer(VkDevice device, VkBuffer buffer, const VkAllocationCal
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);
@ -151,20 +153,20 @@ void rpi_vkDestroyImageView(VkDevice device, VkImageView imageView, const VkAllo
FREE(view);
}
PROFILEEND(rpi_vkDestroyImageView);
PROFILEEND(RPIFUNC(vkDestroyImageView));
}
/*
* 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,
const VkBufferViewCreateInfo* pCreateInfo,
const VkAllocationCallbacks* pAllocator,
VkBufferView* pView)
{
PROFILESTART(rpi_vkCreateBufferView);
PROFILESTART(RPIFUNC(vkCreateBufferView));
assert(device);
assert(pCreateInfo);
@ -174,7 +176,7 @@ VKAPI_ATTR VkResult VKAPI_CALL rpi_vkCreateBufferView(
if(!bv)
{
PROFILEEND(rpi_vkCreateBufferView);
PROFILEEND(RPIFUNC(vkCreateBufferView));
return VK_ERROR_OUT_OF_HOST_MEMORY;
}
@ -185,19 +187,19 @@ VKAPI_ATTR VkResult VKAPI_CALL rpi_vkCreateBufferView(
*pView = bv;
PROFILEEND(rpi_vkCreateBufferView);
PROFILEEND(RPIFUNC(vkCreateBufferView));
return VK_SUCCESS;
}
/*
* 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,
VkBufferView bufferView,
const VkAllocationCallbacks* pAllocator)
{
PROFILESTART(rpi_vkDestroyBufferView);
PROFILESTART(RPIFUNC(vkDestroyBufferView));
assert(device);
@ -207,19 +209,19 @@ VKAPI_ATTR void VKAPI_CALL rpi_vkDestroyBufferView(
FREE(bv);
}
PROFILEEND(rpi_vkDestroyBufferView);
PROFILEEND(RPIFUNC(vkDestroyBufferView));
}
/*
* 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,
const VkImageCreateInfo* pCreateInfo,
const VkAllocationCallbacks* pAllocator,
VkImage* pImage)
{
PROFILESTART(rpi_vkCreateImage);
PROFILESTART(RPIFUNC(vkCreateImage));
assert(device);
assert(pCreateInfo);
@ -228,7 +230,7 @@ VKAPI_ATTR VkResult VKAPI_CALL rpi_vkCreateImage(
_image* i = ALLOCATE(sizeof(_image), 1, VK_SYSTEM_ALLOCATION_SCOPE_OBJECT);
if(!i)
{
PROFILEEND(rpi_vkCreateImage);
PROFILEEND(RPIFUNC(vkCreateImage));
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);
if(!i->queueFamiliesWithAccess)
{
PROFILEEND(rpi_vkCreateImage);
PROFILEEND(RPIFUNC(vkCreateImage));
return VK_ERROR_OUT_OF_HOST_MEMORY;
}
memcpy(i->queueFamiliesWithAccess, pCreateInfo->pQueueFamilyIndices, sizeof(uint32_t) * i->numQueueFamiliesWithAccess);
@ -290,19 +292,19 @@ VKAPI_ATTR VkResult VKAPI_CALL rpi_vkCreateImage(
*pImage = i;
PROFILEEND(rpi_vkCreateImage);
PROFILEEND(RPIFUNC(vkCreateImage));
return VK_SUCCESS;
}
/*
* 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,
VkImage image,
const VkAllocationCallbacks* pAllocator)
{
PROFILESTART(rpi_vkDestroyImage);
PROFILESTART(RPIFUNC(vkDestroyImage));
assert(device);
@ -317,18 +319,18 @@ VKAPI_ATTR void VKAPI_CALL rpi_vkDestroyImage(
FREE(i);
}
PROFILEEND(rpi_vkDestroyImage);
PROFILEEND(RPIFUNC(vkDestroyImage));
}
/*
* 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,
VkImage image,
VkMemoryRequirements* pMemoryRequirements)
{
PROFILESTART(rpi_vkGetImageMemoryRequirements);
PROFILESTART(RPIFUNC(vkGetImageMemoryRequirements));
assert(device);
assert(image);
@ -425,19 +427,19 @@ VKAPI_ATTR void VKAPI_CALL rpi_vkGetImageMemoryRequirements(
pMemoryRequirements->memoryTypeBits = memoryTypes[0].propertyFlags; //TODO
pMemoryRequirements->size = i->size;
PROFILEEND(rpi_vkGetImageMemoryRequirements);
PROFILEEND(RPIFUNC(vkGetImageMemoryRequirements));
}
/*
* 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,
VkImage image,
VkDeviceMemory memory,
VkDeviceSize memoryOffset)
{
PROFILESTART(rpi_vkBindImageMemory);
PROFILESTART(RPIFUNC(vkBindImageMemory));
assert(device);
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);
}
PROFILEEND(rpi_vkBindImageMemory);
PROFILEEND(RPIFUNC(vkBindImageMemory));
return VK_SUCCESS;
}
VKAPI_ATTR VkResult VKAPI_CALL rpi_vkBindBufferMemory2(
VKAPI_ATTR VkResult VKAPI_CALL RPIFUNC(vkBindBufferMemory2)(
VkDevice device,
uint32_t bindInfoCount,
const VkBindBufferMemoryInfo* pBindInfos)
{
PROFILESTART(rpi_vkBindBufferMemory2);
PROFILESTART(RPIFUNC(vkBindBufferMemory2));
assert(device);
assert(pBindInfos);
@ -482,38 +484,38 @@ VKAPI_ATTR VkResult VKAPI_CALL rpi_vkBindBufferMemory2(
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)
{
ret = res;
}
}
PROFILEEND(rpi_vkBindBufferMemory2);
PROFILEEND(RPIFUNC(vkBindBufferMemory2));
return ret;
}
VKAPI_ATTR void VKAPI_CALL rpi_vkGetImageMemoryRequirements2(
VKAPI_ATTR void VKAPI_CALL RPIFUNC(vkGetImageMemoryRequirements2)(
VkDevice device,
const VkImageMemoryRequirementsInfo2* pInfo,
VkMemoryRequirements2* pMemoryRequirements)
{
PROFILESTART(rpi_vkGetImageMemoryRequirements2);
PROFILESTART(RPIFUNC(vkGetImageMemoryRequirements2));
assert(device);
assert(pInfo);
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,
uint32_t bindInfoCount,
const VkBindImageMemoryInfo* pBindInfos)
{
PROFILESTART(rpi_vkBindImageMemory2);
PROFILESTART(RPIFUNC(vkBindImageMemory2));
assert(device);
assert(pBindInfos);
@ -522,18 +524,18 @@ VKAPI_ATTR VkResult VKAPI_CALL rpi_vkBindImageMemory2(
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)
{
ret = res;
}
}
PROFILEEND(rpi_vkBindImageMemory2);
PROFILEEND(RPIFUNC(vkBindImageMemory2));
return ret;
}
VKAPI_ATTR void VKAPI_CALL rpi_vkCmdPushConstants(
VKAPI_ATTR void VKAPI_CALL RPIFUNC(vkCmdPushConstants)(
VkCommandBuffer commandBuffer,
VkPipelineLayout layout,
VkShaderStageFlags stageFlags,
@ -541,7 +543,7 @@ VKAPI_ATTR void VKAPI_CALL rpi_vkCmdPushConstants(
uint32_t size,
const void* pValues)
{
PROFILESTART(rpi_vkCmdPushConstants);
PROFILESTART(RPIFUNC(vkCmdPushConstants));
assert(commandBuffer);
assert(layout);
@ -561,18 +563,18 @@ VKAPI_ATTR void VKAPI_CALL rpi_vkCmdPushConstants(
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,
VkImage image,
const VkImageSubresource* pSubresource,
VkSubresourceLayout* pLayout)
{
PROFILESTART(rpi_vkGetImageSubresourceLayout);
PROFILESTART(RPIFUNC(vkGetImageSubresourceLayout));
//TODO
PROFILEEND(rpi_vkGetImageSubresourceLayout);
PROFILEEND(RPIFUNC(vkGetImageSubresourceLayout));
}

View File

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

View File

@ -1,5 +1,7 @@
#include "common.h"
#include "declarations.h"
#include "kernel/vc4_packet.h"
#include "QPUassembler/qpu_assembler.h"
@ -13,9 +15,9 @@
/*
* 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];
VkRpiShaderModuleAssemblyCreateInfoEXT* ci = pCreateInfo->pCode[4];
@ -23,7 +25,7 @@ VkResult rpi_vkCreateShaderModule(VkDevice device, const VkShaderModuleCreateInf
//shader magic doesn't add up
if(magic != 0x14E45250)
{
PROFILEEND(rpi_vkCreateShaderModule);
PROFILEEND(RPIFUNC(vkCreateShaderModule));
return VK_ERROR_OUT_OF_HOST_MEMORY;
}
@ -35,7 +37,7 @@ VkResult rpi_vkCreateShaderModule(VkDevice device, const VkShaderModuleCreateInf
if(!shader)
{
PROFILEEND(rpi_vkCreateShaderModule);
PROFILEEND(RPIFUNC(vkCreateShaderModule));
return VK_ERROR_OUT_OF_HOST_MEMORY;
}
@ -392,7 +394,7 @@ VkResult rpi_vkCreateShaderModule(VkDevice device, const VkShaderModuleCreateInf
if(!shader->mappings[c])
{
PROFILEEND(rpi_vkCreateShaderModule);
PROFILEEND(RPIFUNC(vkCreateShaderModule));
return VK_ERROR_OUT_OF_HOST_MEMORY;
}
@ -410,13 +412,13 @@ VkResult rpi_vkCreateShaderModule(VkDevice device, const VkShaderModuleCreateInf
*pShaderModule = shader;
PROFILEEND(rpi_vkCreateShaderModule);
PROFILEEND(RPIFUNC(vkCreateShaderModule));
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);
@ -440,5 +442,5 @@ void rpi_vkDestroyShaderModule(VkDevice device, VkShaderModule shaderModule, con
FREE(shader);
}
PROFILEEND(rpi_vkDestroyShaderModule);
PROFILEEND(RPIFUNC(vkDestroyShaderModule));
}

View File

@ -1,6 +1,8 @@
#include "common.h"
VKAPI_ATTR void VKAPI_CALL rpi_vkGetPhysicalDeviceSparseImageFormatProperties(
#include "declarations.h"
VKAPI_ATTR void VKAPI_CALL RPIFUNC(vkGetPhysicalDeviceSparseImageFormatProperties)(
VkPhysicalDevice physicalDevice,
VkFormat format,
VkImageType type,
@ -13,7 +15,7 @@ VKAPI_ATTR void VKAPI_CALL rpi_vkGetPhysicalDeviceSparseImageFormatProperties(
UNSUPPORTED(vkGetPhysicalDeviceSparseImageFormatProperties);
}
VKAPI_ATTR void VKAPI_CALL rpi_vkGetImageSparseMemoryRequirements(
VKAPI_ATTR void VKAPI_CALL RPIFUNC(vkGetImageSparseMemoryRequirements)(
VkDevice device,
VkImage image,
uint32_t* pSparseMemoryRequirementCount,
@ -22,7 +24,7 @@ VKAPI_ATTR void VKAPI_CALL rpi_vkGetImageSparseMemoryRequirements(
UNSUPPORTED(vkGetImageSparseMemoryRequirements);
}
VKAPI_ATTR VkResult VKAPI_CALL rpi_vkQueueBindSparse(
VKAPI_ATTR VkResult VKAPI_CALL RPIFUNC(vkQueueBindSparse)(
VkQueue queue,
uint32_t bindInfoCount,
const VkBindSparseInfo* pBindInfo,
@ -32,7 +34,7 @@ VKAPI_ATTR VkResult VKAPI_CALL rpi_vkQueueBindSparse(
return UNSUPPORTED_RETURN;
}
VKAPI_ATTR void VKAPI_CALL rpi_vkGetPhysicalDeviceSparseImageFormatProperties2(
VKAPI_ATTR void VKAPI_CALL RPIFUNC(vkGetPhysicalDeviceSparseImageFormatProperties2)(
VkPhysicalDevice physicalDevice,
const VkPhysicalDeviceSparseImageFormatInfo2* pFormatInfo,
uint32_t* pPropertyCount,
@ -41,7 +43,7 @@ VKAPI_ATTR void VKAPI_CALL rpi_vkGetPhysicalDeviceSparseImageFormatProperties2(
UNSUPPORTED(vkGetPhysicalDeviceSparseImageFormatProperties2);
}
VKAPI_ATTR void VKAPI_CALL rpi_vkGetImageSparseMemoryRequirements2(
VKAPI_ATTR void VKAPI_CALL RPIFUNC(vkGetImageSparseMemoryRequirements2)(
VkDevice device,
const VkImageSparseMemoryRequirementsInfo2* pInfo,
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.codeSize = sizeof(uint32_t)*6;
smci.pCode = spirv;
rpi_vkCreateShaderModule(device, &smci, 0, blitShaderModule);
RPIFUNC(vkCreateShaderModule)(device, &smci, 0, blitShaderModule);
assert(*blitShaderModule);
{ //assemble fs code
@ -272,7 +272,7 @@ void createClearShaderModule(VkDevice device, VkShaderModule* blitShaderModule,
assert(asm_ptrs[2]);
}
rpi_vkCreateShaderModule(device, &smci, 0, blitShaderModuleNoColor);
RPIFUNC(vkCreateShaderModule)(device, &smci, 0, blitShaderModuleNoColor);
assert(*blitShaderModuleNoColor);
for(uint32_t c = 0; c < 4; ++c)
@ -356,7 +356,7 @@ void createClearPipeline(VkDevice device, VkPipelineDepthStencilStateCreateInfo*
pipelineLayoutCI.pSetLayouts = &blitDsl;
pipelineLayoutCI.pushConstantRangeCount = 2;
pipelineLayoutCI.pPushConstantRanges = &pushConstantRanges[0];
rpi_vkCreatePipelineLayout(device, &pipelineLayoutCI, 0, blitPipelineLayout);
RPIFUNC(vkCreatePipelineLayout)(device, &pipelineLayoutCI, 0, blitPipelineLayout);
VkDynamicState dynState = VK_DYNAMIC_STATE_VIEWPORT;
@ -386,7 +386,7 @@ void createClearPipeline(VkDevice device, VkPipelineDepthStencilStateCreateInfo*
pipelineInfo.pDepthStencilState = dsState;
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)
@ -399,7 +399,7 @@ void createClearDescriptorSetLayouts(VkDevice device, VkDescriptorSetLayout* buf
descriptorLayoutCI.bindingCount = 0;
descriptorLayoutCI.pBindings = 0;
rpi_vkCreateDescriptorSetLayout(device, &descriptorLayoutCI, 0, bufferDsl);
RPIFUNC(vkCreateDescriptorSetLayout)(device, &descriptorLayoutCI, 0, bufferDsl);
}
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
*/
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(firstViewport == 0);
@ -430,15 +430,15 @@ void rpi_vkCmdSetViewport(VkCommandBuffer commandBuffer, uint32_t firstViewport,
cb->viewportDirty = 1;
PROFILEEND(rpi_vkCmdSetViewport);
PROFILEEND(RPIFUNC(vkCmdSetViewport));
}
/*
* 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(firstScissor == 0);
@ -452,15 +452,15 @@ void rpi_vkCmdSetScissor(VkCommandBuffer commandBuffer, uint32_t firstScissor, u
cb->scissorDirty = 1;
PROFILEEND(rpi_vkCmdSetScissor);
PROFILEEND(RPIFUNC(vkCmdSetScissor));
}
/*
* 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);
@ -474,7 +474,7 @@ void rpi_vkCmdBindVertexBuffers(VkCommandBuffer commandBuffer, uint32_t firstBin
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.
* 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,
VkImage image,
VkImageLayout imageLayout,
@ -490,7 +490,7 @@ VKAPI_ATTR void VKAPI_CALL rpi_vkCmdClearColorImage(
uint32_t rangeCount,
const VkImageSubresourceRange* pRanges)
{
PROFILESTART(rpi_vkCmdClearColorImage);
PROFILESTART(RPIFUNC(vkCmdClearColorImage));
assert(commandBuffer);
assert(image);
@ -566,13 +566,13 @@ VKAPI_ATTR void VKAPI_CALL rpi_vkCmdClearColorImage(
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
*/
VKAPI_ATTR void VKAPI_CALL rpi_vkCmdClearDepthStencilImage(
VKAPI_ATTR void VKAPI_CALL RPIFUNC(vkCmdClearDepthStencilImage)(
VkCommandBuffer commandBuffer,
VkImage image,
VkImageLayout imageLayout,
@ -580,7 +580,7 @@ VKAPI_ATTR void VKAPI_CALL rpi_vkCmdClearDepthStencilImage(
uint32_t rangeCount,
const VkImageSubresourceRange* pRanges)
{
PROFILESTART(rpi_vkCmdClearDepthStencilImage);
PROFILESTART(RPIFUNC(vkCmdClearDepthStencilImage));
assert(commandBuffer);
assert(image);
@ -588,20 +588,20 @@ VKAPI_ATTR void VKAPI_CALL rpi_vkCmdClearDepthStencilImage(
//TODO
PROFILEEND(rpi_vkCmdClearDepthStencilImage);
PROFILEEND(RPIFUNC(vkCmdClearDepthStencilImage));
}
/*
* 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,
uint32_t attachmentCount,
const VkClearAttachment* pAttachments,
uint32_t rectCount,
const VkClearRect* pRects)
{
PROFILESTART(rpi_vkCmdClearAttachments);
PROFILESTART(RPIFUNC(vkCmdClearAttachments));
assert(commandBuffer);
assert(pAttachments);
@ -613,7 +613,7 @@ VKAPI_ATTR void VKAPI_CALL rpi_vkCmdClearAttachments(
if(!cmdBuf->currRenderPass)
{
//no active render pass
PROFILEEND(rpi_vkCmdClearAttachments);
PROFILEEND(RPIFUNC(vkCmdClearAttachments));
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);
rpi_vkCmdBindPipeline(commandBuffer, VK_PIPELINE_BIND_POINT_GRAPHICS, blitPipeline);
RPIFUNC(vkCmdBindPipeline)(commandBuffer, VK_PIPELINE_BIND_POINT_GRAPHICS, blitPipeline);
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;
@ -687,7 +687,7 @@ VKAPI_ATTR void VKAPI_CALL rpi_vkCmdClearAttachments(
fragConstants[1] = stencilSetup;
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)
{
@ -699,7 +699,7 @@ VKAPI_ATTR void VKAPI_CALL rpi_vkCmdClearAttachments(
vp.minDepth = 0.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 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[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
rpi_vkDestroyPipelineLayout(device, blitPipelineLayout, 0);
rpi_vkDestroyPipeline(device, blitPipeline, 0);
RPIFUNC(vkDestroyPipelineLayout)(device, blitPipelineLayout, 0);
RPIFUNC(vkDestroyPipeline)(device, blitPipeline, 0);
}
//restore state
@ -729,53 +729,53 @@ VKAPI_ATTR void VKAPI_CALL rpi_vkCmdClearAttachments(
memcpy(cmdBuf->pushConstantBufferVertex, oldPushConstantBufferVertex, sizeof(oldPushConstantBufferVertex));
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
*/
VKAPI_ATTR void VKAPI_CALL rpi_vkCmdFillBuffer(
VKAPI_ATTR void VKAPI_CALL RPIFUNC(vkCmdFillBuffer)(
VkCommandBuffer commandBuffer,
VkBuffer dstBuffer,
VkDeviceSize dstOffset,
VkDeviceSize size,
uint32_t data)
{
PROFILESTART(rpi_vkCmdFillBuffer);
PROFILESTART(RPIFUNC(vkCmdFillBuffer));
//TODO
PROFILEEND(rpi_vkCmdFillBuffer);
PROFILEEND(RPIFUNC(vkCmdFillBuffer));
}
/*
* 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,
VkBuffer dstBuffer,
VkDeviceSize dstOffset,
VkDeviceSize dataSize,
const void* pData)
{
PROFILESTART(rpi_vkCmdUpdateBuffer);
PROFILESTART(RPIFUNC(vkCmdUpdateBuffer));
//TODO
PROFILEEND(rpi_vkCmdUpdateBuffer);
PROFILEEND(RPIFUNC(vkCmdUpdateBuffer));
}
/*
* 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,
VkBuffer buffer,
VkDeviceSize offset,
VkIndexType indexType)
{
PROFILESTART(rpi_vkCmdBindIndexBuffer);
PROFILESTART(RPIFUNC(vkCmdBindIndexBuffer));
assert(commandBuffer);
@ -791,17 +791,17 @@ VKAPI_ATTR void VKAPI_CALL rpi_vkCmdBindIndexBuffer(
cb->indexBufferDirty = 1;
PROFILEEND(rpi_vkCmdBindIndexBuffer);
PROFILEEND(RPIFUNC(vkCmdBindIndexBuffer));
}
/*
* 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,
float lineWidth)
{
PROFILESTART(rpi_vkCmdSetLineWidth);
PROFILESTART(RPIFUNC(vkCmdSetLineWidth));
assert(commandBuffer);
@ -810,19 +810,19 @@ VKAPI_ATTR void VKAPI_CALL rpi_vkCmdSetLineWidth(
cb->lineWidthDirty = 1;
PROFILEEND(rpi_vkCmdSetLineWidth);
PROFILEEND(RPIFUNC(vkCmdSetLineWidth));
}
/*
* 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,
float depthBiasConstantFactor,
float depthBiasClamp,
float depthBiasSlopeFactor)
{
PROFILESTART(rpi_vkCmdSetDepthBias);
PROFILESTART(RPIFUNC(vkCmdSetDepthBias));
assert(commandBuffer);
@ -833,17 +833,17 @@ VKAPI_ATTR void VKAPI_CALL rpi_vkCmdSetDepthBias(
cb->depthBiasDirty = 1;
PROFILEEND(rpi_vkCmdSetDepthBias);
PROFILEEND(RPIFUNC(vkCmdSetDepthBias));
}
/*
* 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,
const float blendConstants[4])
{
PROFILESTART(rpi_vkCmdSetBlendConstants);
PROFILESTART(RPIFUNC(vkCmdSetBlendConstants));
assert(commandBuffer);
@ -852,18 +852,18 @@ VKAPI_ATTR void VKAPI_CALL rpi_vkCmdSetBlendConstants(
cb->blendConstantsDirty = 1;
PROFILEEND(rpi_vkCmdSetBlendConstants);
PROFILEEND(RPIFUNC(vkCmdSetBlendConstants));
}
/*
* 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,
float minDepthBounds,
float maxDepthBounds)
{
PROFILESTART(rpi_vkCmdSetDepthBounds);
PROFILESTART(RPIFUNC(vkCmdSetDepthBounds));
assert(commandBuffer);
@ -873,18 +873,18 @@ VKAPI_ATTR void VKAPI_CALL rpi_vkCmdSetDepthBounds(
cb->depthBoundsDirty = 1;
PROFILEEND(rpi_vkCmdSetDepthBounds);
PROFILEEND(RPIFUNC(vkCmdSetDepthBounds));
}
/*
* 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,
VkStencilFaceFlags faceMask,
uint32_t compareMask)
{
PROFILESTART(rpi_vkCmdSetStencilCompareMask);
PROFILESTART(RPIFUNC(vkCmdSetStencilCompareMask));
assert(commandBuffer);
@ -902,18 +902,18 @@ VKAPI_ATTR void VKAPI_CALL rpi_vkCmdSetStencilCompareMask(
cb->stencilCompareMaskDirty = 1;
PROFILEEND(rpi_vkCmdSetStencilCompareMask);
PROFILEEND(RPIFUNC(vkCmdSetStencilCompareMask));
}
/*
* 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,
VkStencilFaceFlags faceMask,
uint32_t writeMask)
{
PROFILESTART(rpi_vkCmdSetStencilWriteMask);
PROFILESTART(RPIFUNC(vkCmdSetStencilWriteMask));
assert(commandBuffer);
@ -931,18 +931,18 @@ VKAPI_ATTR void VKAPI_CALL rpi_vkCmdSetStencilWriteMask(
cb->stencilWriteMaskDirty = 1;
PROFILEEND(rpi_vkCmdSetStencilWriteMask);
PROFILEEND(RPIFUNC(vkCmdSetStencilWriteMask));
}
/*
* 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,
VkStencilFaceFlags faceMask,
uint32_t reference)
{
PROFILESTART(rpi_vkCmdSetStencilReference);
PROFILESTART(RPIFUNC(vkCmdSetStencilReference));
assert(commandBuffer);
@ -960,5 +960,5 @@ VKAPI_ATTR void VKAPI_CALL rpi_vkCmdSetStencilReference(
cb->stencilReferenceDirty = 1;
PROFILEEND(rpi_vkCmdSetStencilReference);
PROFILEEND(RPIFUNC(vkCmdSetStencilReference));
}

View File

@ -1,5 +1,7 @@
#include "common.h"
#include "declarations.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.
* 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,
const VkSemaphoreCreateInfo* pCreateInfo,
const VkAllocationCallbacks* pAllocator,
VkSemaphore* pSemaphore)
{
PROFILESTART(rpi_vkCreateSemaphore);
PROFILESTART(RPIFUNC(vkCreateSemaphore));
assert(device);
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);
if(!s)
{
PROFILEEND(rpi_vkCreateSemaphore);
PROFILEEND(RPIFUNC(vkCreateSemaphore));
return VK_ERROR_OUT_OF_HOST_MEMORY;
}
sem_init(s, 0, 0); //create semaphore unsignalled, shared between threads
*pSemaphore = (VkSemaphore)s;
PROFILEEND(rpi_vkCreateSemaphore);
PROFILEEND(RPIFUNC(vkCreateSemaphore));
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.
*/
VKAPI_ATTR void VKAPI_CALL rpi_vkCmdPipelineBarrier(
VKAPI_ATTR void VKAPI_CALL RPIFUNC(vkCmdPipelineBarrier)(
VkCommandBuffer commandBuffer,
VkPipelineStageFlags srcStageMask,
VkPipelineStageFlags dstStageMask,
@ -113,7 +115,7 @@ VKAPI_ATTR void VKAPI_CALL rpi_vkCmdPipelineBarrier(
uint32_t imageMemoryBarrierCount,
const VkImageMemoryBarrier* pImageMemoryBarriers)
{
PROFILESTART(rpi_vkCmdPipelineBarrier);
PROFILESTART(RPIFUNC(vkCmdPipelineBarrier));
assert(commandBuffer);
@ -201,17 +203,17 @@ VKAPI_ATTR void VKAPI_CALL rpi_vkCmdPipelineBarrier(
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
* 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)
{
PROFILESTART(rpi_vkDeviceWaitIdle);
PROFILESTART(RPIFUNC(vkDeviceWaitIdle));
assert(device);
@ -225,17 +227,17 @@ VKAPI_ATTR VkResult VKAPI_CALL rpi_vkDeviceWaitIdle(
}
}
PROFILEEND(rpi_vkDeviceWaitIdle);
PROFILEEND(RPIFUNC(vkDeviceWaitIdle));
return VK_SUCCESS;
}
/*
* 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)
{
PROFILESTART(rpi_vkQueueWaitIdle);
PROFILESTART(RPIFUNC(vkQueueWaitIdle));
assert(queue);
@ -244,19 +246,19 @@ VKAPI_ATTR VkResult VKAPI_CALL rpi_vkQueueWaitIdle(
uint64_t timeout = WAIT_TIMEOUT_INFINITE;
vc4_seqno_wait(controlFd, &lastFinishedSeqno, q->lastEmitSeqno, &timeout);
PROFILEEND(rpi_vkQueueWaitIdle);
PROFILEEND(RPIFUNC(vkQueueWaitIdle));
return VK_SUCCESS;
}
/*
* 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,
VkSemaphore semaphore,
const VkAllocationCallbacks* pAllocator)
{
PROFILESTART(rpi_vkDestroySemaphore);
PROFILESTART(RPIFUNC(vkDestroySemaphore));
assert(device);
@ -266,19 +268,19 @@ VKAPI_ATTR void VKAPI_CALL rpi_vkDestroySemaphore(
FREE(semaphore);
}
PROFILEEND(rpi_vkDestroySemaphore);
PROFILEEND(RPIFUNC(vkDestroySemaphore));
}
/*
* 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,
const VkFenceCreateInfo* pCreateInfo,
const VkAllocationCallbacks* pAllocator,
VkFence* pFence)
{
PROFILESTART(rpi_vkCreateFence);
PROFILESTART(RPIFUNC(vkCreateFence));
assert(device);
assert(pCreateInfo);
@ -288,7 +290,7 @@ VKAPI_ATTR VkResult VKAPI_CALL rpi_vkCreateFence(
if(!f)
{
PROFILEEND(rpi_vkCreateFence);
PROFILEEND(RPIFUNC(vkCreateFence));
return VK_ERROR_OUT_OF_HOST_MEMORY;
}
@ -297,19 +299,19 @@ VKAPI_ATTR VkResult VKAPI_CALL rpi_vkCreateFence(
*pFence = f;
PROFILEEND(rpi_vkCreateFence);
PROFILEEND(RPIFUNC(vkCreateFence));
return VK_SUCCESS;
}
/*
* 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,
VkFence fence,
const VkAllocationCallbacks* pAllocator)
{
PROFILESTART(rpi_vkDestroyFence);
PROFILESTART(RPIFUNC(vkDestroyFence));
assert(device);
@ -318,17 +320,17 @@ VKAPI_ATTR void VKAPI_CALL rpi_vkDestroyFence(
FREE(fence);
}
PROFILEEND(rpi_vkDestroyFence);
PROFILEEND(RPIFUNC(vkDestroyFence));
}
/*
* 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,
VkFence fence)
{
PROFILESTART(rpi_vkGetFenceStatus);
PROFILESTART(RPIFUNC(vkGetFenceStatus));
assert(device);
assert(fence);
@ -338,19 +340,19 @@ VKAPI_ATTR VkResult VKAPI_CALL rpi_vkGetFenceStatus(
_fence* f = fence;
VkResult retval = f->signaled ? VK_SUCCESS : VK_NOT_READY;
PROFILEEND(rpi_vkGetFenceStatus);
PROFILEEND(RPIFUNC(vkGetFenceStatus));
return retval;
}
/*
* 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,
uint32_t fenceCount,
const VkFence* pFences)
{
PROFILESTART(rpi_vkResetFences);
PROFILESTART(RPIFUNC(vkResetFences));
assert(device);
assert(pFences);
@ -363,21 +365,21 @@ VKAPI_ATTR VkResult VKAPI_CALL rpi_vkResetFences(
f->seqno = 0;
}
PROFILEEND(rpi_vkResetFences);
PROFILEEND(RPIFUNC(vkResetFences));
return VK_SUCCESS;
}
/*
* 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,
uint32_t fenceCount,
const VkFence* pFences,
VkBool32 waitAll,
uint64_t timeout)
{
PROFILESTART(rpi_vkWaitForFences);
PROFILESTART(RPIFUNC(vkWaitForFences));
assert(device);
assert(pFences);
@ -392,11 +394,11 @@ VKAPI_ATTR VkResult VKAPI_CALL rpi_vkWaitForFences(
_fence* f = pFences[c];
if(!f->signaled) //if any unsignaled
{
PROFILEEND(rpi_vkWaitForFences);
PROFILEEND(RPIFUNC(vkWaitForFences));
return VK_TIMEOUT;
}
PROFILEEND(rpi_vkWaitForFences);
PROFILEEND(RPIFUNC(vkWaitForFences));
return VK_SUCCESS;
}
}
@ -412,7 +414,7 @@ VKAPI_ATTR VkResult VKAPI_CALL rpi_vkWaitForFences(
if(ret < 0)
{
PROFILEEND(rpi_vkWaitForFences);
PROFILEEND(RPIFUNC(vkWaitForFences));
return VK_TIMEOUT;
}
@ -430,11 +432,11 @@ VKAPI_ATTR VkResult VKAPI_CALL rpi_vkWaitForFences(
_fence* f = pFences[c];
if(f->signaled) //if any signaled
{
PROFILEEND(rpi_vkWaitForFences);
PROFILEEND(RPIFUNC(vkWaitForFences));
return VK_SUCCESS;
}
PROFILEEND(rpi_vkWaitForFences);
PROFILEEND(RPIFUNC(vkWaitForFences));
return VK_TIMEOUT;
}
}
@ -455,26 +457,26 @@ VKAPI_ATTR VkResult VKAPI_CALL rpi_vkWaitForFences(
f->signaled = 1;
f->seqno = 0;
PROFILEEND(rpi_vkWaitForFences);
PROFILEEND(RPIFUNC(vkWaitForFences));
return VK_SUCCESS;
}
else
{
//already signaled
PROFILEEND(rpi_vkWaitForFences);
PROFILEEND(RPIFUNC(vkWaitForFences));
return VK_SUCCESS;
}
}
PROFILEEND(rpi_vkWaitForFences);
PROFILEEND(RPIFUNC(vkWaitForFences));
return VK_TIMEOUT;
}
PROFILEEND(rpi_vkWaitForFences);
PROFILEEND(RPIFUNC(vkWaitForFences));
return VK_SUCCESS;
}
VKAPI_ATTR void VKAPI_CALL rpi_vkCmdWaitEvents(
VKAPI_ATTR void VKAPI_CALL RPIFUNC(vkCmdWaitEvents)(
VkCommandBuffer commandBuffer,
uint32_t eventCount,
const VkEvent* pEvents,
@ -490,7 +492,7 @@ VKAPI_ATTR void VKAPI_CALL rpi_vkCmdWaitEvents(
UNSUPPORTED(vkCmdWaitEvents);
}
VKAPI_ATTR VkResult VKAPI_CALL rpi_vkGetEventStatus(
VKAPI_ATTR VkResult VKAPI_CALL RPIFUNC(vkGetEventStatus)(
VkDevice device,
VkEvent event)
{
@ -498,7 +500,7 @@ VKAPI_ATTR VkResult VKAPI_CALL rpi_vkGetEventStatus(
return UNSUPPORTED_RETURN;
}
VKAPI_ATTR void VKAPI_CALL rpi_vkDestroyEvent(
VKAPI_ATTR void VKAPI_CALL RPIFUNC(vkDestroyEvent)(
VkDevice device,
VkEvent event,
const VkAllocationCallbacks* pAllocator)
@ -506,7 +508,7 @@ VKAPI_ATTR void VKAPI_CALL rpi_vkDestroyEvent(
UNSUPPORTED(vkDestroyEvent);
}
VKAPI_ATTR void VKAPI_CALL rpi_vkCmdResetEvent(
VKAPI_ATTR void VKAPI_CALL RPIFUNC(vkCmdResetEvent)(
VkCommandBuffer commandBuffer,
VkEvent event,
VkPipelineStageFlags stageMask)
@ -514,7 +516,7 @@ VKAPI_ATTR void VKAPI_CALL rpi_vkCmdResetEvent(
UNSUPPORTED(vkCmdResetEvent);
}
VKAPI_ATTR VkResult VKAPI_CALL rpi_vkCreateEvent(
VKAPI_ATTR VkResult VKAPI_CALL RPIFUNC(vkCreateEvent)(
VkDevice device,
const VkEventCreateInfo* pCreateInfo,
const VkAllocationCallbacks* pAllocator,
@ -524,7 +526,7 @@ VKAPI_ATTR VkResult VKAPI_CALL rpi_vkCreateEvent(
return UNSUPPORTED_RETURN;
}
VKAPI_ATTR VkResult VKAPI_CALL rpi_vkResetEvent(
VKAPI_ATTR VkResult VKAPI_CALL RPIFUNC(vkResetEvent)(
VkDevice device,
VkEvent event)
{
@ -532,7 +534,7 @@ VKAPI_ATTR VkResult VKAPI_CALL rpi_vkResetEvent(
return UNSUPPORTED_RETURN;
}
VKAPI_ATTR VkResult VKAPI_CALL rpi_vkSetEvent(
VKAPI_ATTR VkResult VKAPI_CALL RPIFUNC(vkSetEvent)(
VkDevice device,
VkEvent event)
{
@ -540,7 +542,7 @@ VKAPI_ATTR VkResult VKAPI_CALL rpi_vkSetEvent(
return UNSUPPORTED_RETURN;
}
VKAPI_ATTR void VKAPI_CALL rpi_vkCmdSetEvent(
VKAPI_ATTR void VKAPI_CALL RPIFUNC(vkCmdSetEvent)(
VkCommandBuffer commandBuffer,
VkEvent event,
VkPipelineStageFlags stageMask)

View File

@ -7,35 +7,6 @@
extern "C" {
#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
*

View File

@ -9,12 +9,12 @@
extern "C" {
#endif
VKAPI_ATTR VkResult VKAPI_CALL rpi_vkGetPhysicalDeviceDisplayPlanePropertiesKHR(
VKAPI_ATTR VkResult VKAPI_CALL RPIFUNC(vkGetPhysicalDeviceDisplayPlanePropertiesKHR)(
VkPhysicalDevice physicalDevice,
uint32_t* pPropertyCount,
VkDisplayPlanePropertiesKHR* pProperties)
{
PROFILESTART(rpi_vkGetPhysicalDeviceDisplayPlanePropertiesKHR);
PROFILESTART(RPIFUNC(vkGetPhysicalDeviceDisplayPlanePropertiesKHR));
assert(physicalDevice);
assert(pPropertyCount);
@ -26,7 +26,7 @@ VKAPI_ATTR VkResult VKAPI_CALL rpi_vkGetPhysicalDeviceDisplayPlanePropertiesKHR(
if(!pProperties)
{
*pPropertyCount = numPlanes;
PROFILEEND(rpi_vkGetPhysicalDeviceDisplayPlanePropertiesKHR);
PROFILEEND(RPIFUNC(vkGetPhysicalDeviceDisplayPlanePropertiesKHR));
return VK_SUCCESS;
}
@ -39,17 +39,17 @@ VKAPI_ATTR VkResult VKAPI_CALL rpi_vkGetPhysicalDeviceDisplayPlanePropertiesKHR(
pProperties[c].currentStackIndex = c; //TODO dunno?
}
PROFILEEND(rpi_vkGetPhysicalDeviceDisplayPlanePropertiesKHR);
PROFILEEND(RPIFUNC(vkGetPhysicalDeviceDisplayPlanePropertiesKHR));
return VK_SUCCESS;
}
VKAPI_ATTR VkResult VKAPI_CALL rpi_vkGetDisplayPlaneSupportedDisplaysKHR(
VKAPI_ATTR VkResult VKAPI_CALL RPIFUNC(vkGetDisplayPlaneSupportedDisplaysKHR)(
VkPhysicalDevice physicalDevice,
uint32_t planeIndex,
uint32_t* pDisplayCount,
VkDisplayKHR* pDisplays)
{
PROFILESTART(rpi_vkGetDisplayPlaneSupportedDisplaysKHR);
PROFILESTART(RPIFUNC(vkGetDisplayPlaneSupportedDisplaysKHR));
assert(physicalDevice);
assert(pDisplayCount);
@ -62,7 +62,7 @@ VKAPI_ATTR VkResult VKAPI_CALL rpi_vkGetDisplayPlaneSupportedDisplaysKHR(
{
*pDisplayCount = planes[planeIndex].numPossibleConnectors;
PROFILEEND(rpi_vkGetDisplayPlaneSupportedDisplaysKHR);
PROFILEEND(RPIFUNC(vkGetDisplayPlaneSupportedDisplaysKHR));
return VK_SUCCESS;
}
@ -78,20 +78,20 @@ VKAPI_ATTR VkResult VKAPI_CALL rpi_vkGetDisplayPlaneSupportedDisplaysKHR(
if(arraySize < planes[planeIndex].numPossibleConnectors)
{
PROFILEEND(rpi_vkGetDisplayPlaneSupportedDisplaysKHR);
PROFILEEND(RPIFUNC(vkGetDisplayPlaneSupportedDisplaysKHR));
return VK_INCOMPLETE;
}
PROFILEEND(rpi_vkGetDisplayPlaneSupportedDisplaysKHR);
PROFILEEND(RPIFUNC(vkGetDisplayPlaneSupportedDisplaysKHR));
return VK_SUCCESS;
}
VKAPI_ATTR VkResult VKAPI_CALL rpi_vkGetPhysicalDeviceDisplayPropertiesKHR(
VKAPI_ATTR VkResult VKAPI_CALL RPIFUNC(vkGetPhysicalDeviceDisplayPropertiesKHR)(
VkPhysicalDevice physicalDevice,
uint32_t* pPropertyCount,
VkDisplayPropertiesKHR* pProperties)
{
PROFILESTART(rpi_vkGetPhysicalDeviceDisplayPropertiesKHR);
PROFILESTART(RPIFUNC(vkGetPhysicalDeviceDisplayPropertiesKHR));
assert(physicalDevice);
assert(pPropertyCount);
@ -104,7 +104,7 @@ VKAPI_ATTR VkResult VKAPI_CALL rpi_vkGetPhysicalDeviceDisplayPropertiesKHR(
{
*pPropertyCount = numDisplays;
PROFILEEND(rpi_vkGetPhysicalDeviceDisplayPropertiesKHR);
PROFILEEND(RPIFUNC(vkGetPhysicalDeviceDisplayPropertiesKHR));
return VK_SUCCESS;
}
@ -128,21 +128,21 @@ VKAPI_ATTR VkResult VKAPI_CALL rpi_vkGetPhysicalDeviceDisplayPropertiesKHR(
if(arraySize < numDisplays)
{
PROFILEEND(rpi_vkGetPhysicalDeviceDisplayPropertiesKHR);
PROFILEEND(RPIFUNC(vkGetPhysicalDeviceDisplayPropertiesKHR));
return VK_INCOMPLETE;
}
PROFILEEND(rpi_vkGetPhysicalDeviceDisplayPropertiesKHR);
PROFILEEND(RPIFUNC(vkGetPhysicalDeviceDisplayPropertiesKHR));
return VK_SUCCESS;
}
VKAPI_ATTR VkResult VKAPI_CALL rpi_vkGetDisplayModePropertiesKHR(
VKAPI_ATTR VkResult VKAPI_CALL RPIFUNC(vkGetDisplayModePropertiesKHR)(
VkPhysicalDevice physicalDevice,
VkDisplayKHR display,
uint32_t* pPropertyCount,
VkDisplayModePropertiesKHR* pProperties)
{
PROFILESTART(rpi_vkGetDisplayModePropertiesKHR);
PROFILESTART(RPIFUNC(vkGetDisplayModePropertiesKHR));
assert(physicalDevice);
assert(display);
@ -156,7 +156,7 @@ VKAPI_ATTR VkResult VKAPI_CALL rpi_vkGetDisplayModePropertiesKHR(
{
*pPropertyCount = numModes;
PROFILEEND(rpi_vkGetDisplayModePropertiesKHR);
PROFILEEND(RPIFUNC(vkGetDisplayModePropertiesKHR));
return VK_SUCCESS;
}
@ -176,22 +176,22 @@ VKAPI_ATTR VkResult VKAPI_CALL rpi_vkGetDisplayModePropertiesKHR(
if(arraySize < numModes)
{
PROFILEEND(rpi_vkGetDisplayModePropertiesKHR);
PROFILEEND(RPIFUNC(vkGetDisplayModePropertiesKHR));
return VK_INCOMPLETE;
}
PROFILEEND(rpi_vkGetDisplayModePropertiesKHR);
PROFILEEND(RPIFUNC(vkGetDisplayModePropertiesKHR));
return VK_SUCCESS;
}
VKAPI_ATTR VkResult VKAPI_CALL rpi_vkCreateDisplayModeKHR(
VKAPI_ATTR VkResult VKAPI_CALL RPIFUNC(vkCreateDisplayModeKHR)(
VkPhysicalDevice physicalDevice,
VkDisplayKHR display,
const VkDisplayModeCreateInfoKHR* pCreateInfo,
const VkAllocationCallbacks* pAllocator,
VkDisplayModeKHR* pMode)
{
PROFILESTART(rpi_vkCreateDisplayModeKHR);
PROFILESTART(RPIFUNC(vkCreateDisplayModeKHR));
assert(physicalDevice);
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,
const VkDisplaySurfaceCreateInfoKHR* pCreateInfo,
const VkAllocationCallbacks* pAllocator,
VkSurfaceKHR* pSurface)
{
PROFILESTART(rpi_vkCreateDisplayPlaneSurfaceKHR);
PROFILESTART(RPIFUNC(vkCreateDisplayPlaneSurfaceKHR));
assert(instance);
assert(pSurface);
@ -235,7 +235,7 @@ VKAPI_ATTR VkResult VKAPI_CALL rpi_vkCreateDisplayPlaneSurfaceKHR(
*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
* (but we'll do so anyways...)
*/
VKAPI_ATTR void VKAPI_CALL rpi_vkDestroySurfaceKHR(
VKAPI_ATTR void VKAPI_CALL RPIFUNC(vkDestroySurfaceKHR)(
VkInstance instance,
VkSurfaceKHR surface,
const VkAllocationCallbacks* pAllocator)
{
PROFILESTART(rpi_vkDestroySurfaceKHR);
PROFILESTART(RPIFUNC(vkDestroySurfaceKHR));
assert(instance);
@ -260,7 +260,7 @@ VKAPI_ATTR void VKAPI_CALL rpi_vkDestroySurfaceKHR(
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
*/
VKAPI_ATTR VkResult VKAPI_CALL rpi_vkGetPhysicalDeviceSurfaceCapabilitiesKHR(
VKAPI_ATTR VkResult VKAPI_CALL RPIFUNC(vkGetPhysicalDeviceSurfaceCapabilitiesKHR)(
VkPhysicalDevice physicalDevice,
VkSurfaceKHR surface,
VkSurfaceCapabilitiesKHR* pSurfaceCapabilities)
{
PROFILESTART(rpi_vkGetPhysicalDeviceSurfaceCapabilitiesKHR);
PROFILESTART(RPIFUNC(vkGetPhysicalDeviceSurfaceCapabilitiesKHR));
assert(physicalDevice);
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_SRC_BIT; //for screenshots
PROFILEEND(rpi_vkGetPhysicalDeviceSurfaceCapabilitiesKHR);
PROFILEEND(RPIFUNC(vkGetPhysicalDeviceSurfaceCapabilitiesKHR));
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,
* 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,
VkSurfaceKHR surface,
uint32_t* pSurfaceFormatCount,
VkSurfaceFormatKHR* pSurfaceFormats)
{
PROFILESTART(rpi_vkGetPhysicalDeviceSurfaceFormatsKHR);
PROFILESTART(RPIFUNC(vkGetPhysicalDeviceSurfaceFormatsKHR));
assert(physicalDevice);
assert(surface);
@ -337,7 +337,7 @@ VKAPI_ATTR VkResult VKAPI_CALL rpi_vkGetPhysicalDeviceSurfaceFormatsKHR(
{
*pSurfaceFormatCount = numFormats;
PROFILEEND(rpi_vkGetPhysicalDeviceSurfaceFormatsKHR);
PROFILEEND(RPIFUNC(vkGetPhysicalDeviceSurfaceFormatsKHR));
return VK_SUCCESS;
}
@ -353,11 +353,11 @@ VKAPI_ATTR VkResult VKAPI_CALL rpi_vkGetPhysicalDeviceSurfaceFormatsKHR(
if(elementsWritten < numFormats)
{
PROFILEEND(rpi_vkGetPhysicalDeviceSurfaceFormatsKHR);
PROFILEEND(RPIFUNC(vkGetPhysicalDeviceSurfaceFormatsKHR));
return VK_INCOMPLETE;
}
PROFILEEND(rpi_vkGetPhysicalDeviceSurfaceFormatsKHR);
PROFILEEND(RPIFUNC(vkGetPhysicalDeviceSurfaceFormatsKHR));
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
* 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,
VkSurfaceKHR surface,
uint32_t* pPresentModeCount,
VkPresentModeKHR* pPresentModes)
{
PROFILESTART(rpi_vkGetPhysicalDeviceSurfacePresentModesKHR);
PROFILESTART(RPIFUNC(vkGetPhysicalDeviceSurfacePresentModesKHR));
assert(physicalDevice);
assert(surface);
@ -386,7 +386,7 @@ VKAPI_ATTR VkResult VKAPI_CALL rpi_vkGetPhysicalDeviceSurfacePresentModesKHR(
{
*pPresentModeCount = numSupportedPresentModes;
PROFILEEND(rpi_vkGetPhysicalDeviceSurfacePresentModesKHR);
PROFILEEND(RPIFUNC(vkGetPhysicalDeviceSurfacePresentModesKHR));
return VK_SUCCESS;
}
@ -403,24 +403,24 @@ VKAPI_ATTR VkResult VKAPI_CALL rpi_vkGetPhysicalDeviceSurfacePresentModesKHR(
if(elementsWritten < numSupportedPresentModes)
{
PROFILEEND(rpi_vkGetPhysicalDeviceSurfacePresentModesKHR);
PROFILEEND(RPIFUNC(vkGetPhysicalDeviceSurfacePresentModesKHR));
return VK_INCOMPLETE;
}
PROFILEEND(rpi_vkGetPhysicalDeviceSurfacePresentModesKHR);
PROFILEEND(RPIFUNC(vkGetPhysicalDeviceSurfacePresentModesKHR));
return VK_SUCCESS;
}
/*
* 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,
const VkSwapchainCreateInfoKHR* pCreateInfo,
const VkAllocationCallbacks* pAllocator,
VkSwapchainKHR* pSwapchain)
{
PROFILESTART(rpi_vkCreateSwapchainKHR);
PROFILESTART(RPIFUNC(vkCreateSwapchainKHR));
assert(device);
assert(pCreateInfo);
@ -429,7 +429,7 @@ VKAPI_ATTR VkResult VKAPI_CALL rpi_vkCreateSwapchainKHR(
*pSwapchain = ALLOCATE(sizeof(_swapchain), 1, VK_SYSTEM_ALLOCATION_SCOPE_OBJECT);
if(!*pSwapchain)
{
PROFILEEND(rpi_vkCreateSwapchainKHR);
PROFILEEND(RPIFUNC(vkCreateSwapchainKHR));
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);
if(!s->images)
{
PROFILEEND(rpi_vkCreateSwapchainKHR);
PROFILEEND(RPIFUNC(vkCreateSwapchainKHR));
return VK_ERROR_OUT_OF_HOST_MEMORY;
}
@ -469,7 +469,7 @@ VKAPI_ATTR VkResult VKAPI_CALL rpi_vkCreateSwapchainKHR(
imageCreateInfo.extent.depth = 1;
VkImage img;
rpi_vkCreateImage(device, &imageCreateInfo, pAllocator, &img);
RPIFUNC(vkCreateImage)(device, &imageCreateInfo, pAllocator, &img);
s->images[c] = *(_image*)img;
@ -480,7 +480,7 @@ VKAPI_ATTR VkResult VKAPI_CALL rpi_vkCreateSwapchainKHR(
s->images[c].clipped = pCreateInfo->clipped;
VkMemoryRequirements mr;
rpi_vkGetImageMemoryRequirements(device, &s->images[c], &mr);
RPIFUNC(vkGetImageMemoryRequirements)(device, &s->images[c], &mr);
s->images[c].alignment = mr.alignment;
@ -497,14 +497,14 @@ VKAPI_ATTR VkResult VKAPI_CALL rpi_vkCreateSwapchainKHR(
}
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);
}
PROFILEEND(rpi_vkCreateSwapchainKHR);
PROFILEEND(RPIFUNC(vkCreateSwapchainKHR));
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
* 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,
VkSwapchainKHR swapchain,
uint32_t* pSwapchainImageCount,
VkImage* pSwapchainImages)
{
PROFILESTART(rpi_vkGetSwapchainImagesKHR);
PROFILESTART(RPIFUNC(vkGetSwapchainImagesKHR));
assert(device);
assert(swapchain);
@ -535,7 +535,7 @@ VKAPI_ATTR VkResult VKAPI_CALL rpi_vkGetSwapchainImagesKHR(
{
*pSwapchainImageCount = s->numImages;
PROFILEEND(rpi_vkGetSwapchainImagesKHR);
PROFILEEND(RPIFUNC(vkGetSwapchainImagesKHR));
return VK_SUCCESS;
}
@ -551,18 +551,18 @@ VKAPI_ATTR VkResult VKAPI_CALL rpi_vkGetSwapchainImagesKHR(
if(elementsWritten < s->numImages)
{
PROFILEEND(rpi_vkGetSwapchainImagesKHR);
PROFILEEND(RPIFUNC(vkGetSwapchainImagesKHR));
return VK_INCOMPLETE;
}
PROFILEEND(rpi_vkGetSwapchainImagesKHR);
PROFILEEND(RPIFUNC(vkGetSwapchainImagesKHR));
return VK_SUCCESS;
}
/*
* 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,
VkSwapchainKHR swapchain,
uint64_t timeout,
@ -570,7 +570,7 @@ VKAPI_ATTR VkResult VKAPI_CALL rpi_vkAcquireNextImageKHR(
VkFence fence,
uint32_t* pImageIndex)
{
PROFILESTART(rpi_vkAcquireNextImageKHR);
PROFILESTART(RPIFUNC(vkAcquireNextImageKHR));
assert(device);
assert(swapchain);
@ -595,7 +595,7 @@ VKAPI_ATTR VkResult VKAPI_CALL rpi_vkAcquireNextImageKHR(
f->signaled = 1;
}
PROFILEEND(rpi_vkAcquireNextImageKHR);
PROFILEEND(RPIFUNC(vkAcquireNextImageKHR));
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,
* 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,
const VkPresentInfoKHR* pPresentInfo)
{
PROFILESTART(rpi_vkQueuePresentKHR);
PROFILESTART(RPIFUNC(vkQueuePresentKHR));
assert(queue);
assert(pPresentInfo);
@ -634,19 +634,19 @@ VKAPI_ATTR VkResult VKAPI_CALL rpi_vkQueuePresentKHR(
s->backbufferIdx = (s->backbufferIdx + 1) % s->numImages;
}
PROFILEEND(rpi_vkQueuePresentKHR);
PROFILEEND(RPIFUNC(vkQueuePresentKHR));
return VK_SUCCESS;
}
/*
* 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,
VkSwapchainKHR swapchain,
const VkAllocationCallbacks* pAllocator)
{
PROFILESTART(rpi_vkDestroySwapchainKHR);
PROFILESTART(RPIFUNC(vkDestroySwapchainKHR));
assert(device);
@ -658,7 +658,7 @@ VKAPI_ATTR void VKAPI_CALL rpi_vkDestroySwapchainKHR(
{
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]);
}
@ -667,7 +667,7 @@ VKAPI_ATTR void VKAPI_CALL rpi_vkDestroySwapchainKHR(
FREE(s);
PROFILEEND(rpi_vkDestroySwapchainKHR);
PROFILEEND(RPIFUNC(vkDestroySwapchainKHR));
//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
* 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,
uint32_t queueFamilyIndex,
VkSurfaceKHR surface,
VkBool32* pSupported)
{
PROFILESTART(rpi_vkGetPhysicalDeviceSurfaceSupportKHR);
PROFILESTART(RPIFUNC(vkGetPhysicalDeviceSurfaceSupportKHR));
assert(pSupported);
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
*pSupported = VK_TRUE;
PROFILEEND(rpi_vkGetPhysicalDeviceSurfaceSupportKHR);
PROFILEEND(RPIFUNC(vkGetPhysicalDeviceSurfaceSupportKHR));
return VK_SUCCESS;
}

View File

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