forked from chromium/chromium
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Reland "WebGPU: Add GPUProgrammablePassEncoder interface"
Reason for revert: Use of the GPUProgrammablePassEncoder and GPURenderEncoderBase interfaces aren't installing the function templates properly. According to the spec[1], the first identifier of `includes` statement MUST reference a `interface`. It means that a `interface mixin` cannot include the other `interface mixin`. In this case, even though GPURenderEncoderBase is `interface mixin`, it includes GPUProgrammablePassEncoder which is `interface mixin`. Solution: The problem should be fixed in spec side[2] and make final interfaces include the mixins directly as follows: GPURenderBundleEncoder includes GPUProgrammablePassEncoder; GPURenderPassEncoder includes GPUProgrammablePassEncoder; Original change's description: > WebGPU: Add GPUProgrammablePassEncoder interface > > This is a spec match-up with[1] > > [1] gpuweb/gpuweb#459 > > Bug: 877147 > Change-Id: I080324cbb083160ae84aa109623e311f24a875cb > Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1845132 > Reviewed-by: Corentin Wallez <cwallez@chromium.org> > Reviewed-by: Kentaro Hara <haraken@chromium.org> > Commit-Queue: Jinho Bang <jinho.bang@samsung.com> > Cr-Commit-Position: refs/heads/master@{#704061} [1] https://heycam.github.io/webidl/#includes-statement [2] gpuweb/gpuweb#470 Bug: 1013649 Change-Id: Iaeb1ac69b0f1f7a779c341e7a92f6b29e28d3880 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1857846 Commit-Queue: Jinho Bang <jinho.bang@samsung.com> Reviewed-by: Kentaro Hara <haraken@chromium.org> Reviewed-by: Corentin Wallez <cwallez@chromium.org> Cr-Commit-Position: refs/heads/master@{#705991}
- Loading branch information
Showing
6 changed files
with
56 additions
and
63 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 16 additions & 0 deletions
16
third_party/blink/renderer/modules/webgpu/gpu_programmable_pass_encoder.idl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
// Copyright 2019 The Chromium Authors. All rights reserved. | ||
// Use of this source code is governed by a BSD-style license that can be | ||
// found in the LICENSE file. | ||
|
||
// https://gpuweb.github.io/gpuweb/ | ||
|
||
[ | ||
RuntimeEnabled=WebGPU | ||
] interface mixin GPUProgrammablePassEncoder { | ||
void setBindGroup(unsigned long index, GPUBindGroup bindGroup, | ||
optional sequence<GPUBufferSize> dynamicOffsets = []); | ||
|
||
void pushDebugGroup(DOMString groupLabel); | ||
void popDebugGroup(); | ||
void insertDebugMarker(DOMString markerLabel); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 29 additions & 0 deletions
29
third_party/blink/renderer/modules/webgpu/gpu_render_encoder_base.idl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
// Copyright 2019 The Chromium Authors. All rights reserved. | ||
// Use of this source code is governed by a BSD-style license that can be | ||
// found in the LICENSE file. | ||
|
||
// https://gpuweb.github.io/gpuweb/ | ||
|
||
[ | ||
RuntimeEnabled=WebGPU | ||
] interface mixin GPURenderEncoderBase { | ||
void setPipeline(GPURenderPipeline pipeline); | ||
|
||
void setIndexBuffer(GPUBuffer buffer, optional GPUBufferSize offset = 0); | ||
void setVertexBuffer(unsigned long slot, | ||
GPUBuffer buffer, | ||
optional GPUBufferSize offset = 0); | ||
|
||
void draw(unsigned long vertexCount, unsigned long instanceCount, | ||
unsigned long firstVertex, | ||
unsigned long firstInstance); | ||
void drawIndexed(unsigned long indexCount, unsigned long instanceCount, | ||
unsigned long firstIndex, | ||
long baseVertex, | ||
unsigned long firstInstance); | ||
|
||
void drawIndirect(GPUBuffer indirectBuffer, | ||
GPUBufferSize indirectOffset); | ||
void drawIndexedIndirect(GPUBuffer indirectBuffer, | ||
GPUBufferSize indirectOffset); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters