Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SDL3] GPU: Investigate adding a Query API #11696

Open
WoozChucky opened this issue Dec 24, 2024 · 3 comments
Open

[SDL3] GPU: Investigate adding a Query API #11696

WoozChucky opened this issue Dec 24, 2024 · 3 comments
Labels
enhancement New feature or request
Milestone

Comments

@WoozChucky
Copy link

WoozChucky commented Dec 24, 2024

Not sure if other supported apis have the same concept of Vulkan's VkQueryPools, but would be great to have this exposed (via some SDL api wrapping) somehow to be able to query some gpu information.

@thatcosmonaut
Copy link
Collaborator

What's your use case? We would have to do some background research to identify a good cross-platform API surface for this.

@WoozChucky
Copy link
Author

Mostly timing measurements in the rendering pipelines.

VK_CHECK(vkGetQueryPoolResults(device, queryPool, 0, ARRAYSIZE(queryResults), sizeof(queryResults), queryResults, sizeof(queryResults[0]), VK_QUERY_RESULT_64_BIT));

double frameGpuBegin = double(queryResults[0]) * props.limits.timestampPeriod * 1e-6;
double frameGpuEnd = double(queryResults[1]) * props.limits.timestampPeriod * 1e-6;

Once again, this might be too specific for Vulkan and troublesome/inexistent in other apis (I havent messed with Metal or DX at all).

@thatcosmonaut
Copy link
Collaborator

This is maybe doable but Metal only supports very coarse timing queries. I'll flag this for 3.x in case anyone wants to investigate this after 3.2 is released.

@thatcosmonaut thatcosmonaut added this to the 3.x milestone Dec 24, 2024
@thatcosmonaut thatcosmonaut added the enhancement New feature or request label Dec 24, 2024
@thatcosmonaut thatcosmonaut changed the title [SDL3] GPU: Support for Vulkan QueryPool ? [SDL3] GPU: Investigate adding a Query API Dec 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants