Commit 616391e5 authored by Austin Eng's avatar Austin Eng Committed by Commit Bot

Update GPURenderPipeline::Create descriptor conversion to match Dawn API changes

This change rolls Dawn and updates Blink code to match the API.

Roll src/third_party/dawn 820a04b9ce6b..eea209106803 (1 commit)

https://dawn.googlesource.com/dawn.git/+log/820a04b9ce6b..eea209106803

git log 820a04b9ce6b..eea209106803 --date=short --no-merges --format='%ad %ae %s'
2019-05-22 yunchao.he@intel.com Update VertexInput (InputState) to match spec - Part 1

CQ_INCLUDE_TRYBOTS=luci.chromium.try:dawn-linux-x64-deps-rel;luci.chromium.try:dawn-mac-x64-deps-rel;luci.chromium.try:dawn-win10-x64-deps-rel;luci.chromium.try:dawn-win10-x86-deps-rel

Bug: dawn:80, dawn:107
Change-Id: I99e03eb6c57999e9f5a238f2747325def22aa65c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1627944Reviewed-by: default avatarKai Ninomiya <kainino@chromium.org>
Reviewed-by: default avatarCorentin Wallez <cwallez@chromium.org>
Commit-Queue: Austin Eng <enga@chromium.org>
Cr-Commit-Position: refs/heads/master@{#662866}
parent 61af1bec
...@@ -273,7 +273,7 @@ vars = { ...@@ -273,7 +273,7 @@ vars = {
# Three lines of non-changing comments so that # Three lines of non-changing comments so that
# the commit queue can handle CLs rolling feed # the commit queue can handle CLs rolling feed
# and whatever else without interference from each other. # and whatever else without interference from each other.
'dawn_revision': '820a04b9ce6b4c9b21ad10e0e7a5a5e718b8a6db', 'dawn_revision': 'eea2091068037c41e52164f100802302768b674d',
# Three lines of non-changing comments so that # Three lines of non-changing comments so that
# the commit queue can handle CLs rolling feed # the commit queue can handle CLs rolling feed
# and whatever else without interference from each other. # and whatever else without interference from each other.
......
...@@ -84,23 +84,23 @@ DawnDepthStencilStateDescriptor AsDawnType( ...@@ -84,23 +84,23 @@ DawnDepthStencilStateDescriptor AsDawnType(
return dawn_desc; return dawn_desc;
} }
using DawnInputStateInfo = std::tuple<DawnInputStateDescriptor, using DawnVertexInputInfo = std::tuple<DawnVertexInputDescriptor,
Vector<DawnVertexInputDescriptor>, Vector<DawnVertexBufferDescriptor>,
Vector<DawnVertexAttributeDescriptor>>; Vector<DawnVertexAttributeDescriptor>>;
DawnInputStateInfo GPUVertexInputAsDawnInputState( DawnVertexInputInfo GPUVertexInputAsDawnInputState(
v8::Isolate* isolate, v8::Isolate* isolate,
const GPUVertexInputDescriptor* descriptor, const GPUVertexInputDescriptor* descriptor,
ExceptionState& exception_state) { ExceptionState& exception_state) {
DawnInputStateDescriptor dawn_desc; DawnVertexInputDescriptor dawn_desc;
dawn_desc.indexFormat = dawn_desc.indexFormat =
AsDawnEnum<DawnIndexFormat>(descriptor->indexFormat()); AsDawnEnum<DawnIndexFormat>(descriptor->indexFormat());
dawn_desc.numAttributes = 0; dawn_desc.numAttributes = 0;
dawn_desc.attributes = nullptr; dawn_desc.attributes = nullptr;
dawn_desc.numInputs = 0; dawn_desc.numBuffers = 0;
dawn_desc.inputs = nullptr; dawn_desc.buffers = nullptr;
Vector<DawnVertexInputDescriptor> dawn_vertex_inputs; Vector<DawnVertexBufferDescriptor> dawn_vertex_buffers;
Vector<DawnVertexAttributeDescriptor> dawn_vertex_attributes; Vector<DawnVertexAttributeDescriptor> dawn_vertex_attributes;
if (descriptor->hasVertexBuffers()) { if (descriptor->hasVertexBuffers()) {
...@@ -110,7 +110,7 @@ DawnInputStateInfo GPUVertexInputAsDawnInputState( ...@@ -110,7 +110,7 @@ DawnInputStateInfo GPUVertexInputAsDawnInputState(
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 std::make_tuple(dawn_desc, std::move(dawn_vertex_inputs), return std::make_tuple(dawn_desc, std::move(dawn_vertex_buffers),
std::move(dawn_vertex_attributes)); std::move(dawn_vertex_attributes));
} }
...@@ -129,16 +129,16 @@ DawnInputStateInfo GPUVertexInputAsDawnInputState( ...@@ -129,16 +129,16 @@ DawnInputStateInfo GPUVertexInputAsDawnInputState(
V8GPUVertexBufferDescriptor::ToImpl(isolate, value, &vertex_buffer, V8GPUVertexBufferDescriptor::ToImpl(isolate, value, &vertex_buffer,
exception_state); exception_state);
if (exception_state.HadException()) { if (exception_state.HadException()) {
return std::make_tuple(dawn_desc, std::move(dawn_vertex_inputs), return std::make_tuple(dawn_desc, std::move(dawn_vertex_buffers),
std::move(dawn_vertex_attributes)); std::move(dawn_vertex_attributes));
} }
DawnVertexInputDescriptor dawn_vertex_input; DawnVertexBufferDescriptor dawn_vertex_buffer;
dawn_vertex_input.inputSlot = i; dawn_vertex_buffer.inputSlot = i;
dawn_vertex_input.stride = vertex_buffer.stride(); dawn_vertex_buffer.stride = vertex_buffer.stride();
dawn_vertex_input.stepMode = dawn_vertex_buffer.stepMode =
AsDawnEnum<DawnInputStepMode>(vertex_buffer.stepMode()); AsDawnEnum<DawnInputStepMode>(vertex_buffer.stepMode());
dawn_vertex_inputs.push_back(dawn_vertex_input); 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 =
...@@ -157,10 +157,10 @@ DawnInputStateInfo GPUVertexInputAsDawnInputState( ...@@ -157,10 +157,10 @@ DawnInputStateInfo GPUVertexInputAsDawnInputState(
dawn_desc.numAttributes = dawn_desc.numAttributes =
static_cast<uint32_t>(dawn_vertex_attributes.size()); static_cast<uint32_t>(dawn_vertex_attributes.size());
dawn_desc.attributes = dawn_vertex_attributes.data(); dawn_desc.attributes = dawn_vertex_attributes.data();
dawn_desc.numInputs = static_cast<uint32_t>(dawn_vertex_inputs.size()); dawn_desc.numBuffers = static_cast<uint32_t>(dawn_vertex_buffers.size());
dawn_desc.inputs = dawn_vertex_inputs.data(); dawn_desc.buffers = dawn_vertex_buffers.data();
return std::make_tuple(dawn_desc, std::move(dawn_vertex_inputs), return std::make_tuple(dawn_desc, std::move(dawn_vertex_buffers),
std::move(dawn_vertex_attributes)); std::move(dawn_vertex_attributes));
} }
...@@ -207,9 +207,9 @@ GPURenderPipeline* GPURenderPipeline::Create( ...@@ -207,9 +207,9 @@ GPURenderPipeline* GPURenderPipeline::Create(
v8::Isolate* isolate = script_state->GetIsolate(); v8::Isolate* isolate = script_state->GetIsolate();
ExceptionState exception_state(isolate, ExceptionState::kConstructionContext, ExceptionState exception_state(isolate, ExceptionState::kConstructionContext,
"GPUVertexInputDescriptor"); "GPUVertexInputDescriptor");
DawnInputStateInfo input_state_info = GPUVertexInputAsDawnInputState( DawnVertexInputInfo vertex_input_info = GPUVertexInputAsDawnInputState(
isolate, webgpu_desc->vertexInput(), exception_state); isolate, webgpu_desc->vertexInput(), exception_state);
dawn_desc.inputState = &std::get<0>(input_state_info); dawn_desc.vertexInput = &std::get<0>(vertex_input_info);
if (exception_state.HadException()) { if (exception_state.HadException()) {
return nullptr; return nullptr;
......
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