mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-20 07:20:10 +01:00
kk: add mtl_device_get_gpu_timestamp bridge
Reviewed-by: Aitor Camacho <aitor@lunarg.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38965>
This commit is contained in:
parent
819213dc29
commit
3a73a7ba29
3 changed files with 25 additions and 1 deletions
|
|
@ -29,6 +29,9 @@ uint32_t mtl_device_get_peer_index(mtl_device *dev);
|
|||
uint64_t mtl_device_get_registry_id(mtl_device *dev);
|
||||
struct mtl_size mtl_device_max_threads_per_threadgroup(mtl_device *dev);
|
||||
|
||||
/* Timestamp query */
|
||||
uint64_t mtl_device_get_gpu_timestamp(mtl_device *dev);
|
||||
|
||||
/* Resource queries */
|
||||
void mtl_heap_buffer_size_and_align_with_length(mtl_device *device,
|
||||
uint64_t *size_B,
|
||||
|
|
|
|||
|
|
@ -129,6 +129,20 @@ mtl_device_max_threads_per_threadgroup(mtl_device *dev)
|
|||
}
|
||||
}
|
||||
|
||||
/* Timestamp query */
|
||||
uint64_t
|
||||
mtl_device_get_gpu_timestamp(mtl_device *dev)
|
||||
{
|
||||
@autoreleasepool {
|
||||
id<MTLDevice> device = (id<MTLDevice>)dev;
|
||||
MTLTimestamp cpu_ts, gpu_ts;
|
||||
|
||||
[device sampleTimestamps:&cpu_ts gpuTimestamp:&gpu_ts];
|
||||
|
||||
return (uint64_t)gpu_ts;
|
||||
}
|
||||
}
|
||||
|
||||
/* Resource queries */
|
||||
/* TODO_KOSMICKRISP Return a struct */
|
||||
void
|
||||
|
|
|
|||
|
|
@ -59,6 +59,13 @@ mtl_device_max_threads_per_threadgroup(mtl_device *dev)
|
|||
return (struct mtl_size){};
|
||||
}
|
||||
|
||||
/* Timestamp query */
|
||||
uint64_t
|
||||
mtl_device_get_gpu_timestamp(mtl_device *dev)
|
||||
{
|
||||
return 0u;
|
||||
}
|
||||
|
||||
/* Resource queries */
|
||||
void
|
||||
mtl_heap_buffer_size_and_align_with_length(mtl_device *device, uint64_t *size_B,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue