mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2025-05-30 00:10:40 +00:00
[vulkan] Make the tracy macros more robust
Now some of the hacks needed for GPU zones work without tracy being enabled (ie, no compiler warnings about unused variables).
This commit is contained in:
parent
800e984880
commit
03af3c5cc9
2 changed files with 17 additions and 8 deletions
|
@ -419,9 +419,7 @@ typedef struct qfv_renderframe_s {
|
|||
VkSemaphore imageAvailableSemaphore;
|
||||
VkSemaphore renderDoneSemaphore;
|
||||
qfv_cmdpoolmgr_t cmdpool;
|
||||
#ifdef TRACY_ENABLE
|
||||
qftVkCtx_t *qftVkCtx;
|
||||
#endif
|
||||
} qfv_renderframe_t;
|
||||
|
||||
typedef struct qfv_renderframeset_s
|
||||
|
|
|
@ -23,12 +23,19 @@ static inline void __qftVkZoneEnd (___tracy_vkctx_scope ***zone)
|
|||
TracyCVkZoneEnd (**zone);
|
||||
}
|
||||
|
||||
#define __qftVkScoped(varname) \
|
||||
__attribute__((cleanup(__qftVkZoneEnd))) \
|
||||
___tracy_vkctx_scope **qfConcat(__qfScoped##varname, __COUNTER__) \
|
||||
= &varname;
|
||||
#define qftVkZone(ctx, cmdbuf, name) TracyCVkZone (ctx, cmdbuf, name)
|
||||
#define qftVkScopedZone(ctx, cmdbuf, name) \
|
||||
qftVkZone (ctx, cmdbuf, name) \
|
||||
__attribute__((cleanup(__qftVkZoneEnd))) \
|
||||
___tracy_vkctx_scope **qfConcat(__qfScoped##varname, __COUNTER__) = &___tracy_gpu_zone
|
||||
#define qftVkZoneC(ctx, cmdbuf, name, color) TracyCVkZone (ctx, cmdbuf, name, color)
|
||||
__qftVkScoped (___tracy_gpu_zone)
|
||||
#define qftVkZoneC(ctx, cmdbuf, name, color) \
|
||||
TracyCVkZoneC (ctx, cmdbuf, name, color)
|
||||
#define qftVkScopedZoneC(ctx, cmdbuf, name, color) \
|
||||
qftVkZoneC (ctx, cmdbuf, name, color) \
|
||||
__qftVkScoped (___tracy_gpu_zone)
|
||||
#define qftVkZoneEnd(varname) TracyCVkZoneEnd (varname)
|
||||
|
||||
#else
|
||||
|
@ -40,9 +47,13 @@ static inline void __qftVkZoneEnd (___tracy_vkctx_scope ***zone)
|
|||
#define qftCVkContextName(ctx, name, size)
|
||||
#define qftCVkContextCollect(ctx, cmdbuf)
|
||||
|
||||
#define qftVkZone(ctx, cmdbuf, name)
|
||||
#define qftVkScopedZone(ctx, cmdbuf, name)
|
||||
#define qftVkZoneC(ctx, cmdbuf, name, color)
|
||||
#define qftVkZone(ctx, cmdbuf, name) \
|
||||
do { (void)(ctx); (void) (cmdbuf); } while (0)
|
||||
#define qftVkScopedZone(ctx, cmdbuf, name) qftVkZone (ctx, cmdbuf, name)
|
||||
#define qftVkZoneC(ctx, cmdbuf, name, color) \
|
||||
do { (void)(ctx); (void)(cmdbuf); (void)(name); (void)(color);} while (0)
|
||||
#define qftVkScopedZoneC(ctx, cmdbuf, name, color) \
|
||||
qftVkZoneC (ctx, cmdbuf, name, color)
|
||||
#define qftVkZoneEnd(varname)
|
||||
|
||||
#endif
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue