Fix deprecation errors for indexFormat being set.

Bug: dawn:502
Change-Id: Ib49a1e6cceb0632792a499314f5e0e4b3434deb7
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/28780
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Brandon Jones <bajones@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
This commit is contained in:
Corentin Wallez 2020-09-23 07:23:56 +00:00 committed by Commit Bot service account
parent 9d0d18d952
commit a3651d2fe0
13 changed files with 20 additions and 11 deletions

View File

@ -223,7 +223,6 @@ class BufferZeroInitTest : public DawnTest {
descriptor.cFragmentStage.module = fsModule;
descriptor.primitiveTopology = wgpu::PrimitiveTopology::PointList;
descriptor.cVertexState.vertexBufferCount = vertexBufferCount;
descriptor.cVertexState.indexFormat = wgpu::IndexFormat::Uint16;
descriptor.cVertexState.cVertexBuffers[0].arrayStride = 4 * sizeof(float);
descriptor.cVertexState.cVertexBuffers[0].attributeCount = 1;
descriptor.cVertexState.cAttributes[0].format = wgpu::VertexFormat::Float4;

View File

@ -46,7 +46,7 @@ class DestroyTest : public DawnTest {
utils::ComboRenderPipelineDescriptor descriptor(device);
descriptor.vertexStage.module = vsModule;
descriptor.cFragmentStage.module = fsModule;
descriptor.primitiveTopology = wgpu::PrimitiveTopology::TriangleStrip;
descriptor.primitiveTopology = wgpu::PrimitiveTopology::TriangleList;
descriptor.cVertexState.vertexBufferCount = 1;
descriptor.cVertexState.cVertexBuffers[0].arrayStride = 4 * sizeof(float);
descriptor.cVertexState.cVertexBuffers[0].attributeCount = 1;

View File

@ -46,6 +46,7 @@ class DrawIndexedIndirectTest : public DawnTest {
descriptor.vertexStage.module = vsModule;
descriptor.cFragmentStage.module = fsModule;
descriptor.primitiveTopology = wgpu::PrimitiveTopology::TriangleStrip;
descriptor.cVertexState.indexFormat = wgpu::IndexFormat::Uint32;
descriptor.cVertexState.vertexBufferCount = 1;
descriptor.cVertexState.cVertexBuffers[0].arrayStride = 4 * sizeof(float);
descriptor.cVertexState.cVertexBuffers[0].attributeCount = 1;

View File

@ -46,6 +46,7 @@ class DrawIndexedTest : public DawnTest {
descriptor.vertexStage.module = vsModule;
descriptor.cFragmentStage.module = fsModule;
descriptor.primitiveTopology = wgpu::PrimitiveTopology::TriangleStrip;
descriptor.cVertexState.indexFormat = wgpu::IndexFormat::Uint32;
descriptor.cVertexState.vertexBufferCount = 1;
descriptor.cVertexState.cVertexBuffers[0].arrayStride = 4 * sizeof(float);
descriptor.cVertexState.cVertexBuffers[0].attributeCount = 1;

View File

@ -46,6 +46,7 @@ class DrawIndirectTest : public DawnTest {
descriptor.vertexStage.module = vsModule;
descriptor.cFragmentStage.module = fsModule;
descriptor.primitiveTopology = wgpu::PrimitiveTopology::TriangleStrip;
descriptor.cVertexState.indexFormat = wgpu::IndexFormat::Uint32;
descriptor.cVertexState.vertexBufferCount = 1;
descriptor.cVertexState.cVertexBuffers[0].arrayStride = 4 * sizeof(float);
descriptor.cVertexState.cVertexBuffers[0].attributeCount = 1;

View File

@ -45,7 +45,7 @@ class DrawTest : public DawnTest {
utils::ComboRenderPipelineDescriptor descriptor(device);
descriptor.vertexStage.module = vsModule;
descriptor.cFragmentStage.module = fsModule;
descriptor.primitiveTopology = wgpu::PrimitiveTopology::TriangleStrip;
descriptor.primitiveTopology = wgpu::PrimitiveTopology::TriangleList;
descriptor.cVertexState.vertexBufferCount = 1;
descriptor.cVertexState.cVertexBuffers[0].arrayStride = 4 * sizeof(float);
descriptor.cVertexState.cVertexBuffers[0].attributeCount = 1;

View File

@ -536,7 +536,7 @@ TEST_P(MultipleWriteThenMultipleReadTests, SeparateBuffers) {
utils::ComboRenderPipelineDescriptor rpDesc(device);
rpDesc.vertexStage.module = vsModule;
rpDesc.cFragmentStage.module = fsModule;
rpDesc.primitiveTopology = wgpu::PrimitiveTopology::TriangleStrip;
rpDesc.primitiveTopology = wgpu::PrimitiveTopology::TriangleList;
rpDesc.cVertexState.vertexBufferCount = 1;
rpDesc.cVertexState.cVertexBuffers[0].arrayStride = kVertexBufferStride;
rpDesc.cVertexState.cVertexBuffers[0].attributeCount = 1;
@ -658,7 +658,7 @@ TEST_P(MultipleWriteThenMultipleReadTests, OneBuffer) {
utils::ComboRenderPipelineDescriptor rpDesc(device);
rpDesc.vertexStage.module = vsModule;
rpDesc.cFragmentStage.module = fsModule;
rpDesc.primitiveTopology = wgpu::PrimitiveTopology::TriangleStrip;
rpDesc.primitiveTopology = wgpu::PrimitiveTopology::TriangleList;
rpDesc.cVertexState.vertexBufferCount = 1;
rpDesc.cVertexState.cVertexBuffers[0].arrayStride = kVertexBufferStride;
rpDesc.cVertexState.cVertexBuffers[0].attributeCount = 1;

View File

@ -69,6 +69,7 @@ class MultisampledSamplingTest : public DawnTest {
gl_FragDepth = 0.7;
})");
desc.cVertexState.indexFormat = wgpu::IndexFormat::Uint32;
desc.cVertexState.vertexBufferCount = 1;
desc.cVertexState.cVertexBuffers[0].attributeCount = 1;
desc.cVertexState.cVertexBuffers[0].arrayStride = 2 * sizeof(float);

View File

@ -190,7 +190,13 @@ class PrimitiveTopologyTest : public DawnTest {
utils::ComboRenderPipelineDescriptor descriptor(device);
descriptor.vertexStage.module = vsModule;
descriptor.cFragmentStage.module = fsModule;
descriptor.primitiveTopology = primitiveTopology;
if (primitiveTopology == wgpu::PrimitiveTopology::TriangleStrip ||
primitiveTopology == wgpu::PrimitiveTopology::LineStrip) {
descriptor.cVertexState.indexFormat = wgpu::IndexFormat::Uint32;
}
descriptor.cVertexState.vertexBufferCount = 1;
descriptor.cVertexState.cVertexBuffers[0].arrayStride = 4 * sizeof(float);
descriptor.cVertexState.cVertexBuffers[0].attributeCount = 1;

View File

@ -53,7 +53,7 @@ class RenderBundleTest : public DawnTest {
utils::ComboRenderPipelineDescriptor descriptor(device);
descriptor.vertexStage.module = vsModule;
descriptor.cFragmentStage.module = fsModule;
descriptor.primitiveTopology = wgpu::PrimitiveTopology::TriangleStrip;
descriptor.primitiveTopology = wgpu::PrimitiveTopology::TriangleList;
descriptor.cVertexState.vertexBufferCount = 1;
descriptor.cVertexState.cVertexBuffers[0].arrayStride = 4 * sizeof(float);
descriptor.cVertexState.cVertexBuffers[0].attributeCount = 1;

View File

@ -45,7 +45,7 @@ class RenderPassTest : public DawnTest {
utils::ComboRenderPipelineDescriptor descriptor(device);
descriptor.vertexStage.module = mVSModule;
descriptor.cFragmentStage.module = fsModule;
descriptor.primitiveTopology = wgpu::PrimitiveTopology::TriangleStrip;
descriptor.primitiveTopology = wgpu::PrimitiveTopology::TriangleList;
descriptor.cColorStates[0].format = kFormat;
pipeline = device.CreateRenderPipeline(&descriptor);
@ -145,7 +145,7 @@ TEST_P(RenderPassTest, NoCorrespondingFragmentShaderOutputs) {
utils::ComboRenderPipelineDescriptor descriptor(device);
descriptor.vertexStage.module = mVSModule;
descriptor.cFragmentStage.module = fsModule;
descriptor.primitiveTopology = wgpu::PrimitiveTopology::TriangleStrip;
descriptor.primitiveTopology = wgpu::PrimitiveTopology::TriangleList;
descriptor.cColorStates[0].format = kFormat;
wgpu::RenderPipeline pipelineWithNoFragmentOutput =

View File

@ -69,7 +69,7 @@ class TextureSubresourceTest : public DawnTest {
utils::ComboRenderPipelineDescriptor descriptor(device);
descriptor.vertexStage.module = vsModule;
descriptor.cFragmentStage.module = fsModule;
descriptor.primitiveTopology = wgpu::PrimitiveTopology::TriangleStrip;
descriptor.primitiveTopology = wgpu::PrimitiveTopology::TriangleList;
descriptor.cColorStates[0].format = kFormat;
wgpu::RenderPipeline rp = device.CreateRenderPipeline(&descriptor);
@ -110,7 +110,7 @@ class TextureSubresourceTest : public DawnTest {
utils::ComboRenderPipelineDescriptor descriptor(device);
descriptor.vertexStage.module = vsModule;
descriptor.cFragmentStage.module = fsModule;
descriptor.primitiveTopology = wgpu::PrimitiveTopology::TriangleStrip;
descriptor.primitiveTopology = wgpu::PrimitiveTopology::TriangleList;
descriptor.cColorStates[0].format = kFormat;
wgpu::SamplerDescriptor samplerDescriptor = {};

View File

@ -21,7 +21,7 @@ namespace utils {
ComboVertexStateDescriptor::ComboVertexStateDescriptor() {
wgpu::VertexStateDescriptor* descriptor = this;
descriptor->indexFormat = wgpu::IndexFormat::Uint32;
descriptor->indexFormat = wgpu::IndexFormat::Undefined;
descriptor->vertexBufferCount = 0;
// Fill the default values for vertexBuffers and vertexAttributes in buffers.