Skip to content

Move CPU/GPU timestamp correlation to vkGetPhysicalDeviceProperties() #1983

Open
@billhollings

Description

@billhollings

It turns out that MTLDevice sampleTimestamps:gpuTimestamp: executes synchronously with other queue activities, and can block GPU execution if it is called frequently.

Move timestamp correlation to the execution of vkGetPhysicalDeviceProperties() so it is called only on demand by the app.

Furthermore, MTLDevice sampleTimestamps:gpuTimestamp: should only be invoked if all of these conditions are met (otherwise the VkPhysicalDeviceLimits::timestampPeriod should be set to 1.0):

  • CPU is not Apple Silicon (!supportsMTLGPUFamily(Apple1)).
  • MVKPhysicalDevice::_timestampMTLCounterSet exists.
  • MVKPhysicalDeviceMetalFeatures::counterSamplingPoints is empty.

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugCompletedIssue has been fixed, or enhancement implemented.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions