diff options
author | Marek Olšák <[email protected]> | 2020-02-19 20:28:01 -0500 |
---|---|---|
committer | Marge Bot <[email protected]> | 2020-03-06 01:06:14 +0000 |
commit | 59e96bc513be3938e2d6dc4357e4d38fa5481f6a (patch) | |
tree | 386ad5f08bac6e4ba7b58e1b03706082178acbda /src/mapi | |
parent | 108fdb54c6c1b82ec3131b0c2e00d554b3729cfb (diff) |
glthread: add support for TexParameteri and SamplerParameteri functions
It's straightfoward except that I had to hack the python scripts to add
"marshal_count", which behaves just like "count" except that "variable_param"
is ignored. ("variable_param" changes the behavior of "count", which I don't
want)
Reviewed-by: Timothy Arceri <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3948>
Diffstat (limited to 'src/mapi')
-rw-r--r-- | src/mapi/glapi/gen/ARB_direct_state_access.xml | 8 | ||||
-rw-r--r-- | src/mapi/glapi/gen/ARB_sampler_objects.xml | 8 | ||||
-rw-r--r-- | src/mapi/glapi/gen/EXT_direct_state_access.xml | 16 | ||||
-rw-r--r-- | src/mapi/glapi/gen/GL3x.xml | 4 | ||||
-rw-r--r-- | src/mapi/glapi/gen/OES_fixed_point.xml | 2 | ||||
-rw-r--r-- | src/mapi/glapi/gen/gl_API.dtd | 3 | ||||
-rw-r--r-- | src/mapi/glapi/gen/gl_API.xml | 6 | ||||
-rw-r--r-- | src/mapi/glapi/gen/gl_XML.py | 11 | ||||
-rw-r--r-- | src/mapi/glapi/gen/gl_and_es_API.xml | 3 | ||||
-rw-r--r-- | src/mapi/glapi/gen/gl_marshal.py | 10 | ||||
-rw-r--r-- | src/mapi/glapi/gen/marshal_XML.py | 4 |
11 files changed, 42 insertions, 33 deletions
diff --git a/src/mapi/glapi/gen/ARB_direct_state_access.xml b/src/mapi/glapi/gen/ARB_direct_state_access.xml index 42ed70a7633..c652a412aa7 100644 --- a/src/mapi/glapi/gen/ARB_direct_state_access.xml +++ b/src/mapi/glapi/gen/ARB_direct_state_access.xml @@ -487,7 +487,7 @@ <function name="TextureParameterfv"> <param name="texture" type="GLuint" /> <param name="pname" type="GLenum" /> - <param name="param" type="const GLfloat *" /> + <param name="param" type="const GLfloat *" count="_mesa_tex_param_enum_to_count(pname)"/> </function> <function name="TextureParameteri"> @@ -499,19 +499,19 @@ <function name="TextureParameterIiv"> <param name="texture" type="GLuint" /> <param name="pname" type="GLenum" /> - <param name="params" type="const GLint *" /> + <param name="params" type="const GLint *" count="_mesa_tex_param_enum_to_count(pname)"/> </function> <function name="TextureParameterIuiv"> <param name="texture" type="GLuint" /> <param name="pname" type="GLenum" /> - <param name="params" type="const GLuint *" /> + <param name="params" type="const GLuint *" count="_mesa_tex_param_enum_to_count(pname)"/> </function> <function name="TextureParameteriv"> <param name="texture" type="GLuint" /> <param name="pname" type="GLenum" /> - <param name="param" type="const GLint *" /> + <param name="param" type="const GLint *" count="_mesa_tex_param_enum_to_count(pname)"/> </function> <function name="GenerateTextureMipmap" no_error="true"> diff --git a/src/mapi/glapi/gen/ARB_sampler_objects.xml b/src/mapi/glapi/gen/ARB_sampler_objects.xml index b8fdd125e24..1e628124c7f 100644 --- a/src/mapi/glapi/gen/ARB_sampler_objects.xml +++ b/src/mapi/glapi/gen/ARB_sampler_objects.xml @@ -42,25 +42,25 @@ <function name="SamplerParameteriv" es2="3.0"> <param name="sampler" type="GLuint"/> <param name="pname" type="GLenum"/> - <param name="params" type="const GLint *"/> + <param name="params" type="const GLint *" count="_mesa_tex_param_enum_to_count(pname)"/> </function> <function name="SamplerParameterfv" es2="3.0"> <param name="sampler" type="GLuint"/> <param name="pname" type="GLenum"/> - <param name="params" type="const GLfloat *"/> + <param name="params" type="const GLfloat *" count="_mesa_tex_param_enum_to_count(pname)"/> </function> <function name="SamplerParameterIiv" es2="3.2"> <param name="sampler" type="GLuint"/> <param name="pname" type="GLenum"/> - <param name="params" type="const GLint *"/> + <param name="params" type="const GLint *" count="_mesa_tex_param_enum_to_count(pname)"/> </function> <function name="SamplerParameterIuiv" es2="3.2"> <param name="sampler" type="GLuint"/> <param name="pname" type="GLenum"/> - <param name="params" type="const GLuint *"/> + <param name="params" type="const GLuint *" count="_mesa_tex_param_enum_to_count(pname)"/> </function> <function name="GetSamplerParameteriv" es2="3.0"> diff --git a/src/mapi/glapi/gen/EXT_direct_state_access.xml b/src/mapi/glapi/gen/EXT_direct_state_access.xml index 0d29282d293..b1cda780361 100644 --- a/src/mapi/glapi/gen/EXT_direct_state_access.xml +++ b/src/mapi/glapi/gen/EXT_direct_state_access.xml @@ -151,7 +151,7 @@ <param name="texture" type="GLuint" /> <param name="target" type="GLenum" /> <param name="pname" type="GLenum" /> - <param name="params" type="const GLint *" /> + <param name="params" type="const GLint *" count="_mesa_tex_param_enum_to_count(pname)"/> </function> <function name="TextureParameterfEXT"> @@ -165,7 +165,7 @@ <param name="texture" type="GLuint" /> <param name="target" type="GLenum" /> <param name="pname" type="GLenum" /> - <param name="params" type="const float *" /> + <param name="params" type="const float *" count="_mesa_tex_param_enum_to_count(pname)"/> </function> <function name="TextureImage1DEXT"> @@ -402,7 +402,7 @@ <param name="texunit" type="GLenum" /> <param name="target" type="GLenum" /> <param name="pname" type="GLenum" /> - <param name="param" type="const GLint*" /> + <param name="param" type="const GLint*" count="_mesa_tex_param_enum_to_count(pname)"/> </function> <function name="MultiTexParameterfEXT"> @@ -416,7 +416,7 @@ <param name="texunit" type="GLenum" /> <param name="target" type="GLenum" /> <param name="pname" type="GLenum" /> - <param name="param" type="const GLfloat*" /> + <param name="param" type="const GLfloat*" count="_mesa_tex_param_enum_to_count(pname)"/> </function> <function name="GetMultiTexParameterivEXT"> @@ -1288,14 +1288,14 @@ <param name="texture" type="GLuint" /> <param name="target" type="GLenum" /> <param name="pname" type="GLenum" /> - <param name="params" type="const GLint*" /> + <param name="params" type="const GLint*" count="_mesa_tex_param_enum_to_count(pname)"/> </function> <function name="TextureParameterIuivEXT"> <param name="texture" type="GLuint" /> <param name="target" type="GLenum" /> <param name="pname" type="GLenum" /> - <param name="params" type="const GLuint*" /> + <param name="params" type="const GLuint*" count="_mesa_tex_param_enum_to_count(pname)"/> </function> <function name="GetTextureParameterIivEXT"> @@ -1316,14 +1316,14 @@ <param name="texunit" type="GLenum" /> <param name="target" type="GLenum" /> <param name="pname" type="GLenum" /> - <param name="params" type="const GLint*" /> + <param name="params" type="const GLint*" count="_mesa_tex_param_enum_to_count(pname)"/> </function> <function name="MultiTexParameterIuivEXT"> <param name="texunit" type="GLenum" /> <param name="target" type="GLenum" /> <param name="pname" type="GLenum" /> - <param name="params" type="const GLuint*" /> + <param name="params" type="const GLuint*" count="_mesa_tex_param_enum_to_count(pname)"/> </function> <function name="GetMultiTexParameterIivEXT"> diff --git a/src/mapi/glapi/gen/GL3x.xml b/src/mapi/glapi/gen/GL3x.xml index 5608353cb28..4bf7c132560 100644 --- a/src/mapi/glapi/gen/GL3x.xml +++ b/src/mapi/glapi/gen/GL3x.xml @@ -451,13 +451,13 @@ <function name="TexParameterIiv" es2="3.2"> <param name="target" type="GLenum"/> <param name="pname" type="GLenum"/> - <param name="params" type="const GLint *"/> + <param name="params" type="const GLint *" count="_mesa_tex_param_enum_to_count(pname)"/> </function> <function name="TexParameterIuiv" es2="3.2"> <param name="target" type="GLenum"/> <param name="pname" type="GLenum"/> - <param name="params" type="const GLuint *"/> + <param name="params" type="const GLuint *" count="_mesa_tex_param_enum_to_count(pname)"/> </function> <function name="GetTexParameterIiv" es2="3.2"> diff --git a/src/mapi/glapi/gen/OES_fixed_point.xml b/src/mapi/glapi/gen/OES_fixed_point.xml index edd0acdba6f..5b4c48a7824 100644 --- a/src/mapi/glapi/gen/OES_fixed_point.xml +++ b/src/mapi/glapi/gen/OES_fixed_point.xml @@ -234,7 +234,7 @@ <function name="TexParameterxvOES" es1="1.0" alias="TexParameterxv"> <param name="target" type="GLenum"/> <param name="pname" type="GLenum"/> - <param name="params" type="const GLfixed *"/> + <param name="params" type="const GLfixed *" count="_mesa_tex_param_enum_to_count(pname)"/> </function> <!-- texgen --> diff --git a/src/mapi/glapi/gen/gl_API.dtd b/src/mapi/glapi/gen/gl_API.dtd index b464250777c..1f10e1e012d 100644 --- a/src/mapi/glapi/gen/gl_API.dtd +++ b/src/mapi/glapi/gen/gl_API.dtd @@ -41,6 +41,7 @@ desktop (true | false) "true" marshal NMTOKEN #IMPLIED marshal_fail CDATA #IMPLIED> + marshal_count CDATA #IMPLIED> <!ATTLIST size name NMTOKEN #REQUIRED count NMTOKEN #IMPLIED mode (get | set) "set"> @@ -134,6 +135,8 @@ param: to switch back to the Mesa implementation and call it directly. Used to disable glthread for GL compatibility interactions that we don't want to track state for. + marshal_count - same as count, but variable_param is ignored. Used by + glthread. glx: rop - Opcode value for "render" commands diff --git a/src/mapi/glapi/gen/gl_API.xml b/src/mapi/glapi/gen/gl_API.xml index a33e82ad53d..151148060b7 100644 --- a/src/mapi/glapi/gen/gl_API.xml +++ b/src/mapi/glapi/gen/gl_API.xml @@ -2131,7 +2131,8 @@ <function name="TexParameterfv" es1="1.1" es2="2.0"> <param name="target" type="GLenum"/> <param name="pname" type="GLenum"/> - <param name="params" type="const GLfloat *" variable_param="pname"/> + <param name="params" type="const GLfloat *" variable_param="pname" + marshal_count="_mesa_tex_param_enum_to_count(pname)"/> <glx rop="106"/> </function> @@ -2145,7 +2146,8 @@ <function name="TexParameteriv" es1="1.1" es2="2.0"> <param name="target" type="GLenum"/> <param name="pname" type="GLenum"/> - <param name="params" type="const GLint *" variable_param="pname"/> + <param name="params" type="const GLint *" variable_param="pname" + marshal_count="_mesa_tex_param_enum_to_count(pname)"/> <glx rop="108"/> </function> diff --git a/src/mapi/glapi/gen/gl_XML.py b/src/mapi/glapi/gen/gl_XML.py index 5b5f6e23b0a..7f1edbde9dd 100644 --- a/src/mapi/glapi/gen/gl_XML.py +++ b/src/mapi/glapi/gen/gl_XML.py @@ -431,6 +431,7 @@ class gl_parameter(object): self.count = 0 self.counter = c + self.marshal_count = element.get("marshal_count") self.count_scale = int(element.get( "count_scale", "1" )) elements = (count * self.count_scale) @@ -493,7 +494,7 @@ class gl_parameter(object): def is_variable_length(self): - return len(self.count_parameter_list) or self.counter + return len(self.count_parameter_list) or self.counter or self.marshal_count def is_64_bit(self): @@ -564,7 +565,7 @@ class gl_parameter(object): return c - def size_string(self, use_parens = 1): + def size_string(self, use_parens = 1, marshal = 0): base_size_str = "" count = self.get_element_count() @@ -573,10 +574,12 @@ class gl_parameter(object): base_size_str += "sizeof(%s)" % ( self.get_base_type_string() ) - if self.counter or self.count_parameter_list: + if self.counter or self.count_parameter_list or (self.marshal_count and marshal): list = [ "compsize" ] - if self.counter and self.count_parameter_list: + if self.marshal_count and marshal: + list = [ self.marshal_count ] + elif self.counter and self.count_parameter_list: list.append( self.counter ) elif self.counter: list = [ self.counter ] diff --git a/src/mapi/glapi/gen/gl_and_es_API.xml b/src/mapi/glapi/gen/gl_and_es_API.xml index fc152841028..2f47edf6914 100644 --- a/src/mapi/glapi/gen/gl_and_es_API.xml +++ b/src/mapi/glapi/gen/gl_and_es_API.xml @@ -259,7 +259,8 @@ <function name="TexParameterxv" es1="1.1" desktop="false"> <param name="target" type="GLenum"/> <param name="pname" type="GLenum"/> - <param name="params" type="const GLfixed *" variable_param="pname"/> + <param name="params" type="const GLfixed *" variable_param="pname" + marshal_count="_mesa_tex_param_enum_to_count(pname)"/> </function> <!-- from GL_OES_single_precision --> diff --git a/src/mapi/glapi/gen/gl_marshal.py b/src/mapi/glapi/gen/gl_marshal.py index 476f54d6aa6..a421c95dcfe 100644 --- a/src/mapi/glapi/gen/gl_marshal.py +++ b/src/mapi/glapi/gen/gl_marshal.py @@ -156,12 +156,12 @@ class PrintCode(gl_XML.gl_print_base): if p.count_scale != 1: out(('/* Next {0} bytes are ' '{1} {2}[{3}][{4}] */').format( - p.size_string(), p.get_base_type_string(), + p.size_string(marshal = 1), p.get_base_type_string(), p.name, p.counter, p.count_scale)) else: out(('/* Next {0} bytes are ' '{1} {2}[{3}] */').format( - p.size_string(), p.get_base_type_string(), + p.size_string(marshal = 1), p.get_base_type_string(), p.name, p.counter)) out('};') @@ -203,9 +203,9 @@ class PrintCode(gl_XML.gl_print_base): if i < len(func.variable_params): out('else') with indent(): - out('variable_data += {0};'.format(p.size_string(False))) + out('variable_data += {0};'.format(p.size_string(False, marshal = 1))) elif i < len(func.variable_params): - out('variable_data += {0};'.format(p.size_string(False))) + out('variable_data += {0};'.format(p.size_string(False, marshal = 1))) i += 1 self.print_sync_call(func) @@ -240,7 +240,7 @@ class PrintCode(gl_XML.gl_print_base): with indent(): out('GET_CURRENT_CONTEXT(ctx);') for p in func.variable_params: - out('int {0}_size = {1};'.format(p.name, p.size_string())) + out('int {0}_size = {1};'.format(p.name, p.size_string(marshal = 1))) struct = 'struct marshal_cmd_{0}'.format(func.name) size_terms = ['sizeof({0})'.format(struct)] diff --git a/src/mapi/glapi/gen/marshal_XML.py b/src/mapi/glapi/gen/marshal_XML.py index 5b682c51965..f6103b9e8fe 100644 --- a/src/mapi/glapi/gen/marshal_XML.py +++ b/src/mapi/glapi/gen/marshal_XML.py @@ -77,11 +77,11 @@ class marshal_function(gl_XML.gl_function): for p in self.parameters: if p.is_output: return 'sync' - if (p.is_pointer() and not (p.count or p.counter) + if (p.is_pointer() and not (p.count or p.counter or p.marshal_count) and not (self.marshal == 'draw' and (p.name == 'indices' or p.name == 'indirect'))): return 'sync' - if p.count_parameter_list: + if p.count_parameter_list and not p.marshal_count: # Parameter size is determined by enums; haven't # written logic to handle this yet. TODO: fix. return 'sync' |