GL backend: fix baseVertex param to DrawIndexed.
Re-enable the appropriate test.
BUG=
Change-Id: I8b823b17259f7c588fda0be4fe86990d11a0a324
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/5460
Commit-Queue: Stephen White <senorblanco@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
diff --git a/src/dawn_native/opengl/CommandBufferGL.cpp b/src/dawn_native/opengl/CommandBufferGL.cpp
index ea66e2c..1a5fded 100644
--- a/src/dawn_native/opengl/CommandBufferGL.cpp
+++ b/src/dawn_native/opengl/CommandBufferGL.cpp
@@ -622,18 +622,18 @@
GLenum formatType = IndexFormatType(indexFormat);
if (draw->firstInstance > 0) {
- glDrawElementsInstancedBaseInstance(
+ glDrawElementsInstancedBaseVertexBaseInstance(
lastPipeline->GetGLPrimitiveTopology(), draw->indexCount, formatType,
reinterpret_cast<void*>(draw->firstIndex * formatSize +
indexBufferBaseOffset),
- draw->instanceCount, draw->firstInstance);
+ draw->instanceCount, draw->baseVertex, draw->firstInstance);
} else {
// This branch is only needed on OpenGL < 4.2
- glDrawElementsInstanced(
+ glDrawElementsInstancedBaseVertex(
lastPipeline->GetGLPrimitiveTopology(), draw->indexCount, formatType,
reinterpret_cast<void*>(draw->firstIndex * formatSize +
indexBufferBaseOffset),
- draw->instanceCount);
+ draw->instanceCount, draw->baseVertex);
}
} break;
diff --git a/src/tests/end2end/DrawIndexedTests.cpp b/src/tests/end2end/DrawIndexedTests.cpp
index f3fa3d7..9365349 100644
--- a/src/tests/end2end/DrawIndexedTests.cpp
+++ b/src/tests/end2end/DrawIndexedTests.cpp
@@ -132,9 +132,6 @@
// Test the parameter 'baseVertex' of DrawIndexed() works.
TEST_P(DrawIndexedTest, BaseVertex) {
- // TODO(jiawei.shao@intel.com): enable 'baseVertex' on OpenGL back-ends
- DAWN_SKIP_TEST_IF(IsOpenGL());
-
RGBA8 filled(0, 255, 0, 255);
RGBA8 notFilled(0, 0, 0, 0);