Commit ef83d4b0 authored by Austin Eng's avatar Austin Eng Committed by Commit Bot

Add WebGPU skeleton idl

This patch adds the WebGPU enums and empty WebGPU interfaces

Change-Id: I3e016188924f313f8258dcaf2682c6dcb2d9ee60
Bug: 877147
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1547347Reviewed-by: default avatarKentaro Hara <haraken@chromium.org>
Reviewed-by: default avatarCorentin Wallez <cwallez@chromium.org>
Reviewed-by: default avatarKai Ninomiya <kainino@chromium.org>
Commit-Queue: Kai Ninomiya <kainino@chromium.org>
Commit-Queue: Austin Eng <enga@chromium.org>
Cr-Commit-Position: refs/heads/master@{#647108}
parent d7d8b188
...@@ -46,6 +46,10 @@ bindings_modules_generated_union_type_files = [ ...@@ -46,6 +46,10 @@ bindings_modules_generated_union_type_files = [
"$bindings_modules_v8_output_dir/effect_proxy_or_worklet_group_effect_proxy.h", "$bindings_modules_v8_output_dir/effect_proxy_or_worklet_group_effect_proxy.h",
"$bindings_modules_v8_output_dir/float32_array_or_float64_array_or_dom_matrix.cc", "$bindings_modules_v8_output_dir/float32_array_or_float64_array_or_dom_matrix.cc",
"$bindings_modules_v8_output_dir/float32_array_or_float64_array_or_dom_matrix.h", "$bindings_modules_v8_output_dir/float32_array_or_float64_array_or_dom_matrix.h",
"$bindings_modules_v8_output_dir/gpu_out_of_memory_error_or_gpu_validation_error.cc",
"$bindings_modules_v8_output_dir/gpu_out_of_memory_error_or_gpu_validation_error.h",
"$bindings_modules_v8_output_dir/gpu_sampler_or_gpu_texture_view_or_gpu_buffer_binding.cc",
"$bindings_modules_v8_output_dir/gpu_sampler_or_gpu_texture_view_or_gpu_buffer_binding.h",
"$bindings_modules_v8_output_dir/html_canvas_element_or_offscreen_canvas.cc", "$bindings_modules_v8_output_dir/html_canvas_element_or_offscreen_canvas.cc",
"$bindings_modules_v8_output_dir/html_canvas_element_or_offscreen_canvas.h", "$bindings_modules_v8_output_dir/html_canvas_element_or_offscreen_canvas.h",
"$bindings_modules_v8_output_dir/idb_object_store_or_idb_index.cc", "$bindings_modules_v8_output_dir/idb_object_store_or_idb_index.cc",
......
...@@ -432,9 +432,32 @@ modules_idl_files = ...@@ -432,9 +432,32 @@ modules_idl_files =
"webgl/webgl_video_texture.idl", "webgl/webgl_video_texture.idl",
"webgpu/gpu.idl", "webgpu/gpu.idl",
"webgpu/gpu_adapter.idl", "webgpu/gpu_adapter.idl",
"webgpu/gpu_bind_group.idl",
"webgpu/gpu_bind_group_layout.idl",
"webgpu/gpu_buffer.idl",
"webgpu/gpu_buffer_usage.idl",
"webgpu/gpu_canvas_context.idl",
"webgpu/gpu_color_write_bit.idl",
"webgpu/gpu_command_buffer.idl",
"webgpu/gpu_command_encoder.idl",
"webgpu/gpu_compute_pass_encoder.idl",
"webgpu/gpu_compute_pipeline.idl",
"webgpu/gpu_device.idl", "webgpu/gpu_device.idl",
"webgpu/gpu_fence.idl", "webgpu/gpu_fence.idl",
"webgpu/gpu_out_of_memory_error.idl",
"webgpu/gpu_pipeline_layout.idl",
"webgpu/gpu_queue.idl", "webgpu/gpu_queue.idl",
"webgpu/gpu_render_pass_encoder.idl",
"webgpu/gpu_render_pipeline.idl",
"webgpu/gpu_sampler.idl",
"webgpu/gpu_shader_module.idl",
"webgpu/gpu_shader_stage_bit.idl",
"webgpu/gpu_swap_chain.idl",
"webgpu/gpu_texture.idl",
"webgpu/gpu_texture_usage.idl",
"webgpu/gpu_texture_view.idl",
"webgpu/gpu_uncaptured_error_event.idl",
"webgpu/gpu_validation_error.idl",
"webmidi/midi_access.idl", "webmidi/midi_access.idl",
"webmidi/midi_connection_event.idl", "webmidi/midi_connection_event.idl",
"webmidi/midi_input.idl", "webmidi/midi_input.idl",
...@@ -744,11 +767,45 @@ modules_dictionary_idl_files = ...@@ -744,11 +767,45 @@ modules_dictionary_idl_files =
"webaudio/wave_shaper_options.idl", "webaudio/wave_shaper_options.idl",
"webgl/webgl_context_attributes.idl", "webgl/webgl_context_attributes.idl",
"webgl/webgl_context_event_init.idl", "webgl/webgl_context_event_init.idl",
"webgpu/gpu_bind_group_binding.idl",
"webgpu/gpu_bind_group_descriptor.idl",
"webgpu/gpu_bind_group_layout_binding.idl",
"webgpu/gpu_bind_group_layout_descriptor.idl",
"webgpu/gpu_blend_descriptor.idl",
"webgpu/gpu_buffer_binding.idl",
"webgpu/gpu_buffer_copy_view.idl",
"webgpu/gpu_buffer_descriptor.idl",
"webgpu/gpu_color.idl",
"webgpu/gpu_color_state_descriptor.idl",
"webgpu/gpu_command_encoder_descriptor.idl",
"webgpu/gpu_compute_pipeline_descriptor.idl",
"webgpu/gpu_depth_stencil_state_descriptor.idl",
"webgpu/gpu_device_descriptor.idl", "webgpu/gpu_device_descriptor.idl",
"webgpu/gpu_extensions.idl", "webgpu/gpu_extensions.idl",
"webgpu/gpu_extent_3d.idl",
"webgpu/gpu_fence_descriptor.idl", "webgpu/gpu_fence_descriptor.idl",
"webgpu/gpu_limits.idl", "webgpu/gpu_limits.idl",
"webgpu/gpu_origin_3d.idl",
"webgpu/gpu_pipeline_descriptor_base.idl",
"webgpu/gpu_pipeline_layout_descriptor.idl",
"webgpu/gpu_pipeline_stage_descriptor.idl",
"webgpu/gpu_rasterization_state_descriptor.idl",
"webgpu/gpu_render_pass_color_attachment_descriptor.idl",
"webgpu/gpu_render_pass_depth_stencil_attachment_descriptor.idl",
"webgpu/gpu_render_pass_descriptor.idl",
"webgpu/gpu_render_pipeline_descriptor.idl",
"webgpu/gpu_request_adapter_options.idl", "webgpu/gpu_request_adapter_options.idl",
"webgpu/gpu_sampler_descriptor.idl",
"webgpu/gpu_shader_module_descriptor.idl",
"webgpu/gpu_stencil_state_face_descriptor.idl",
"webgpu/gpu_swap_chain_descriptor.idl",
"webgpu/gpu_texture_copy_view.idl",
"webgpu/gpu_texture_descriptor.idl",
"webgpu/gpu_texture_view_descriptor.idl",
"webgpu/gpu_uncaptured_error_event_init.idl",
"webgpu/gpu_vertex_attribute_descriptor.idl",
"webgpu/gpu_vertex_buffer_descriptor.idl",
"webgpu/gpu_vertex_input_descriptor.idl",
"webmidi/midi_connection_event_init.idl", "webmidi/midi_connection_event_init.idl",
"webmidi/midi_message_event_init.idl", "webmidi/midi_message_event_init.idl",
"webmidi/midi_options.idl", "webmidi/midi_options.idl",
......
...@@ -15,12 +15,54 @@ blink_modules_sources("webgpu") { ...@@ -15,12 +15,54 @@ blink_modules_sources("webgpu") {
"gpu.h", "gpu.h",
"gpu_adapter.cc", "gpu_adapter.cc",
"gpu_adapter.h", "gpu_adapter.h",
"gpu_bind_group.cc",
"gpu_bind_group.h",
"gpu_bind_group_layout.cc",
"gpu_bind_group_layout.h",
"gpu_buffer.cc",
"gpu_buffer.h",
"gpu_buffer_usage.h",
"gpu_canvas_context.cc",
"gpu_canvas_context.h",
"gpu_color_write_bit.h",
"gpu_command_buffer.cc",
"gpu_command_buffer.h",
"gpu_command_encoder.cc",
"gpu_command_encoder.h",
"gpu_compute_pass_encoder.cc",
"gpu_compute_pass_encoder.h",
"gpu_compute_pipeline.cc",
"gpu_compute_pipeline.h",
"gpu_device.cc", "gpu_device.cc",
"gpu_device.h", "gpu_device.h",
"gpu_fence.cc", "gpu_fence.cc",
"gpu_fence.h", "gpu_fence.h",
"gpu_out_of_memory_error.cc",
"gpu_out_of_memory_error.h",
"gpu_pipeline_layout.cc",
"gpu_pipeline_layout.h",
"gpu_queue.cc", "gpu_queue.cc",
"gpu_queue.h", "gpu_queue.h",
"gpu_render_pass_encoder.cc",
"gpu_render_pass_encoder.h",
"gpu_render_pipeline.cc",
"gpu_render_pipeline.h",
"gpu_sampler.cc",
"gpu_sampler.h",
"gpu_shader_module.cc",
"gpu_shader_module.h",
"gpu_shader_stage_bit.h",
"gpu_swap_chain.cc",
"gpu_swap_chain.h",
"gpu_texture.cc",
"gpu_texture.h",
"gpu_texture_usage.h",
"gpu_texture_view.cc",
"gpu_texture_view.h",
"gpu_uncaptured_error_event.cc",
"gpu_uncaptured_error_event.h",
"gpu_validation_error.cc",
"gpu_validation_error.h",
"navigator_gpu.cc", "navigator_gpu.cc",
"navigator_gpu.h", "navigator_gpu.h",
] ]
......
// 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.
#include "third_party/blink/renderer/modules/webgpu/gpu_bind_group.h"
#include "third_party/blink/renderer/modules/webgpu/gpu_device.h"
namespace blink {
// static
GPUBindGroup* GPUBindGroup::Create(GPUDevice* device,
DawnBindGroup bind_group) {
return MakeGarbageCollected<GPUBindGroup>(device, bind_group);
}
GPUBindGroup::GPUBindGroup(GPUDevice* device, DawnBindGroup bind_group)
: DawnObject<DawnBindGroup>(device, bind_group) {}
GPUBindGroup::~GPUBindGroup() {
if (IsDawnControlClientDestroyed()) {
return;
}
GetProcs().bindGroupRelease(GetHandle());
}
} // namespace blink
// 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_BIND_GROUP_H_
#define THIRD_PARTY_BLINK_RENDERER_MODULES_WEBGPU_GPU_BIND_GROUP_H_
#include "third_party/blink/renderer/modules/webgpu/dawn_object.h"
namespace blink {
class GPUBindGroup : public DawnObject<DawnBindGroup> {
DEFINE_WRAPPERTYPEINFO();
public:
static GPUBindGroup* Create(GPUDevice* device, DawnBindGroup bind_group);
explicit GPUBindGroup(GPUDevice* device, DawnBindGroup bind_group);
~GPUBindGroup() override;
private:
DISALLOW_COPY_AND_ASSIGN(GPUBindGroup);
};
} // namespace blink
#endif // THIRD_PARTY_BLINK_RENDERER_MODULES_WEBGPU_GPU_BIND_GROUP_H_
// 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://github.com/gpuweb/gpuweb/blob/master/design/sketch.webidl
[
RuntimeEnabled=WebGPU
] interface GPUBindGroup {
};
// 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://github.com/gpuweb/gpuweb/blob/master/design/sketch.webidl
typedef (GPUSampler or GPUTextureView or GPUBufferBinding) GPUBindingResource;
dictionary GPUBindGroupBinding {
required unsigned long binding;
required GPUBindingResource resource;
};
// 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://github.com/gpuweb/gpuweb/blob/master/design/sketch.webidl
dictionary GPUBindGroupDescriptor {
required GPUBindGroupLayout layout;
required sequence<GPUBindGroupBinding> bindings;
};
// 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.
#include "third_party/blink/renderer/modules/webgpu/gpu_bind_group_layout.h"
#include "third_party/blink/renderer/modules/webgpu/gpu_device.h"
namespace blink {
// static
GPUBindGroupLayout* GPUBindGroupLayout::Create(
GPUDevice* device,
DawnBindGroupLayout bind_group_layout) {
return MakeGarbageCollected<GPUBindGroupLayout>(device, bind_group_layout);
}
GPUBindGroupLayout::GPUBindGroupLayout(GPUDevice* device,
DawnBindGroupLayout bind_group_layout)
: DawnObject<DawnBindGroupLayout>(device, bind_group_layout) {}
GPUBindGroupLayout::~GPUBindGroupLayout() {
if (IsDawnControlClientDestroyed()) {
return;
}
GetProcs().bindGroupLayoutRelease(GetHandle());
}
} // namespace blink
// 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_BIND_GROUP_LAYOUT_H_
#define THIRD_PARTY_BLINK_RENDERER_MODULES_WEBGPU_GPU_BIND_GROUP_LAYOUT_H_
#include "third_party/blink/renderer/modules/webgpu/dawn_object.h"
namespace blink {
class GPUBindGroupLayout : public DawnObject<DawnBindGroupLayout> {
DEFINE_WRAPPERTYPEINFO();
public:
static GPUBindGroupLayout* Create(GPUDevice* device,
DawnBindGroupLayout bind_group_layout);
explicit GPUBindGroupLayout(GPUDevice* device,
DawnBindGroupLayout bind_group_layout);
~GPUBindGroupLayout() override;
private:
DISALLOW_COPY_AND_ASSIGN(GPUBindGroupLayout);
};
} // namespace blink
#endif // THIRD_PARTY_BLINK_RENDERER_MODULES_WEBGPU_GPU_BIND_GROUP_LAYOUT_H_
// 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://github.com/gpuweb/gpuweb/blob/master/design/sketch.webidl
[
RuntimeEnabled=WebGPU
] interface GPUBindGroupLayout {
};
// 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://github.com/gpuweb/gpuweb/blob/master/design/sketch.webidl
dictionary GPUBindGroupLayoutBinding {
required unsigned long binding;
required GPUShaderStageFlags visibility;
required GPUBindingType type;
};
enum GPUBindingType {
"uniform-buffer",
"dynamic-uniform-buffer",
"sampler",
"sampled-texture",
"storage-buffer",
"dynamic-storage-buffer"
};
// 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://github.com/gpuweb/gpuweb/blob/master/design/sketch.webidl
dictionary GPUBindGroupLayoutDescriptor {
required sequence<GPUBindGroupLayoutBinding> bindings;
};
// 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://github.com/gpuweb/gpuweb/blob/master/design/sketch.webidl
dictionary GPUBlendDescriptor {
GPUBlendFactor srcFactor = "one";
GPUBlendFactor dstFactor = "zero";
GPUBlendOperation operation = "add";
};
enum GPUBlendFactor {
"zero",
"one",
"src-color",
"one-minus-src-color",
"src-alpha",
"one-minus-src-alpha",
"dst-color",
"one-minus-dst-color",
"dst-alpha",
"one-minus-dst-alpha",
"src-alpha-saturated",
"blend-color",
"one-minus-blend-color"
};
enum GPUBlendOperation {
"add",
"subtract",
"reverse-subtract",
"min",
"max"
};
// 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.
#include "third_party/blink/renderer/modules/webgpu/gpu_buffer.h"
#include "third_party/blink/renderer/modules/webgpu/gpu_device.h"
namespace blink {
// static
GPUBuffer* GPUBuffer::Create(GPUDevice* device, DawnBuffer buffer) {
return MakeGarbageCollected<GPUBuffer>(device, buffer);
}
GPUBuffer::GPUBuffer(GPUDevice* device, DawnBuffer buffer)
: DawnObject<DawnBuffer>(device, buffer) {}
GPUBuffer::~GPUBuffer() {
if (IsDawnControlClientDestroyed()) {
return;
}
GetProcs().bufferRelease(GetHandle());
}
} // namespace blink
// 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_BUFFER_H_
#define THIRD_PARTY_BLINK_RENDERER_MODULES_WEBGPU_GPU_BUFFER_H_
#include "third_party/blink/renderer/modules/webgpu/dawn_object.h"
namespace blink {
class GPUBuffer : public DawnObject<DawnBuffer> {
DEFINE_WRAPPERTYPEINFO();
public:
static GPUBuffer* Create(GPUDevice* device, DawnBuffer buffer);
explicit GPUBuffer(GPUDevice* device, DawnBuffer buffer);
~GPUBuffer() override;
// gpu_buffer.idl
// TODO(crbug.com/877147): implement GPUBuffer.
private:
DISALLOW_COPY_AND_ASSIGN(GPUBuffer);
};
} // namespace blink
#endif // THIRD_PARTY_BLINK_RENDERER_MODULES_WEBGPU_GPU_BUFFER_H_
// 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://github.com/gpuweb/gpuweb/blob/master/design/sketch.webidl
[
RuntimeEnabled=WebGPU
] interface GPUBuffer {
};
// 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://github.com/gpuweb/gpuweb/blob/master/design/sketch.webidl
dictionary GPUBufferBinding {
required GPUBuffer buffer;
unsigned long long offset = 0;
required unsigned long long size;
};
// 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://github.com/gpuweb/gpuweb/blob/master/design/sketch.webidl
dictionary GPUBufferCopyView {
required GPUBuffer buffer;
unsigned long long offset = 0;
required unsigned long rowPitch;
required unsigned long imageHeight;
};
// 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://github.com/gpuweb/gpuweb/blob/master/design/sketch.webidl
dictionary GPUBufferDescriptor {
required unsigned long long size;
required GPUBufferUsageFlags usage;
};
// 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_BUFFER_USAGE_H_
#define THIRD_PARTY_BLINK_RENDERER_MODULES_WEBGPU_GPU_BUFFER_USAGE_H_
#include "third_party/blink/renderer/platform/bindings/script_wrappable.h"
namespace blink {
class GPUBufferUsage : public ScriptWrappable {
DEFINE_WRAPPERTYPEINFO();
public:
// gpu_buffer_usage.idl
static constexpr uint32_t kNone = 0;
static constexpr uint32_t kMapRead = 1;
static constexpr uint32_t kMapWrite = 2;
static constexpr uint32_t kTransferSrc = 4;
static constexpr uint32_t kTransferDst = 8;
static constexpr uint32_t kIndex = 16;
static constexpr uint32_t kVertex = 32;
static constexpr uint32_t kUniform = 64;
static constexpr uint32_t kStorage = 128;
private:
DISALLOW_COPY_AND_ASSIGN(GPUBufferUsage);
};
} // namespace blink
#endif // THIRD_PARTY_BLINK_RENDERER_MODULES_WEBGPU_GPU_BUFFER_USAGE_H_
// 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://github.com/gpuweb/gpuweb/blob/master/design/sketch.webidl
typedef unsigned long GPUBufferUsageFlags;
[
RuntimeEnabled=WebGPU
] interface GPUBufferUsage {
const unsigned long NONE = 0;
const unsigned long MAP_READ = 1;
const unsigned long MAP_WRITE = 2;
const unsigned long TRANSFER_SRC = 4;
const unsigned long TRANSFER_DST = 8;
const unsigned long INDEX = 16;
const unsigned long VERTEX = 32;
const unsigned long UNIFORM = 64;
const unsigned long STORAGE = 128;
};
// 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.
#include "third_party/blink/renderer/modules/webgpu/gpu_canvas_context.h"
namespace blink {} // namespace blink
// 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_CANVAS_CONTEXT_H_
#define THIRD_PARTY_BLINK_RENDERER_MODULES_WEBGPU_GPU_CANVAS_CONTEXT_H_
#include "third_party/blink/renderer/platform/bindings/script_wrappable.h"
namespace blink {
class GPUCanvasContext : public ScriptWrappable {
DEFINE_WRAPPERTYPEINFO();
public:
// gpu_canvas_context.idl
// TODO(crbug.com/877147): implement GPUCanvasContext.
private:
DISALLOW_COPY_AND_ASSIGN(GPUCanvasContext);
};
} // namespace blink
#endif // THIRD_PARTY_BLINK_RENDERER_MODULES_WEBGPU_GPU_CANVAS_CONTEXT_H_
// 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://github.com/gpuweb/gpuweb/blob/master/design/sketch.webidl
[
RuntimeEnabled=WebGPU
] interface GPUCanvasContext {
};
// 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://github.com/gpuweb/gpuweb/blob/master/design/sketch.webidl
dictionary GPUColor {
required float r;
required float g;
required float b;
required float a;
};
// 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://github.com/gpuweb/gpuweb/blob/master/design/sketch.webidl
dictionary GPUColorStateDescriptor {
required GPUTextureFormat format;
required GPUBlendDescriptor alphaBlend;
required GPUBlendDescriptor colorBlend;
GPUColorWriteFlags writeMask = 15; // GPUColorWriteFlags.ALL
};
// 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_COLOR_WRITE_BIT_H_
#define THIRD_PARTY_BLINK_RENDERER_MODULES_WEBGPU_GPU_COLOR_WRITE_BIT_H_
#include "third_party/blink/renderer/platform/bindings/script_wrappable.h"
namespace blink {
class GPUColorWriteBit : public ScriptWrappable {
DEFINE_WRAPPERTYPEINFO();
public:
// gpu_color_write_bit.idl
static constexpr uint32_t kNone = 0;
static constexpr uint32_t kRed = 1;
static constexpr uint32_t kGreen = 2;
static constexpr uint32_t kBlue = 4;
static constexpr uint32_t kAlpha = 8;
static constexpr uint32_t kAll = 15;
private:
DISALLOW_COPY_AND_ASSIGN(GPUColorWriteBit);
};
} // namespace blink
#endif // THIRD_PARTY_BLINK_RENDERER_MODULES_WEBGPU_GPU_COLOR_WRITE_BIT_H_
// 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://github.com/gpuweb/gpuweb/blob/master/design/sketch.webidl
typedef unsigned long GPUColorWriteFlags;
[
RuntimeEnabled=WebGPU
] interface GPUColorWriteBit {
const unsigned long NONE = 0;
const unsigned long RED = 1;
const unsigned long GREEN = 2;
const unsigned long BLUE = 4;
const unsigned long ALPHA = 8;
const unsigned long ALL = 15;
};
// 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.
#include "third_party/blink/renderer/modules/webgpu/gpu_command_buffer.h"
#include "third_party/blink/renderer/modules/webgpu/gpu_device.h"
namespace blink {
// static
GPUCommandBuffer* GPUCommandBuffer::Create(GPUDevice* device,
DawnCommandBuffer command_buffer) {
return MakeGarbageCollected<GPUCommandBuffer>(device, command_buffer);
}
GPUCommandBuffer::GPUCommandBuffer(GPUDevice* device,
DawnCommandBuffer command_buffer)
: DawnObject<DawnCommandBuffer>(device, command_buffer) {}
GPUCommandBuffer::~GPUCommandBuffer() {
if (IsDawnControlClientDestroyed()) {
return;
}
GetProcs().commandBufferRelease(GetHandle());
}
} // namespace blink
// 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_COMMAND_BUFFER_H_
#define THIRD_PARTY_BLINK_RENDERER_MODULES_WEBGPU_GPU_COMMAND_BUFFER_H_
#include "third_party/blink/renderer/modules/webgpu/dawn_object.h"
namespace blink {
class GPUCommandBuffer : public DawnObject<DawnCommandBuffer> {
DEFINE_WRAPPERTYPEINFO();
public:
static GPUCommandBuffer* Create(GPUDevice* device,
DawnCommandBuffer command_buffer);
explicit GPUCommandBuffer(GPUDevice* device,
DawnCommandBuffer command_buffer);
~GPUCommandBuffer() override;
private:
DISALLOW_COPY_AND_ASSIGN(GPUCommandBuffer);
};
} // namespace blink
#endif // THIRD_PARTY_BLINK_RENDERER_MODULES_WEBGPU_GPU_COMMAND_BUFFER_H_
// 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://github.com/gpuweb/gpuweb/blob/master/design/sketch.webidl
[
RuntimeEnabled=WebGPU
] interface GPUCommandBuffer {
};
// 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.
#include "third_party/blink/renderer/modules/webgpu/gpu_command_encoder.h"
#include "third_party/blink/renderer/modules/webgpu/gpu_device.h"
namespace blink {
// static
GPUCommandEncoder* GPUCommandEncoder::Create(
GPUDevice* device,
DawnCommandEncoder command_encoder) {
return MakeGarbageCollected<GPUCommandEncoder>(device, command_encoder);
}
GPUCommandEncoder::GPUCommandEncoder(GPUDevice* device,
DawnCommandEncoder command_encoder)
: DawnObject<DawnCommandEncoder>(device, command_encoder) {}
GPUCommandEncoder::~GPUCommandEncoder() {
if (IsDawnControlClientDestroyed()) {
return;
}
GetProcs().commandEncoderRelease(GetHandle());
}
} // namespace blink
// 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_COMMAND_ENCODER_H_
#define THIRD_PARTY_BLINK_RENDERER_MODULES_WEBGPU_GPU_COMMAND_ENCODER_H_
#include "third_party/blink/renderer/modules/webgpu/dawn_object.h"
namespace blink {
class GPUCommandEncoder : public DawnObject<DawnCommandEncoder> {
DEFINE_WRAPPERTYPEINFO();
public:
static GPUCommandEncoder* Create(GPUDevice* device,
DawnCommandEncoder command_encoder);
explicit GPUCommandEncoder(GPUDevice* device,
DawnCommandEncoder command_encoder);
~GPUCommandEncoder() override;
// gpu_command_encoder.idl
// TODO(crbug.com/877147): implement GPUCommandEncoder.
private:
DISALLOW_COPY_AND_ASSIGN(GPUCommandEncoder);
};
} // namespace blink
#endif // THIRD_PARTY_BLINK_RENDERER_MODULES_WEBGPU_GPU_COMMAND_ENCODER_H_
// 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://github.com/gpuweb/gpuweb/blob/master/design/sketch.webidl
[
RuntimeEnabled=WebGPU
] interface GPUCommandEncoder {
};
// 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://github.com/gpuweb/gpuweb/blob/master/design/sketch.webidl
dictionary GPUCommandEncoderDescriptor {
};
// 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.
#include "third_party/blink/renderer/modules/webgpu/gpu_compute_pass_encoder.h"
#include "third_party/blink/renderer/modules/webgpu/gpu_device.h"
namespace blink {
// static
GPUComputePassEncoder* GPUComputePassEncoder::Create(
GPUDevice* device,
DawnComputePassEncoder compute_pass_encoder) {
return MakeGarbageCollected<GPUComputePassEncoder>(device,
compute_pass_encoder);
}
GPUComputePassEncoder::GPUComputePassEncoder(
GPUDevice* device,
DawnComputePassEncoder compute_pass_encoder)
: DawnObject<DawnComputePassEncoder>(device, compute_pass_encoder) {}
GPUComputePassEncoder::~GPUComputePassEncoder() {
if (IsDawnControlClientDestroyed()) {
return;
}
GetProcs().computePassEncoderRelease(GetHandle());
}
} // namespace blink
// 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_COMPUTE_PASS_ENCODER_H_
#define THIRD_PARTY_BLINK_RENDERER_MODULES_WEBGPU_GPU_COMPUTE_PASS_ENCODER_H_
#include "third_party/blink/renderer/modules/webgpu/dawn_object.h"
namespace blink {
class GPUComputePassEncoder : public DawnObject<DawnComputePassEncoder> {
DEFINE_WRAPPERTYPEINFO();
public:
static GPUComputePassEncoder* Create(
GPUDevice* device,
DawnComputePassEncoder compute_pass_encoder);
explicit GPUComputePassEncoder(GPUDevice* device,
DawnComputePassEncoder compute_pass_encoder);
~GPUComputePassEncoder() override;
// gpu_compute_pass_encoder.idl
// TODO(crbug.com/877147): implement GPUComputePassEncoder.
private:
DISALLOW_COPY_AND_ASSIGN(GPUComputePassEncoder);
};
} // namespace blink
#endif // THIRD_PARTY_BLINK_RENDERER_MODULES_WEBGPU_GPU_COMPUTE_PASS_ENCODER_H_
// 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://github.com/gpuweb/gpuweb/blob/master/design/sketch.webidl
[
RuntimeEnabled=WebGPU
] interface GPUComputePassEncoder {
};
// 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.
#include "third_party/blink/renderer/modules/webgpu/gpu_compute_pipeline.h"
#include "third_party/blink/renderer/modules/webgpu/gpu_device.h"
namespace blink {
// static
GPUComputePipeline* GPUComputePipeline::Create(
GPUDevice* device,
DawnComputePipeline compute_pipeline) {
return MakeGarbageCollected<GPUComputePipeline>(device, compute_pipeline);
}
GPUComputePipeline::GPUComputePipeline(GPUDevice* device,
DawnComputePipeline compute_pipeline)
: DawnObject<DawnComputePipeline>(device, compute_pipeline) {}
GPUComputePipeline::~GPUComputePipeline() {
if (IsDawnControlClientDestroyed()) {
return;
}
GetProcs().computePipelineRelease(GetHandle());
}
} // namespace blink
// 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_COMPUTE_PIPELINE_H_
#define THIRD_PARTY_BLINK_RENDERER_MODULES_WEBGPU_GPU_COMPUTE_PIPELINE_H_
#include "third_party/blink/renderer/modules/webgpu/dawn_object.h"
namespace blink {
class GPUComputePipeline : public DawnObject<DawnComputePipeline> {
DEFINE_WRAPPERTYPEINFO();
public:
static GPUComputePipeline* Create(GPUDevice* device,
DawnComputePipeline compute_pipeline);
explicit GPUComputePipeline(GPUDevice* device,
DawnComputePipeline compute_pipeline);
~GPUComputePipeline() override;
private:
DISALLOW_COPY_AND_ASSIGN(GPUComputePipeline);
};
} // namespace blink
#endif // THIRD_PARTY_BLINK_RENDERER_MODULES_WEBGPU_GPU_COMPUTE_PIPELINE_H_
// 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://github.com/gpuweb/gpuweb/blob/master/design/sketch.webidl
[
RuntimeEnabled=WebGPU
] interface GPUComputePipeline {
};
// 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://github.com/gpuweb/gpuweb/blob/master/design/sketch.webidl
dictionary GPUComputePipelineDescriptor : GPUPipelineDescriptorBase {
required GPUPipelineStageDescriptor computeStage;
};
// 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://github.com/gpuweb/gpuweb/blob/master/design/sketch.webidl
dictionary GPUDepthStencilStateDescriptor {
required GPUTextureFormat format;
boolean depthWriteEnabled = false;
GPUCompareFunction depthCompare = "always";
required GPUStencilStateFaceDescriptor stencilFront;
required GPUStencilStateFaceDescriptor stencilBack;
unsigned long stencilReadMask = 0xFFFFFFFF;
unsigned long stencilWriteMask = 0xFFFFFFFF;
};
...@@ -11,3 +11,5 @@ ...@@ -11,3 +11,5 @@
GPUQueue getQueue(); GPUQueue getQueue();
}; };
typedef (GPUOutOfMemoryError or GPUValidationError) GPUError;
// 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://github.com/gpuweb/gpuweb/blob/master/design/sketch.webidl
dictionary GPUExtent3D {
required unsigned long width;
required unsigned long height;
required unsigned long depth;
};
...@@ -5,4 +5,5 @@ ...@@ -5,4 +5,5 @@
// https://github.com/gpuweb/gpuweb/blob/master/design/sketch.webidl // https://github.com/gpuweb/gpuweb/blob/master/design/sketch.webidl
dictionary GPULimits { dictionary GPULimits {
unsigned long maxBindGroups = 4;
}; };
// 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://github.com/gpuweb/gpuweb/blob/master/design/sketch.webidl
dictionary GPUOrigin3D {
required unsigned long x;
required unsigned long y;
required unsigned long z;
};
// 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.
#include "third_party/blink/renderer/modules/webgpu/gpu_out_of_memory_error.h"
namespace blink {
// static
GPUOutOfMemoryError* GPUOutOfMemoryError::Create() {
return MakeGarbageCollected<GPUOutOfMemoryError>();
}
GPUOutOfMemoryError::GPUOutOfMemoryError() {}
} // namespace blink
// 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_OUT_OF_MEMORY_ERROR_H_
#define THIRD_PARTY_BLINK_RENDERER_MODULES_WEBGPU_GPU_OUT_OF_MEMORY_ERROR_H_
#include "third_party/blink/renderer/platform/bindings/script_wrappable.h"
namespace blink {
class GPUOutOfMemoryError : public ScriptWrappable {
DEFINE_WRAPPERTYPEINFO();
public:
static GPUOutOfMemoryError* Create();
GPUOutOfMemoryError();
private:
DISALLOW_COPY_AND_ASSIGN(GPUOutOfMemoryError);
};
} // namespace blink
#endif // THIRD_PARTY_BLINK_RENDERER_MODULES_WEBGPU_GPU_OUT_OF_MEMORY_ERROR_H_
// 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://github.com/gpuweb/gpuweb/blob/master/design/sketch.webidl
[
Constructor(),
RuntimeEnabled=WebGPU
] interface GPUOutOfMemoryError {
};
// 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://github.com/gpuweb/gpuweb/blob/master/design/sketch.webidl
dictionary GPUPipelineDescriptorBase {
DOMString label;
required GPUPipelineLayout layout;
};
// 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.
#include "third_party/blink/renderer/modules/webgpu/gpu_pipeline_layout.h"
#include "third_party/blink/renderer/modules/webgpu/gpu_device.h"
namespace blink {
// static
GPUPipelineLayout* GPUPipelineLayout::Create(
GPUDevice* device,
DawnPipelineLayout pipeline_layout) {
return MakeGarbageCollected<GPUPipelineLayout>(device, pipeline_layout);
}
GPUPipelineLayout::GPUPipelineLayout(GPUDevice* device,
DawnPipelineLayout pipeline_layout)
: DawnObject<DawnPipelineLayout>(device, pipeline_layout) {}
GPUPipelineLayout::~GPUPipelineLayout() {
if (IsDawnControlClientDestroyed()) {
return;
}
GetProcs().pipelineLayoutRelease(GetHandle());
}
} // namespace blink
// 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_PIPELINE_LAYOUT_H_
#define THIRD_PARTY_BLINK_RENDERER_MODULES_WEBGPU_GPU_PIPELINE_LAYOUT_H_
#include "third_party/blink/renderer/modules/webgpu/dawn_object.h"
namespace blink {
class GPUPipelineLayout : public DawnObject<DawnPipelineLayout> {
DEFINE_WRAPPERTYPEINFO();
public:
static GPUPipelineLayout* Create(GPUDevice* device,
DawnPipelineLayout pipeline_layout);
explicit GPUPipelineLayout(GPUDevice* device,
DawnPipelineLayout pipeline_layout);
~GPUPipelineLayout() override;
private:
DISALLOW_COPY_AND_ASSIGN(GPUPipelineLayout);
};
} // namespace blink
#endif // THIRD_PARTY_BLINK_RENDERER_MODULES_WEBGPU_GPU_PIPELINE_LAYOUT_H_
// 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://github.com/gpuweb/gpuweb/blob/master/design/sketch.webidl
[
RuntimeEnabled=WebGPU
] interface GPUPipelineLayout {
};
// 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://github.com/gpuweb/gpuweb/blob/master/design/sketch.webidl
dictionary GPUPipelineLayoutDescriptor {
required sequence<GPUBindGroupLayout> bindGroupLayouts;
};
// 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://github.com/gpuweb/gpuweb/blob/master/design/sketch.webidl
dictionary GPUPipelineStageDescriptor {
required GPUShaderModule module;
required DOMString entryPoint;
};
// 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://github.com/gpuweb/gpuweb/blob/master/design/sketch.webidl
dictionary GPURasterizationStateDescriptor {
required GPUFrontFace frontFace;
GPUCullMode cullMode = "none";
long depthBias = 0;
float depthBiasSlopeScale = 0;
float depthBiasClamp = 0;
};
enum GPUFrontFace {
"ccw",
"cw"
};
enum GPUCullMode {
"none",
"front",
"back"
};
// 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://github.com/gpuweb/gpuweb/blob/master/design/sketch.webidl
dictionary GPURenderPassColorAttachmentDescriptor {
required GPUTextureView attachment;
GPUTextureView? resolveTarget = null;
required GPULoadOp loadOp;
required GPUStoreOp storeOp;
required GPUColor clearColor;
};
// 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://github.com/gpuweb/gpuweb/blob/master/design/sketch.webidl
dictionary GPURenderPassDepthStencilAttachmentDescriptor {
required GPUTextureView attachment;
required GPULoadOp depthLoadOp;
required GPUStoreOp depthStoreOp;
required float clearDepth;
required GPULoadOp stencilLoadOp;
required GPUStoreOp stencilStoreOp;
unsigned long clearStencil = 0;
};
// 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://github.com/gpuweb/gpuweb/blob/master/design/sketch.webidl
dictionary GPURenderPassDescriptor {
required sequence<GPURenderPassColorAttachmentDescriptor> colorAttachments;
GPURenderPassDepthStencilAttachmentDescriptor depthStencilAttachment = null;
};
enum GPULoadOp {
"clear",
"load"
};
enum GPUStoreOp {
"store"
};
// 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.
#include "third_party/blink/renderer/modules/webgpu/gpu_render_pass_encoder.h"
#include "third_party/blink/renderer/modules/webgpu/gpu_device.h"
namespace blink {
// static
GPURenderPassEncoder* GPURenderPassEncoder::Create(
GPUDevice* device,
DawnRenderPassEncoder render_pass_encoder) {
return MakeGarbageCollected<GPURenderPassEncoder>(device,
render_pass_encoder);
}
GPURenderPassEncoder::GPURenderPassEncoder(
GPUDevice* device,
DawnRenderPassEncoder render_pass_encoder)
: DawnObject<DawnRenderPassEncoder>(device, render_pass_encoder) {}
GPURenderPassEncoder::~GPURenderPassEncoder() {
if (IsDawnControlClientDestroyed()) {
return;
}
GetProcs().renderPassEncoderRelease(GetHandle());
}
} // namespace blink
// 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_RENDER_PASS_ENCODER_H_
#define THIRD_PARTY_BLINK_RENDERER_MODULES_WEBGPU_GPU_RENDER_PASS_ENCODER_H_
#include "third_party/blink/renderer/modules/webgpu/dawn_object.h"
namespace blink {
class GPURenderPassEncoder : public DawnObject<DawnRenderPassEncoder> {
DEFINE_WRAPPERTYPEINFO();
public:
static GPURenderPassEncoder* Create(
GPUDevice* device,
DawnRenderPassEncoder render_pass_encoder);
explicit GPURenderPassEncoder(GPUDevice* device,
DawnRenderPassEncoder render_pass_encoder);
~GPURenderPassEncoder() override;
// gpu_render_pass_encoder.idl
// TODO(crbug.com/877147): implement GPURenderPassEncoder.
private:
DISALLOW_COPY_AND_ASSIGN(GPURenderPassEncoder);
};
} // namespace blink
#endif // THIRD_PARTY_BLINK_RENDERER_MODULES_WEBGPU_GPU_RENDER_PASS_ENCODER_H_
// 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://github.com/gpuweb/gpuweb/blob/master/design/sketch.webidl
[
RuntimeEnabled=WebGPU
] interface GPURenderPassEncoder {
};
// 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.
#include "third_party/blink/renderer/modules/webgpu/gpu_render_pipeline.h"
#include "third_party/blink/renderer/modules/webgpu/gpu_device.h"
namespace blink {
// static
GPURenderPipeline* GPURenderPipeline::Create(
GPUDevice* device,
DawnRenderPipeline render_pipeline) {
return MakeGarbageCollected<GPURenderPipeline>(device, render_pipeline);
}
GPURenderPipeline::GPURenderPipeline(GPUDevice* device,
DawnRenderPipeline render_pipeline)
: DawnObject<DawnRenderPipeline>(device, render_pipeline) {}
GPURenderPipeline::~GPURenderPipeline() {
if (IsDawnControlClientDestroyed()) {
return;
}
GetProcs().renderPipelineRelease(GetHandle());
}
} // namespace blink
// 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_RENDER_PIPELINE_H_
#define THIRD_PARTY_BLINK_RENDERER_MODULES_WEBGPU_GPU_RENDER_PIPELINE_H_
#include "third_party/blink/renderer/modules/webgpu/dawn_object.h"
namespace blink {
class GPURenderPipeline : public DawnObject<DawnRenderPipeline> {
DEFINE_WRAPPERTYPEINFO();
public:
static GPURenderPipeline* Create(GPUDevice* device,
DawnRenderPipeline render_pipeline);
explicit GPURenderPipeline(GPUDevice* device,
DawnRenderPipeline render_pipeline);
~GPURenderPipeline() override;
private:
DISALLOW_COPY_AND_ASSIGN(GPURenderPipeline);
};
} // namespace blink
#endif // THIRD_PARTY_BLINK_RENDERER_MODULES_WEBGPU_GPU_RENDER_PIPELINE_H_
// 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://github.com/gpuweb/gpuweb/blob/master/design/sketch.webidl
[
RuntimeEnabled=WebGPU
] interface GPURenderPipeline {
};
// 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://github.com/gpuweb/gpuweb/blob/master/design/sketch.webidl
dictionary GPURenderPipelineDescriptor : GPUPipelineDescriptorBase {
required GPUPipelineStageDescriptor vertexStage;
GPUPipelineStageDescriptor fragmentStage = null;
required GPUPrimitiveTopology primitiveTopology;
required GPURasterizationStateDescriptor rasterizationState;
required sequence<GPUColorStateDescriptor> colorStates;
GPUDepthStencilStateDescriptor depthStencilState = null;
required GPUVertexInputDescriptor vertexInput;
unsigned long sampleCount = 1;
};
enum GPUPrimitiveTopology {
"point-list",
"line-list",
"line-strip",
"triangle-list",
"triangle-strip"
};
// 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.
#include "third_party/blink/renderer/modules/webgpu/gpu_sampler.h"
#include "third_party/blink/renderer/modules/webgpu/gpu_device.h"
namespace blink {
// static
GPUSampler* GPUSampler::Create(GPUDevice* device, DawnSampler sampler) {
return MakeGarbageCollected<GPUSampler>(device, sampler);
}
GPUSampler::GPUSampler(GPUDevice* device, DawnSampler sampler)
: DawnObject<DawnSampler>(device, sampler) {}
GPUSampler::~GPUSampler() {
if (IsDawnControlClientDestroyed()) {
return;
}
GetProcs().samplerRelease(GetHandle());
}
} // namespace blink
// 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_SAMPLER_H_
#define THIRD_PARTY_BLINK_RENDERER_MODULES_WEBGPU_GPU_SAMPLER_H_
#include "third_party/blink/renderer/modules/webgpu/dawn_object.h"
namespace blink {
class GPUSampler : public DawnObject<DawnSampler> {
DEFINE_WRAPPERTYPEINFO();
public:
static GPUSampler* Create(GPUDevice* device, DawnSampler sampler);
explicit GPUSampler(GPUDevice* device, DawnSampler sampler);
~GPUSampler() override;
private:
DISALLOW_COPY_AND_ASSIGN(GPUSampler);
};
} // namespace blink
#endif // THIRD_PARTY_BLINK_RENDERER_MODULES_WEBGPU_GPU_SAMPLER_H_
// 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://github.com/gpuweb/gpuweb/blob/master/design/sketch.webidl
[
RuntimeEnabled=WebGPU
] interface GPUSampler {
};
// 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://github.com/gpuweb/gpuweb/blob/master/design/sketch.webidl
dictionary GPUSamplerDescriptor {
GPUAddressMode addressModeU = "clamp-to-edge";
GPUAddressMode addressModeV = "clamp-to-edge";
GPUAddressMode addressModeW = "clamp-to-edge";
GPUFilterMode magFilter = "nearest";
GPUFilterMode minFilter = "nearest";
GPUFilterMode mipmapFilter = "nearest";
float lodMinClamp = 0;
float lodMaxClamp = 0xffffffff;
GPUCompareFunction compareFunction = "never";
};
enum GPUAddressMode {
"clamp-to-edge",
"repeat",
"mirror-repeat"
};
enum GPUFilterMode {
"nearest",
"linear"
};
enum GPUCompareFunction {
"never",
"less",
"equal",
"less-equal",
"greater",
"not-equal",
"greater-equal",
"always"
};
// 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.
#include "third_party/blink/renderer/modules/webgpu/gpu_shader_module.h"
#include "third_party/blink/renderer/modules/webgpu/gpu_device.h"
namespace blink {
// static
GPUShaderModule* GPUShaderModule::Create(GPUDevice* device,
DawnShaderModule shader_module) {
return MakeGarbageCollected<GPUShaderModule>(device, shader_module);
}
GPUShaderModule::GPUShaderModule(GPUDevice* device,
DawnShaderModule shader_module)
: DawnObject<DawnShaderModule>(device, shader_module) {}
GPUShaderModule::~GPUShaderModule() {
if (IsDawnControlClientDestroyed()) {
return;
}
GetProcs().shaderModuleRelease(GetHandle());
}
} // namespace blink
// 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_SHADER_MODULE_H_
#define THIRD_PARTY_BLINK_RENDERER_MODULES_WEBGPU_GPU_SHADER_MODULE_H_
#include "third_party/blink/renderer/modules/webgpu/dawn_object.h"
namespace blink {
class GPUShaderModule : public DawnObject<DawnShaderModule> {
DEFINE_WRAPPERTYPEINFO();
public:
static GPUShaderModule* Create(GPUDevice* device,
DawnShaderModule shader_module);
explicit GPUShaderModule(GPUDevice* device, DawnShaderModule shader_module);
~GPUShaderModule() override;
private:
DISALLOW_COPY_AND_ASSIGN(GPUShaderModule);
};
} // namespace blink
#endif // THIRD_PARTY_BLINK_RENDERER_MODULES_WEBGPU_GPU_SHADER_MODULE_H_
// 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://github.com/gpuweb/gpuweb/blob/master/design/sketch.webidl
[
RuntimeEnabled=WebGPU
] interface GPUShaderModule {
};
// 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://github.com/gpuweb/gpuweb/blob/master/design/sketch.webidl
dictionary GPUShaderModuleDescriptor {
DOMString label;
// TODO(kainino): should be:
// [AllowShared, FlexibleArrayBufferView] required ArrayBufferView code;
// (or BufferSource?)
required Uint32Array code;
};
// 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_SHADER_STAGE_BIT_H_
#define THIRD_PARTY_BLINK_RENDERER_MODULES_WEBGPU_GPU_SHADER_STAGE_BIT_H_
#include "third_party/blink/renderer/platform/bindings/script_wrappable.h"
namespace blink {
class GPUShaderStageBit : public ScriptWrappable {
DEFINE_WRAPPERTYPEINFO();
public:
// gpu_shader_stage_bit.idl
static constexpr uint32_t kNone = 0;
static constexpr uint32_t kVertex = 1;
static constexpr uint32_t kFragment = 2;
static constexpr uint32_t kCompute = 4;
private:
DISALLOW_COPY_AND_ASSIGN(GPUShaderStageBit);
};
} // namespace blink
#endif // THIRD_PARTY_BLINK_RENDERER_MODULES_WEBGPU_GPU_SHADER_STAGE_BIT_H_
// 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://github.com/gpuweb/gpuweb/blob/master/design/sketch.webidl
typedef unsigned long GPUShaderStageFlags;
[
RuntimeEnabled=WebGPU
] interface GPUShaderStageBit {
const unsigned long NONE = 0;
const unsigned long VERTEX = 1;
const unsigned long FRAGMENT = 2;
const unsigned long COMPUTE = 4;
};
// 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://github.com/gpuweb/gpuweb/blob/master/design/sketch.webidl
dictionary GPUStencilStateFaceDescriptor {
GPUCompareFunction compare = "always";
GPUStencilOperation failOp = "keep";
GPUStencilOperation depthFailOp = "keep";
GPUStencilOperation passOp = "keep";
};
enum GPUStencilOperation {
"keep",
"zero",
"replace",
"invert",
"increment-clamp",
"decrement-clamp",
"increment-wrap",
"decrement-wrap"
};
// 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.
#include "third_party/blink/renderer/modules/webgpu/gpu_swap_chain.h"
#include "third_party/blink/renderer/modules/webgpu/gpu_device.h"
namespace blink {
// static
GPUSwapChain* GPUSwapChain::Create(GPUDevice* device,
DawnSwapChain swap_chain) {
return MakeGarbageCollected<GPUSwapChain>(device, swap_chain);
}
GPUSwapChain::GPUSwapChain(GPUDevice* device, DawnSwapChain swap_chain)
: DawnObject<DawnSwapChain>(device, swap_chain) {}
GPUSwapChain::~GPUSwapChain() {
if (IsDawnControlClientDestroyed()) {
return;
}
GetProcs().swapChainRelease(GetHandle());
}
} // namespace blink
// 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_SWAP_CHAIN_H_
#define THIRD_PARTY_BLINK_RENDERER_MODULES_WEBGPU_GPU_SWAP_CHAIN_H_
#include "third_party/blink/renderer/modules/webgpu/dawn_object.h"
namespace blink {
class GPUDevice;
class GPUSwapChain : public DawnObject<DawnSwapChain> {
DEFINE_WRAPPERTYPEINFO();
public:
static GPUSwapChain* Create(GPUDevice* device, DawnSwapChain swap_chain);
explicit GPUSwapChain(GPUDevice* devivce, DawnSwapChain swap_chain);
~GPUSwapChain() override;
// gpu_swap_chain.idl
// TODO(crbug.com/877147): implement GPUSwapChain.
private:
DISALLOW_COPY_AND_ASSIGN(GPUSwapChain);
};
} // namespace blink
#endif // THIRD_PARTY_BLINK_RENDERER_MODULES_WEBGPU_GPU_SWAP_CHAIN_H_
// 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://github.com/gpuweb/gpuweb/blob/master/design/sketch.webidl
[
RuntimeEnabled=WebGPU
] interface GPUSwapChain {
};
// 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://github.com/gpuweb/gpuweb/blob/master/design/sketch.webidl
dictionary GPUSwapChainDescriptor {
required GPUCanvasContext context;
required GPUTextureFormat format;
GPUTextureUsageFlags usage = 16; // GPUTextureUsage.OUTPUT_ATTACHMENT
};
// 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.
#include "third_party/blink/renderer/modules/webgpu/gpu_texture.h"
#include "third_party/blink/renderer/modules/webgpu/gpu_device.h"
namespace blink {
// static
GPUTexture* GPUTexture::Create(GPUDevice* device, DawnTexture texture) {
return MakeGarbageCollected<GPUTexture>(device, texture);
}
GPUTexture::GPUTexture(GPUDevice* device, DawnTexture texture)
: DawnObject<DawnTexture>(device, texture) {}
GPUTexture::~GPUTexture() {
if (IsDawnControlClientDestroyed()) {
return;
}
GetProcs().textureRelease(GetHandle());
}
} // namespace blink
// 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_TEXTURE_H_
#define THIRD_PARTY_BLINK_RENDERER_MODULES_WEBGPU_GPU_TEXTURE_H_
#include "third_party/blink/renderer/modules/webgpu/dawn_object.h"
namespace blink {
class GPUTexture : public DawnObject<DawnTexture> {
DEFINE_WRAPPERTYPEINFO();
public:
static GPUTexture* Create(GPUDevice* device, DawnTexture texture);
explicit GPUTexture(GPUDevice* device, DawnTexture texture);
~GPUTexture() override;
// gpu_texture.idl
// TODO(crbug.com/877147): implement GPUTexture.
private:
DISALLOW_COPY_AND_ASSIGN(GPUTexture);
};
} // namespace blink
#endif // THIRD_PARTY_BLINK_RENDERER_MODULES_WEBGPU_GPU_TEXTURE_H_
// 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://github.com/gpuweb/gpuweb/blob/master/design/sketch.webidl
[
RuntimeEnabled=WebGPU
] interface GPUTexture {
};
// 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://github.com/gpuweb/gpuweb/blob/master/design/sketch.webidl
dictionary GPUTextureCopyView {
required GPUTexture texture;
unsigned long mipLevel = 0;
unsigned long arrayLayer = 0;
required GPUOrigin3D origin;
};
// 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://github.com/gpuweb/gpuweb/blob/master/design/sketch.webidl
dictionary GPUTextureDescriptor {
GPUExtent3D size;
unsigned long arrayLayerCount = 1;
unsigned long mipLevelCount = 1;
unsigned long sampleCount = 1;
GPUTextureDimension dimension = "2d";
required GPUTextureFormat format;
required GPUTextureUsageFlags usage;
};
enum GPUTextureDimension {
"1d",
"2d",
"3d"
};
enum GPUTextureFormat {
/* Normal 8 bit formats */
"r8unorm",
"r8unorm-srgb",
"r8snorm",
"r8uint",
"r8sint",
/* Normal 16 bit formats */
"r16unorm",
"r16snorm",
"r16uint",
"r16sint",
"r16float",
"rg8unorm",
"rg8unorm-srgb",
"rg8snorm",
"rg8uint",
"rg8sint",
/* Packed 16 bit formats */
"b5g6r5unorm",
/* Normal 32 bit formats */
"r32uint",
"r32sint",
"r32float",
"rg16unorm",
"rg16snorm",
"rg16uint",
"rg16sint",
"rg16float",
"rgba8unorm",
"rgba8unorm-srgb",
"rgba8snorm",
"rgba8uint",
"rgba8sint",
"bgra8unorm",
"bgra8unorm-srgb",
/* Packed 32 bit formats */
"rgb10a2unorm",
"rg11b10float",
/* Normal 64 bit formats */
"rg32uint",
"rg32sint",
"rg32float",
"rgba16unorm",
"rgba16snorm",
"rgba16uint",
"rgba16sint",
"rgba16float",
/* Normal 128 bit formats */
"rgba32uint",
"rgba32sint",
"rgba32float",
/* Depth / Stencil formats */
"depth32float",
"depth32float-stencil8",
};
// 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_TEXTURE_USAGE_H_
#define THIRD_PARTY_BLINK_RENDERER_MODULES_WEBGPU_GPU_TEXTURE_USAGE_H_
#include "third_party/blink/renderer/platform/bindings/script_wrappable.h"
namespace blink {
class GPUTextureUsage : public ScriptWrappable {
DEFINE_WRAPPERTYPEINFO();
public:
// gpu_texture_usage.idl
static constexpr uint32_t kNone = 0;
static constexpr uint32_t kTransferSrc = 1;
static constexpr uint32_t kTransferDst = 2;
static constexpr uint32_t kSampled = 4;
static constexpr uint32_t kStorage = 8;
static constexpr uint32_t kOutputAttachment = 16;
private:
DISALLOW_COPY_AND_ASSIGN(GPUTextureUsage);
};
} // namespace blink
#endif // THIRD_PARTY_BLINK_RENDERER_MODULES_WEBGPU_GPU_TEXTURE_USAGE_H_
// 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://github.com/gpuweb/gpuweb/blob/master/design/sketch.webidl
typedef unsigned long GPUTextureUsageFlags;
[
RuntimeEnabled=WebGPU
] interface GPUTextureUsage {
const unsigned long NONE = 0;
const unsigned long TRANSFER_SRC = 1;
const unsigned long TRANSFER_DST = 2;
const unsigned long SAMPLED = 4;
const unsigned long STORAGE = 8;
const unsigned long OUTPUT_ATTACHMENT = 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.
#include "third_party/blink/renderer/modules/webgpu/gpu_texture_view.h"
#include "third_party/blink/renderer/modules/webgpu/gpu_device.h"
namespace blink {
// static
GPUTextureView* GPUTextureView::Create(GPUDevice* device,
DawnTextureView texture_view) {
return MakeGarbageCollected<GPUTextureView>(device, texture_view);
}
GPUTextureView::GPUTextureView(GPUDevice* device, DawnTextureView texture_view)
: DawnObject<DawnTextureView>(device, texture_view) {}
GPUTextureView::~GPUTextureView() {
if (IsDawnControlClientDestroyed()) {
return;
}
GetProcs().textureViewRelease(GetHandle());
}
} // namespace blink
// 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_TEXTURE_VIEW_H_
#define THIRD_PARTY_BLINK_RENDERER_MODULES_WEBGPU_GPU_TEXTURE_VIEW_H_
#include "third_party/blink/renderer/modules/webgpu/dawn_object.h"
namespace blink {
class GPUTextureView : public DawnObject<DawnTextureView> {
DEFINE_WRAPPERTYPEINFO();
public:
static GPUTextureView* Create(GPUDevice* device,
DawnTextureView texture_view);
explicit GPUTextureView(GPUDevice* device, DawnTextureView texture_view);
~GPUTextureView() override;
private:
DISALLOW_COPY_AND_ASSIGN(GPUTextureView);
};
} // namespace blink
#endif // THIRD_PARTY_BLINK_RENDERER_MODULES_WEBGPU_GPU_TEXTURE_VIEW_H_
// 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://github.com/gpuweb/gpuweb/blob/master/design/sketch.webidl
[
RuntimeEnabled=WebGPU
] interface GPUTextureView {
};
// 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://github.com/gpuweb/gpuweb/blob/master/design/sketch.webidl
dictionary GPUTextureViewDescriptor {
required GPUTextureFormat format;
required GPUTextureViewDimension dimension;
required GPUTextureAspect aspect;
unsigned long baseMipLevel = 0;
unsigned long mipLevelCount = 1;
unsigned long baseArrayLayer = 0;
unsigned long arrayLayerCount = 1;
};
enum GPUTextureViewDimension {
"1d",
"2d",
"2d-array",
"cube",
"cube-array",
"3d"
};
enum GPUTextureAspect {
"all",
"stencil-only",
"depth-only"
};
// 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.
#include "third_party/blink/renderer/modules/webgpu/gpu_uncaptured_error_event.h"
#include "third_party/blink/renderer/modules/webgpu/gpu_uncaptured_error_event_init.h"
namespace blink {
// static
GPUUncapturedErrorEvent* GPUUncapturedErrorEvent::Create(
const AtomicString& type,
const GPUUncapturedErrorEventInit* gpuUncapturedErrorEventInitDict) {
return MakeGarbageCollected<GPUUncapturedErrorEvent>(
type, gpuUncapturedErrorEventInitDict);
}
GPUUncapturedErrorEvent::GPUUncapturedErrorEvent(
const AtomicString& type,
const GPUUncapturedErrorEventInit* gpuUncapturedErrorEventInitDict)
: Event(type, Bubbles::kNo, Cancelable::kYes) {}
} // namespace blink
// 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_UNCAPTURED_ERROR_EVENT_H_
#define THIRD_PARTY_BLINK_RENDERER_MODULES_WEBGPU_GPU_UNCAPTURED_ERROR_EVENT_H_
#include "third_party/blink/renderer/modules/event_modules.h"
namespace blink {
class GPUUncapturedErrorEventInit;
class GPUUncapturedErrorEvent : public Event {
DEFINE_WRAPPERTYPEINFO();
public:
static GPUUncapturedErrorEvent* Create(const AtomicString& type,
const GPUUncapturedErrorEventInit*);
GPUUncapturedErrorEvent(const AtomicString& type,
const GPUUncapturedErrorEventInit*);
// gpu_uncaptured_error_event.idl
// TODO(crbug.com/877147): implement GPUUncapturedErrorEvent.
private:
DISALLOW_COPY_AND_ASSIGN(GPUUncapturedErrorEvent);
};
} // namespace blink
#endif // THIRD_PARTY_BLINK_RENDERER_MODULES_WEBGPU_GPU_UNCAPTURED_ERROR_EVENT_H_
// 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://github.com/gpuweb/gpuweb/blob/master/design/sketch.webidl
[
Constructor(DOMString type, GPUUncapturedErrorEventInit gpuUncapturedErrorEventInitDict),
RuntimeEnabled=WebGPU
] interface GPUUncapturedErrorEvent : Event {
};
// 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://github.com/gpuweb/gpuweb/blob/master/design/sketch.webidl
dictionary GPUUncapturedErrorEventInit : EventInit {
required GPUError error;
};
// 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.
#include "third_party/blink/renderer/modules/webgpu/gpu_validation_error.h"
namespace blink {
// static
GPUValidationError* GPUValidationError::Create(const AtomicString& message) {
return MakeGarbageCollected<GPUValidationError>(message);
}
GPUValidationError::GPUValidationError(const AtomicString& message) {
message_ = message;
}
const String& GPUValidationError::message() const {
return message_;
}
} // namespace blink
// 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_VALIDATION_ERROR_H_
#define THIRD_PARTY_BLINK_RENDERER_MODULES_WEBGPU_GPU_VALIDATION_ERROR_H_
#include "third_party/blink/renderer/platform/bindings/script_wrappable.h"
#include "third_party/blink/renderer/platform/wtf/text/wtf_string.h"
namespace blink {
class GPUValidationError : public ScriptWrappable {
DEFINE_WRAPPERTYPEINFO();
public:
static GPUValidationError* Create(const AtomicString& message);
GPUValidationError(const AtomicString& message);
// gpu_validation_error.idl
const String& message() const;
private:
String message_;
DISALLOW_COPY_AND_ASSIGN(GPUValidationError);
};
} // namespace blink
#endif // THIRD_PARTY_BLINK_RENDERER_MODULES_WEBGPU_GPU_VALIDATION_ERROR_H_
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