Commit e828e6b0 authored by Kai Ninomiya's avatar Kai Ninomiya Committed by Commit Bot

Add GPUMapMode/Flags and expose GPUDeviceLostInfo on workers

Add GPUMapMode/GPUMapModeFlags definitions, in prep for implementing the
new WebGPU buffer mapping primitives.

GPUDevice.lost is exposed on workers; it was just a small mistake that
GPUDeviceLostInfo wasn't as well.

Bug: 1069302
Change-Id: Icc54e28d1b65b05a8d189dda9ce4dad1e0ec29d8
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2305022Reviewed-by: default avatarAustin Eng <enga@chromium.org>
Reviewed-by: default avatarYuki Shiino <yukishiino@chromium.org>
Reviewed-by: default avatarCorentin Wallez <cwallez@chromium.org>
Commit-Queue: Kai Ninomiya <kainino@chromium.org>
Cr-Commit-Position: refs/heads/master@{#789816}
parent a64955e5
......@@ -867,6 +867,7 @@ static_idl_files_in_modules = get_path_info(
"//third_party/blink/renderer/modules/webgpu/gpu_fence_descriptor.idl",
"//third_party/blink/renderer/modules/webgpu/gpu_image_bitmap_copy_view.idl",
"//third_party/blink/renderer/modules/webgpu/gpu_limits.idl",
"//third_party/blink/renderer/modules/webgpu/gpu_map_mode.idl",
"//third_party/blink/renderer/modules/webgpu/gpu_object_descriptor_base.idl",
"//third_party/blink/renderer/modules/webgpu/gpu_origin_2d_dict.idl",
"//third_party/blink/renderer/modules/webgpu/gpu_origin_3d_dict.idl",
......
......@@ -41,6 +41,7 @@ blink_modules_sources("webgpu") {
"gpu_device_lost_info.h",
"gpu_fence.cc",
"gpu_fence.h",
"gpu_map_mode.h",
"gpu_out_of_memory_error.cc",
"gpu_out_of_memory_error.h",
"gpu_pipeline_layout.cc",
......
......@@ -5,8 +5,7 @@
// https://gpuweb.github.io/gpuweb/
[
Exposed=Window,
RuntimeEnabled=WebGPU
Exposed(Window WebGPU, Worker WebGPU)
] interface GPUDeviceLostInfo {
readonly attribute DOMString message;
};
......
// 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.
#ifndef THIRD_PARTY_BLINK_RENDERER_MODULES_WEBGPU_GPU_MAP_MODE_H_
#define THIRD_PARTY_BLINK_RENDERER_MODULES_WEBGPU_GPU_MAP_MODE_H_
#include "third_party/blink/renderer/platform/bindings/script_wrappable.h"
namespace blink {
class GPUMapMode : public ScriptWrappable {
DEFINE_WRAPPERTYPEINFO();
public:
// gpu_map_mode.idl
static constexpr uint32_t kRead = 1;
static constexpr uint32_t kWrite = 2;
private:
DISALLOW_COPY_AND_ASSIGN(GPUMapMode);
};
} // namespace blink
#endif // THIRD_PARTY_BLINK_RENDERER_MODULES_WEBGPU_GPU_MAP_MODE_H_
// Copyright 2020 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/#typedefdef-gpumapmodeflags
typedef [EnforceRange] unsigned long GPUMapModeFlags;
[
Exposed(Window WebGPU, Worker WebGPU)
] interface GPUMapMode {
const unsigned long READ = 0x0001;
const unsigned long WRITE = 0x0002;
};
......@@ -18,6 +18,7 @@ modules_idl_files = [
"gpu_device.idl",
"gpu_device_lost_info.idl",
"gpu_fence.idl",
"gpu_map_mode.idl",
"gpu_out_of_memory_error.idl",
"gpu_pipeline_layout.idl",
"gpu_queue.idl",
......
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