From ffe9f60358c3eddd043873b5f4bbc1752d98547c Mon Sep 17 00:00:00 2001 From: Jason Ekstrand Date: Tue, 12 May 2015 13:44:43 -0700 Subject: [PATCH] vk: Add stub() and stub_return() macros and mark piles of functions as stubs --- src/vulkan/device.c | 53 +++++++++++++++++++++++++++---------------- src/vulkan/image.c | 4 ++-- src/vulkan/meta.c | 11 +++++++++ src/vulkan/pipeline.c | 10 ++++---- src/vulkan/private.h | 12 ++++++++++ 5 files changed, 63 insertions(+), 27 deletions(-) diff --git a/src/vulkan/device.c b/src/vulkan/device.c index 49384c7940c..98e1570372b 100644 --- a/src/vulkan/device.c +++ b/src/vulkan/device.c @@ -1055,7 +1055,7 @@ VkResult VKAPI vkQueueBindObjectMemoryRange( VkDeviceMemory mem, VkDeviceSize memOffset) { - return VK_UNSUPPORTED; + stub_return(VK_UNSUPPORTED); } VkResult vkQueueBindImageMemoryRange( @@ -1066,7 +1066,7 @@ VkResult vkQueueBindImageMemoryRange( VkDeviceMemory mem, VkDeviceSize memOffset) { - return VK_UNSUPPORTED; + stub_return(VK_UNSUPPORTED); } VkResult VKAPI vkCreateFence( @@ -1074,7 +1074,7 @@ VkResult VKAPI vkCreateFence( const VkFenceCreateInfo* pCreateInfo, VkFence* pFence) { - return VK_UNSUPPORTED; + stub_return(VK_UNSUPPORTED); } VkResult VKAPI vkResetFences( @@ -1082,14 +1082,14 @@ VkResult VKAPI vkResetFences( uint32_t fenceCount, VkFence* pFences) { - return VK_UNSUPPORTED; + stub_return(VK_UNSUPPORTED); } VkResult VKAPI vkGetFenceStatus( VkDevice device, VkFence fence) { - return VK_UNSUPPORTED; + stub_return(VK_UNSUPPORTED); } VkResult VKAPI vkWaitForFences( @@ -1099,7 +1099,7 @@ VkResult VKAPI vkWaitForFences( bool32_t waitAll, uint64_t timeout) { - return VK_UNSUPPORTED; + stub_return(VK_UNSUPPORTED); } // Queue semaphore functions @@ -1109,21 +1109,21 @@ VkResult VKAPI vkCreateSemaphore( const VkSemaphoreCreateInfo* pCreateInfo, VkSemaphore* pSemaphore) { - return VK_UNSUPPORTED; + stub_return(VK_UNSUPPORTED); } VkResult VKAPI vkQueueSignalSemaphore( VkQueue queue, VkSemaphore semaphore) { - return VK_UNSUPPORTED; + stub_return(VK_UNSUPPORTED); } VkResult VKAPI vkQueueWaitSemaphore( VkQueue queue, VkSemaphore semaphore) { - return VK_UNSUPPORTED; + stub_return(VK_UNSUPPORTED); } // Event functions @@ -1133,28 +1133,28 @@ VkResult VKAPI vkCreateEvent( const VkEventCreateInfo* pCreateInfo, VkEvent* pEvent) { - return VK_UNSUPPORTED; + stub_return(VK_UNSUPPORTED); } VkResult VKAPI vkGetEventStatus( VkDevice device, VkEvent event) { - return VK_UNSUPPORTED; + stub_return(VK_UNSUPPORTED); } VkResult VKAPI vkSetEvent( VkDevice device, VkEvent event) { - return VK_UNSUPPORTED; + stub_return(VK_UNSUPPORTED); } VkResult VKAPI vkResetEvent( VkDevice device, VkEvent event) { - return VK_UNSUPPORTED; + stub_return(VK_UNSUPPORTED); } // Query functions @@ -1205,7 +1205,7 @@ VkResult VKAPI vkGetQueryPoolResults( void* pData, VkQueryResultFlags flags) { - return VK_UNSUPPORTED; + stub_return(VK_UNSUPPORTED); } // Format capabilities @@ -1217,7 +1217,7 @@ VkResult VKAPI vkGetFormatInfo( size_t* pDataSize, void* pData) { - return VK_UNSUPPORTED; + stub_return(VK_UNSUPPORTED); } // Buffer functions @@ -1429,14 +1429,14 @@ VkResult VKAPI vkBeginDescriptorPoolUpdate( VkDevice device, VkDescriptorUpdateMode updateMode) { - return VK_UNSUPPORTED; + stub_return(VK_UNSUPPORTED); } VkResult VKAPI vkEndDescriptorPoolUpdate( VkDevice device, VkCmdBuffer cmd) { - return VK_UNSUPPORTED; + stub_return(VK_UNSUPPORTED); } VkResult VKAPI vkCreateDescriptorPool( @@ -1446,14 +1446,14 @@ VkResult VKAPI vkCreateDescriptorPool( const VkDescriptorPoolCreateInfo* pCreateInfo, VkDescriptorPool* pDescriptorPool) { - return VK_UNSUPPORTED; + stub_return(VK_UNSUPPORTED); } VkResult VKAPI vkResetDescriptorPool( VkDevice device, VkDescriptorPool descriptorPool) { - return VK_UNSUPPORTED; + stub_return(VK_UNSUPPORTED); } VkResult VKAPI vkAllocDescriptorSets( @@ -1494,6 +1494,7 @@ void VKAPI vkClearDescriptorSets( uint32_t count, const VkDescriptorSet* pDescriptorSets) { + stub(); } void VKAPI vkUpdateDescriptors( @@ -1721,7 +1722,7 @@ VkResult VKAPI vkCreateDynamicDepthStencilState( const VkDynamicDsStateCreateInfo* pCreateInfo, VkDynamicDsState* pState) { - return VK_UNSUPPORTED; + stub_return(VK_UNSUPPORTED); } // Command buffer functions @@ -2369,6 +2370,7 @@ void VKAPI vkCmdDispatch( uint32_t y, uint32_t z) { + stub(); } void VKAPI vkCmdDispatchIndirect( @@ -2376,6 +2378,7 @@ void VKAPI vkCmdDispatchIndirect( VkBuffer buffer, VkDeviceSize offset) { + stub(); } void VKAPI vkCmdSetEvent( @@ -2383,6 +2386,7 @@ void VKAPI vkCmdSetEvent( VkEvent event, VkPipeEvent pipeEvent) { + stub(); } void VKAPI vkCmdResetEvent( @@ -2390,6 +2394,7 @@ void VKAPI vkCmdResetEvent( VkEvent event, VkPipeEvent pipeEvent) { + stub(); } void VKAPI vkCmdWaitEvents( @@ -2400,6 +2405,7 @@ void VKAPI vkCmdWaitEvents( uint32_t memBarrierCount, const void** ppMemBarriers) { + stub(); } void VKAPI vkCmdPipelineBarrier( @@ -2410,6 +2416,7 @@ void VKAPI vkCmdPipelineBarrier( uint32_t memBarrierCount, const void** ppMemBarriers) { + stub(); } static void @@ -2471,6 +2478,7 @@ void VKAPI vkCmdResetQueryPool( uint32_t startQuery, uint32_t queryCount) { + stub(); } #define TIMESTAMP 0x44070 @@ -2515,6 +2523,7 @@ void VKAPI vkCmdCopyQueryPoolResults( VkDeviceSize destStride, VkQueryResultFlags flags) { + stub(); } void VKAPI vkCmdInitAtomicCounters( @@ -2524,6 +2533,7 @@ void VKAPI vkCmdInitAtomicCounters( uint32_t counterCount, const uint32_t* pData) { + stub(); } void VKAPI vkCmdLoadAtomicCounters( @@ -2534,6 +2544,7 @@ void VKAPI vkCmdLoadAtomicCounters( VkBuffer srcBuffer, VkDeviceSize srcOffset) { + stub(); } void VKAPI vkCmdSaveAtomicCounters( @@ -2544,6 +2555,7 @@ void VKAPI vkCmdSaveAtomicCounters( VkBuffer destBuffer, VkDeviceSize destOffset) { + stub(); } VkResult VKAPI vkCreateFramebuffer( @@ -2665,4 +2677,5 @@ void VKAPI vkCmdEndRenderPass( VkCmdBuffer cmdBuffer, VkRenderPass renderPass) { + stub(); } diff --git a/src/vulkan/image.c b/src/vulkan/image.c index d416bdd1b63..4dd96ceac3b 100644 --- a/src/vulkan/image.c +++ b/src/vulkan/image.c @@ -286,7 +286,7 @@ VkResult VKAPI vkGetImageSubresourceInfo( size_t* pDataSize, void* pData) { - return VK_UNSUPPORTED; + stub_return(VK_UNSUPPORTED); } // Image view functions @@ -400,5 +400,5 @@ VkResult VKAPI vkCreateDepthStencilView( const VkDepthStencilViewCreateInfo* pCreateInfo, VkDepthStencilView* pView) { - return VK_UNSUPPORTED; + stub_return(VK_UNSUPPORTED); } diff --git a/src/vulkan/meta.c b/src/vulkan/meta.c index 18e928053ff..c346c3ef871 100644 --- a/src/vulkan/meta.c +++ b/src/vulkan/meta.c @@ -283,6 +283,7 @@ void VKAPI vkCmdCopyBuffer( uint32_t regionCount, const VkBufferCopy* pRegions) { + stub(); } void VKAPI vkCmdCopyImage( @@ -294,6 +295,7 @@ void VKAPI vkCmdCopyImage( uint32_t regionCount, const VkImageCopy* pRegions) { + stub(); } void VKAPI vkCmdBlitImage( @@ -305,6 +307,7 @@ void VKAPI vkCmdBlitImage( uint32_t regionCount, const VkImageBlit* pRegions) { + stub(); } void VKAPI vkCmdCopyBufferToImage( @@ -315,6 +318,7 @@ void VKAPI vkCmdCopyBufferToImage( uint32_t regionCount, const VkBufferImageCopy* pRegions) { + stub(); } void VKAPI vkCmdCopyImageToBuffer( @@ -325,6 +329,7 @@ void VKAPI vkCmdCopyImageToBuffer( uint32_t regionCount, const VkBufferImageCopy* pRegions) { + stub(); } void VKAPI vkCmdCloneImageData( @@ -334,6 +339,7 @@ void VKAPI vkCmdCloneImageData( VkImage destImage, VkImageLayout destImageLayout) { + stub(); } void VKAPI vkCmdUpdateBuffer( @@ -343,6 +349,7 @@ void VKAPI vkCmdUpdateBuffer( VkDeviceSize dataSize, const uint32_t* pData) { + stub(); } void VKAPI vkCmdFillBuffer( @@ -352,6 +359,7 @@ void VKAPI vkCmdFillBuffer( VkDeviceSize fillSize, uint32_t data) { + stub(); } void VKAPI vkCmdClearColorImage( @@ -362,6 +370,7 @@ void VKAPI vkCmdClearColorImage( uint32_t rangeCount, const VkImageSubresourceRange* pRanges) { + stub(); } void VKAPI vkCmdClearDepthStencil( @@ -373,6 +382,7 @@ void VKAPI vkCmdClearDepthStencil( uint32_t rangeCount, const VkImageSubresourceRange* pRanges) { + stub(); } void VKAPI vkCmdResolveImage( @@ -384,6 +394,7 @@ void VKAPI vkCmdResolveImage( uint32_t regionCount, const VkImageResolve* pRegions) { + stub(); } void diff --git a/src/vulkan/pipeline.c b/src/vulkan/pipeline.c index a82466ce3da..ce1fa303d7c 100644 --- a/src/vulkan/pipeline.c +++ b/src/vulkan/pipeline.c @@ -512,7 +512,7 @@ VkResult VKAPI vkCreateGraphicsPipelineDerivative( VkPipeline basePipeline, VkPipeline* pPipeline) { - return VK_UNSUPPORTED; + stub_return(VK_UNSUPPORTED); } VkResult VKAPI vkCreateComputePipeline( @@ -520,7 +520,7 @@ VkResult VKAPI vkCreateComputePipeline( const VkComputePipelineCreateInfo* pCreateInfo, VkPipeline* pPipeline) { - return VK_UNSUPPORTED; + stub_return(VK_UNSUPPORTED); } VkResult VKAPI vkStorePipeline( @@ -529,7 +529,7 @@ VkResult VKAPI vkStorePipeline( size_t* pDataSize, void* pData) { - return VK_UNSUPPORTED; + stub_return(VK_UNSUPPORTED); } VkResult VKAPI vkLoadPipeline( @@ -538,7 +538,7 @@ VkResult VKAPI vkLoadPipeline( const void* pData, VkPipeline* pPipeline) { - return VK_UNSUPPORTED; + stub_return(VK_UNSUPPORTED); } VkResult VKAPI vkLoadPipelineDerivative( @@ -548,7 +548,7 @@ VkResult VKAPI vkLoadPipelineDerivative( VkPipeline basePipeline, VkPipeline* pPipeline) { - return VK_UNSUPPORTED; + stub_return(VK_UNSUPPORTED); } // Pipeline layout functions diff --git a/src/vulkan/private.h b/src/vulkan/private.h index 0ee0dabc256..00aceb7ded1 100644 --- a/src/vulkan/private.h +++ b/src/vulkan/private.h @@ -93,6 +93,18 @@ void __anv_finishme(const char *file, int line, const char *format, ...); #define anv_finishme(format, ...) \ __anv_finishme(__FILE__, __LINE__, format, ##__VA_ARGS__); +#define stub_return(v) \ + do { \ + anv_finishme("stub %s", __func__); \ + return (v); \ + } while (0) + +#define stub(v) \ + do { \ + anv_finishme("stub %s", __func__); \ + return; \ + } while (0) + /** * A dynamically growable, circular buffer. Elements are added at head and * removed from tail. head and tail are free-running uint32_t indices and we -- 2.30.2