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,17 +229,23 @@ GPURenderPipeline* GPURenderPipeline::Create(
dawn_desc.fragmentStage = nullptr;
}
DawnVertexInputInfo vertex_input_info;
if (webgpu_desc->hasVertexInput()) {
// TODO(crbug.com/dawn/131): Update Dawn to match WebGPU vertex input
v8::Isolate* isolate = script_state->GetIsolate();
ExceptionState exception_state(isolate, ExceptionState::kConstructionContext,
ExceptionState exception_state(isolate,
ExceptionState::kConstructionContext,
"GPUVertexInputDescriptor");
DawnVertexInputInfo vertex_input_info = GPUVertexInputAsDawnInputState(
vertex_input_info = GPUVertexInputAsDawnInputState(
isolate, webgpu_desc->vertexInput(), exception_state);
dawn_desc.vertexInput = &std::get<0>(vertex_input_info);
if (exception_state.HadException()) {
return nullptr;
}
} else {
dawn_desc.vertexInput = nullptr;
}
dawn_desc.primitiveTopology =
AsDawnEnum<DawnPrimitiveTopology>(webgpu_desc->primitiveTopology());
......
......@@ -12,7 +12,7 @@ dictionary GPURenderPipelineDescriptor : GPUPipelineDescriptorBase {
GPURasterizationStateDescriptor rasterizationState;
required sequence<GPUColorStateDescriptor> colorStates;
GPUDepthStencilStateDescriptor depthStencilState;
required GPUVertexInputDescriptor vertexInput;
GPUVertexInputDescriptor vertexInput;
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