Skip to content

GPU: Query API#15651

Draft
thatcosmonaut wants to merge 4 commits into
libsdl-org:mainfrom
thatcosmonaut:gpu_query_api
Draft

GPU: Query API#15651
thatcosmonaut wants to merge 4 commits into
libsdl-org:mainfrom
thatcosmonaut:gpu_query_api

Conversation

@thatcosmonaut
Copy link
Copy Markdown
Collaborator

  • I confirm that I am the author of this code and release it to the SDL project under the Zlib license. This contribution does not contain code from other sources, including code generated by a Large Language Model ("AI").

Description

Provides an API for performing timestamp and occlusion queries. Implemented in Vulkan as a proof of concept.

Before merge:

  • Ensure that the API is sufficient
  • Implement D3D12
  • Implement Metal

Existing Issue(s)

Implements #11696

@thatcosmonaut
Copy link
Copy Markdown
Collaborator Author

I'm considering that it might be nice to allow query pools to cycle, since otherwise users will have to maintain their own query pool ring buffers.

Comment thread include/SDL3/SDL_gpu.h
Comment on lines +4080 to +4081
* After this function is called, the data in the query pool is no longer valid,
* so don't call this function multiple times before performing another query.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this discard the entire contents of the query pool or just the data for [first_query, first_query + count]? It reads like the former

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That comment is actually wrong, I need to add an explicit reset function because Vulkan requires it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants