Commit 01d19807 authored by Jiawei Shao's avatar Jiawei Shao Committed by Chromium LUCI CQ

[WebGPU] Add the entry point of CreateReadyRenderPipeline

BUG=dawn:529

Change-Id: I9cae2840f7e653372d9434a2d8a9ea386ede988b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2574062
Commit-Queue: Jiawei Shao <jiawei.shao@intel.com>
Reviewed-by: default avatarCorentin Wallez <cwallez@chromium.org>
Cr-Commit-Position: refs/heads/master@{#834653}
parent 8cc902d8
...@@ -149,6 +149,33 @@ void GPUDevice::OnDeviceLostError(const char* message) { ...@@ -149,6 +149,33 @@ void GPUDevice::OnDeviceLostError(const char* message) {
} }
} }
void GPUDevice::OnCreateReadyRenderPipelineCallback(
ScriptPromiseResolver* resolver,
WGPUCreateReadyPipelineStatus status,
WGPURenderPipeline render_pipeline,
const char* message) {
switch (status) {
case WGPUCreateReadyPipelineStatus_Success: {
resolver->Resolve(
MakeGarbageCollected<GPURenderPipeline>(this, render_pipeline));
break;
}
case WGPUCreateReadyPipelineStatus_Error:
case WGPUCreateReadyPipelineStatus_DeviceLost:
case WGPUCreateReadyPipelineStatus_DeviceDestroyed:
case WGPUCreateReadyPipelineStatus_Unknown: {
resolver->Reject(MakeGarbageCollected<DOMException>(
DOMExceptionCode::kOperationError, message));
break;
}
default: {
NOTREACHED();
}
}
}
void GPUDevice::OnCreateReadyComputePipelineCallback( void GPUDevice::OnCreateReadyComputePipelineCallback(
ScriptPromiseResolver* resolver, ScriptPromiseResolver* resolver,
WGPUCreateReadyPipelineStatus status, WGPUCreateReadyPipelineStatus status,
...@@ -239,6 +266,36 @@ GPUComputePipeline* GPUDevice::createComputePipeline( ...@@ -239,6 +266,36 @@ GPUComputePipeline* GPUDevice::createComputePipeline(
return GPUComputePipeline::Create(this, descriptor); return GPUComputePipeline::Create(this, descriptor);
} }
ScriptPromise GPUDevice::createReadyRenderPipeline(
ScriptState* script_state,
const GPURenderPipelineDescriptor* descriptor) {
auto* resolver = MakeGarbageCollected<ScriptPromiseResolver>(script_state);
ScriptPromise promise = resolver->Promise();
OwnedRenderPipelineDescriptor dawn_desc_info;
v8::Isolate* isolate = script_state->GetIsolate();
ExceptionState exception_state(isolate, ExceptionState::kConstructionContext,
"GPUVertexStateDescriptor");
ConvertToDawnType(isolate, descriptor, &dawn_desc_info, exception_state);
if (exception_state.HadException()) {
resolver->Reject(MakeGarbageCollected<DOMException>(
DOMExceptionCode::kOperationError,
"Error in parsing GPURenderPipelineDescriptor"));
} else {
auto* callback =
BindDawnCallback(&GPUDevice::OnCreateReadyRenderPipelineCallback,
WrapPersistent(this), WrapPersistent(resolver));
GetProcs().deviceCreateReadyRenderPipeline(
GetHandle(), &dawn_desc_info.dawn_desc, callback->UnboundCallback(),
callback->AsUserdata());
}
// WebGPU guarantees that promises are resolved in finite time so we need to
// ensure commands are flushed.
EnsureFlush();
return promise;
}
ScriptPromise GPUDevice::createReadyComputePipeline( ScriptPromise GPUDevice::createReadyComputePipeline(
ScriptState* script_state, ScriptState* script_state,
const GPUComputePipelineDescriptor* descriptor) { const GPUComputePipelineDescriptor* descriptor) {
......
...@@ -92,6 +92,9 @@ class GPUDevice final : public EventTargetWithInlineData, ...@@ -92,6 +92,9 @@ class GPUDevice final : public EventTargetWithInlineData,
const GPURenderPipelineDescriptor* descriptor); const GPURenderPipelineDescriptor* descriptor);
GPUComputePipeline* createComputePipeline( GPUComputePipeline* createComputePipeline(
const GPUComputePipelineDescriptor* descriptor); const GPUComputePipelineDescriptor* descriptor);
ScriptPromise createReadyRenderPipeline(
ScriptState* script_state,
const GPURenderPipelineDescriptor* descriptor);
ScriptPromise createReadyComputePipeline( ScriptPromise createReadyComputePipeline(
ScriptState* script_state, ScriptState* script_state,
const GPUComputePipelineDescriptor* descriptor); const GPUComputePipelineDescriptor* descriptor);
...@@ -126,6 +129,10 @@ class GPUDevice final : public EventTargetWithInlineData, ...@@ -126,6 +129,10 @@ class GPUDevice final : public EventTargetWithInlineData,
WGPUErrorType type, WGPUErrorType type,
const char* message); const char* message);
void OnCreateReadyRenderPipelineCallback(ScriptPromiseResolver* resolver,
WGPUCreateReadyPipelineStatus status,
WGPURenderPipeline render_pipeline,
const char* message);
void OnCreateReadyComputePipelineCallback( void OnCreateReadyComputePipelineCallback(
ScriptPromiseResolver* resolver, ScriptPromiseResolver* resolver,
WGPUCreateReadyPipelineStatus status, WGPUCreateReadyPipelineStatus status,
......
...@@ -25,6 +25,7 @@ ...@@ -25,6 +25,7 @@
[CallWith=ScriptState] GPURenderPipeline createRenderPipeline(GPURenderPipelineDescriptor descriptor); [CallWith=ScriptState] GPURenderPipeline createRenderPipeline(GPURenderPipelineDescriptor descriptor);
GPUComputePipeline createComputePipeline(GPUComputePipelineDescriptor descriptor); GPUComputePipeline createComputePipeline(GPUComputePipelineDescriptor descriptor);
[CallWith=ScriptState] Promise<GPURenderPipeline?> createReadyRenderPipeline(GPURenderPipelineDescriptor descriptor);
[CallWith=ScriptState] Promise<GPUComputePipeline?> createReadyComputePipeline(GPUComputePipelineDescriptor descriptor); [CallWith=ScriptState] Promise<GPUComputePipeline?> createReadyComputePipeline(GPUComputePipelineDescriptor descriptor);
GPUCommandEncoder createCommandEncoder(optional GPUCommandEncoderDescriptor descriptor = {}); GPUCommandEncoder createCommandEncoder(optional GPUCommandEncoderDescriptor descriptor = {});
......
...@@ -14,7 +14,6 @@ ...@@ -14,7 +14,6 @@
#include "third_party/blink/renderer/bindings/modules/v8/v8_gpu_vertex_attribute_descriptor.h" #include "third_party/blink/renderer/bindings/modules/v8/v8_gpu_vertex_attribute_descriptor.h"
#include "third_party/blink/renderer/bindings/modules/v8/v8_gpu_vertex_buffer_layout_descriptor.h" #include "third_party/blink/renderer/bindings/modules/v8/v8_gpu_vertex_buffer_layout_descriptor.h"
#include "third_party/blink/renderer/bindings/modules/v8/v8_gpu_vertex_state_descriptor.h" #include "third_party/blink/renderer/bindings/modules/v8/v8_gpu_vertex_state_descriptor.h"
#include "third_party/blink/renderer/modules/webgpu/dawn_conversions.h"
#include "third_party/blink/renderer/modules/webgpu/gpu_bind_group_layout.h" #include "third_party/blink/renderer/modules/webgpu/gpu_bind_group_layout.h"
#include "third_party/blink/renderer/modules/webgpu/gpu_device.h" #include "third_party/blink/renderer/modules/webgpu/gpu_device.h"
#include "third_party/blink/renderer/modules/webgpu/gpu_pipeline_layout.h" #include "third_party/blink/renderer/modules/webgpu/gpu_pipeline_layout.h"
...@@ -88,22 +87,24 @@ WGPUDepthStencilStateDescriptor AsDawnType( ...@@ -88,22 +87,24 @@ WGPUDepthStencilStateDescriptor AsDawnType(
return dawn_desc; return dawn_desc;
} }
using WGPUVertexStateInfo = std::tuple<WGPUVertexStateDescriptor, void GPUVertexStateAsWGPUVertexState(
Vector<WGPUVertexBufferLayoutDescriptor>,
Vector<WGPUVertexAttributeDescriptor>>;
WGPUVertexStateInfo GPUVertexStateAsWGPUVertexState(
v8::Isolate* isolate, v8::Isolate* isolate,
const GPUVertexStateDescriptor* descriptor, const GPUVertexStateDescriptor* descriptor,
WGPUVertexStateDescriptor* dawn_desc,
Vector<WGPUVertexBufferLayoutDescriptor>* dawn_vertex_buffers,
Vector<WGPUVertexAttributeDescriptor>* dawn_vertex_attributes,
ExceptionState& exception_state) { ExceptionState& exception_state) {
WGPUVertexStateDescriptor dawn_desc = {}; DCHECK(isolate);
dawn_desc.indexFormat = DCHECK(descriptor);
DCHECK(dawn_desc);
DCHECK(dawn_vertex_buffers);
DCHECK(dawn_vertex_attributes);
*dawn_desc = {};
dawn_desc->indexFormat =
AsDawnEnum<WGPUIndexFormat>(descriptor->indexFormat()); AsDawnEnum<WGPUIndexFormat>(descriptor->indexFormat());
dawn_desc.vertexBufferCount = 0; dawn_desc->vertexBufferCount = 0;
dawn_desc.vertexBuffers = nullptr; dawn_desc->vertexBuffers = nullptr;
Vector<WGPUVertexBufferLayoutDescriptor> dawn_vertex_buffers;
Vector<WGPUVertexAttributeDescriptor> dawn_vertex_attributes;
if (descriptor->hasVertexBuffers()) { if (descriptor->hasVertexBuffers()) {
// TODO(crbug.com/951629): Use a sequence of nullable descriptors. // TODO(crbug.com/951629): Use a sequence of nullable descriptors.
...@@ -111,9 +112,7 @@ WGPUVertexStateInfo GPUVertexStateAsWGPUVertexState( ...@@ -111,9 +112,7 @@ WGPUVertexStateInfo GPUVertexStateAsWGPUVertexState(
descriptor->vertexBuffers().V8Value(); descriptor->vertexBuffers().V8Value();
if (!vertex_buffers_value->IsArray()) { if (!vertex_buffers_value->IsArray()) {
exception_state.ThrowTypeError("vertexBuffers must be an array"); exception_state.ThrowTypeError("vertexBuffers must be an array");
return;
return std::make_tuple(dawn_desc, std::move(dawn_vertex_buffers),
std::move(dawn_vertex_attributes));
} }
v8::Local<v8::Context> context = isolate->GetCurrentContext(); v8::Local<v8::Context> context = isolate->GetCurrentContext();
...@@ -135,7 +134,7 @@ WGPUVertexStateInfo GPUVertexStateAsWGPUVertexState( ...@@ -135,7 +134,7 @@ WGPUVertexStateInfo GPUVertexStateAsWGPUVertexState(
dawn_vertex_buffer.stepMode = WGPUInputStepMode_Vertex; dawn_vertex_buffer.stepMode = WGPUInputStepMode_Vertex;
dawn_vertex_buffer.attributeCount = 0; dawn_vertex_buffer.attributeCount = 0;
dawn_vertex_buffer.attributes = nullptr; dawn_vertex_buffer.attributes = nullptr;
dawn_vertex_buffers.push_back(dawn_vertex_buffer); dawn_vertex_buffers->push_back(dawn_vertex_buffer);
continue; continue;
} }
...@@ -143,8 +142,7 @@ WGPUVertexStateInfo GPUVertexStateAsWGPUVertexState( ...@@ -143,8 +142,7 @@ WGPUVertexStateInfo GPUVertexStateAsWGPUVertexState(
NativeValueTraits<GPUVertexBufferLayoutDescriptor>::NativeValue( NativeValueTraits<GPUVertexBufferLayoutDescriptor>::NativeValue(
isolate, value, exception_state); isolate, value, exception_state);
if (exception_state.HadException()) { if (exception_state.HadException()) {
return std::make_tuple(dawn_desc, std::move(dawn_vertex_buffers), return;
std::move(dawn_vertex_attributes));
} }
WGPUVertexBufferLayoutDescriptor dawn_vertex_buffer = {}; WGPUVertexBufferLayoutDescriptor dawn_vertex_buffer = {};
...@@ -154,7 +152,7 @@ WGPUVertexStateInfo GPUVertexStateAsWGPUVertexState( ...@@ -154,7 +152,7 @@ WGPUVertexStateInfo GPUVertexStateAsWGPUVertexState(
dawn_vertex_buffer.attributeCount = dawn_vertex_buffer.attributeCount =
static_cast<uint32_t>(vertex_buffer->attributes().size()); static_cast<uint32_t>(vertex_buffer->attributes().size());
dawn_vertex_buffer.attributes = nullptr; dawn_vertex_buffer.attributes = nullptr;
dawn_vertex_buffers.push_back(dawn_vertex_buffer); dawn_vertex_buffers->push_back(dawn_vertex_buffer);
for (wtf_size_t j = 0; j < vertex_buffer->attributes().size(); ++j) { for (wtf_size_t j = 0; j < vertex_buffer->attributes().size(); ++j) {
const GPUVertexAttributeDescriptor* attribute = const GPUVertexAttributeDescriptor* attribute =
...@@ -164,7 +162,7 @@ WGPUVertexStateInfo GPUVertexStateAsWGPUVertexState( ...@@ -164,7 +162,7 @@ WGPUVertexStateInfo GPUVertexStateAsWGPUVertexState(
dawn_vertex_attribute.offset = attribute->offset(); dawn_vertex_attribute.offset = attribute->offset();
dawn_vertex_attribute.format = dawn_vertex_attribute.format =
AsDawnEnum<WGPUVertexFormat>(attribute->format()); AsDawnEnum<WGPUVertexFormat>(attribute->format());
dawn_vertex_attributes.push_back(dawn_vertex_attribute); dawn_vertex_attributes->push_back(dawn_vertex_attribute);
} }
} }
...@@ -172,21 +170,18 @@ WGPUVertexStateInfo GPUVertexStateAsWGPUVertexState( ...@@ -172,21 +170,18 @@ WGPUVertexStateInfo GPUVertexStateAsWGPUVertexState(
// after we stopped appending to the vector so the pointers aren't // after we stopped appending to the vector so the pointers aren't
// invalidated. // invalidated.
uint32_t attributeIndex = 0; uint32_t attributeIndex = 0;
for (WGPUVertexBufferLayoutDescriptor& buffer : dawn_vertex_buffers) { for (WGPUVertexBufferLayoutDescriptor& buffer : *dawn_vertex_buffers) {
if (buffer.attributeCount == 0) { if (buffer.attributeCount == 0) {
continue; continue;
} }
buffer.attributes = &dawn_vertex_attributes[attributeIndex]; buffer.attributes = &(*dawn_vertex_attributes)[attributeIndex];
attributeIndex += buffer.attributeCount; attributeIndex += buffer.attributeCount;
} }
} }
dawn_desc.vertexBufferCount = dawn_desc->vertexBufferCount =
static_cast<uint32_t>(dawn_vertex_buffers.size()); static_cast<uint32_t>(dawn_vertex_buffers->size());
dawn_desc.vertexBuffers = dawn_vertex_buffers.data(); dawn_desc->vertexBuffers = dawn_vertex_buffers->data();
return std::make_tuple(dawn_desc, std::move(dawn_vertex_buffers),
std::move(dawn_vertex_attributes));
} }
WGPURasterizationStateDescriptor AsDawnType( WGPURasterizationStateDescriptor AsDawnType(
...@@ -206,79 +201,89 @@ WGPURasterizationStateDescriptor AsDawnType( ...@@ -206,79 +201,89 @@ WGPURasterizationStateDescriptor AsDawnType(
} // anonymous namespace } // anonymous namespace
// static void ConvertToDawnType(v8::Isolate* isolate,
GPURenderPipeline* GPURenderPipeline::Create( const GPURenderPipelineDescriptor* webgpu_desc,
ScriptState* script_state, OwnedRenderPipelineDescriptor* dawn_desc_info,
GPUDevice* device, ExceptionState& exception_state) {
const GPURenderPipelineDescriptor* webgpu_desc) { DCHECK(isolate);
DCHECK(device);
DCHECK(webgpu_desc); DCHECK(webgpu_desc);
DCHECK(dawn_desc_info);
GPUVertexStateAsWGPUVertexState(
isolate, webgpu_desc->vertexState(), &dawn_desc_info->vertex_state,
&dawn_desc_info->vertex_buffer_layouts,
&dawn_desc_info->vertex_attributes, exception_state);
if (exception_state.HadException()) {
return;
}
dawn_desc_info->dawn_desc.vertexState = &dawn_desc_info->vertex_state;
std::string label;
WGPURenderPipelineDescriptor dawn_desc = {};
dawn_desc.nextInChain = nullptr;
if (webgpu_desc->hasLayout()) { if (webgpu_desc->hasLayout()) {
dawn_desc.layout = AsDawnType(webgpu_desc->layout()); dawn_desc_info->dawn_desc.layout = AsDawnType(webgpu_desc->layout());
} }
if (webgpu_desc->hasLabel()) { if (webgpu_desc->hasLabel()) {
label = webgpu_desc->label().Utf8(); dawn_desc_info->label = webgpu_desc->label().Utf8();
dawn_desc.label = label.c_str(); dawn_desc_info->dawn_desc.label = dawn_desc_info->label.c_str();
} }
OwnedProgrammableStageDescriptor vertex_stage_info = dawn_desc_info->vertex_stage_info = AsDawnType(webgpu_desc->vertexStage());
AsDawnType(webgpu_desc->vertexStage()); dawn_desc_info->dawn_desc.vertexStage =
dawn_desc.vertexStage = std::get<0>(vertex_stage_info); std::get<0>(dawn_desc_info->vertex_stage_info);
OwnedProgrammableStageDescriptor fragment_stage_info;
if (webgpu_desc->hasFragmentStage()) { if (webgpu_desc->hasFragmentStage()) {
fragment_stage_info = AsDawnType(webgpu_desc->fragmentStage()); dawn_desc_info->fragment_stage_info =
dawn_desc.fragmentStage = &std::get<0>(fragment_stage_info); AsDawnType(webgpu_desc->fragmentStage());
} else { dawn_desc_info->dawn_desc.fragmentStage =
dawn_desc.fragmentStage = nullptr; &std::get<0>(dawn_desc_info->fragment_stage_info);
} }
dawn_desc.primitiveTopology = dawn_desc_info->dawn_desc.primitiveTopology =
AsDawnEnum<WGPUPrimitiveTopology>(webgpu_desc->primitiveTopology()); AsDawnEnum<WGPUPrimitiveTopology>(webgpu_desc->primitiveTopology());
v8::Isolate* isolate = script_state->GetIsolate(); dawn_desc_info->rasterization_state =
ExceptionState exception_state(isolate, ExceptionState::kConstructionContext, AsDawnType(webgpu_desc->rasterizationState());
"GPUVertexStateDescriptor"); dawn_desc_info->dawn_desc.rasterizationState =
WGPUVertexStateInfo vertex_state_info = GPUVertexStateAsWGPUVertexState( &dawn_desc_info->rasterization_state;
isolate, webgpu_desc->vertexState(), exception_state);
WGPUVertexStateDescriptor dawn_vertex_state = std::get<0>(vertex_state_info);
dawn_desc.vertexState = &dawn_vertex_state;
if (exception_state.HadException()) { dawn_desc_info->dawn_desc.sampleCount = webgpu_desc->sampleCount();
return nullptr;
}
WGPURasterizationStateDescriptor rasterization_state;
rasterization_state = AsDawnType(webgpu_desc->rasterizationState());
dawn_desc.rasterizationState = &rasterization_state;
dawn_desc.sampleCount = webgpu_desc->sampleCount();
WGPUDepthStencilStateDescriptor depth_stencil_state = {};
if (webgpu_desc->hasDepthStencilState()) { if (webgpu_desc->hasDepthStencilState()) {
depth_stencil_state = AsDawnType(webgpu_desc->depthStencilState()); dawn_desc_info->depth_stencil_state =
dawn_desc.depthStencilState = &depth_stencil_state; AsDawnType(webgpu_desc->depthStencilState());
} else { dawn_desc_info->dawn_desc.depthStencilState =
dawn_desc.depthStencilState = nullptr; &dawn_desc_info->depth_stencil_state;
} }
std::unique_ptr<WGPUColorStateDescriptor[]> color_states = dawn_desc_info->color_states = AsDawnType(webgpu_desc->colorStates());
AsDawnType(webgpu_desc->colorStates()); dawn_desc_info->dawn_desc.colorStateCount =
dawn_desc.colorStateCount =
static_cast<uint32_t>(webgpu_desc->colorStates().size()); static_cast<uint32_t>(webgpu_desc->colorStates().size());
dawn_desc_info->dawn_desc.colorStates = dawn_desc_info->color_states.get();
dawn_desc.colorStates = color_states.get(); dawn_desc_info->dawn_desc.sampleMask = webgpu_desc->sampleMask();
dawn_desc_info->dawn_desc.alphaToCoverageEnabled =
webgpu_desc->alphaToCoverageEnabled();
}
// static
GPURenderPipeline* GPURenderPipeline::Create(
ScriptState* script_state,
GPUDevice* device,
const GPURenderPipelineDescriptor* webgpu_desc) {
DCHECK(device);
DCHECK(webgpu_desc);
dawn_desc.sampleMask = webgpu_desc->sampleMask(); OwnedRenderPipelineDescriptor dawn_desc_info;
dawn_desc.alphaToCoverageEnabled = webgpu_desc->alphaToCoverageEnabled(); v8::Isolate* isolate = script_state->GetIsolate();
ExceptionState exception_state(isolate, ExceptionState::kConstructionContext,
"GPUVertexStateDescriptor");
ConvertToDawnType(isolate, webgpu_desc, &dawn_desc_info, exception_state);
if (exception_state.HadException()) {
return nullptr;
}
return MakeGarbageCollected<GPURenderPipeline>( return MakeGarbageCollected<GPURenderPipeline>(
device, device->GetProcs().deviceCreateRenderPipeline(device->GetHandle(), device, device->GetProcs().deviceCreateRenderPipeline(
&dawn_desc)); device->GetHandle(), &dawn_desc_info.dawn_desc));
} }
GPURenderPipeline::GPURenderPipeline(GPUDevice* device, GPURenderPipeline::GPURenderPipeline(GPUDevice* device,
......
...@@ -5,14 +5,47 @@ ...@@ -5,14 +5,47 @@
#ifndef THIRD_PARTY_BLINK_RENDERER_MODULES_WEBGPU_GPU_RENDER_PIPELINE_H_ #ifndef THIRD_PARTY_BLINK_RENDERER_MODULES_WEBGPU_GPU_RENDER_PIPELINE_H_
#define 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_conversions.h"
#include "third_party/blink/renderer/modules/webgpu/dawn_object.h" #include "third_party/blink/renderer/modules/webgpu/dawn_object.h"
namespace blink { namespace blink {
class GPUBindGroupLayout; class GPUBindGroupLayout;
class GPURenderPipelineDescriptor; class GPURenderPipelineDescriptor;
class ExceptionState;
class ScriptState; class ScriptState;
struct OwnedRenderPipelineDescriptor {
public:
OwnedRenderPipelineDescriptor() : dawn_desc({}) {}
// This struct should be non-copyable non-movable because it contains
// self-referencing pointers that would be invalidated when moved / copied.
OwnedRenderPipelineDescriptor(const OwnedRenderPipelineDescriptor& desc) =
delete;
OwnedRenderPipelineDescriptor(OwnedRenderPipelineDescriptor&& desc) = delete;
OwnedRenderPipelineDescriptor& operator=(
const OwnedRenderPipelineDescriptor& desc) = delete;
OwnedRenderPipelineDescriptor& operator=(
OwnedRenderPipelineDescriptor&& desc) = delete;
WGPURenderPipelineDescriptor dawn_desc;
std::string label;
OwnedProgrammableStageDescriptor vertex_stage_info;
OwnedProgrammableStageDescriptor fragment_stage_info;
WGPUVertexStateDescriptor vertex_state;
Vector<WGPUVertexBufferLayoutDescriptor> vertex_buffer_layouts;
Vector<WGPUVertexAttributeDescriptor> vertex_attributes;
WGPURasterizationStateDescriptor rasterization_state;
WGPUDepthStencilStateDescriptor depth_stencil_state;
std::unique_ptr<WGPUColorStateDescriptor[]> color_states;
};
void ConvertToDawnType(v8::Isolate* isolate,
const GPURenderPipelineDescriptor* webgpu_desc,
OwnedRenderPipelineDescriptor* dawn_desc_info,
ExceptionState& exception_state);
class GPURenderPipeline : public DawnObject<WGPURenderPipeline> { class GPURenderPipeline : public DawnObject<WGPURenderPipeline> {
DEFINE_WRAPPERTYPEINFO(); DEFINE_WRAPPERTYPEINFO();
......
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