self.csize = "paramsize(pname)*sizeof(%s)"%self.base_ctype
else:
s = self.func.get_param(self.size.split('*')[0])
- if (s.type=="SizeI" or s.type.endswith("Int32") or s.type.startswith("BufferSize")) and s.kind=="value":
- self.csize = "%s*sizeof(%s)"%(self.size, self.base_ctype)
- if self.func.name.startswith("Uniform") and self.func.name[7].isdigit():
- self.csize += "*%s"%func.name[7]
+ if (s.type=="SizeI" or s.type.endswith("Int32") or s.type.startswith("BufferSize")):
+ if s.kind=="value":
+ self.csize = "%s"%self.size
+ if self.func.name.startswith("glUniformMatrix") and self.func.name[16]!='x':
+ self.csize += "*%d"%(int(self.func.name[15])**2)
+ elif self.func.name.startswith("glUniform") and self.func.name[9].isdigit():
+ self.csize += "*%s"%self.func.name[9]
+ if strip_name(self.base_ctype)!="void":
+ self.csize += "*sizeof(%s)"%self.base_ctype
+ elif s.kind=="array" and s.size==1:
+ self.csize = "*%s"%s.name
if not self.csize:
sys.stderr.write("Could not determine size for array parameter '%s[%s]' of function '%s'\n"%(self.name, self.size, self.func.name))
elif self.kind=="reference":
have_type = True
elif cn.endswith("Format"):
res += "formatsize(%s)"%param.name
- elif param.name=="pname" or cn.endswith("Parameter"):
+ elif param.name=="pname" or cn.endswith("Parameter") or (param.name=="target" and cn=="enum"):
res += "paramsize(%s)"%param.name
- elif cn=="MapTarget":
- res += "mapsize(%s)"%param.name
+ elif param.name=="buffer" and cn=="enum":
+ res += "buffersize(%s)"%param.name
elif (cn=="SizeI" or cn.endswith("Int32")) and not param.size:
res += param.name
else: