mesa: Track the current vertex/element array buffers for glthread.
We want to support glthread on GLES contexts with reasonable apps, and on desktop for apps that use VBOs but haven't completely moved to core GL. To do so, we have to deal with the "the user may or may not pass user pointers to draw calls" problem. Acked-by: Timothy Arceri <tarceri@itsqueeze.com> Acked-by: Marek Olšák <maraeo@gmail.com> Tested-by: Dieter Nützel <Dieter@nuetzel-hh.de> Tested-by: Mike Lothian <mike@fireburn.co.uk>
This commit is contained in:
committed by
Timothy Arceri
parent
238d027ed6
commit
012bfebc07
@@ -8,7 +8,8 @@
|
||||
|
||||
<category name="GL_ARB_base_instance" number="107">
|
||||
|
||||
<function name="DrawArraysInstancedBaseInstance" exec="dynamic" marshal="draw">
|
||||
<function name="DrawArraysInstancedBaseInstance" exec="dynamic" marshal="draw"
|
||||
marshal_fail="_mesa_glthread_is_non_vbo_draw_elements(ctx)">
|
||||
<param name="mode" type="GLenum"/>
|
||||
<param name="first" type="GLint"/>
|
||||
<param name="count" type="GLsizei"/>
|
||||
@@ -16,7 +17,8 @@
|
||||
<param name="baseinstance" type="GLuint"/>
|
||||
</function>
|
||||
|
||||
<function name="DrawElementsInstancedBaseInstance" exec="dynamic" marshal="draw">
|
||||
<function name="DrawElementsInstancedBaseInstance" exec="dynamic" marshal="draw"
|
||||
marshal_fail="_mesa_glthread_is_non_vbo_draw_elements(ctx)">
|
||||
<param name="mode" type="GLenum"/>
|
||||
<param name="count" type="GLsizei"/>
|
||||
<param name="type" type="GLenum"/>
|
||||
@@ -25,7 +27,8 @@
|
||||
<param name="baseinstance" type="GLuint"/>
|
||||
</function>
|
||||
|
||||
<function name="DrawElementsInstancedBaseVertexBaseInstance" exec="dynamic" marshal="draw">
|
||||
<function name="DrawElementsInstancedBaseVertexBaseInstance" exec="dynamic" marshal="draw"
|
||||
marshal_fail="_mesa_glthread_is_non_vbo_draw_elements(ctx)">
|
||||
<param name="mode" type="GLenum"/>
|
||||
<param name="count" type="GLsizei"/>
|
||||
<param name="type" type="GLenum"/>
|
||||
|
||||
@@ -8,7 +8,8 @@
|
||||
|
||||
<category name="GL_ARB_draw_elements_base_vertex" number="62">
|
||||
|
||||
<function name="DrawElementsBaseVertex" es2="3.2" exec="dynamic" marshal="draw">
|
||||
<function name="DrawElementsBaseVertex" es2="3.2" exec="dynamic" marshal="draw"
|
||||
marshal_fail="_mesa_glthread_is_non_vbo_draw_elements(ctx)">
|
||||
<param name="mode" type="GLenum"/>
|
||||
<param name="count" type="GLsizei"/>
|
||||
<param name="type" type="GLenum"/>
|
||||
@@ -16,7 +17,8 @@
|
||||
<param name="basevertex" type="GLint"/>
|
||||
</function>
|
||||
|
||||
<function name="DrawRangeElementsBaseVertex" es2="3.2" exec="dynamic" marshal="draw">
|
||||
<function name="DrawRangeElementsBaseVertex" es2="3.2" exec="dynamic" marshal="draw"
|
||||
marshal_fail="_mesa_glthread_is_non_vbo_draw_elements(ctx)">
|
||||
<param name="mode" type="GLenum"/>
|
||||
<param name="start" type="GLuint"/>
|
||||
<param name="end" type="GLuint"/>
|
||||
@@ -26,7 +28,8 @@
|
||||
<param name="basevertex" type="GLint"/>
|
||||
</function>
|
||||
|
||||
<function name="MultiDrawElementsBaseVertex" exec="dynamic" marshal="draw">
|
||||
<function name="MultiDrawElementsBaseVertex" exec="dynamic" marshal="draw"
|
||||
marshal_fail="_mesa_glthread_is_non_vbo_draw_elements(ctx)">
|
||||
<param name="mode" type="GLenum"/>
|
||||
<param name="count" type="const GLsizei *"/>
|
||||
<param name="type" type="GLenum"/>
|
||||
@@ -35,7 +38,8 @@
|
||||
<param name="basevertex" type="const GLint *"/>
|
||||
</function>
|
||||
|
||||
<function name="DrawElementsInstancedBaseVertex" es2="3.2" exec="dynamic" marshal="draw">
|
||||
<function name="DrawElementsInstancedBaseVertex" es2="3.2" exec="dynamic" marshal="draw"
|
||||
marshal_fail="_mesa_glthread_is_non_vbo_draw_elements(ctx)">
|
||||
<param name="mode" type="GLenum"/>
|
||||
<param name="count" type="GLsizei"/>
|
||||
<param name="type" type="GLenum"/>
|
||||
|
||||
@@ -15,7 +15,8 @@
|
||||
<param name="primcount" type="GLsizei"/>
|
||||
</function>
|
||||
|
||||
<function name="DrawElementsInstancedARB" exec="dynamic" marshal="draw">
|
||||
<function name="DrawElementsInstancedARB" exec="dynamic" marshal="draw"
|
||||
marshal_fail="_mesa_glthread_is_non_vbo_draw_elements(ctx)">
|
||||
<param name="mode" type="GLenum"/>
|
||||
<param name="count" type="GLsizei"/>
|
||||
<param name="type" type="GLenum"/>
|
||||
|
||||
@@ -10,7 +10,8 @@
|
||||
|
||||
<enum name="VERTEX_ARRAY_BINDING" value="0x85B5"/>
|
||||
|
||||
<function name="BindVertexArray" es2="3.0">
|
||||
<function name="BindVertexArray" es2="3.0"
|
||||
marshal_fail="_mesa_glthread_is_compat_bind_vertex_array(ctx)">
|
||||
<param name="array" type="GLuint"/>
|
||||
</function>
|
||||
|
||||
|
||||
@@ -256,7 +256,8 @@
|
||||
|
||||
<!-- These functions alias ones from GL_EXT_gpu_shader4 -->
|
||||
|
||||
<function name="VertexAttribIPointer" es2="3.0" marshal="async">
|
||||
<function name="VertexAttribIPointer" es2="3.0" marshal="async"
|
||||
marshal_fail="_mesa_glthread_is_non_vbo_vertex_attrib_pointer(ctx)">
|
||||
<param name="index" type="GLuint"/>
|
||||
<param name="size" type="GLint"/>
|
||||
<param name="type" type="GLenum"/>
|
||||
|
||||
@@ -3153,7 +3153,8 @@
|
||||
<glx handcode="true"/>
|
||||
</function>
|
||||
|
||||
<function name="ColorPointer" es1="1.0" deprecated="3.1" marshal="async">
|
||||
<function name="ColorPointer" es1="1.0" deprecated="3.1" marshal="async"
|
||||
marshal_fail="_mesa_glthread_is_non_vbo_vertex_attrib_pointer(ctx)">
|
||||
<param name="size" type="GLint"/>
|
||||
<param name="type" type="GLenum"/>
|
||||
<param name="stride" type="GLsizei"/>
|
||||
@@ -3173,7 +3174,8 @@
|
||||
<glx rop="193" handcode="true"/>
|
||||
</function>
|
||||
|
||||
<function name="DrawElements" es1="1.0" es2="2.0" exec="dynamic" marshal="draw">
|
||||
<function name="DrawElements" es1="1.0" es2="2.0" exec="dynamic" marshal="draw"
|
||||
marshal_fail="_mesa_glthread_is_non_vbo_draw_elements(ctx)">
|
||||
<param name="mode" type="GLenum"/>
|
||||
<param name="count" type="GLsizei"/>
|
||||
<param name="type" type="GLenum"/>
|
||||
@@ -3181,7 +3183,8 @@
|
||||
<glx handcode="true"/>
|
||||
</function>
|
||||
|
||||
<function name="EdgeFlagPointer" deprecated="3.1" marshal="async">
|
||||
<function name="EdgeFlagPointer" deprecated="3.1" marshal="async"
|
||||
marshal_fail="_mesa_glthread_is_non_vbo_vertex_attrib_pointer(ctx)">
|
||||
<param name="stride" type="GLsizei"/>
|
||||
<param name="pointer" type="const GLvoid *"/>
|
||||
<glx handcode="true"/>
|
||||
@@ -3198,7 +3201,8 @@
|
||||
<glx handcode="true"/>
|
||||
</function>
|
||||
|
||||
<function name="IndexPointer" deprecated="3.1" marshal="async">
|
||||
<function name="IndexPointer" deprecated="3.1" marshal="async"
|
||||
marshal_fail="_mesa_glthread_is_non_vbo_vertex_attrib_pointer(ctx)">
|
||||
<param name="type" type="GLenum"/>
|
||||
<param name="stride" type="GLsizei"/>
|
||||
<param name="pointer" type="const GLvoid *"/>
|
||||
@@ -3212,14 +3216,16 @@
|
||||
<glx handcode="true"/>
|
||||
</function>
|
||||
|
||||
<function name="NormalPointer" es1="1.0" deprecated="3.1" marshal="async">
|
||||
<function name="NormalPointer" es1="1.0" deprecated="3.1" marshal="async"
|
||||
marshal_fail="_mesa_glthread_is_non_vbo_vertex_attrib_pointer(ctx)">
|
||||
<param name="type" type="GLenum"/>
|
||||
<param name="stride" type="GLsizei"/>
|
||||
<param name="pointer" type="const GLvoid *"/>
|
||||
<glx handcode="true"/>
|
||||
</function>
|
||||
|
||||
<function name="TexCoordPointer" es1="1.0" deprecated="3.1" marshal="async">
|
||||
<function name="TexCoordPointer" es1="1.0" deprecated="3.1" marshal="async"
|
||||
marshal_fail="_mesa_glthread_is_non_vbo_vertex_attrib_pointer(ctx)">
|
||||
<param name="size" type="GLint"/>
|
||||
<param name="type" type="GLenum"/>
|
||||
<param name="stride" type="GLsizei"/>
|
||||
@@ -3227,7 +3233,8 @@
|
||||
<glx handcode="true"/>
|
||||
</function>
|
||||
|
||||
<function name="VertexPointer" es1="1.0" deprecated="3.1" marshal="async">
|
||||
<function name="VertexPointer" es1="1.0" deprecated="3.1" marshal="async"
|
||||
marshal_fail="_mesa_glthread_is_non_vbo_vertex_attrib_pointer(ctx)">
|
||||
<param name="size" type="GLint"/>
|
||||
<param name="type" type="GLenum"/>
|
||||
<param name="stride" type="GLsizei"/>
|
||||
@@ -3730,7 +3737,8 @@
|
||||
<glx rop="4097"/>
|
||||
</function>
|
||||
|
||||
<function name="DrawRangeElements" es2="3.0" exec="dynamic" marshal="draw">
|
||||
<function name="DrawRangeElements" es2="3.0" exec="dynamic" marshal="draw"
|
||||
marshal_fail="_mesa_glthread_is_non_vbo_draw_elements(ctx)">
|
||||
<param name="mode" type="GLenum"/>
|
||||
<param name="start" type="GLuint"/>
|
||||
<param name="end" type="GLuint"/>
|
||||
@@ -4716,7 +4724,8 @@
|
||||
<glx rop="4125"/>
|
||||
</function>
|
||||
|
||||
<function name="FogCoordPointer" deprecated="3.1" marshal="async">
|
||||
<function name="FogCoordPointer" deprecated="3.1" marshal="async"
|
||||
marshal_fail="_mesa_glthread_is_non_vbo_vertex_attrib_pointer(ctx)">
|
||||
<param name="type" type="GLenum"/>
|
||||
<param name="stride" type="GLsizei"/>
|
||||
<param name="pointer" type="const GLvoid *"/>
|
||||
@@ -4852,7 +4861,8 @@
|
||||
<glx rop="4132"/>
|
||||
</function>
|
||||
|
||||
<function name="SecondaryColorPointer" deprecated="3.1" marshal="async">
|
||||
<function name="SecondaryColorPointer" deprecated="3.1" marshal="async"
|
||||
marshal_fail="_mesa_glthread_is_non_vbo_vertex_attrib_pointer(ctx)">
|
||||
<param name="size" type="GLint"/>
|
||||
<param name="type" type="GLenum"/>
|
||||
<param name="stride" type="GLsizei"/>
|
||||
@@ -5017,7 +5027,7 @@
|
||||
<type name="intptr" size="4" glx_name="CARD32"/>
|
||||
<type name="sizeiptr" size="4" unsigned="true" glx_name="CARD32"/>
|
||||
|
||||
<function name="BindBuffer" es1="1.1" es2="2.0">
|
||||
<function name="BindBuffer" es1="1.1" es2="2.0" marshal="custom">
|
||||
<param name="target" type="GLenum"/>
|
||||
<param name="buffer" type="GLuint"/>
|
||||
<glx ignore="true"/>
|
||||
@@ -5806,7 +5816,8 @@
|
||||
<glx rop="4233"/>
|
||||
</function>
|
||||
|
||||
<function name="VertexAttribPointer" es2="2.0" marshal="async">
|
||||
<function name="VertexAttribPointer" es2="2.0" marshal="async"
|
||||
marshal_fail="_mesa_glthread_is_non_vbo_vertex_attrib_pointer(ctx)">
|
||||
<param name="index" type="GLuint"/>
|
||||
<param name="size" type="GLint"/>
|
||||
<param name="type" type="GLenum"/>
|
||||
@@ -9179,7 +9190,8 @@
|
||||
<param name="i" type="GLint"/>
|
||||
</function>
|
||||
|
||||
<function name="ColorPointerEXT" deprecated="3.1" marshal="async">
|
||||
<function name="ColorPointerEXT" deprecated="3.1" marshal="async"
|
||||
marshal_fail="_mesa_glthread_is_non_vbo_vertex_attrib_pointer(ctx)">
|
||||
<param name="size" type="GLint"/>
|
||||
<param name="type" type="GLenum"/>
|
||||
<param name="stride" type="GLsizei"/>
|
||||
@@ -9194,7 +9206,8 @@
|
||||
<param name="count" type="GLsizei"/>
|
||||
</function>
|
||||
|
||||
<function name="EdgeFlagPointerEXT" deprecated="3.1" marshal="async">
|
||||
<function name="EdgeFlagPointerEXT" deprecated="3.1" marshal="async"
|
||||
marshal_fail="_mesa_glthread_is_non_vbo_vertex_attrib_pointer(ctx)">
|
||||
<param name="stride" type="GLsizei"/>
|
||||
<param name="count" type="GLsizei"/>
|
||||
<param name="pointer" type="const GLboolean *"/>
|
||||
@@ -9206,7 +9219,8 @@
|
||||
<param name="params" type="GLvoid **" output="true"/>
|
||||
</function>
|
||||
|
||||
<function name="IndexPointerEXT" deprecated="3.1" marshal="async">
|
||||
<function name="IndexPointerEXT" deprecated="3.1" marshal="async"
|
||||
marshal_fail="_mesa_glthread_is_non_vbo_vertex_attrib_pointer(ctx)">
|
||||
<param name="type" type="GLenum"/>
|
||||
<param name="stride" type="GLsizei"/>
|
||||
<param name="count" type="GLsizei"/>
|
||||
@@ -9214,7 +9228,8 @@
|
||||
<glx handcode="true"/>
|
||||
</function>
|
||||
|
||||
<function name="NormalPointerEXT" deprecated="3.1" marshal="async">
|
||||
<function name="NormalPointerEXT" deprecated="3.1" marshal="async"
|
||||
marshal_fail="_mesa_glthread_is_non_vbo_vertex_attrib_pointer(ctx)">
|
||||
<param name="type" type="GLenum"/>
|
||||
<param name="stride" type="GLsizei"/>
|
||||
<param name="count" type="GLsizei"/>
|
||||
@@ -9222,7 +9237,8 @@
|
||||
<glx handcode="true"/>
|
||||
</function>
|
||||
|
||||
<function name="TexCoordPointerEXT" deprecated="3.1" marshal="async">
|
||||
<function name="TexCoordPointerEXT" deprecated="3.1" marshal="async"
|
||||
marshal_fail="_mesa_glthread_is_non_vbo_vertex_attrib_pointer(ctx)">
|
||||
<param name="size" type="GLint"/>
|
||||
<param name="type" type="GLenum"/>
|
||||
<param name="stride" type="GLsizei"/>
|
||||
@@ -9231,7 +9247,8 @@
|
||||
<glx handcode="true"/>
|
||||
</function>
|
||||
|
||||
<function name="VertexPointerEXT" deprecated="3.1" marshal="async">
|
||||
<function name="VertexPointerEXT" deprecated="3.1" marshal="async"
|
||||
marshal_fail="_mesa_glthread_is_non_vbo_vertex_attrib_pointer(ctx)">
|
||||
<param name="size" type="GLint"/>
|
||||
<param name="type" type="GLenum"/>
|
||||
<param name="stride" type="GLsizei"/>
|
||||
@@ -10206,7 +10223,8 @@
|
||||
<param name="primcount" type="GLsizei"/>
|
||||
</function>
|
||||
|
||||
<function name="MultiDrawElementsEXT" es1="1.0" es2="2.0" exec="dynamic" marshal="draw">
|
||||
<function name="MultiDrawElementsEXT" es1="1.0" es2="2.0" exec="dynamic" marshal="draw"
|
||||
marshal_fail="_mesa_glthread_is_non_vbo_draw_elements(ctx)">
|
||||
<param name="mode" type="GLenum"/>
|
||||
<param name="count" type="const GLsizei *"/>
|
||||
<param name="type" type="GLenum"/>
|
||||
@@ -11225,7 +11243,8 @@
|
||||
<glx handcode="true" ignore="true"/>
|
||||
</function>
|
||||
|
||||
<function name="MultiModeDrawElementsIBM" marshal="draw">
|
||||
<function name="MultiModeDrawElementsIBM" marshal="draw"
|
||||
marshal_fail="_mesa_glthread_is_non_vbo_draw_elements(ctx)">
|
||||
<param name="mode" type="const GLenum *"/>
|
||||
<param name="count" type="const GLsizei *"/>
|
||||
<param name="type" type="GLenum"/>
|
||||
|
||||
@@ -252,10 +252,6 @@ class PrintCode(gl_XML.gl_print_base):
|
||||
self.print_sync_dispatch(func)
|
||||
out('}')
|
||||
|
||||
if func.marshal == 'draw':
|
||||
out('/* We relied on all vertex and index data being in VBOs */')
|
||||
out('assert(ctx->API == API_OPENGL_CORE);')
|
||||
|
||||
out('}')
|
||||
|
||||
def print_async_body(self, func):
|
||||
|
||||
Reference in New Issue
Block a user