From a3651d2fe0737c1522556657eb0dd5539186c839 Mon Sep 17 00:00:00 2001 From: Corentin Wallez Date: Wed, 23 Sep 2020 07:23:56 +0000 Subject: [PATCH] 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 Reviewed-by: Brandon Jones Reviewed-by: Austin Eng --- src/tests/end2end/BufferZeroInitTests.cpp | 1 - src/tests/end2end/DestroyTests.cpp | 2 +- src/tests/end2end/DrawIndexedIndirectTests.cpp | 1 + src/tests/end2end/DrawIndexedTests.cpp | 1 + src/tests/end2end/DrawIndirectTests.cpp | 1 + src/tests/end2end/DrawTests.cpp | 2 +- src/tests/end2end/GpuMemorySynchronizationTests.cpp | 4 ++-- src/tests/end2end/MultisampledSamplingTests.cpp | 1 + src/tests/end2end/PrimitiveTopologyTests.cpp | 6 ++++++ src/tests/end2end/RenderBundleTests.cpp | 2 +- src/tests/end2end/RenderPassTests.cpp | 4 ++-- src/tests/end2end/TextureSubresourceTests.cpp | 4 ++-- src/utils/ComboRenderPipelineDescriptor.cpp | 2 +- 13 files changed, 20 insertions(+), 11 deletions(-) diff --git a/src/tests/end2end/BufferZeroInitTests.cpp b/src/tests/end2end/BufferZeroInitTests.cpp index c8a07e0876..4304053374 100644 --- a/src/tests/end2end/BufferZeroInitTests.cpp +++ b/src/tests/end2end/BufferZeroInitTests.cpp @@ -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; diff --git a/src/tests/end2end/DestroyTests.cpp b/src/tests/end2end/DestroyTests.cpp index 4122001189..6c105bfe81 100644 --- a/src/tests/end2end/DestroyTests.cpp +++ b/src/tests/end2end/DestroyTests.cpp @@ -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; diff --git a/src/tests/end2end/DrawIndexedIndirectTests.cpp b/src/tests/end2end/DrawIndexedIndirectTests.cpp index fc96092432..fa758ef1e2 100644 --- a/src/tests/end2end/DrawIndexedIndirectTests.cpp +++ b/src/tests/end2end/DrawIndexedIndirectTests.cpp @@ -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; diff --git a/src/tests/end2end/DrawIndexedTests.cpp b/src/tests/end2end/DrawIndexedTests.cpp index 07b26024da..c05215eb00 100644 --- a/src/tests/end2end/DrawIndexedTests.cpp +++ b/src/tests/end2end/DrawIndexedTests.cpp @@ -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; diff --git a/src/tests/end2end/DrawIndirectTests.cpp b/src/tests/end2end/DrawIndirectTests.cpp index 56b55ec89e..c110c35cbe 100644 --- a/src/tests/end2end/DrawIndirectTests.cpp +++ b/src/tests/end2end/DrawIndirectTests.cpp @@ -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; diff --git a/src/tests/end2end/DrawTests.cpp b/src/tests/end2end/DrawTests.cpp index b4673bfedf..ce8d7f310a 100644 --- a/src/tests/end2end/DrawTests.cpp +++ b/src/tests/end2end/DrawTests.cpp @@ -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; diff --git a/src/tests/end2end/GpuMemorySynchronizationTests.cpp b/src/tests/end2end/GpuMemorySynchronizationTests.cpp index f340e885d9..2915794057 100644 --- a/src/tests/end2end/GpuMemorySynchronizationTests.cpp +++ b/src/tests/end2end/GpuMemorySynchronizationTests.cpp @@ -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; diff --git a/src/tests/end2end/MultisampledSamplingTests.cpp b/src/tests/end2end/MultisampledSamplingTests.cpp index 8c017d0fc0..244c673162 100644 --- a/src/tests/end2end/MultisampledSamplingTests.cpp +++ b/src/tests/end2end/MultisampledSamplingTests.cpp @@ -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); diff --git a/src/tests/end2end/PrimitiveTopologyTests.cpp b/src/tests/end2end/PrimitiveTopologyTests.cpp index 0c0c285176..1f0be7e206 100644 --- a/src/tests/end2end/PrimitiveTopologyTests.cpp +++ b/src/tests/end2end/PrimitiveTopologyTests.cpp @@ -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; diff --git a/src/tests/end2end/RenderBundleTests.cpp b/src/tests/end2end/RenderBundleTests.cpp index c58eb8cac7..2e14597c2d 100644 --- a/src/tests/end2end/RenderBundleTests.cpp +++ b/src/tests/end2end/RenderBundleTests.cpp @@ -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; diff --git a/src/tests/end2end/RenderPassTests.cpp b/src/tests/end2end/RenderPassTests.cpp index 74069fff48..427de708b9 100644 --- a/src/tests/end2end/RenderPassTests.cpp +++ b/src/tests/end2end/RenderPassTests.cpp @@ -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 = diff --git a/src/tests/end2end/TextureSubresourceTests.cpp b/src/tests/end2end/TextureSubresourceTests.cpp index 741e77af73..27c96174e6 100644 --- a/src/tests/end2end/TextureSubresourceTests.cpp +++ b/src/tests/end2end/TextureSubresourceTests.cpp @@ -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 = {}; diff --git a/src/utils/ComboRenderPipelineDescriptor.cpp b/src/utils/ComboRenderPipelineDescriptor.cpp index 5fa40c4266..558fe78c00 100644 --- a/src/utils/ComboRenderPipelineDescriptor.cpp +++ b/src/utils/ComboRenderPipelineDescriptor.cpp @@ -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.