Make the offset of SetIndexBuffer default to 0

BUG=dawn:22

Change-Id: Icc4f03c3f49b610ef5f620b4c26a6ae24ed6c774
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/12040
Reviewed-by: François Beaufort <beaufort.francois@gmail.com>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
This commit is contained in:
Corentin Wallez 2019-10-10 17:21:48 +00:00 committed by Commit Bot service account
parent 9e64afcb91
commit d285525d4a
6 changed files with 13 additions and 13 deletions

View File

@ -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"}
]
},
{

View File

@ -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();
}

View File

@ -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);

View File

@ -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);

View File

@ -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());

View File

@ -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);