Commit 95cf2fcb authored by François Beaufort's avatar François Beaufort Committed by Commit Bot

[WebGPU] Add debug markers to ComputePassEncoder and RenderPassEncoder

Following https://dawn-review.googlesource.com/c/dawn/+/9680 change,
this CL adds debug markers methods (pushDebugGroup, popDebugGroup, and
insertDebugMarker) to GPUComputePassEncoder and GPURenderPassEncoder.

Bug: 877147
Change-Id: Id833eaff5ed98a842b1cabc7d4c8c08098e0853e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1732077Reviewed-by: default avatarCorentin Wallez <cwallez@chromium.org>
Commit-Queue: François Beaufort <beaufort.francois@gmail.com>
Cr-Commit-Position: refs/heads/master@{#683557}
parent 773d749c
...@@ -39,6 +39,20 @@ void GPUComputePassEncoder::setBindGroup( ...@@ -39,6 +39,20 @@ void GPUComputePassEncoder::setBindGroup(
dynamicOffsets.data()); dynamicOffsets.data());
} }
void GPUComputePassEncoder::pushDebugGroup(String groupLabel) {
GetProcs().computePassEncoderPushDebugGroup(GetHandle(),
groupLabel.Utf8().data());
}
void GPUComputePassEncoder::popDebugGroup() {
GetProcs().computePassEncoderPopDebugGroup(GetHandle());
}
void GPUComputePassEncoder::insertDebugMarker(String markerLabel) {
GetProcs().computePassEncoderInsertDebugMarker(GetHandle(),
markerLabel.Utf8().data());
}
void GPUComputePassEncoder::setPipeline(GPUComputePipeline* pipeline) { void GPUComputePassEncoder::setPipeline(GPUComputePipeline* pipeline) {
GetProcs().computePassEncoderSetPipeline(GetHandle(), pipeline->GetHandle()); GetProcs().computePassEncoderSetPipeline(GetHandle(), pipeline->GetHandle());
} }
......
...@@ -28,6 +28,9 @@ class GPUComputePassEncoder : public DawnObject<DawnComputePassEncoder> { ...@@ -28,6 +28,9 @@ class GPUComputePassEncoder : public DawnObject<DawnComputePassEncoder> {
void setBindGroup(uint32_t index, void setBindGroup(uint32_t index,
GPUBindGroup* bindGroup, GPUBindGroup* bindGroup,
const Vector<uint64_t>& dynamicOffsets); const Vector<uint64_t>& dynamicOffsets);
void pushDebugGroup(String groupLabel);
void popDebugGroup();
void insertDebugMarker(String markerLabel);
void setPipeline(GPUComputePipeline* pipeline); void setPipeline(GPUComputePipeline* pipeline);
void dispatch(uint32_t x, uint32_t y, uint32_t z); void dispatch(uint32_t x, uint32_t y, uint32_t z);
void dispatchIndirect(GPUBuffer* indirectBuffer, uint64_t indirectOffset); void dispatchIndirect(GPUBuffer* indirectBuffer, uint64_t indirectOffset);
......
...@@ -7,9 +7,14 @@ ...@@ -7,9 +7,14 @@
[ [
RuntimeEnabled=WebGPU RuntimeEnabled=WebGPU
] interface GPUComputePassEncoder { ] interface GPUComputePassEncoder {
// GPUProgrammablePassEncoder methods
void setBindGroup(unsigned long index, void setBindGroup(unsigned long index,
GPUBindGroup bindGroup, GPUBindGroup bindGroup,
optional sequence<unsigned long long> dynamicOffsets = []); optional sequence<unsigned long long> dynamicOffsets = []);
void pushDebugGroup(DOMString groupLabel);
void popDebugGroup();
void insertDebugMarker(DOMString markerLabel);
void setPipeline(GPUComputePipeline pipeline); void setPipeline(GPUComputePipeline pipeline);
void dispatch(unsigned long x, void dispatch(unsigned long x,
......
...@@ -42,6 +42,20 @@ void GPURenderPassEncoder::setBindGroup( ...@@ -42,6 +42,20 @@ void GPURenderPassEncoder::setBindGroup(
dynamicOffsets.data()); dynamicOffsets.data());
} }
void GPURenderPassEncoder::pushDebugGroup(String groupLabel) {
GetProcs().renderPassEncoderPushDebugGroup(GetHandle(),
groupLabel.Utf8().data());
}
void GPURenderPassEncoder::popDebugGroup() {
GetProcs().renderPassEncoderPopDebugGroup(GetHandle());
}
void GPURenderPassEncoder::insertDebugMarker(String markerLabel) {
GetProcs().renderPassEncoderInsertDebugMarker(GetHandle(),
markerLabel.Utf8().data());
}
void GPURenderPassEncoder::setPipeline(GPURenderPipeline* pipeline) { void GPURenderPassEncoder::setPipeline(GPURenderPipeline* pipeline) {
GetProcs().renderPassEncoderSetPipeline(GetHandle(), pipeline->GetHandle()); GetProcs().renderPassEncoderSetPipeline(GetHandle(), pipeline->GetHandle());
} }
......
...@@ -30,6 +30,9 @@ class GPURenderPassEncoder : public DawnObject<DawnRenderPassEncoder> { ...@@ -30,6 +30,9 @@ class GPURenderPassEncoder : public DawnObject<DawnRenderPassEncoder> {
void setBindGroup(uint32_t index, void setBindGroup(uint32_t index,
GPUBindGroup* bindGroup, GPUBindGroup* bindGroup,
const Vector<uint64_t>& dynamicOffsets); const Vector<uint64_t>& dynamicOffsets);
void pushDebugGroup(String groupLabel);
void popDebugGroup();
void insertDebugMarker(String markerLabel);
void setPipeline(GPURenderPipeline* pipeline); void setPipeline(GPURenderPipeline* pipeline);
void setBlendColor(GPUColor* color); void setBlendColor(GPUColor* color);
......
...@@ -7,9 +7,14 @@ ...@@ -7,9 +7,14 @@
[ [
RuntimeEnabled=WebGPU RuntimeEnabled=WebGPU
] interface GPURenderPassEncoder { ] interface GPURenderPassEncoder {
// GPUProgrammablePassEncoder methods
void setBindGroup(unsigned long index, void setBindGroup(unsigned long index,
GPUBindGroup bindGroup, GPUBindGroup bindGroup,
optional sequence<unsigned long long> dynamicOffsets = []); optional sequence<unsigned long long> dynamicOffsets = []);
void pushDebugGroup(DOMString groupLabel);
void popDebugGroup();
void insertDebugMarker(DOMString markerLabel);
void setPipeline(GPURenderPipeline pipeline); void setPipeline(GPURenderPipeline pipeline);
void setBlendColor(GPUColor color); void setBlendColor(GPUColor color);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment