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);
|
uint64_t mtl_device_get_registry_id(mtl_device *dev);
|
||||||
struct mtl_size mtl_device_max_threads_per_threadgroup(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 */
|
/* Resource queries */
|
||||||
void mtl_heap_buffer_size_and_align_with_length(mtl_device *device,
|
void mtl_heap_buffer_size_and_align_with_length(mtl_device *device,
|
||||||
uint64_t *size_B,
|
uint64_t *size_B,
|
||||||
|
|
@ -37,4 +40,4 @@ void
|
||||||
mtl_heap_texture_size_and_align_with_descriptor(mtl_device *device,
|
mtl_heap_texture_size_and_align_with_descriptor(mtl_device *device,
|
||||||
struct kk_image_layout *layout);
|
struct kk_image_layout *layout);
|
||||||
|
|
||||||
#endif /* MTL_DEVICE_H */
|
#endif /* MTL_DEVICE_H */
|
||||||
|
|
|
||||||
|
|
@ -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 */
|
/* Resource queries */
|
||||||
/* TODO_KOSMICKRISP Return a struct */
|
/* TODO_KOSMICKRISP Return a struct */
|
||||||
void
|
void
|
||||||
|
|
|
||||||
|
|
@ -59,6 +59,13 @@ mtl_device_max_threads_per_threadgroup(mtl_device *dev)
|
||||||
return (struct mtl_size){};
|
return (struct mtl_size){};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Timestamp query */
|
||||||
|
uint64_t
|
||||||
|
mtl_device_get_gpu_timestamp(mtl_device *dev)
|
||||||
|
{
|
||||||
|
return 0u;
|
||||||
|
}
|
||||||
|
|
||||||
/* Resource queries */
|
/* Resource queries */
|
||||||
void
|
void
|
||||||
mtl_heap_buffer_size_and_align_with_length(mtl_device *device, uint64_t *size_B,
|
mtl_heap_buffer_size_and_align_with_length(mtl_device *device, uint64_t *size_B,
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue