zink: move get_timestamp to screen
this doesn't need to use a particular context Reviewed-by: Adam Jackson <ajax@redhat.com> Reviewed-by: Dave Airlie <airlied@redhat.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16529>
This commit is contained in:
parent
0befc259a6
commit
fffafa3635
|
@ -1293,10 +1293,10 @@ zink_get_query_result_resource(struct pipe_context *pctx,
|
|||
force_cpu_read(ctx, pquery, result_type, pres, offset);
|
||||
}
|
||||
|
||||
static uint64_t
|
||||
zink_get_timestamp(struct pipe_context *pctx)
|
||||
uint64_t
|
||||
zink_get_timestamp(struct pipe_screen *pscreen)
|
||||
{
|
||||
struct zink_screen *screen = zink_screen(pctx->screen);
|
||||
struct zink_screen *screen = zink_screen(pscreen);
|
||||
uint64_t timestamp, deviation;
|
||||
if (screen->info.have_EXT_calibrated_timestamps) {
|
||||
VkCalibratedTimestampInfoEXT cti = {0};
|
||||
|
@ -1306,7 +1306,7 @@ zink_get_timestamp(struct pipe_context *pctx)
|
|||
mesa_loge("ZINK: vkGetCalibratedTimestampsEXT failed");
|
||||
}
|
||||
} else {
|
||||
pctx = &screen->copy_context->base;
|
||||
struct pipe_context *pctx = &screen->copy_context->base;
|
||||
struct pipe_query *pquery = pctx->create_query(pctx, PIPE_QUERY_TIMESTAMP, 0);
|
||||
if (!pquery)
|
||||
return 0;
|
||||
|
@ -1336,5 +1336,4 @@ zink_context_query_init(struct pipe_context *pctx)
|
|||
pctx->get_query_result_resource = zink_get_query_result_resource;
|
||||
pctx->set_active_query_state = zink_set_active_query_state;
|
||||
pctx->render_condition = zink_render_condition;
|
||||
pctx->get_timestamp = zink_get_timestamp;
|
||||
}
|
||||
|
|
|
@ -25,6 +25,7 @@
|
|||
#define ZINK_QUERY_H
|
||||
|
||||
#include <stdbool.h>
|
||||
#include <inttypes.h>
|
||||
|
||||
struct zink_batch;
|
||||
struct zink_batch_state;
|
||||
|
@ -32,6 +33,7 @@ struct zink_context;
|
|||
struct zink_fence;
|
||||
struct zink_query;
|
||||
struct zink_screen;
|
||||
struct pipe_screen;
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
@ -59,6 +61,8 @@ zink_check_conditional_render(struct zink_context *ctx);
|
|||
|
||||
void
|
||||
zink_context_destroy_query_pools(struct zink_context *ctx);
|
||||
uint64_t
|
||||
zink_get_timestamp(struct pipe_screen *pscreen);
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
|
|
@ -34,6 +34,7 @@
|
|||
#include "zink_instance.h"
|
||||
#include "zink_program.h"
|
||||
#include "zink_public.h"
|
||||
#include "zink_query.h"
|
||||
#include "zink_resource.h"
|
||||
#include "nir_to_spirv/nir_to_spirv.h" // for SPIRV_VERSION
|
||||
|
||||
|
@ -2195,6 +2196,7 @@ zink_internal_create_screen(const struct pipe_screen_config *config)
|
|||
screen->base.get_vendor = zink_get_vendor;
|
||||
screen->base.get_device_vendor = zink_get_device_vendor;
|
||||
screen->base.get_compute_param = zink_get_compute_param;
|
||||
screen->base.get_timestamp = zink_get_timestamp;
|
||||
screen->base.query_memory_info = zink_query_memory_info;
|
||||
screen->base.get_param = zink_get_param;
|
||||
screen->base.get_paramf = zink_get_paramf;
|
||||
|
|
Loading…
Reference in New Issue