diff options
author | Paul Berry <stereotype441@gmail.com> | 2012-11-07 13:04:40 -0800 |
---|---|---|
committer | Eric Anholt <eric@anholt.net> | 2013-01-03 09:38:39 -0800 |
commit | 368db6308befdd58999437a7137e5a7760aafb17 (patch) | |
tree | b0ea07e12f32730a0b633e3d25ebdbe3a53fad9a | |
parent | e76d1b69630fabf7011e7a69414097dbfab69168 (diff) |
Annotate functions with "marshal" attribute in GLAPI XML.
Several API functions require special treatment in order to be
marshalled to a background thread. Others can't be safely executed in
a background thread and need to be executed synchronously (e.g. since
they return data through a pointer argument).
This annotation will be used when code generating thread marshalling
code, to ensure that each function is marshalled in the correct way.
The possible annotations are:
- "draw": this is a draw call, and hence may access memory through
pointers that were set up by a previous call to
e.g. glVertexAttribPointer(), so it needs to be marshalled
specially.
- "async": this call should be marshalled to a background thread by
storing all of its arguments in a buffer that is shared with the
background thread.
- "sync": this call should not be marshalled to a background
thread--it should be executed synchronously.
- "custom": the marshalling for this function is complex enough that
it can't be code generated--it will be hand-coded instead.
Note that GL calls that return void will be treated as "async" by
default, and GL calls that return non-void will be treated as "sync"
by default.
Note that PixelMap functions are marked as synchronous for now since
their pointer may be relative to buffer on the GPU, so we'll need
special logic to marshal them properly.
-rw-r--r-- | src/mapi/glapi/gen/ARB_base_instance.xml | 6 | ||||
-rw-r--r-- | src/mapi/glapi/gen/ARB_draw_elements_base_vertex.xml | 9 | ||||
-rw-r--r-- | src/mapi/glapi/gen/ARB_draw_instanced.xml | 6 | ||||
-rw-r--r-- | src/mapi/glapi/gen/EXT_transform_feedback.xml | 3 | ||||
-rw-r--r-- | src/mapi/glapi/gen/gl_API.dtd | 3 | ||||
-rw-r--r-- | src/mapi/glapi/gen/gl_API.xml | 41 |
6 files changed, 41 insertions, 27 deletions
diff --git a/src/mapi/glapi/gen/ARB_base_instance.xml b/src/mapi/glapi/gen/ARB_base_instance.xml index 1478e39700c..4029b003cf3 100644 --- a/src/mapi/glapi/gen/ARB_base_instance.xml +++ b/src/mapi/glapi/gen/ARB_base_instance.xml @@ -9,7 +9,7 @@ <category name="GL_ARB_base_instance" number="107"> <function name="DrawArraysInstancedBaseInstance" offset="assign" - exec="dynamic"> + exec="dynamic" marshal="draw"> <param name="mode" type="GLenum"/> <param name="first" type="GLint"/> <param name="count" type="GLsizei"/> @@ -18,7 +18,7 @@ </function> <function name="DrawElementsInstancedBaseInstance" offset="assign" - exec="dynamic"> + exec="dynamic" marshal="draw"> <param name="mode" type="GLenum"/> <param name="count" type="GLsizei"/> <param name="type" type="GLenum"/> @@ -28,7 +28,7 @@ </function> <function name="DrawElementsInstancedBaseVertexBaseInstance" offset="assign" - exec="dynamic"> + exec="dynamic" marshal="draw"> <param name="mode" type="GLenum"/> <param name="count" type="GLsizei"/> <param name="type" type="GLenum"/> diff --git a/src/mapi/glapi/gen/ARB_draw_elements_base_vertex.xml b/src/mapi/glapi/gen/ARB_draw_elements_base_vertex.xml index 986654848ca..a2a0a775ed4 100644 --- a/src/mapi/glapi/gen/ARB_draw_elements_base_vertex.xml +++ b/src/mapi/glapi/gen/ARB_draw_elements_base_vertex.xml @@ -8,7 +8,8 @@ <category name="GL_ARB_draw_elements_base_vertex" number="62"> - <function name="DrawElementsBaseVertex" offset="assign" exec="dynamic"> + <function name="DrawElementsBaseVertex" offset="assign" exec="dynamic" + marshal="draw"> <param name="mode" type="GLenum"/> <param name="count" type="GLsizei"/> <param name="type" type="GLenum"/> @@ -17,7 +18,7 @@ </function> <function name="DrawRangeElementsBaseVertex" offset="assign" - exec="dynamic"> + exec="dynamic" marshal="draw"> <param name="mode" type="GLenum"/> <param name="start" type="GLuint"/> <param name="end" type="GLuint"/> @@ -28,7 +29,7 @@ </function> <function name="MultiDrawElementsBaseVertex" offset="assign" - exec="dynamic"> + exec="dynamic" marshal="draw"> <param name="mode" type="GLenum"/> <param name="count" type="const GLsizei *"/> <param name="type" type="GLenum"/> @@ -38,7 +39,7 @@ </function> <function name="DrawElementsInstancedBaseVertex" offset="assign" - exec="dynamic"> + exec="dynamic" marshal="draw"> <param name="mode" type="GLenum"/> <param name="count" type="GLsizei"/> <param name="type" type="GLenum"/> diff --git a/src/mapi/glapi/gen/ARB_draw_instanced.xml b/src/mapi/glapi/gen/ARB_draw_instanced.xml index 7ee7629c706..022d43922fc 100644 --- a/src/mapi/glapi/gen/ARB_draw_instanced.xml +++ b/src/mapi/glapi/gen/ARB_draw_instanced.xml @@ -8,14 +8,16 @@ <category name="GL_ARB_draw_instanced" number="44"> - <function name="DrawArraysInstancedARB" offset="assign" exec="dynamic"> + <function name="DrawArraysInstancedARB" offset="assign" exec="dynamic" + marshal="draw"> <param name="mode" type="GLenum"/> <param name="first" type="GLint"/> <param name="count" type="GLsizei"/> <param name="primcount" type="GLsizei"/> </function> - <function name="DrawElementsInstancedARB" offset="assign" exec="dynamic"> + <function name="DrawElementsInstancedARB" offset="assign" exec="dynamic" + marshal="draw"> <param name="mode" type="GLenum"/> <param name="count" type="GLsizei"/> <param name="type" type="GLenum"/> diff --git a/src/mapi/glapi/gen/EXT_transform_feedback.xml b/src/mapi/glapi/gen/EXT_transform_feedback.xml index e4b310ec362..2ca9dd658eb 100644 --- a/src/mapi/glapi/gen/EXT_transform_feedback.xml +++ b/src/mapi/glapi/gen/EXT_transform_feedback.xml @@ -108,7 +108,8 @@ <function name="ResumeTransformFeedback" offset="assign" es2="3.0"> </function> - <function name="DrawTransformFeedback" offset="assign" exec="dynamic"> + <function name="DrawTransformFeedback" offset="assign" exec="dynamic" + marshal="draw"> <param name="mode" type="GLenum"/> <param name="id" type="GLuint"/> </function> diff --git a/src/mapi/glapi/gen/gl_API.dtd b/src/mapi/glapi/gen/gl_API.dtd index ab321fad0f8..e34ca85d9d3 100644 --- a/src/mapi/glapi/gen/gl_API.dtd +++ b/src/mapi/glapi/gen/gl_API.dtd @@ -40,7 +40,8 @@ es2 CDATA "none" deprecated CDATA "none" exec NMTOKEN #IMPLIED - desktop (true | false) "true"> + desktop (true | false) "true" + marshal NMTOKEN #IMPLIED> <!ATTLIST size name NMTOKEN #REQUIRED count NMTOKEN #IMPLIED mode (get | set) "set"> diff --git a/src/mapi/glapi/gen/gl_API.xml b/src/mapi/glapi/gen/gl_API.xml index a47316a8351..826b0359645 100644 --- a/src/mapi/glapi/gen/gl_API.xml +++ b/src/mapi/glapi/gen/gl_API.xml @@ -2424,11 +2424,18 @@ <glx rop="139" handcode="client"/> </function> - <function name="Finish" offset="216" es1="1.0" es2="2.0"> + <function name="Finish" offset="216" es1="1.0" es2="2.0" marshal="sync"> <glx sop="108" handcode="true"/> </function> - <function name="Flush" offset="217" es1="1.0" es2="2.0"> + <!-- TODO: Flush is marshalled synchronously as a temporary hack + since we don't yet have a hook into SwapBuffers. + + NOTE: when we remove this hack, we'll still have to handle Flush + specially to ensure that it causes all previous commands to get + delivered to the server thread. + --> + <function name="Flush" offset="217" es1="1.0" es2="2.0" marshal="sync"> <glx sop="142" handcode="true"/> </function> @@ -2662,21 +2669,21 @@ <glx sop="110" handcode="client"/> </function> - <function name="PixelMapfv" offset="251" deprecated="3.1"> + <function name="PixelMapfv" offset="251" deprecated="3.1" marshal="sync"> <param name="map" type="GLenum"/> <param name="mapsize" type="GLsizei" counter="true"/> <param name="values" type="const GLfloat *" count="mapsize"/> <glx rop="168" large="true"/> </function> - <function name="PixelMapuiv" offset="252" deprecated="3.1"> + <function name="PixelMapuiv" offset="252" deprecated="3.1" marshal="sync"> <param name="map" type="GLenum"/> <param name="mapsize" type="GLsizei" counter="true"/> <param name="values" type="const GLuint *" count="mapsize"/> <glx rop="169" large="true"/> </function> - <function name="PixelMapusv" offset="253" deprecated="3.1"> + <function name="PixelMapusv" offset="253" deprecated="3.1" marshal="sync"> <param name="map" type="GLenum"/> <param name="mapsize" type="GLsizei" counter="true"/> <param name="values" type="const GLushort *" count="mapsize"/> @@ -3207,7 +3214,7 @@ <enum name="CLIENT_ALL_ATTRIB_BITS" value="0xFFFFFFFF"/> <function name="ArrayElement" offset="306" deprecated="3.1" - exec="dynamic"> + exec="dynamic" marshal="draw"> <param name="i" type="GLint"/> <glx handcode="true"/> </function> @@ -3227,7 +3234,7 @@ </function> <function name="DrawArrays" offset="310" es1="1.0" es2="2.0" - exec="dynamic"> + exec="dynamic" marshal="draw"> <param name="mode" type="GLenum"/> <param name="first" type="GLint"/> <param name="count" type="GLsizei"/> @@ -3235,7 +3242,7 @@ </function> <function name="DrawElements" offset="311" es1="1.0" es2="2.0" - exec="dynamic"> + exec="dynamic" marshal="draw"> <param name="mode" type="GLenum"/> <param name="count" type="GLsizei"/> <param name="type" type="GLenum"/> @@ -3794,7 +3801,7 @@ </function> <function name="DrawRangeElements" offset="338" es2="3.0" - exec="dynamic"> + exec="dynamic" marshal="draw"> <param name="mode" type="GLenum"/> <param name="start" type="GLuint"/> <param name="end" type="GLuint"/> @@ -4822,7 +4829,7 @@ <glx handcode="true"/> </function> - <function name="MultiDrawArrays" offset="assign"> + <function name="MultiDrawArrays" offset="assign" marshal="draw"> <param name="mode" type="GLenum"/> <param name="first" type="const GLint *"/> <param name="count" type="const GLsizei *"/> @@ -8244,7 +8251,7 @@ <enum name="MAX_VERTEX_STREAMS" value="0x8E71"/> <function name="DrawTransformFeedbackStream" offset="assign" - exec="dynamic"> + exec="dynamic" marshal="draw"> <param name="mode" type="GLenum"/> <param name="id" type="GLuint"/> <param name="stream" type="GLuint"/> @@ -8281,14 +8288,14 @@ <category name="GL_ARB_transform_feedback_instanced" number="109"> <function name="DrawTransformFeedbackInstanced" offset="assign" - exec="dynamic"> + exec="dynamic" marshal="draw"> <param name="mode" type="GLenum"/> <param name="id" type="GLuint"/> <param name="primcount" type="GLsizei"/> </function> <function name="DrawTransformFeedbackStreamInstanced" offset="assign" - exec="dynamic"> + exec="dynamic" marshal="draw"> <param name="mode" type="GLenum"/> <param name="id" type="GLuint"/> <param name="stream" type="GLuint"/> @@ -10149,7 +10156,7 @@ </function> <function name="MultiDrawElementsEXT" offset="assign" es1="1.0" es2="2.0" - exec="dynamic"> + exec="dynamic" marshal="draw"> <param name="mode" type="GLenum"/> <param name="count" type="const GLsizei *"/> <param name="type" type="GLenum"/> @@ -11160,7 +11167,8 @@ </category> <category name="GL_IBM_multimode_draw_arrays" number="200"> - <function name="MultiModeDrawArraysIBM" offset="assign" static_dispatch="false"> + <function name="MultiModeDrawArraysIBM" offset="assign" + static_dispatch="false" marshal="draw"> <param name="mode" type="const GLenum *"/> <param name="first" type="const GLint *"/> <param name="count" type="const GLsizei *"/> @@ -11169,7 +11177,8 @@ <glx handcode="true" ignore="true"/> </function> - <function name="MultiModeDrawElementsIBM" offset="assign" static_dispatch="false"> + <function name="MultiModeDrawElementsIBM" offset="assign" + static_dispatch="false" marshal="draw"> <param name="mode" type="const GLenum *"/> <param name="count" type="const GLsizei *"/> <param name="type" type="GLenum"/> |