mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-03-06 16:30:42 +01:00
zink: add frame trace markers on the queue
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21655>
This commit is contained in:
parent
bb796f70a1
commit
340f2d1a25
4 changed files with 42 additions and 0 deletions
|
|
@ -681,6 +681,8 @@ kopper_present(void *data, void *gdata, int thread_idx)
|
|||
cpi->info.waitSemaphoreCount = 0;
|
||||
}
|
||||
VkResult error2 = VKSCR(QueuePresentKHR)(screen->queue, &cpi->info);
|
||||
zink_screen_debug_marker_end(screen, screen->frame_marker_emitted);
|
||||
zink_screen_debug_marker_begin(screen, "frame");
|
||||
simple_mtx_unlock(&screen->queue_lock);
|
||||
swapchain->last_present = cpi->image;
|
||||
if (cpi->indefinite_acquire)
|
||||
|
|
|
|||
|
|
@ -3033,6 +3033,8 @@ zink_internal_create_screen(const struct pipe_screen_config *config)
|
|||
zink_tracing = screen->instance_info.have_EXT_debug_utils &&
|
||||
(u_trace_is_enabled(U_TRACE_TYPE_PERFETTO) || u_trace_is_enabled(U_TRACE_TYPE_MARKERS));
|
||||
|
||||
screen->frame_marker_emitted = zink_screen_debug_marker_begin(screen, "frame");
|
||||
|
||||
return screen;
|
||||
|
||||
fail:
|
||||
|
|
@ -3080,3 +3082,35 @@ void zink_stub_function_not_loaded()
|
|||
mesa_loge("ZINK: a Vulkan function was called without being loaded");
|
||||
abort();
|
||||
}
|
||||
|
||||
bool
|
||||
zink_screen_debug_marker_begin(struct zink_screen *screen, const char *fmt, ...)
|
||||
{
|
||||
if (!zink_tracing)
|
||||
return false;
|
||||
|
||||
char *name;
|
||||
va_list va;
|
||||
va_start(va, fmt);
|
||||
int ret = vasprintf(&name, fmt, va);
|
||||
va_end(va);
|
||||
|
||||
if (ret == -1)
|
||||
return false;
|
||||
|
||||
VkDebugUtilsLabelEXT info = { 0 };
|
||||
info.sType = VK_STRUCTURE_TYPE_DEBUG_UTILS_LABEL_EXT;
|
||||
info.pLabelName = name;
|
||||
|
||||
VKSCR(QueueBeginDebugUtilsLabelEXT)(screen->queue, &info);
|
||||
|
||||
free(name);
|
||||
return true;
|
||||
}
|
||||
|
||||
void
|
||||
zink_screen_debug_marker_end(struct zink_screen *screen, bool emitted)
|
||||
{
|
||||
if (emitted)
|
||||
VKSCR(QueueEndDebugUtilsLabelEXT)(screen->queue);
|
||||
}
|
||||
|
|
@ -129,6 +129,11 @@ zink_screen_get_pipeline_cache(struct zink_screen *screen, struct zink_program *
|
|||
void
|
||||
zink_stub_function_not_loaded(void);
|
||||
|
||||
bool
|
||||
zink_screen_debug_marker_begin(struct zink_screen *screen, const char *fmt, ...);
|
||||
void
|
||||
zink_screen_debug_marker_end(struct zink_screen *screen, bool emitted);
|
||||
|
||||
#define warn_missing_feature(warned, feat) \
|
||||
do { \
|
||||
if (!warned) { \
|
||||
|
|
|
|||
|
|
@ -1270,6 +1270,7 @@ struct zink_screen {
|
|||
bool threaded;
|
||||
bool is_cpu;
|
||||
bool abort_on_hang;
|
||||
bool frame_marker_emitted;
|
||||
uint64_t curr_batch; //the current batch id
|
||||
uint32_t last_finished;
|
||||
VkSemaphore sem;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue