Commit 1f78663b authored by François Beaufort's avatar François Beaufort Committed by Commit Bot

[WebGPU] Do not require vertexInput in GPURenderPipelineDescriptor

Following WebGPU spec change at https://github.com/gpuweb/gpuweb/issues/378,
vertexInput descriptor from GPURenderPipelineDescriptor should not be
required anymore.

Bug: 877147
Change-Id: Ifdd0ba7ff6af2b8648ad45d029e5ef7b8484f8a8
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1776023
Commit-Queue: François Beaufort <beaufort.francois@gmail.com>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: default avatarCorentin Wallez <cwallez@chromium.org>
Cr-Commit-Position: refs/heads/master@{#691978}
parent 77a9983d
...@@ -229,16 +229,22 @@ GPURenderPipeline* GPURenderPipeline::Create( ...@@ -229,16 +229,22 @@ GPURenderPipeline* GPURenderPipeline::Create(
dawn_desc.fragmentStage = nullptr; dawn_desc.fragmentStage = nullptr;
} }
// TODO(crbug.com/dawn/131): Update Dawn to match WebGPU vertex input DawnVertexInputInfo vertex_input_info;
v8::Isolate* isolate = script_state->GetIsolate(); if (webgpu_desc->hasVertexInput()) {
ExceptionState exception_state(isolate, ExceptionState::kConstructionContext, // TODO(crbug.com/dawn/131): Update Dawn to match WebGPU vertex input
"GPUVertexInputDescriptor"); v8::Isolate* isolate = script_state->GetIsolate();
DawnVertexInputInfo vertex_input_info = GPUVertexInputAsDawnInputState( ExceptionState exception_state(isolate,
isolate, webgpu_desc->vertexInput(), exception_state); ExceptionState::kConstructionContext,
dawn_desc.vertexInput = &std::get<0>(vertex_input_info); "GPUVertexInputDescriptor");
vertex_input_info = GPUVertexInputAsDawnInputState(
if (exception_state.HadException()) { isolate, webgpu_desc->vertexInput(), exception_state);
return nullptr; dawn_desc.vertexInput = &std::get<0>(vertex_input_info);
if (exception_state.HadException()) {
return nullptr;
}
} else {
dawn_desc.vertexInput = nullptr;
} }
dawn_desc.primitiveTopology = dawn_desc.primitiveTopology =
......
...@@ -12,7 +12,7 @@ dictionary GPURenderPipelineDescriptor : GPUPipelineDescriptorBase { ...@@ -12,7 +12,7 @@ dictionary GPURenderPipelineDescriptor : GPUPipelineDescriptorBase {
GPURasterizationStateDescriptor rasterizationState; GPURasterizationStateDescriptor rasterizationState;
required sequence<GPUColorStateDescriptor> colorStates; required sequence<GPUColorStateDescriptor> colorStates;
GPUDepthStencilStateDescriptor depthStencilState; GPUDepthStencilStateDescriptor depthStencilState;
required GPUVertexInputDescriptor vertexInput; GPUVertexInputDescriptor vertexInput;
unsigned long sampleCount = 1; unsigned long sampleCount = 1;
......
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