Commit c22fef94 by Jamie Madill

D3D11: Fix instancing draw with line loops.

We were missing the implementation for the instanced draw for these. Implement them in the same way as for triangle fan. BUG=angleproject:1101 Change-Id: I444f3a23383c63b8df6f9ebe25b255c8890632a1 Reviewed-on: https://chromium-review.googlesource.com/313007 Tryjob-Request: Jamie Madill <jmadill@chromium.org> Reviewed-by: 's avatarCorentin Wallez <cwallez@chromium.org> Reviewed-by: 's avatarGeoff Lang <geofflang@chromium.org> Tested-by: 's avatarJamie Madill <jmadill@chromium.org>
parent a0537333
......@@ -1980,7 +1980,7 @@ gl::Error Renderer11::drawArraysImpl(const gl::Data &data,
if (mode == GL_LINE_LOOP)
{
return drawLineLoop(data, count, GL_NONE, nullptr, nullptr);
return drawLineLoop(data, count, GL_NONE, nullptr, nullptr, instances);
}
if (mode == GL_TRIANGLE_FAN)
......@@ -2023,7 +2023,7 @@ gl::Error Renderer11::drawElementsImpl(const gl::Data &data,
if (mode == GL_LINE_LOOP)
{
return drawLineLoop(data, count, type, indices, &indexInfo);
return drawLineLoop(data, count, type, indices, &indexInfo, instances);
}
if (mode == GL_TRIANGLE_FAN)
......@@ -2064,7 +2064,8 @@ gl::Error Renderer11::drawLineLoop(const gl::Data &data,
GLsizei count,
GLenum type,
const GLvoid *indexPointer,
const TranslatedIndexData *indexInfo)
const TranslatedIndexData *indexInfo,
int instances)
{
gl::VertexArray *vao = data.state->getVertexArray();
gl::Buffer *elementArrayBuffer = vao->getElementArrayBuffer().get();
......@@ -2150,7 +2151,15 @@ gl::Error Renderer11::drawLineLoop(const gl::Data &data,
INT baseVertexLocation = (indexInfo ? -static_cast<int>(indexInfo->indexRange.start) : 0);
UINT indexCount = static_cast<UINT>(mScratchIndexDataBuffer.size());
mDeviceContext->DrawIndexed(indexCount, 0, baseVertexLocation);
if (instances > 0)
{
mDeviceContext->DrawIndexedInstanced(indexCount, instances, 0, baseVertexLocation, 0);
}
else
{
mDeviceContext->DrawIndexed(indexCount, 0, baseVertexLocation);
}
return gl::Error(GL_NO_ERROR);
}
......
......@@ -308,7 +308,8 @@ class Renderer11 : public RendererD3D
GLsizei count,
GLenum type,
const GLvoid *indices,
const TranslatedIndexData *indexInfo);
const TranslatedIndexData *indexInfo,
int instances);
gl::Error drawTriangleFan(const gl::Data &data,
GLsizei count,
GLenum type,
......
......@@ -1051,8 +1051,6 @@
1101 WIN : dEQP-GLES3.functional.state_query.internal_format.rgb_samples = FAIL
1101 WIN : dEQP-GLES3.functional.polygon_offset.fixed16_render_with_units = FAIL
1101 WIN : dEQP-GLES3.functional.polygon_offset.fixed24_render_with_units = FAIL
1101 WIN : dEQP-GLES3.functional.draw.draw_arrays_instanced.line_loop.instanced_attributes = FAIL
1101 WIN : dEQP-GLES3.functional.draw.draw_elements_instanced.line_loop.instanced_attributes = FAIL
1101 WIN : dEQP-GLES3.functional.flush_finish.flush = FAIL
1101 WIN : dEQP-GLES3.functional.lifetime.gen.transform_feedback = FAIL
1101 WIN : dEQP-GLES3.functional.lifetime.gen.vertex_array = FAIL
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment