ToStr function for VkResourceType

This commit is contained in:
baldurk
2016-02-07 18:39:59 +01:00
parent 4f744645e8
commit 302060bea6
3 changed files with 45 additions and 5 deletions
+42
View File
@@ -727,6 +727,48 @@ PrimitiveTopology MakePrimitiveTopology(VkPrimitiveTopology Topo, uint32_t patch
VulkanResourceManager *manager = NULL;
#define MGR() VulkanResourceManager::GetInstance()
template<>
string ToStrHelper<false, VkResourceType>::Get(const VkResourceType &el)
{
switch(el)
{
TOSTR_CASE_STRINGIZE(eResUnknown)
TOSTR_CASE_STRINGIZE(eResPhysicalDevice)
TOSTR_CASE_STRINGIZE(eResInstance)
TOSTR_CASE_STRINGIZE(eResDevice)
TOSTR_CASE_STRINGIZE(eResQueue)
TOSTR_CASE_STRINGIZE(eResDeviceMemory)
TOSTR_CASE_STRINGIZE(eResBuffer)
TOSTR_CASE_STRINGIZE(eResBufferView)
TOSTR_CASE_STRINGIZE(eResImage)
TOSTR_CASE_STRINGIZE(eResImageView)
TOSTR_CASE_STRINGIZE(eResAttachmentView)
TOSTR_CASE_STRINGIZE(eResFramebuffer)
TOSTR_CASE_STRINGIZE(eResRenderPass)
TOSTR_CASE_STRINGIZE(eResShaderModule)
TOSTR_CASE_STRINGIZE(eResShader)
TOSTR_CASE_STRINGIZE(eResPipelineCache)
TOSTR_CASE_STRINGIZE(eResPipelineLayout)
TOSTR_CASE_STRINGIZE(eResPipeline)
TOSTR_CASE_STRINGIZE(eResSampler)
TOSTR_CASE_STRINGIZE(eResDescriptorPool)
TOSTR_CASE_STRINGIZE(eResDescriptorSetLayout)
TOSTR_CASE_STRINGIZE(eResDescriptorSet)
TOSTR_CASE_STRINGIZE(eResViewportState)
TOSTR_CASE_STRINGIZE(eResRasterState)
TOSTR_CASE_STRINGIZE(eResColorBlendState)
TOSTR_CASE_STRINGIZE(eResDepthStencilState)
TOSTR_CASE_STRINGIZE(eResCmdPool)
TOSTR_CASE_STRINGIZE(eResCmdBuffer)
TOSTR_CASE_STRINGIZE(eResFence)
TOSTR_CASE_STRINGIZE(eResSemaphore)
TOSTR_CASE_STRINGIZE(eResWSISwapChain)
default: break;
}
return StringFormat::Fmt("VkResourceType<%d>", el);
}
template<>
string ToStrHelper<false, VkDeviceCreateFlagBits>::Get(const VkDeviceCreateFlagBits &el)
{
+1 -1
View File
@@ -64,7 +64,7 @@ bool IsDispatchableRes(WrappedVkRes *ptr)
|| WrappedVkDevice::IsAlloc(ptr) || WrappedVkQueue::IsAlloc(ptr) || WrappedVkCmdBuffer::IsAlloc(ptr));
}
VkNamespace IdentifyTypeByPtr(WrappedVkRes *ptr)
VkResourceType IdentifyTypeByPtr(WrappedVkRes *ptr)
{
if(WrappedVkPhysicalDevice::IsAlloc(ptr)) return eResPhysicalDevice;
if(WrappedVkInstance::IsAlloc(ptr)) return eResInstance;
+2 -4
View File
@@ -403,10 +403,9 @@ VkResourceRecord *GetRecord(RealType obj)
return GetWrapped(obj)->record;
}
enum VkNamespace
enum VkResourceType
{
eResUnknown = 0,
eResSpecial,
eResPhysicalDevice,
eResInstance,
eResDevice,
@@ -434,7 +433,6 @@ enum VkNamespace
eResDepthStencilState,
eResCmdPool,
eResCmdBuffer,
eResCmdBufferBake,
eResFence,
eResSemaphore,
@@ -442,7 +440,7 @@ enum VkNamespace
};
bool IsDispatchableRes(WrappedVkRes *ptr);
VkNamespace IdentifyTypeByPtr(WrappedVkRes *ptr);
VkResourceType IdentifyTypeByPtr(WrappedVkRes *ptr);
#define UNTRANSITIONED_IMG_STATE ((VkImageLayout)0xffffffff)