Commit 1da00653 by Qin Jiajia Committed by Commit Bot

Remove IndexRange in DrawElements functions

This change will remove IndexRange parameter in DrawElements functions. And calculate it until we truly need it. Meanwhile we add direct drawing path to avoid retrieving index range for DrawElements* functions in D3D11 backend. This change may not bring much performance improvement since we still need to retrieve index range in validation at the beginning of every DrawElements* call entry point. BUG=angleproject:1393 Change-Id: I86a8739c0893954c94eb398db62820ced7871565 Reviewed-on: https://chromium-review.googlesource.com/544634Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
parent a779b610
......@@ -1855,8 +1855,7 @@ void Context::drawArraysInstanced(GLenum mode, GLint first, GLsizei count, GLsiz
void Context::drawElements(GLenum mode, GLsizei count, GLenum type, const void *indices)
{
syncRendererState();
const IndexRange &indexRange = getParams<HasIndexRange>().getIndexRange().value();
handleError(mImplementation->drawElements(this, mode, count, type, indices, indexRange));
handleError(mImplementation->drawElements(this, mode, count, type, indices));
}
void Context::drawElementsInstanced(GLenum mode,
......@@ -1866,9 +1865,8 @@ void Context::drawElementsInstanced(GLenum mode,
GLsizei instances)
{
syncRendererState();
const IndexRange &indexRange = getParams<HasIndexRange>().getIndexRange().value();
handleError(mImplementation->drawElementsInstanced(this, mode, count, type, indices, instances,
indexRange));
handleError(
mImplementation->drawElementsInstanced(this, mode, count, type, indices, instances));
}
void Context::drawRangeElements(GLenum mode,
......@@ -1879,9 +1877,7 @@ void Context::drawRangeElements(GLenum mode,
const void *indices)
{
syncRendererState();
const IndexRange &indexRange = getParams<HasIndexRange>().getIndexRange().value();
handleError(mImplementation->drawRangeElements(this, mode, start, end, count, type, indices,
indexRange));
handleError(mImplementation->drawRangeElements(this, mode, start, end, count, type, indices));
}
void Context::drawArraysIndirect(GLenum mode, const void *indirect)
......
......@@ -51,23 +51,20 @@ class ContextImpl : public GLImplFactory
GLenum mode,
GLsizei count,
GLenum type,
const void *indices,
const gl::IndexRange &indexRange) = 0;
const void *indices) = 0;
virtual gl::Error drawElementsInstanced(const gl::Context *context,
GLenum mode,
GLsizei count,
GLenum type,
const void *indices,
GLsizei instances,
const gl::IndexRange &indexRange) = 0;
GLsizei instances) = 0;
virtual gl::Error drawRangeElements(const gl::Context *context,
GLenum mode,
GLuint start,
GLuint end,
GLsizei count,
GLenum type,
const void *indices,
const gl::IndexRange &indexRange) = 0;
const void *indices) = 0;
virtual gl::Error drawArraysIndirect(const gl::Context *context,
GLenum mode,
......
......@@ -11,6 +11,8 @@
#include "common/utilities.h"
#include "libANGLE/Buffer.h"
#include "libANGLE/Context.h"
#include "libANGLE/VertexArray.h"
#include "libANGLE/formatutils.h"
#include "libANGLE/renderer/d3d/BufferD3D.h"
#include "libANGLE/renderer/d3d/IndexBuffer.h"
......@@ -146,11 +148,12 @@ bool IndexDataManager::usePrimitiveRestartWorkaround(bool primitiveRestartFixedI
mRendererClass == RENDERER_D3D11);
}
bool IndexDataManager::isStreamingIndexData(bool primitiveRestartWorkaround,
GLenum srcType,
gl::Buffer *glBuffer)
bool IndexDataManager::isStreamingIndexData(const gl::Context *context, GLenum srcType)
{
BufferD3D *buffer = glBuffer ? GetImplAs<BufferD3D>(glBuffer) : nullptr;
const auto &glState = context->getGLState();
bool primitiveRestartWorkaround =
usePrimitiveRestartWorkaround(glState.isPrimitiveRestartEnabled(), srcType);
gl::Buffer *glBuffer = glState.getVertexArray()->getElementArrayBuffer().get();
// Case 1: the indices are passed by pointer, which forces the streaming of index data
if (glBuffer == nullptr)
......@@ -158,6 +161,7 @@ bool IndexDataManager::isStreamingIndexData(bool primitiveRestartWorkaround,
return true;
}
BufferD3D *buffer = GetImplAs<BufferD3D>(glBuffer);
const GLenum dstType = (srcType == GL_UNSIGNED_INT || primitiveRestartWorkaround)
? GL_UNSIGNED_INT
: GL_UNSIGNED_SHORT;
......@@ -175,7 +179,7 @@ bool IndexDataManager::isStreamingIndexData(bool primitiveRestartWorkaround,
return true;
}
if ((staticBuffer->getBufferSize() != 0) && (staticBuffer->getIndexType() != dstType))
if ((staticBuffer->getBufferSize() == 0) || (staticBuffer->getIndexType() != dstType))
{
return true;
}
......
......@@ -69,9 +69,7 @@ class IndexDataManager : angle::NonCopyable
virtual ~IndexDataManager();
bool usePrimitiveRestartWorkaround(bool primitiveRestartFixedIndexEnabled, GLenum type);
bool isStreamingIndexData(bool primitiveRestartWorkaround,
GLenum srcType,
gl::Buffer *glBuffer);
bool isStreamingIndexData(const gl::Context *context, GLenum srcType);
gl::Error prepareIndexData(GLenum srcType,
GLsizei count,
gl::Buffer *glBuffer,
......
......@@ -293,6 +293,12 @@ Serial RendererD3D::generateSerial()
return mSerialFactory.generate();
}
bool RendererD3D::instancedPointSpritesActive(ProgramD3D *programD3D, GLenum mode) const
{
return programD3D->usesPointSize() && programD3D->usesInstancedPointSpriteEmulation() &&
mode == GL_POINTS;
}
unsigned int GetBlendSampleMask(const gl::State &glState, int samples)
{
unsigned int mask = 0;
......
......@@ -336,6 +336,11 @@ class RendererD3D : public BufferFactoryD3D
gl::TextureCapsMap *outTextureCaps,
gl::Extensions *outExtensions,
gl::Limitations *outLimitations) const = 0;
virtual bool instancedPointSpritesActive(ProgramD3D *programD3D, GLenum mode) const;
// Support direct drawing with the drawing parameters.
virtual bool supportsDirectDrawing(const gl::Context *context,
GLenum mode,
GLenum type) const = 0;
void cleanup();
......
......@@ -167,10 +167,9 @@ gl::Error Context11::drawElements(const gl::Context *context,
GLenum mode,
GLsizei count,
GLenum type,
const void *indices,
const gl::IndexRange &indexRange)
const void *indices)
{
return mRenderer->genericDrawElements(context, mode, count, type, indices, 0, indexRange);
return mRenderer->genericDrawElements(context, mode, count, type, indices, 0);
}
gl::Error Context11::drawElementsInstanced(const gl::Context *context,
......@@ -178,11 +177,9 @@ gl::Error Context11::drawElementsInstanced(const gl::Context *context,
GLsizei count,
GLenum type,
const void *indices,
GLsizei instances,
const gl::IndexRange &indexRange)
GLsizei instances)
{
return mRenderer->genericDrawElements(context, mode, count, type, indices, instances,
indexRange);
return mRenderer->genericDrawElements(context, mode, count, type, indices, instances);
}
gl::Error Context11::drawRangeElements(const gl::Context *context,
......@@ -191,10 +188,9 @@ gl::Error Context11::drawRangeElements(const gl::Context *context,
GLuint end,
GLsizei count,
GLenum type,
const void *indices,
const gl::IndexRange &indexRange)
const void *indices)
{
return mRenderer->genericDrawElements(context, mode, count, type, indices, 0, indexRange);
return mRenderer->genericDrawElements(context, mode, count, type, indices, 0);
}
gl::Error Context11::drawArraysIndirect(const gl::Context *context,
......
......@@ -78,23 +78,20 @@ class Context11 : public ContextImpl
GLenum mode,
GLsizei count,
GLenum type,
const void *indices,
const gl::IndexRange &indexRange) override;
const void *indices) override;
gl::Error drawElementsInstanced(const gl::Context *context,
GLenum mode,
GLsizei count,
GLenum type,
const void *indices,
GLsizei instances,
const gl::IndexRange &indexRange) override;
GLsizei instances) override;
gl::Error drawRangeElements(const gl::Context *context,
GLenum mode,
GLuint start,
GLuint end,
GLsizei count,
GLenum type,
const void *indices,
const gl::IndexRange &indexRange) override;
const void *indices) override;
gl::Error drawArraysIndirect(const gl::Context *context,
GLenum mode,
const void *indirect) override;
......
......@@ -1792,14 +1792,43 @@ gl::Error Renderer11::drawArraysImpl(const gl::Context *context,
return gl::NoError();
}
gl::Error Renderer11::drawElementsImpl(const gl::ContextState &data,
const TranslatedIndexData &indexInfo,
gl::Error Renderer11::drawElementsImpl(const gl::Context *context,
GLenum mode,
GLsizei count,
GLenum type,
const void *indices,
GLsizei instances)
{
const auto &data = context->getContextState();
TranslatedIndexData indexInfo;
if (supportsDirectDrawing(context, mode, type))
{
ANGLE_TRY(applyIndexBuffer(data, nullptr, 0, mode, type, &indexInfo));
ANGLE_TRY(applyVertexBuffer(context, mode, 0, 0, 0, &indexInfo));
const gl::Type &typeInfo = gl::GetTypeInfo(type);
unsigned int startIndexLocation =
static_cast<unsigned int>(reinterpret_cast<const uintptr_t>(indices)) / typeInfo.bytes;
if (instances > 0)
{
mDeviceContext->DrawIndexedInstanced(count, instances, startIndexLocation, 0, 0);
}
else
{
mDeviceContext->DrawIndexed(count, startIndexLocation, 0);
}
return gl::NoError();
}
const gl::IndexRange &indexRange =
context->getParams<gl::HasIndexRange>().getIndexRange().value();
indexInfo.indexRange = indexRange;
ANGLE_TRY(applyIndexBuffer(data, indices, count, mode, type, &indexInfo));
size_t vertexCount = indexInfo.indexRange.vertexCount();
ANGLE_TRY(applyVertexBuffer(context, mode, static_cast<GLsizei>(indexInfo.indexRange.start),
static_cast<GLsizei>(vertexCount), instances, &indexInfo));
int startVertex = static_cast<int>(indexInfo.indexRange.start);
int baseVertex = -startVertex;
......@@ -1863,12 +1892,12 @@ gl::Error Renderer11::drawElementsImpl(const gl::ContextState &data,
return gl::NoError();
}
bool Renderer11::supportsFastIndirectDraw(const gl::Context *context, GLenum mode, GLenum type)
bool Renderer11::supportsDirectDrawing(const gl::Context *context, GLenum mode, GLenum type) const
{
const auto &glState = context->getGLState();
const auto &vertexArray = glState.getVertexArray();
auto *vertexArray11 = GetImplAs<VertexArray11>(vertexArray);
// Indirect drawing doesn't support dynamic attribute storage since it needs the first and count
// Direct drawing doesn't support dynamic attribute storage since it needs the first and count
// to translate when applyVertexBuffer. GL_LINE_LOOP and GL_TRIANGLE_FAN are not supported
// either since we need to simulate them in D3D.
if (vertexArray11->hasDynamicAttrib(context) || mode == GL_LINE_LOOP || mode == GL_TRIANGLE_FAN)
......@@ -1876,18 +1905,17 @@ bool Renderer11::supportsFastIndirectDraw(const gl::Context *context, GLenum mod
return false;
}
ProgramD3D *programD3D = GetImplAs<ProgramD3D>(glState.getProgram());
if (instancedPointSpritesActive(programD3D, mode))
{
return false;
}
if (type != GL_NONE)
{
gl::Buffer *elementArrayBuffer = vertexArray->getElementArrayBuffer().get();
ASSERT(elementArrayBuffer);
// Only non-streaming index data can be directly used to do indirect draw since they don't
// need the indices and count informations. Here we don't check whether it really has
// primitive restart index in it since it also needs to know the index range and count.
// So, for all other situations, we fall back to normal draw instead of indirect draw.
bool primitiveRestartWorkaround = mIndexDataManager->usePrimitiveRestartWorkaround(
glState.isPrimitiveRestartEnabled(), type);
return !mIndexDataManager->isStreamingIndexData(primitiveRestartWorkaround, type,
elementArrayBuffer);
// Only non-streaming index data can be directly used to draw since they don't
// need the indices and count informations.
return !mIndexDataManager->isStreamingIndexData(context, type);
}
return true;
}
......@@ -1908,7 +1936,7 @@ gl::Error Renderer11::drawArraysIndirectImpl(const gl::Context *context,
Buffer11 *storage = GetImplAs<Buffer11>(drawIndirectBuffer);
uintptr_t offset = reinterpret_cast<uintptr_t>(indirect);
if (supportsFastIndirectDraw(context, mode, GL_NONE))
if (supportsDirectDrawing(context, mode, GL_NONE))
{
applyVertexBuffer(context, mode, 0, 0, 0, nullptr);
ID3D11Buffer *buffer = nullptr;
......@@ -1959,7 +1987,7 @@ gl::Error Renderer11::drawElementsIndirectImpl(const gl::Context *context,
uintptr_t offset = reinterpret_cast<uintptr_t>(indirect);
TranslatedIndexData indexInfo;
if (supportsFastIndirectDraw(context, mode, type))
if (supportsDirectDrawing(context, mode, type))
{
ANGLE_TRY(applyIndexBuffer(contextState, nullptr, 0, mode, type, &indexInfo));
ANGLE_TRY(applyVertexBuffer(context, mode, 0, 0, 0, &indexInfo));
......@@ -4229,8 +4257,7 @@ gl::Error Renderer11::genericDrawElements(const gl::Context *context,
GLsizei count,
GLenum type,
const void *indices,
GLsizei instances,
const gl::IndexRange &indexRange)
GLsizei instances)
{
const auto &data = context->getContextState();
const auto &glState = data.getState();
......@@ -4250,24 +4277,16 @@ gl::Error Renderer11::genericDrawElements(const gl::Context *context,
ANGLE_TRY(mStateManager.updateState(context, mode));
TranslatedIndexData indexInfo;
indexInfo.indexRange = indexRange;
ANGLE_TRY(applyIndexBuffer(data, indices, count, mode, type, &indexInfo));
applyTransformFeedbackBuffers(data);
// Transform feedback is not allowed for DrawElements, this error should have been caught at the
// API validation layer.
ASSERT(!glState.isTransformFeedbackActiveUnpaused());
size_t vertexCount = indexInfo.indexRange.vertexCount();
ANGLE_TRY(applyVertexBuffer(context, mode, static_cast<GLsizei>(indexInfo.indexRange.start),
static_cast<GLsizei>(vertexCount), instances, &indexInfo));
ANGLE_TRY(programD3D->applyUniformBuffers(data));
if (!skipDraw(data, mode))
{
ANGLE_TRY(drawElementsImpl(data, indexInfo, mode, count, type, indices, instances));
ANGLE_TRY(drawElementsImpl(context, mode, count, type, indices, instances));
}
return gl::NoError();
......
......@@ -404,8 +404,7 @@ class Renderer11 : public RendererD3D
GLsizei count,
GLenum type,
const void *indices,
GLsizei instances,
const gl::IndexRange &indexRange);
GLsizei instances);
gl::Error genericDrawIndirect(const gl::Context *context,
GLenum mode,
......@@ -471,14 +470,17 @@ class Renderer11 : public RendererD3D
gl::Error clearRenderTarget(RenderTargetD3D *renderTarget,
const gl::ColorF &clearValues) override;
protected:
// Support direct drawing with the drawing parameters.
bool supportsDirectDrawing(const gl::Context *context, GLenum mode, GLenum type) const override;
private:
gl::Error drawArraysImpl(const gl::Context *context,
GLenum mode,
GLint startVertex,
GLsizei count,
GLsizei instances);
gl::Error drawElementsImpl(const gl::ContextState &data,
const TranslatedIndexData &indexInfo,
gl::Error drawElementsImpl(const gl::Context *context,
GLenum mode,
GLsizei count,
GLenum type,
......@@ -490,9 +492,6 @@ class Renderer11 : public RendererD3D
GLenum type,
const void *indirect);
// Support directly using indirect draw buffer.
bool supportsFastIndirectDraw(const gl::Context *context, GLenum mode, GLenum type);
void generateCaps(gl::Caps *outCaps,
gl::TextureCapsMap *outTextureCaps,
gl::Extensions *outExtensions,
......
......@@ -153,10 +153,9 @@ gl::Error Context9::drawElements(const gl::Context *context,
GLenum mode,
GLsizei count,
GLenum type,
const void *indices,
const gl::IndexRange &indexRange)
const void *indices)
{
return mRenderer->genericDrawElements(context, mode, count, type, indices, 0, indexRange);
return mRenderer->genericDrawElements(context, mode, count, type, indices, 0);
}
gl::Error Context9::drawElementsInstanced(const gl::Context *context,
......@@ -164,11 +163,9 @@ gl::Error Context9::drawElementsInstanced(const gl::Context *context,
GLsizei count,
GLenum type,
const void *indices,
GLsizei instances,
const gl::IndexRange &indexRange)
GLsizei instances)
{
return mRenderer->genericDrawElements(context, mode, count, type, indices, instances,
indexRange);
return mRenderer->genericDrawElements(context, mode, count, type, indices, instances);
}
gl::Error Context9::drawRangeElements(const gl::Context *context,
......@@ -177,10 +174,9 @@ gl::Error Context9::drawRangeElements(const gl::Context *context,
GLuint end,
GLsizei count,
GLenum type,
const void *indices,
const gl::IndexRange &indexRange)
const void *indices)
{
return mRenderer->genericDrawElements(context, mode, count, type, indices, 0, indexRange);
return mRenderer->genericDrawElements(context, mode, count, type, indices, 0);
}
gl::Error Context9::drawArraysIndirect(const gl::Context *context,
......
......@@ -78,23 +78,20 @@ class Context9 : public ContextImpl
GLenum mode,
GLsizei count,
GLenum type,
const void *indices,
const gl::IndexRange &indexRange) override;
const void *indices) override;
gl::Error drawElementsInstanced(const gl::Context *context,
GLenum mode,
GLsizei count,
GLenum type,
const void *indices,
GLsizei instances,
const gl::IndexRange &indexRange) override;
GLsizei instances) override;
gl::Error drawRangeElements(const gl::Context *context,
GLenum mode,
GLuint start,
GLuint end,
GLsizei count,
GLenum type,
const void *indices,
const gl::IndexRange &indexRange) override;
const void *indices) override;
gl::Error drawArraysIndirect(const gl::Context *context,
GLenum mode,
const void *indirect) override;
......
......@@ -1412,14 +1412,24 @@ gl::Error Renderer9::drawArraysImpl(const gl::ContextState &data,
}
}
gl::Error Renderer9::drawElementsImpl(const gl::ContextState &data,
const TranslatedIndexData &indexInfo,
gl::Error Renderer9::drawElementsImpl(const gl::Context *context,
GLenum mode,
GLsizei count,
GLenum type,
const void *indices,
GLsizei /*instances*/)
GLsizei instances)
{
const auto &data = context->getContextState();
TranslatedIndexData indexInfo;
const gl::IndexRange &indexRange =
context->getParams<gl::HasIndexRange>().getIndexRange().value();
indexInfo.indexRange = indexRange;
ANGLE_TRY(applyIndexBuffer(data, indices, count, mode, type, &indexInfo));
size_t vertexCount = indexInfo.indexRange.vertexCount();
ANGLE_TRY(applyVertexBuffer(data.getState(), mode,
static_cast<GLsizei>(indexInfo.indexRange.start),
static_cast<GLsizei>(vertexCount), instances, &indexInfo));
startScene();
int minIndex = static_cast<int>(indexInfo.indexRange.start);
......@@ -1437,7 +1447,6 @@ gl::Error Renderer9::drawElementsImpl(const gl::ContextState &data,
}
else
{
size_t vertexCount = indexInfo.indexRange.vertexCount();
for (int i = 0; i < mRepeatDraw; i++)
{
mDevice->DrawIndexedPrimitive(mPrimitiveType, -minIndex, minIndex,
......@@ -3112,8 +3121,7 @@ gl::Error Renderer9::genericDrawElements(const gl::Context *context,
GLsizei count,
GLenum type,
const void *indices,
GLsizei instances,
const gl::IndexRange &indexRange)
GLsizei instances)
{
const auto &data = context->getContextState();
gl::Program *program = context->getGLState().getProgram();
......@@ -3130,10 +3138,7 @@ gl::Error Renderer9::genericDrawElements(const gl::Context *context,
ANGLE_TRY(updateState(context, mode));
TranslatedIndexData indexInfo;
indexInfo.indexRange = indexRange;
ANGLE_TRY(applyIndexBuffer(data, indices, count, mode, type, &indexInfo));
applyTransformFeedbackBuffers(data.getState());
// Transform feedback is not allowed for DrawElements, this error should have been caught at the
......@@ -3141,17 +3146,13 @@ gl::Error Renderer9::genericDrawElements(const gl::Context *context,
// layer.
ASSERT(!data.getState().isTransformFeedbackActiveUnpaused());
size_t vertexCount = indexInfo.indexRange.vertexCount();
ANGLE_TRY(applyVertexBuffer(data.getState(), mode,
static_cast<GLsizei>(indexInfo.indexRange.start),
static_cast<GLsizei>(vertexCount), instances, &indexInfo));
ANGLE_TRY(applyTextures(context));
ANGLE_TRY(applyShaders(context, mode));
ANGLE_TRY(programD3D->applyUniformBuffers(data));
if (!skipDraw(data, mode))
{
ANGLE_TRY(drawElementsImpl(data, indexInfo, mode, count, type, indices, instances));
ANGLE_TRY(drawElementsImpl(context, mode, count, type, indices, instances));
}
return gl::NoError();
......@@ -3196,6 +3197,13 @@ gl::Error Renderer9::genericDrawArrays(const gl::Context *context,
return gl::NoError();
}
bool Renderer9::supportsDirectDrawing(const gl::Context *context, GLenum mode, GLenum type) const
{
// TODO(jiajia.qin@intel.com): Add direct drawing for d3d9
UNIMPLEMENTED();
return false;
}
FramebufferImpl *Renderer9::createDefaultFramebuffer(const gl::FramebufferState &state)
{
return new Framebuffer9(state, this);
......
......@@ -382,8 +382,7 @@ class Renderer9 : public RendererD3D
GLsizei count,
GLenum type,
const void *indices,
GLsizei instances,
const gl::IndexRange &indexRange);
GLsizei instances);
// Necessary hack for default framebuffers in D3D.
FramebufferImpl *createDefaultFramebuffer(const gl::FramebufferState &state) override;
......@@ -398,14 +397,17 @@ class Renderer9 : public RendererD3D
gl::Error clearRenderTarget(RenderTargetD3D *renderTarget,
const gl::ColorF &clearValues) override;
protected:
// Support direct drawing with the drawing parameters.
bool supportsDirectDrawing(const gl::Context *context, GLenum mode, GLenum type) const override;
private:
gl::Error drawArraysImpl(const gl::ContextState &data,
GLenum mode,
GLint startVertex,
GLsizei count,
GLsizei instances);
gl::Error drawElementsImpl(const gl::ContextState &data,
const TranslatedIndexData &indexInfo,
gl::Error drawElementsImpl(const gl::Context *context,
GLenum mode,
GLsizei count,
GLenum type,
......
......@@ -170,10 +170,9 @@ gl::Error ContextGL::drawElements(const gl::Context *context,
GLenum mode,
GLsizei count,
GLenum type,
const void *indices,
const gl::IndexRange &indexRange)
const void *indices)
{
return mRenderer->drawElements(context, mode, count, type, indices, indexRange);
return mRenderer->drawElements(context, mode, count, type, indices);
}
gl::Error ContextGL::drawElementsInstanced(const gl::Context *context,
......@@ -181,11 +180,9 @@ gl::Error ContextGL::drawElementsInstanced(const gl::Context *context,
GLsizei count,
GLenum type,
const void *indices,
GLsizei instances,
const gl::IndexRange &indexRange)
GLsizei instances)
{
return mRenderer->drawElementsInstanced(context, mode, count, type, indices, instances,
indexRange);
return mRenderer->drawElementsInstanced(context, mode, count, type, indices, instances);
}
gl::Error ContextGL::drawRangeElements(const gl::Context *context,
......@@ -194,11 +191,9 @@ gl::Error ContextGL::drawRangeElements(const gl::Context *context,
GLuint end,
GLsizei count,
GLenum type,
const void *indices,
const gl::IndexRange &indexRange)
const void *indices)
{
return mRenderer->drawRangeElements(context, mode, start, end, count, type, indices,
indexRange);
return mRenderer->drawRangeElements(context, mode, start, end, count, type, indices);
}
gl::Error ContextGL::drawArraysIndirect(const gl::Context *context,
......
......@@ -86,23 +86,20 @@ class ContextGL : public ContextImpl
GLenum mode,
GLsizei count,
GLenum type,
const void *indices,
const gl::IndexRange &indexRange) override;
const void *indices) override;
gl::Error drawElementsInstanced(const gl::Context *context,
GLenum mode,
GLsizei count,
GLenum type,
const void *indices,
GLsizei instances,
const gl::IndexRange &indexRange) override;
GLsizei instances) override;
gl::Error drawRangeElements(const gl::Context *context,
GLenum mode,
GLuint start,
GLuint end,
GLsizei count,
GLenum type,
const void *indices,
const gl::IndexRange &indexRange) override;
const void *indices) override;
gl::Error drawArraysIndirect(const gl::Context *context,
GLenum mode,
const void *indirect) override;
......
......@@ -282,8 +282,7 @@ gl::Error RendererGL::drawElements(const gl::Context *context,
GLenum mode,
GLsizei count,
GLenum type,
const void *indices,
const gl::IndexRange &indexRange)
const void *indices)
{
const void *drawIndexPtr = nullptr;
ANGLE_TRY(mStateManager->setDrawElementsState(context, count, type, indices, 0, &drawIndexPtr));
......@@ -301,8 +300,7 @@ gl::Error RendererGL::drawElementsInstanced(const gl::Context *context,
GLsizei count,
GLenum type,
const void *indices,
GLsizei instances,
const gl::IndexRange &indexRange)
GLsizei instances)
{
const void *drawIndexPointer = nullptr;
ANGLE_TRY(mStateManager->setDrawElementsState(context, count, type, indices, instances,
......@@ -322,8 +320,7 @@ gl::Error RendererGL::drawRangeElements(const gl::Context *context,
GLuint end,
GLsizei count,
GLenum type,
const void *indices,
const gl::IndexRange &indexRange)
const void *indices)
{
const void *drawIndexPointer = nullptr;
ANGLE_TRY(
......
......@@ -62,23 +62,20 @@ class RendererGL : angle::NonCopyable
GLenum mode,
GLsizei count,
GLenum type,
const void *indices,
const gl::IndexRange &indexRange);
const void *indices);
gl::Error drawElementsInstanced(const gl::Context *context,
GLenum mode,
GLsizei count,
GLenum type,
const void *indices,
GLsizei instances,
const gl::IndexRange &indexRange);
GLsizei instances);
gl::Error drawRangeElements(const gl::Context *context,
GLenum mode,
GLuint start,
GLuint end,
GLsizei count,
GLenum type,
const void *indices,
const gl::IndexRange &indexRange);
const void *indices);
gl::Error drawArraysIndirect(const gl::Context *context, GLenum mode, const void *indirect);
gl::Error drawElementsIndirect(const gl::Context *context,
GLenum mode,
......
......@@ -113,8 +113,7 @@ gl::Error ContextNULL::drawElements(const gl::Context *context,
GLenum mode,
GLsizei count,
GLenum type,
const void *indices,
const gl::IndexRange &indexRange)
const void *indices)
{
return gl::NoError();
}
......@@ -124,8 +123,7 @@ gl::Error ContextNULL::drawElementsInstanced(const gl::Context *context,
GLsizei count,
GLenum type,
const void *indices,
GLsizei instances,
const gl::IndexRange &indexRange)
GLsizei instances)
{
return gl::NoError();
}
......@@ -136,8 +134,7 @@ gl::Error ContextNULL::drawRangeElements(const gl::Context *context,
GLuint end,
GLsizei count,
GLenum type,
const void *indices,
const gl::IndexRange &indexRange)
const void *indices)
{
return gl::NoError();
}
......
......@@ -57,23 +57,20 @@ class ContextNULL : public ContextImpl
GLenum mode,
GLsizei count,
GLenum type,
const void *indices,
const gl::IndexRange &indexRange) override;
const void *indices) override;
gl::Error drawElementsInstanced(const gl::Context *context,
GLenum mode,
GLsizei count,
GLenum type,
const void *indices,
GLsizei instances,
const gl::IndexRange &indexRange) override;
GLsizei instances) override;
gl::Error drawRangeElements(const gl::Context *context,
GLenum mode,
GLuint start,
GLuint end,
GLsizei count,
GLenum type,
const void *indices,
const gl::IndexRange &indexRange) override;
const void *indices) override;
gl::Error drawArraysIndirect(const gl::Context *context,
GLenum mode,
const void *indirect) override;
......
......@@ -340,8 +340,7 @@ gl::Error ContextVk::drawElements(const gl::Context *context,
GLenum mode,
GLsizei count,
GLenum type,
const void *indices,
const gl::IndexRange &indexRange)
const void *indices)
{
UNIMPLEMENTED();
return gl::InternalError();
......@@ -352,8 +351,7 @@ gl::Error ContextVk::drawElementsInstanced(const gl::Context *context,
GLsizei count,
GLenum type,
const void *indices,
GLsizei instances,
const gl::IndexRange &indexRange)
GLsizei instances)
{
UNIMPLEMENTED();
return gl::InternalError();
......@@ -365,8 +363,7 @@ gl::Error ContextVk::drawRangeElements(const gl::Context *context,
GLuint end,
GLsizei count,
GLenum type,
const void *indices,
const gl::IndexRange &indexRange)
const void *indices)
{
return gl::NoError();
}
......
......@@ -46,23 +46,20 @@ class ContextVk : public ContextImpl, public ResourceVk
GLenum mode,
GLsizei count,
GLenum type,
const void *indices,
const gl::IndexRange &indexRange) override;
const void *indices) override;
gl::Error drawElementsInstanced(const gl::Context *context,
GLenum mode,
GLsizei count,
GLenum type,
const void *indices,
GLsizei instances,
const gl::IndexRange &indexRange) override;
GLsizei instances) override;
gl::Error drawRangeElements(const gl::Context *context,
GLenum mode,
GLuint start,
GLuint end,
GLsizei count,
GLenum type,
const void *indices,
const gl::IndexRange &indexRange) override;
const void *indices) override;
gl::Error drawArraysIndirect(const gl::Context *context,
GLenum mode,
const void *indirect) override;
......
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