improved codes of Debug

This commit is contained in:
2022-09-27 19:41:28 +08:00
parent 981a1adf4c
commit cc02b719e6
7 changed files with 71 additions and 16 deletions

View File

@@ -27,11 +27,11 @@ public:
bool End(){return(vkEndCommandBuffer(cmd_buf)==VK_SUCCESS);}
#ifdef _DEBUG
void SetDebugName(const char *);
void BeginRegion(const char *,const Color4f &);
void SetDebugName(const UTF8String &);
void BeginRegion(const UTF8String &,const Color4f &);
void EndRegion();
#else
void BeginRegion(const char *,const Color4f &){}
void BeginRegion(const UTF8String &,const Color4f &){}
void EndRegion(){}
#endif//_DEBUG
};//class GPUCmdBuffer

View File

@@ -90,6 +90,8 @@ public:
DU_FUNC(DeferredOperationKHR, DEFERRED_OPERATION_KHR)
DU_FUNC(IndirectCommandsLayoutNV, INDIRECT_COMMANDS_LAYOUT_NV)
// DU_FUNC(BufferCollectionFuchsia, BUFFER_COLLECTION_FUCHSIA)
#undef DU_FUNC
void QueueBegin (VkQueue,const char *,const Color4f &color=Color4f(1,1,1,1));
void QueueEnd (VkQueue q){duf.QueueEnd(q);}

View File

@@ -83,6 +83,23 @@ public:
const bool isIntegratedGPU ()const{return(properties.deviceType==VK_PHYSICAL_DEVICE_TYPE_INTEGRATED_GPU);} ///<是否是集成显卡
const bool isVirtualGPU ()const{return(properties.deviceType==VK_PHYSICAL_DEVICE_TYPE_VIRTUAL_GPU);} ///<是否是虚拟显卡
#define HGL_VK_IS_BRAND(name) (hgl::stricmp(properties.deviceName,#name,sizeof(#name))==0)
const bool isMicrosoft ()const{return HGL_VK_IS_BRAND(Microsoft);}
const bool isMesa ()const{return HGL_VK_IS_BRAND(Mesa );}
const bool isAMD ()const{return HGL_VK_IS_BRAND(AMD )
||HGL_VK_IS_BRAND(ATI );}
const bool isNvidia ()const{return HGL_VK_IS_BRAND(nVidia );}
const bool isIntel ()const{return HGL_VK_IS_BRAND(Intel );}
const bool isQualcomm ()const{return HGL_VK_IS_BRAND(Adreno );}
const bool isApple ()const{return HGL_VK_IS_BRAND(Apple );}
const bool isImgTec ()const{return HGL_VK_IS_BRAND(ImgTec )
||HGL_VK_IS_BRAND(PowerVR );}
const bool isARM ()const{return HGL_VK_IS_BRAND(Arm )
||HGL_VK_IS_BRAND(Mali );}
#undef HGL_VK_IS_BRAND
public:
VkFormatProperties GetFormatProperties(const VkFormat format)const

View File

@@ -26,6 +26,8 @@ private:
public:
virtual ~GPUQueue();
operator VkQueue(){return queue;}
VkResult Present(const VkPresentInfoKHR *pi){return vkQueuePresentKHR(queue,pi);}

View File

@@ -41,6 +41,7 @@ public:
virtual ~RenderTarget();
GPUQueue * GetQueue () {return queue;}
const VkExtent2D & GetExtent ()const {return extent;}
virtual RenderPass * GetRenderPass () {return render_pass;}
virtual const VkRenderPass GetVkRenderPass ()const {return render_pass->GetVkRenderPass();}