Commit a12072ca by Geoff Lang Committed by Commit Bot

GL: Use ANGLE_GL_TRY for draw calls.

Bug: angleproject:3020 Change-Id: Id3ff1828a9a63f4efe6e85dc938a22dc6a782a88 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2135926Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org> Reviewed-by: 's avatarJonah Ryan-Davis <jonahr@google.com> Commit-Queue: Geoff Lang <geofflang@chromium.org>
parent 5dafe107
...@@ -288,11 +288,12 @@ angle::Result ContextGL::drawArrays(const gl::Context *context, ...@@ -288,11 +288,12 @@ angle::Result ContextGL::drawArrays(const gl::Context *context,
ANGLE_TRY(setDrawArraysState(context, first, count, instanceCount)); ANGLE_TRY(setDrawArraysState(context, first, count, instanceCount));
if (!usesMultiview) if (!usesMultiview)
{ {
getFunctions()->drawArrays(ToGLenum(mode), first, count); ANGLE_GL_TRY(context, getFunctions()->drawArrays(ToGLenum(mode), first, count));
} }
else else
{ {
getFunctions()->drawArraysInstanced(ToGLenum(mode), first, count, instanceCount); ANGLE_GL_TRY(context, getFunctions()->drawArraysInstanced(ToGLenum(mode), first, count,
instanceCount));
} }
return angle::Result::Continue; return angle::Result::Continue;
} }
...@@ -311,7 +312,8 @@ angle::Result ContextGL::drawArraysInstanced(const gl::Context *context, ...@@ -311,7 +312,8 @@ angle::Result ContextGL::drawArraysInstanced(const gl::Context *context,
} }
ANGLE_TRY(setDrawArraysState(context, first, count, adjustedInstanceCount)); ANGLE_TRY(setDrawArraysState(context, first, count, adjustedInstanceCount));
getFunctions()->drawArraysInstanced(ToGLenum(mode), first, count, adjustedInstanceCount); ANGLE_GL_TRY(context, getFunctions()->drawArraysInstanced(ToGLenum(mode), first, count,
adjustedInstanceCount));
return angle::Result::Continue; return angle::Result::Continue;
} }
...@@ -413,8 +415,9 @@ angle::Result ContextGL::drawArraysInstancedBaseInstance(const gl::Context *cont ...@@ -413,8 +415,9 @@ angle::Result ContextGL::drawArraysInstancedBaseInstance(const gl::Context *cont
if (functions->drawArraysInstancedBaseInstance) if (functions->drawArraysInstancedBaseInstance)
{ {
// GL 4.2+ or GL_EXT_base_instance // GL 4.2+ or GL_EXT_base_instance
functions->drawArraysInstancedBaseInstance(ToGLenum(mode), first, count, ANGLE_GL_TRY(context,
adjustedInstanceCount, baseInstance); functions->drawArraysInstancedBaseInstance(
ToGLenum(mode), first, count, adjustedInstanceCount, baseInstance));
} }
else else
{ {
...@@ -426,7 +429,8 @@ angle::Result ContextGL::drawArraysInstancedBaseInstance(const gl::Context *cont ...@@ -426,7 +429,8 @@ angle::Result ContextGL::drawArraysInstancedBaseInstance(const gl::Context *cont
gl::AttributesMask attribToResetMask = gl::AttributesMask attribToResetMask =
updateAttributesForBaseInstance(program, baseInstance); updateAttributesForBaseInstance(program, baseInstance);
functions->drawArraysInstanced(ToGLenum(mode), first, count, adjustedInstanceCount); ANGLE_GL_TRY(context, functions->drawArraysInstanced(ToGLenum(mode), first, count,
adjustedInstanceCount));
resetUpdatedAttributes(attribToResetMask); resetUpdatedAttributes(attribToResetMask);
} }
...@@ -453,12 +457,14 @@ angle::Result ContextGL::drawElements(const gl::Context *context, ...@@ -453,12 +457,14 @@ angle::Result ContextGL::drawElements(const gl::Context *context,
ANGLE_TRY(setDrawElementsState(context, count, type, indices, instanceCount, &drawIndexPtr)); ANGLE_TRY(setDrawElementsState(context, count, type, indices, instanceCount, &drawIndexPtr));
if (!usesMultiview) if (!usesMultiview)
{ {
getFunctions()->drawElements(ToGLenum(mode), count, ToGLenum(type), drawIndexPtr); ANGLE_GL_TRY(context, getFunctions()->drawElements(ToGLenum(mode), count, ToGLenum(type),
drawIndexPtr));
} }
else else
{ {
getFunctions()->drawElementsInstanced(ToGLenum(mode), count, ToGLenum(type), drawIndexPtr, ANGLE_GL_TRY(context,
instanceCount); getFunctions()->drawElementsInstanced(ToGLenum(mode), count, ToGLenum(type),
drawIndexPtr, instanceCount));
} }
return angle::Result::Continue; return angle::Result::Continue;
} }
...@@ -483,13 +489,14 @@ angle::Result ContextGL::drawElementsBaseVertex(const gl::Context *context, ...@@ -483,13 +489,14 @@ angle::Result ContextGL::drawElementsBaseVertex(const gl::Context *context,
ANGLE_TRY(setDrawElementsState(context, count, type, indices, instanceCount, &drawIndexPtr)); ANGLE_TRY(setDrawElementsState(context, count, type, indices, instanceCount, &drawIndexPtr));
if (!usesMultiview) if (!usesMultiview)
{ {
getFunctions()->drawElementsBaseVertex(ToGLenum(mode), count, ToGLenum(type), drawIndexPtr, ANGLE_GL_TRY(context, getFunctions()->drawElementsBaseVertex(
baseVertex); ToGLenum(mode), count, ToGLenum(type), drawIndexPtr, baseVertex));
} }
else else
{ {
getFunctions()->drawElementsInstancedBaseVertex(ToGLenum(mode), count, ToGLenum(type), ANGLE_GL_TRY(context, getFunctions()->drawElementsInstancedBaseVertex(
drawIndexPtr, instanceCount, baseVertex); ToGLenum(mode), count, ToGLenum(type), drawIndexPtr,
instanceCount, baseVertex));
} }
return angle::Result::Continue; return angle::Result::Continue;
} }
...@@ -511,8 +518,9 @@ angle::Result ContextGL::drawElementsInstanced(const gl::Context *context, ...@@ -511,8 +518,9 @@ angle::Result ContextGL::drawElementsInstanced(const gl::Context *context,
ANGLE_TRY(setDrawElementsState(context, count, type, indices, adjustedInstanceCount, ANGLE_TRY(setDrawElementsState(context, count, type, indices, adjustedInstanceCount,
&drawIndexPointer)); &drawIndexPointer));
getFunctions()->drawElementsInstanced(ToGLenum(mode), count, ToGLenum(type), drawIndexPointer, ANGLE_GL_TRY(context,
adjustedInstanceCount); getFunctions()->drawElementsInstanced(ToGLenum(mode), count, ToGLenum(type),
drawIndexPointer, adjustedInstanceCount));
return angle::Result::Continue; return angle::Result::Continue;
} }
...@@ -534,8 +542,9 @@ angle::Result ContextGL::drawElementsInstancedBaseVertex(const gl::Context *cont ...@@ -534,8 +542,9 @@ angle::Result ContextGL::drawElementsInstancedBaseVertex(const gl::Context *cont
ANGLE_TRY(setDrawElementsState(context, count, type, indices, adjustedInstanceCount, ANGLE_TRY(setDrawElementsState(context, count, type, indices, adjustedInstanceCount,
&drawIndexPointer)); &drawIndexPointer));
getFunctions()->drawElementsInstancedBaseVertex( ANGLE_GL_TRY(context, getFunctions()->drawElementsInstancedBaseVertex(
ToGLenum(mode), count, ToGLenum(type), drawIndexPointer, adjustedInstanceCount, baseVertex); ToGLenum(mode), count, ToGLenum(type), drawIndexPointer,
adjustedInstanceCount, baseVertex));
return angle::Result::Continue; return angle::Result::Continue;
} }
...@@ -564,9 +573,9 @@ angle::Result ContextGL::drawElementsInstancedBaseVertexBaseInstance(const gl::C ...@@ -564,9 +573,9 @@ angle::Result ContextGL::drawElementsInstancedBaseVertexBaseInstance(const gl::C
if (functions->drawElementsInstancedBaseVertexBaseInstance) if (functions->drawElementsInstancedBaseVertexBaseInstance)
{ {
// GL 4.2+ or GL_EXT_base_instance // GL 4.2+ or GL_EXT_base_instance
functions->drawElementsInstancedBaseVertexBaseInstance( ANGLE_GL_TRY(context, functions->drawElementsInstancedBaseVertexBaseInstance(
ToGLenum(mode), count, ToGLenum(type), drawIndexPointer, adjustedInstanceCount, ToGLenum(mode), count, ToGLenum(type), drawIndexPointer,
baseVertex, baseInstance); adjustedInstanceCount, baseVertex, baseInstance));
} }
else else
{ {
...@@ -575,9 +584,9 @@ angle::Result ContextGL::drawElementsInstancedBaseVertexBaseInstance(const gl::C ...@@ -575,9 +584,9 @@ angle::Result ContextGL::drawElementsInstancedBaseVertexBaseInstance(const gl::C
gl::AttributesMask attribToResetMask = gl::AttributesMask attribToResetMask =
updateAttributesForBaseInstance(program, baseInstance); updateAttributesForBaseInstance(program, baseInstance);
functions->drawElementsInstancedBaseVertex(ToGLenum(mode), count, ToGLenum(type), ANGLE_GL_TRY(context, functions->drawElementsInstancedBaseVertex(
drawIndexPointer, adjustedInstanceCount, ToGLenum(mode), count, ToGLenum(type), drawIndexPointer,
baseVertex); adjustedInstanceCount, baseVertex));
resetUpdatedAttributes(attribToResetMask); resetUpdatedAttributes(attribToResetMask);
} }
...@@ -602,13 +611,14 @@ angle::Result ContextGL::drawRangeElements(const gl::Context *context, ...@@ -602,13 +611,14 @@ angle::Result ContextGL::drawRangeElements(const gl::Context *context,
setDrawElementsState(context, count, type, indices, instanceCount, &drawIndexPointer)); setDrawElementsState(context, count, type, indices, instanceCount, &drawIndexPointer));
if (!usesMultiview) if (!usesMultiview)
{ {
getFunctions()->drawRangeElements(ToGLenum(mode), start, end, count, ToGLenum(type), ANGLE_GL_TRY(context, getFunctions()->drawRangeElements(ToGLenum(mode), start, end, count,
drawIndexPointer); ToGLenum(type), drawIndexPointer));
} }
else else
{ {
getFunctions()->drawElementsInstanced(ToGLenum(mode), count, ToGLenum(type), ANGLE_GL_TRY(context,
drawIndexPointer, instanceCount); getFunctions()->drawElementsInstanced(ToGLenum(mode), count, ToGLenum(type),
drawIndexPointer, instanceCount));
} }
return angle::Result::Continue; return angle::Result::Continue;
} }
...@@ -631,13 +641,15 @@ angle::Result ContextGL::drawRangeElementsBaseVertex(const gl::Context *context, ...@@ -631,13 +641,15 @@ angle::Result ContextGL::drawRangeElementsBaseVertex(const gl::Context *context,
setDrawElementsState(context, count, type, indices, instanceCount, &drawIndexPointer)); setDrawElementsState(context, count, type, indices, instanceCount, &drawIndexPointer));
if (!usesMultiview) if (!usesMultiview)
{ {
getFunctions()->drawRangeElementsBaseVertex(ToGLenum(mode), start, end, count, ANGLE_GL_TRY(context, getFunctions()->drawRangeElementsBaseVertex(
ToGLenum(type), drawIndexPointer, baseVertex); ToGLenum(mode), start, end, count, ToGLenum(type),
drawIndexPointer, baseVertex));
} }
else else
{ {
getFunctions()->drawElementsInstancedBaseVertex( ANGLE_GL_TRY(context, getFunctions()->drawElementsInstancedBaseVertex(
ToGLenum(mode), count, ToGLenum(type), drawIndexPointer, instanceCount, baseVertex); ToGLenum(mode), count, ToGLenum(type), drawIndexPointer,
instanceCount, baseVertex));
} }
return angle::Result::Continue; return angle::Result::Continue;
} }
...@@ -646,7 +658,7 @@ angle::Result ContextGL::drawArraysIndirect(const gl::Context *context, ...@@ -646,7 +658,7 @@ angle::Result ContextGL::drawArraysIndirect(const gl::Context *context,
gl::PrimitiveMode mode, gl::PrimitiveMode mode,
const void *indirect) const void *indirect)
{ {
getFunctions()->drawArraysIndirect(ToGLenum(mode), indirect); ANGLE_GL_TRY(context, getFunctions()->drawArraysIndirect(ToGLenum(mode), indirect));
return angle::Result::Continue; return angle::Result::Continue;
} }
...@@ -655,7 +667,8 @@ angle::Result ContextGL::drawElementsIndirect(const gl::Context *context, ...@@ -655,7 +667,8 @@ angle::Result ContextGL::drawElementsIndirect(const gl::Context *context,
gl::DrawElementsType type, gl::DrawElementsType type,
const void *indirect) const void *indirect)
{ {
getFunctions()->drawElementsIndirect(ToGLenum(mode), ToGLenum(type), indirect); ANGLE_GL_TRY(context,
getFunctions()->drawElementsIndirect(ToGLenum(mode), ToGLenum(type), indirect));
return angle::Result::Continue; return angle::Result::Continue;
} }
......
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