Sitelet https://github.com/gpuweb/gpuweb/pull/691/files
Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 35 additions & 2 deletions spec/index.bs
Original file line number Diff line number Diff line change
Expand Up @@ -802,7 +802,8 @@ allows additional usages of WebGPU that would have otherwise been invalid.

<script type=idl>
enum GPUExtensionName {
"texture-compression-bc"
"texture-compression-bc",
"pipeline-statistics-query"
};
</script>

Expand Down Expand Up @@ -2543,6 +2544,9 @@ interface mixin GPUProgrammablePassEncoder {
void pushDebugGroup(DOMString groupLabel);
void popDebugGroup();
void insertDebugMarker(DOMString markerLabel);

void beginPipelineStatisticsQuery(GPUQuerySet querySet, GPUSize32 queryIndex);
void endPipelineStatisticsQuery(GPUQuerySet querySet, GPUSize32 queryIndex);
};
</script>

Expand Down Expand Up @@ -2793,17 +2797,46 @@ GPUQuerySet includes GPUObjectBase;
dictionary GPUQuerySetDescriptor : GPUObjectDescriptorBase {
required GPUQueryType type;
required GPUSize32 count;
sequence<GPUPipelineStatisticName> pipelineStatistics = [];
};
</script>

<dl dfn-type=dict-member dfn-for=GPUQuerySetDescriptor>
: <dfn>pipelineStatistics</dfn>
::
The set of {{GPUPipelineStatisticName}} values in this sequence defines which pipeline statistics will be returned in the new query set.

<div class=validusage dfn-for=GPUQuerySetDescriptor.pipelineStatistics>
<dfn abstract-op>Valid Usage</dfn>
1. |pipelineStatistics| is ignored if type is not {{GPUQueryType/pipeline-statistics}}.
2. If {{GPUExtensionName/pipeline-statistics-query}} is not available, |type| must not be {{GPUQueryType/pipeline-statistics}}.
3. If |type| is {{GPUQueryType/pipeline-statistics}}, |pipelineStatistics| must be a sequence of {{GPUPipelineStatisticName}} values which cannot be duplicated.
</div>
</dl>

## QueryType ## {#querytype}

<script type=idl>
enum GPUQueryType {
"occlusion"
"occlusion",
"pipeline-statistics"
};
</script>

## Pipeline Statistics Query ## {#pipeline-statistics}

<script type=idl>
enum GPUPipelineStatisticName {
"vertex-shader-invocations",
"clipper-invocations",
"clipper-primitives-out",
"fragment-shader-invocations",
"compute-shader-invocations"
};
</script>

When resolving pipeline statistics query, each result is written into uint64, and the number and order of the results written to GPU buffer matches the number and order of {{GPUPipelineStatisticName}} specified in {{GPUQuerySetDescriptor/pipelineStatistics}}.


# Canvas Rendering &amp; Swap Chains # {#canvas-rendering}

Expand Down