Commit 675fe718 by Jamie Madill Committed by Commit Bot

Don't return Error from Context draw methods.

The Error should be consumed in the Context call. BUG=angleproject:747 Change-Id: I5daae602e8f6c7feed89573c6c9387c295ba9a32 Reviewed-on: https://chromium-review.googlesource.com/421258Reviewed-by: 's avatarGeoff Lang <geofflang@chromium.org> Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
parent 77ba408a
......@@ -1618,56 +1618,61 @@ void Context::getBooleani_v(GLenum target, GLuint index, GLboolean *data)
}
}
Error Context::drawArrays(GLenum mode, GLint first, GLsizei count)
void Context::drawArrays(GLenum mode, GLint first, GLsizei count)
{
syncRendererState();
ANGLE_TRY(mImplementation->drawArrays(mode, first, count));
MarkTransformFeedbackBufferUsage(mGLState.getCurrentTransformFeedback());
return NoError();
auto error = mImplementation->drawArrays(mode, first, count);
handleError(error);
if (!error.isError())
{
MarkTransformFeedbackBufferUsage(mGLState.getCurrentTransformFeedback());
}
}
Error Context::drawArraysInstanced(GLenum mode, GLint first, GLsizei count, GLsizei instanceCount)
void Context::drawArraysInstanced(GLenum mode, GLint first, GLsizei count, GLsizei instanceCount)
{
syncRendererState();
ANGLE_TRY(mImplementation->drawArraysInstanced(mode, first, count, instanceCount));
MarkTransformFeedbackBufferUsage(mGLState.getCurrentTransformFeedback());
return NoError();
auto error = mImplementation->drawArraysInstanced(mode, first, count, instanceCount);
handleError(error);
if (!error.isError())
{
MarkTransformFeedbackBufferUsage(mGLState.getCurrentTransformFeedback());
}
}
Error Context::drawElements(GLenum mode,
GLsizei count,
GLenum type,
const GLvoid *indices,
const IndexRange &indexRange)
void Context::drawElements(GLenum mode,
GLsizei count,
GLenum type,
const GLvoid *indices,
const IndexRange &indexRange)
{
syncRendererState();
return mImplementation->drawElements(mode, count, type, indices, indexRange);
handleError(mImplementation->drawElements(mode, count, type, indices, indexRange));
}
Error Context::drawElementsInstanced(GLenum mode,
GLsizei count,
GLenum type,
const GLvoid *indices,
GLsizei instances,
const IndexRange &indexRange)
void Context::drawElementsInstanced(GLenum mode,
GLsizei count,
GLenum type,
const GLvoid *indices,
GLsizei instances,
const IndexRange &indexRange)
{
syncRendererState();
return mImplementation->drawElementsInstanced(mode, count, type, indices, instances,
indexRange);
handleError(
mImplementation->drawElementsInstanced(mode, count, type, indices, instances, indexRange));
}
Error Context::drawRangeElements(GLenum mode,
GLuint start,
GLuint end,
GLsizei count,
GLenum type,
const GLvoid *indices,
const IndexRange &indexRange)
void Context::drawRangeElements(GLenum mode,
GLuint start,
GLuint end,
GLsizei count,
GLenum type,
const GLvoid *indices,
const IndexRange &indexRange)
{
syncRendererState();
return mImplementation->drawRangeElements(mode, start, end, count, type, indices, indexRange);
handleError(
mImplementation->drawRangeElements(mode, start, end, count, type, indices, indexRange));
}
void Context::drawArraysIndirect(GLenum mode, const GLvoid *indirect)
......@@ -1682,14 +1687,14 @@ void Context::drawElementsIndirect(GLenum mode, GLenum type, const GLvoid *indir
handleError(mImplementation->drawElementsIndirect(mode, type, indirect));
}
Error Context::flush()
void Context::flush()
{
return mImplementation->flush();
handleError(mImplementation->flush());
}
Error Context::finish()
void Context::finish()
{
return mImplementation->finish();
handleError(mImplementation->finish());
}
void Context::insertEventMarker(GLsizei length, const char *marker)
......
......@@ -289,27 +289,27 @@ class Context final : public ValidationContext
void clearBufferiv(GLenum buffer, GLint drawbuffer, const GLint *values);
void clearBufferfi(GLenum buffer, GLint drawbuffer, GLfloat depth, GLint stencil);
Error drawArrays(GLenum mode, GLint first, GLsizei count);
Error drawArraysInstanced(GLenum mode, GLint first, GLsizei count, GLsizei instanceCount);
Error drawElements(GLenum mode,
GLsizei count,
GLenum type,
const GLvoid *indices,
const IndexRange &indexRange);
Error drawElementsInstanced(GLenum mode,
GLsizei count,
GLenum type,
const GLvoid *indices,
GLsizei instances,
const IndexRange &indexRange);
Error drawRangeElements(GLenum mode,
GLuint start,
GLuint end,
GLsizei count,
GLenum type,
const GLvoid *indices,
const IndexRange &indexRange);
void drawArrays(GLenum mode, GLint first, GLsizei count);
void drawArraysInstanced(GLenum mode, GLint first, GLsizei count, GLsizei instanceCount);
void drawElements(GLenum mode,
GLsizei count,
GLenum type,
const GLvoid *indices,
const IndexRange &indexRange);
void drawElementsInstanced(GLenum mode,
GLsizei count,
GLenum type,
const GLvoid *indices,
GLsizei instances,
const IndexRange &indexRange);
void drawRangeElements(GLenum mode,
GLuint start,
GLuint end,
GLsizei count,
GLenum type,
const GLvoid *indices,
const IndexRange &indexRange);
void drawArraysIndirect(GLenum mode, const GLvoid *indirect);
void drawElementsIndirect(GLenum mode, GLenum type, const GLvoid *indirect);
......@@ -488,8 +488,8 @@ class Context final : public ValidationContext
void generateMipmap(GLenum target);
Error flush();
Error finish();
void flush();
void finish();
void getBufferPointerv(GLenum target, GLenum pname, void **params);
GLvoid *mapBuffer(GLenum target, GLenum access);
......
......@@ -764,12 +764,7 @@ void GL_APIENTRY DrawArrays(GLenum mode, GLint first, GLsizei count)
return;
}
Error error = context->drawArrays(mode, first, count);
if (error.isError())
{
context->handleError(error);
return;
}
context->drawArrays(mode, first, count);
}
}
......@@ -787,12 +782,7 @@ void GL_APIENTRY DrawElements(GLenum mode, GLsizei count, GLenum type, const GLv
return;
}
Error error = context->drawElements(mode, count, type, indices, indexRange);
if (error.isError())
{
context->handleError(error);
return;
}
context->drawElements(mode, count, type, indices, indexRange);
}
}
......@@ -836,12 +826,7 @@ void GL_APIENTRY Finish(void)
Context *context = GetValidGlobalContext();
if (context)
{
Error error = context->finish();
if (error.isError())
{
context->handleError(error);
return;
}
context->finish();
}
}
......@@ -852,12 +837,7 @@ void GL_APIENTRY Flush(void)
Context *context = GetValidGlobalContext();
if (context)
{
Error error = context->flush();
if (error.isError())
{
context->handleError(error);
return;
}
context->flush();
}
}
......
......@@ -276,12 +276,7 @@ void GL_APIENTRY DrawArraysInstancedANGLE(GLenum mode,
return;
}
Error error = context->drawArraysInstanced(mode, first, count, primcount);
if (error.isError())
{
context->handleError(error);
return;
}
context->drawArraysInstanced(mode, first, count, primcount);
}
}
......@@ -306,13 +301,7 @@ void GL_APIENTRY DrawElementsInstancedANGLE(GLenum mode,
return;
}
Error error =
context->drawElementsInstanced(mode, count, type, indices, primcount, indexRange);
if (error.isError())
{
context->handleError(error);
return;
}
context->drawElementsInstanced(mode, count, type, indices, primcount, indexRange);
}
}
......
......@@ -61,17 +61,7 @@ void GL_APIENTRY DrawRangeElements(GLenum mode, GLuint start, GLuint end, GLsize
return;
}
// As long as index validation is done, it doesn't matter whether the context receives a drawElements or
// a drawRangeElements call - the GL back-end is free to choose to call drawRangeElements based on the
// validated index range. If index validation is removed, adding drawRangeElements to the context interface
// should be reconsidered.
Error error =
context->drawRangeElements(mode, start, end, count, type, indices, indexRange);
if (error.isError())
{
context->handleError(error);
return;
}
context->drawRangeElements(mode, start, end, count, type, indices, indexRange);
}
}
......@@ -1702,12 +1692,7 @@ void GL_APIENTRY DrawArraysInstanced(GLenum mode, GLint first, GLsizei count, GL
return;
}
Error error = context->drawArraysInstanced(mode, first, count, instanceCount);
if (error.isError())
{
context->handleError(error);
return;
}
context->drawArraysInstanced(mode, first, count, instanceCount);
}
}
......@@ -1731,13 +1716,7 @@ void GL_APIENTRY DrawElementsInstanced(GLenum mode, GLsizei count, GLenum type,
return;
}
Error error =
context->drawElementsInstanced(mode, count, type, indices, instanceCount, indexRange);
if (error.isError())
{
context->handleError(error);
return;
}
context->drawElementsInstanced(mode, count, type, indices, instanceCount, indexRange);
}
}
......
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