Dawn: update to RenderPassEncoder::SetIndexBufferWithFormat().

RenderPassEncoder::SetIndexBuffer() is deprecated.
Change-Id: Ie7b357df8bbee16fd08fa1bdf5e9cbedf11b259d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/331495
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Stephen White <senorblanco@google.com>
This commit is contained in:
Stephen White 2020-11-03 11:29:12 -05:00 committed by Skia Commit-Bot
parent 3744b2a366
commit 541f2acf98
2 changed files with 5 additions and 2 deletions

View File

@ -183,7 +183,7 @@ void GrDawnOpsRenderPass::onBindBuffers(sk_sp<const GrBuffer> indexBuffer,
}
if (indexBuffer) {
wgpu::Buffer index = static_cast<const GrDawnBuffer*>(indexBuffer.get())->get();
fPassEncoder.SetIndexBuffer(index);
fPassEncoder.SetIndexBufferWithFormat(index, wgpu::IndexFormat::Uint16);
}
}

View File

@ -373,7 +373,10 @@ sk_sp<GrDawnProgram> GrDawnProgramBuilder::Build(GrDawnGpu* gpu,
inputs.push_back(input);
}
wgpu::VertexStateDescriptor vertexState;
vertexState.indexFormat = wgpu::IndexFormat::Uint16;
if (programInfo.primitiveType() == GrPrimitiveType::kTriangleStrip ||
programInfo.primitiveType() == GrPrimitiveType::kLineStrip) {
vertexState.indexFormat = wgpu::IndexFormat::Uint16;
}
vertexState.vertexBufferCount = inputs.size();
vertexState.vertexBuffers = &inputs.front();