anv: add a custom AcquireNextImage2KHR func
So that we can plug our intel_measure framework. Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com> Reviewed-by: Felix DeGrood <felix.j.degrood@intel.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14998>
This commit is contained in:
parent
6e939ca865
commit
7a52286215
|
@ -426,7 +426,7 @@ _anv_measure_submit(struct anv_cmd_buffer *cmd_buffer)
|
|||
* Hook for the start of a frame.
|
||||
*/
|
||||
void
|
||||
anv_measure_acquire(struct anv_device *device)
|
||||
_anv_measure_acquire(struct anv_device *device)
|
||||
{
|
||||
struct intel_measure_config *config = config_from_device(device);
|
||||
struct intel_measure_device *measure_device = &device->physical->measure_device;
|
||||
|
|
|
@ -46,7 +46,7 @@ void _anv_measure_endcommandbuffer(struct anv_cmd_buffer *cmd_buffer);
|
|||
void _anv_measure_beginrenderpass(struct anv_cmd_buffer *cmd_buffer);
|
||||
|
||||
/* tracks frame progression */
|
||||
void anv_measure_acquire(struct anv_device *device);
|
||||
void _anv_measure_acquire(struct anv_device *device);
|
||||
|
||||
/* should be combined with endcommandbuffer */
|
||||
void _anv_measure_submit(struct anv_cmd_buffer *cmd_buffer);
|
||||
|
@ -55,6 +55,10 @@ void
|
|||
_anv_measure_add_secondary(struct anv_cmd_buffer *primary,
|
||||
struct anv_cmd_buffer *secondary);
|
||||
|
||||
#define anv_measure_acquire(device) \
|
||||
if (unlikely(device->physical->measure_device.config)) \
|
||||
_anv_measure_acquire(device)
|
||||
|
||||
#define anv_measure_snapshot(cmd_buffer, type, event_name, count) \
|
||||
if (unlikely(cmd_buffer->measure)) \
|
||||
_anv_measure_snapshot(cmd_buffer, type, event_name, count)
|
||||
|
|
|
@ -71,6 +71,22 @@ anv_finish_wsi(struct anv_physical_device *physical_device)
|
|||
&physical_device->instance->vk.alloc);
|
||||
}
|
||||
|
||||
VkResult anv_AcquireNextImage2KHR(
|
||||
VkDevice _device,
|
||||
const VkAcquireNextImageInfoKHR *pAcquireInfo,
|
||||
uint32_t *pImageIndex)
|
||||
{
|
||||
VK_FROM_HANDLE(anv_device, device, _device);
|
||||
|
||||
VkResult result =
|
||||
wsi_common_acquire_next_image2(&device->physical->wsi_device,
|
||||
_device, pAcquireInfo, pImageIndex);
|
||||
if (result == VK_SUCCESS)
|
||||
anv_measure_acquire(device);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
VkResult anv_QueuePresentKHR(
|
||||
VkQueue _queue,
|
||||
const VkPresentInfoKHR* pPresentInfo)
|
||||
|
|
Loading…
Reference in New Issue