On 14 December 2012 17:26, Ian Romanick <span dir="ltr"><<a href="mailto:idr@freedesktop.org" target="_blank">idr@freedesktop.org</a>></span> wrote:<br><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="HOEnZb"><div class="h5">On 12/14/2012 01:01 PM, Paul Berry wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
In GLES3, only glDrawArrays() and glDrawArraysInstanced() calls are<br>
allowed when transform feedback is active.<br>
---<br>
src/mesa/main/api_validate.c | 45 ++++++++++++++++++++++++++++++<u></u>++++++++++++++<br>
1 file changed, 45 insertions(+)<br>
<br>
diff --git a/src/mesa/main/api_validate.c b/src/mesa/main/api_validate.c<br>
index e47db23..355a93c 100644<br>
--- a/src/mesa/main/api_validate.c<br>
+++ b/src/mesa/main/api_validate.c<br>
@@ -313,9 +313,24 @@ _mesa_validate_DrawElements(<u></u>struct gl_context *ctx,<br>
GLenum mode, GLsizei count, GLenum type,<br>
const GLvoid *indices, GLint basevertex)<br>
{<br>
+ struct gl_transform_feedback_object *xfb_obj<br>
+ = ctx->TransformFeedback.<u></u>CurrentObject;<br>
ASSERT_OUTSIDE_BEGIN_END_WITH_<u></u>RETVAL(ctx, GL_FALSE);<br>
FLUSH_CURRENT(ctx, 0);<br>
<br>
+ /* From the GLES3 specification, section 2.14.2 (Transform Feedback<br>
+ * Primitive Capture):<br>
+ *<br>
+ * The error INVALID_OPERATION is also generated by DrawElements,<br>
+ * DrawElementsInstanced, and DrawRangeElements while transform feedback<br>
+ * is active and not paused, regardless of mode.<br>
+ */<br>
+ if (_mesa_is_gles3(ctx) && xfb_obj->Active && !xfb_obj->Paused) {<br>
</blockquote></div></div>
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^<u></u>^^^^^<br>
<br>
It seems like this predicate appears in a bunch of places. May be an is_active() macro to wrap it would be nice?</blockquote><div><br>That's a good point. It actually appears in a number of different files in various guises. I'll add a patch to the end of the series that makes an inline function for it.<br>
</div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="HOEnZb"><div class="h5"><br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
+ _mesa_error(ctx, GL_INVALID_OPERATION,<br>
+ "glDrawElements(transform feedback active)");<br>
+ return GL_FALSE;<br>
+ }<br>
+<br>
if (count <= 0) {<br>
if (count < 0)<br>
_mesa_error(ctx, GL_INVALID_VALUE, "glDrawElements(count)" );<br>
@@ -431,9 +446,24 @@ _mesa_validate_<u></u>DrawRangeElements(struct gl_context *ctx, GLenum mode,<br>
GLsizei count, GLenum type,<br>
const GLvoid *indices, GLint basevertex)<br>
{<br>
+ struct gl_transform_feedback_object *xfb_obj<br>
+ = ctx->TransformFeedback.<u></u>CurrentObject;<br>
ASSERT_OUTSIDE_BEGIN_END_WITH_<u></u>RETVAL(ctx, GL_FALSE);<br>
FLUSH_CURRENT(ctx, 0);<br>
<br>
+ /* From the GLES3 specification, section 2.14.2 (Transform Feedback<br>
+ * Primitive Capture):<br>
+ *<br>
+ * The error INVALID_OPERATION is also generated by DrawElements,<br>
+ * DrawElementsInstanced, and DrawRangeElements while transform feedback<br>
+ * is active and not paused, regardless of mode.<br>
+ */<br>
+ if (_mesa_is_gles3(ctx) && xfb_obj->Active && !xfb_obj->Paused) {<br>
+ _mesa_error(ctx, GL_INVALID_OPERATION,<br>
+ "glDrawElements(transform feedback active)");<br>
+ return GL_FALSE;<br>
+ }<br>
+<br>
if (count <= 0) {<br>
if (count < 0)<br>
_mesa_error(ctx, GL_INVALID_VALUE, "glDrawRangeElements(count)" );<br>
@@ -560,9 +590,24 @@ _mesa_validate_<u></u>DrawElementsInstanced(struct gl_context *ctx,<br>
const GLvoid *indices, GLsizei numInstances,<br>
GLint basevertex)<br>
{<br>
+ struct gl_transform_feedback_object *xfb_obj<br>
+ = ctx->TransformFeedback.<u></u>CurrentObject;<br>
ASSERT_OUTSIDE_BEGIN_END_WITH_<u></u>RETVAL(ctx, GL_FALSE);<br>
FLUSH_CURRENT(ctx, 0);<br>
<br>
+ /* From the GLES3 specification, section 2.14.2 (Transform Feedback<br>
+ * Primitive Capture):<br>
+ *<br>
+ * The error INVALID_OPERATION is also generated by DrawElements,<br>
+ * DrawElementsInstanced, and DrawRangeElements while transform feedback<br>
+ * is active and not paused, regardless of mode.<br>
+ */<br>
+ if (_mesa_is_gles3(ctx) && xfb_obj->Active && !xfb_obj->Paused) {<br>
+ _mesa_error(ctx, GL_INVALID_OPERATION,<br>
+ "glDrawElements(transform feedback active)");<br>
+ return GL_FALSE;<br>
+ }<br>
+<br>
if (count <= 0) {<br>
if (count < 0)<br>
_mesa_error(ctx, GL_INVALID_VALUE,<br>
<br>
</blockquote>
<br>
</div></div></blockquote></div><br></div>