commit 7c22988b10a4778682a21264b4a54b9e1a77eebd
Author: Austin Eng <
en...@chromium.org>
AuthorDate: Tue Mar 01 23:56:06 2022
Commit: Chromium LUCI CQ <
chromiu...@luci-project-accounts.iam.gserviceaccount.com>
CommitDate: Tue Mar 01 23:56:06 2022
Update deprecated usage of Dawn internal usages extension
Internal usages have moved from a per-command API to a member on
CommandEncoder descriptor chain.
Bug: dawn:1027
Change-Id: I08aba946db7d32620c9d70070862b9fd1554670b
Reviewed-on:
https://chromium-review.googlesource.com/c/chromium/src/+/3496880
Reviewed-by: Juanmi Huertas <
juan...@chromium.org>
Commit-Queue: Austin Eng <
en...@chromium.org>
Cr-Commit-Position: refs/heads/main@{#976475}
diff --git a/third_party/blink/renderer/modules/webgpu/gpu_swap_chain.cc b/third_party/blink/renderer/modules/webgpu/gpu_swap_chain.cc
index 4776766..f3e12c1 100644
--- a/third_party/blink/renderer/modules/webgpu/gpu_swap_chain.cc
+++ b/third_party/blink/renderer/modules/webgpu/gpu_swap_chain.cc
@@ -228,10 +228,6 @@
reservation.id, reservation.generation,
WGPUTextureUsage_CopyDst,
reinterpret_cast<const GLbyte*>(&dst_mailbox));
-
- WGPUCommandEncoder command_encoder =
- GetProcs().deviceCreateCommandEncoder(device_->GetHandle(), nullptr);
-
WGPUImageCopyTexture source = {
.nextInChain = nullptr,
.texture = texture,
@@ -251,8 +247,18 @@
.height = static_cast<uint32_t>(size.height()),
.depthOrArrayLayers = 1,
};
- GetProcs().commandEncoderCopyTextureToTextureInternal(
- command_encoder, &source, &destination, ©_size);
+
+ WGPUDawnEncoderInternalUsageDescriptor internal_usage_desc = {
+ .chain = {.sType = WGPUSType_DawnEncoderInternalUsageDescriptor},
+ .useInternalUsages = true,
+ };
+ WGPUCommandEncoderDescriptor command_encoder_desc = {
+ .nextInChain = &internal_usage_desc.chain,
+ };
+ WGPUCommandEncoder command_encoder = GetProcs().deviceCreateCommandEncoder(
+ device_->GetHandle(), &command_encoder_desc);
+ GetProcs().commandEncoderCopyTextureToTexture(command_encoder, &source,
+ &destination, ©_size);
WGPUCommandBuffer command_buffer =
GetProcs().commandEncoderFinish(command_encoder, nullptr);