Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

haoxli
Copy link
Contributor

@haoxli haoxli commented May 21, 2020

These query APIs do not support on render bundles, move them to GPUComputePassEncoder and GPURenderPassEncoder.
Issue: #794


Preview | Diff

void dispatch(GPUSize32 x, optional GPUSize32 y = 1, optional GPUSize32 z = 1);
void dispatchIndirect(GPUBuffer indirectBuffer, GPUSize64 indirectOffset);

void beginPipelineStatisticsQuery(GPUQuerySet querySet, GPUSize32 queryIndex);
Copy link
Contributor

Choose a reason for hiding this comment

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

Just a crazy thought: we could just make it a part of the compute pass:

dictionary GPUComputePassDescriptor {
    GPUQuerySet? pipelineStatisticsQuerySet;
    optional GPUSize32 pipelineStatisticsQueryIndex = 0;
};

That would have a bit less spec text duplication and complexity.

Copy link
Contributor

Choose a reason for hiding this comment

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

To reduce duplication there could alternatively be a GPUPassEncoderBase that shares stuff between GPUComputePassEncoder and GPURenderPassEncoder. In particular we'll want to finer detail control over memory barriers in compute passes eventually, and this would lead to "fatter" compute passes so having a single pipelineStatistics per pass would be too constraining.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Another consideration is there is also an occlusionQuerySet in GPURenderPassDescriptor , if add a pipelineStatisticsQuerySet, maybe it's a duplication in spec, and there will be timestamp query in the future.

Copy link
Contributor

@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.

I think it makes sense for these to be totally separate (and specced separately) since they expose different things. Compute shader invocations only in compute passes, everything else only in render passes.

spec/index.bs Outdated
void dispatchIndirect(GPUBuffer indirectBuffer, GPUSize64 indirectOffset);

void beginPipelineStatisticsQuery(GPUQuerySet querySet, GPUSize32 queryIndex);
void endPipelineStatisticsQuery(GPUQuerySet querySet, GPUSize32 queryIndex);
Copy link
Contributor

Choose a reason for hiding this comment

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

Actually, since pipeline statistics queries can't be nested, could this just be endPipelineStatisticsQuery()?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, I will remove these args.

@haoxli haoxli force-pushed the pipeline-statistics-fix branch from 313eb61 to 64ff17e Compare May 27, 2020 03:24
These query APIs do not support on render bundles.
@kvark kvark merged commit 0268a8d into gpuweb:master Jun 1, 2020
@haoxli haoxli mentioned this pull request Jun 4, 2020
haoxli added a commit to haoxli/gpuweb that referenced this pull request Jun 4, 2020
beginPipelineStatisticsQuery and endPipelineStatisticsQuery have been
changed in gpuweb#797, remove them in GPUProgrammablePassEncoder which are
added when rebasing.
kainino0x pushed a commit that referenced this pull request Jun 10, 2020
* Query API: Timestamp Query

* Add writeTimestamp in GPUCommandEncoder

* Add extension requirements in queries

* Add issue for constraints on the availability

* Unified text format

* Move writeTimestamp to render/compute encoders

beginPipelineStatisticsQuery and endPipelineStatisticsQuery have been
changed in #797, remove them in GPUProgrammablePassEncoder which are
added when rebasing.

* Update spec/index.bs

* Update spec/index.bs
ben-clayton added a commit to ben-clayton/gpuweb that referenced this pull request Sep 6, 2022
This file was incorrectly named `float_built_functions.spce.ts`
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.

4 participants