diff --git a/dawn.json b/dawn.json index 588436a6fd..81d99142aa 100644 --- a/dawn.json +++ b/dawn.json @@ -891,7 +891,7 @@ "name": "set index buffer", "args": [ {"name": "buffer", "type": "buffer"}, - {"name": "offset", "type": "uint64_t"} + {"name": "offset", "type": "uint64_t", "default": "0"} ] }, { @@ -1076,7 +1076,7 @@ "name": "set index buffer", "args": [ {"name": "buffer", "type": "buffer"}, - {"name": "offset", "type": "uint64_t"} + {"name": "offset", "type": "uint64_t", "default": "0"} ] }, { diff --git a/examples/CppHelloTriangle.cpp b/examples/CppHelloTriangle.cpp index 0fd317c6b3..2437e3a521 100644 --- a/examples/CppHelloTriangle.cpp +++ b/examples/CppHelloTriangle.cpp @@ -162,7 +162,7 @@ void frame() { pass.SetPipeline(pipeline); pass.SetBindGroup(0, bindGroup); pass.SetVertexBuffer(0, vertexBuffer); - pass.SetIndexBuffer(indexBuffer, 0); + pass.SetIndexBuffer(indexBuffer); pass.DrawIndexed(3, 1, 0, 0, 0); pass.EndPass(); } diff --git a/examples/CubeReflection.cpp b/examples/CubeReflection.cpp index 345593103f..ac712a6a91 100644 --- a/examples/CubeReflection.cpp +++ b/examples/CubeReflection.cpp @@ -273,7 +273,7 @@ void frame() { pass.SetPipeline(pipeline); pass.SetBindGroup(0, bindGroup[0]); pass.SetVertexBuffer(0, vertexBuffer); - pass.SetIndexBuffer(indexBuffer, 0); + pass.SetIndexBuffer(indexBuffer); pass.DrawIndexed(36, 1, 0, 0, 0); pass.SetStencilReference(0x1); diff --git a/src/tests/end2end/IndexFormatTests.cpp b/src/tests/end2end/IndexFormatTests.cpp index 0d8a33b953..fa3710aba2 100644 --- a/src/tests/end2end/IndexFormatTests.cpp +++ b/src/tests/end2end/IndexFormatTests.cpp @@ -79,7 +79,7 @@ TEST_P(IndexFormatTest, Uint32) { dawn::RenderPassEncoder pass = encoder.BeginRenderPass(&renderPass.renderPassInfo); pass.SetPipeline(pipeline); pass.SetVertexBuffer(0, vertexBuffer); - pass.SetIndexBuffer(indexBuffer, 0); + pass.SetIndexBuffer(indexBuffer); pass.DrawIndexed(3, 1, 0, 0, 0); pass.EndPass(); } @@ -106,7 +106,7 @@ TEST_P(IndexFormatTest, Uint16) { dawn::RenderPassEncoder pass = encoder.BeginRenderPass(&renderPass.renderPassInfo); pass.SetPipeline(pipeline); pass.SetVertexBuffer(0, vertexBuffer); - pass.SetIndexBuffer(indexBuffer, 0); + pass.SetIndexBuffer(indexBuffer); pass.DrawIndexed(3, 1, 0, 0, 0); pass.EndPass(); } @@ -156,7 +156,7 @@ TEST_P(IndexFormatTest, Uint32PrimitiveRestart) { dawn::RenderPassEncoder pass = encoder.BeginRenderPass(&renderPass.renderPassInfo); pass.SetPipeline(pipeline); pass.SetVertexBuffer(0, vertexBuffer); - pass.SetIndexBuffer(indexBuffer, 0); + pass.SetIndexBuffer(indexBuffer); pass.DrawIndexed(7, 1, 0, 0, 0); pass.EndPass(); } @@ -198,7 +198,7 @@ TEST_P(IndexFormatTest, Uint16PrimitiveRestart) { dawn::RenderPassEncoder pass = encoder.BeginRenderPass(&renderPass.renderPassInfo); pass.SetPipeline(pipeline); pass.SetVertexBuffer(0, vertexBuffer); - pass.SetIndexBuffer(indexBuffer, 0); + pass.SetIndexBuffer(indexBuffer); pass.DrawIndexed(7, 1, 0, 0, 0); pass.EndPass(); } @@ -233,7 +233,7 @@ TEST_P(IndexFormatTest, ChangePipelineAfterSetIndexBuffer) { dawn::RenderPassEncoder pass = encoder.BeginRenderPass(&renderPass.renderPassInfo); pass.SetPipeline(pipeline16); pass.SetVertexBuffer(0, vertexBuffer); - pass.SetIndexBuffer(indexBuffer, 0); + pass.SetIndexBuffer(indexBuffer); pass.SetPipeline(pipeline32); pass.DrawIndexed(3, 1, 0, 0, 0); pass.EndPass(); @@ -262,7 +262,7 @@ TEST_P(IndexFormatTest, DISABLED_SetIndexBufferBeforeSetPipeline) { dawn::CommandEncoder encoder = device.CreateCommandEncoder(); { dawn::RenderPassEncoder pass = encoder.BeginRenderPass(&renderPass.renderPassInfo); - pass.SetIndexBuffer(indexBuffer, 0); + pass.SetIndexBuffer(indexBuffer); pass.SetPipeline(pipeline); pass.SetVertexBuffer(0, vertexBuffer); pass.DrawIndexed(3, 1, 0, 0, 0); diff --git a/src/tests/unittests/validation/CommandBufferValidationTests.cpp b/src/tests/unittests/validation/CommandBufferValidationTests.cpp index c51fa679da..e78bec8390 100644 --- a/src/tests/unittests/validation/CommandBufferValidationTests.cpp +++ b/src/tests/unittests/validation/CommandBufferValidationTests.cpp @@ -194,7 +194,7 @@ TEST_F(CommandBufferValidationTest, BufferWithMultipleReadUsage) { dawn::CommandEncoder encoder = device.CreateCommandEncoder(); DummyRenderPass dummyRenderPass(device); dawn::RenderPassEncoder pass = encoder.BeginRenderPass(&dummyRenderPass); - pass.SetIndexBuffer(buffer, 0); + pass.SetIndexBuffer(buffer); pass.SetVertexBuffer(0, buffer); pass.EndPass(); encoder.Finish(); @@ -217,7 +217,7 @@ TEST_F(CommandBufferValidationTest, BufferWithReadAndWriteUsage) { dawn::CommandEncoder encoder = device.CreateCommandEncoder(); DummyRenderPass dummyRenderPass(device); dawn::RenderPassEncoder pass = encoder.BeginRenderPass(&dummyRenderPass); - pass.SetIndexBuffer(buffer, 0); + pass.SetIndexBuffer(buffer); pass.SetBindGroup(0, bg); pass.EndPass(); ASSERT_DEVICE_ERROR(encoder.Finish()); diff --git a/src/tests/unittests/validation/DrawIndirectValidationTests.cpp b/src/tests/unittests/validation/DrawIndirectValidationTests.cpp index 660138b4f7..aa44305c3b 100644 --- a/src/tests/unittests/validation/DrawIndirectValidationTests.cpp +++ b/src/tests/unittests/validation/DrawIndirectValidationTests.cpp @@ -84,7 +84,7 @@ class DrawIndirectValidationTest : public ValidationTest { uint32_t zeros[100] = {}; dawn::Buffer indexBuffer = utils::CreateBufferFromData(device, zeros, sizeof(zeros), dawn::BufferUsage::Index); - pass.SetIndexBuffer(indexBuffer, 0); + pass.SetIndexBuffer(indexBuffer); pass.DrawIndexedIndirect(indirectBuffer, indirectOffset); } else { pass.DrawIndirect(indirectBuffer, indirectOffset);