mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-04-19 12:20:40 +02:00
zink: add pipe_context::get_timestamp hook
this uses VK_EXT_calibrated_timestamps to read a timestamp immediately from the device without using a batch, which is what the gallium api expects Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6923>
This commit is contained in:
parent
b551ee22df
commit
bb603352b6
1 changed files with 15 additions and 0 deletions
|
|
@ -477,6 +477,20 @@ zink_render_condition(struct pipe_context *pctx,
|
|||
pipe_resource_reference(&pres, NULL);
|
||||
}
|
||||
|
||||
static uint64_t
|
||||
zink_get_timestamp(struct pipe_context *pctx)
|
||||
{
|
||||
struct zink_screen *screen = zink_screen(pctx->screen);
|
||||
uint64_t timestamp, deviation;
|
||||
assert(screen->info.have_EXT_calibrated_timestamps);
|
||||
VkCalibratedTimestampInfoEXT cti = {};
|
||||
cti.sType = VK_STRUCTURE_TYPE_CALIBRATED_TIMESTAMP_INFO_EXT;
|
||||
cti.timeDomain = VK_TIME_DOMAIN_DEVICE_EXT;
|
||||
screen->vk_GetCalibratedTimestampsEXT(screen->dev, 1, &cti, ×tamp, &deviation);
|
||||
timestamp_to_nanoseconds(screen, ×tamp);
|
||||
return timestamp;
|
||||
}
|
||||
|
||||
void
|
||||
zink_context_query_init(struct pipe_context *pctx)
|
||||
{
|
||||
|
|
@ -490,4 +504,5 @@ zink_context_query_init(struct pipe_context *pctx)
|
|||
pctx->get_query_result = zink_get_query_result;
|
||||
pctx->set_active_query_state = zink_set_active_query_state;
|
||||
pctx->render_condition = zink_render_condition;
|
||||
pctx->get_timestamp = zink_get_timestamp;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue