<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">
<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">
<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">
<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">
<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">
<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">
<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">
<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">
<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">
<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">
<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 -->
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">
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
<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>
<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>
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)
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):
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()
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 ]
<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 -->
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('};')
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)
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)]
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'
}
}
+static inline unsigned
+_mesa_tex_param_enum_to_count(GLenum pname)
+{
+ switch (pname) {
+ case GL_TEXTURE_MIN_FILTER:
+ case GL_TEXTURE_MAG_FILTER:
+ case GL_TEXTURE_WRAP_S:
+ case GL_TEXTURE_WRAP_T:
+ case GL_TEXTURE_WRAP_R:
+ case GL_TEXTURE_BASE_LEVEL:
+ case GL_TEXTURE_MAX_LEVEL:
+ case GL_GENERATE_MIPMAP_SGIS:
+ case GL_TEXTURE_COMPARE_MODE_ARB:
+ case GL_TEXTURE_COMPARE_FUNC_ARB:
+ case GL_DEPTH_TEXTURE_MODE_ARB:
+ case GL_DEPTH_STENCIL_TEXTURE_MODE:
+ case GL_TEXTURE_SRGB_DECODE_EXT:
+ case GL_TEXTURE_CUBE_MAP_SEAMLESS:
+ case GL_TEXTURE_SWIZZLE_R:
+ case GL_TEXTURE_SWIZZLE_G:
+ case GL_TEXTURE_SWIZZLE_B:
+ case GL_TEXTURE_SWIZZLE_A:
+ case GL_TEXTURE_MIN_LOD:
+ case GL_TEXTURE_MAX_LOD:
+ case GL_TEXTURE_PRIORITY:
+ case GL_TEXTURE_MAX_ANISOTROPY_EXT:
+ case GL_TEXTURE_LOD_BIAS:
+ case GL_TEXTURE_TILING_EXT:
+ return 1;
+ case GL_TEXTURE_CROP_RECT_OES:
+ case GL_TEXTURE_SWIZZLE_RGBA:
+ case GL_TEXTURE_BORDER_COLOR:
+ return 4;
+ default:
+ return 0;
+ }
+}
+
#endif /* MARSHAL_H */