Skip to content

Conversation

@greggman
Copy link
Collaborator

@greggman greggman commented Dec 5, 2024

It was mentioned that a previous PR did the wrong thing by possibly applying a time more than once per timer query. This PR addresses that issue by making the TimestampQueryManager take a callback at initialization time that is called, only when a value is available. The value is provided to the callback. This pattern is similar to ResizeObserver

I agree with another comment, I kind of feel like it would be more useful to support multiple queries. But, maybe as a sample it's fine to support just 1.

It was mentioned that a previous PR did the wrong thing
by possibly applying a time more than once per timer query.
This PR addresses that issue by making the TimestampQueryManager
take a callback at initialization time that is called, only when
a value is available. The value is provided to the callback.
This pattern is similar to ResizeObserver

I agree with another comment, I kind of feel like it would
be more useful to support multiple queries. But, maybe as a
sample it's fine to support just 1.
Copy link
Collaborator

@kainino0x kainino0x left a comment

Choose a reason for hiding this comment

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

LGTM

@kainino0x kainino0x merged commit b056bc1 into webgpu:main Dec 11, 2024
1 check passed
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