]> git.tdb.fi Git - gldbg.git/commitdiff
Describe some texture parameters when printing
authorMikko Rasa <tdb@tdb.fi>
Tue, 18 Jan 2011 08:19:31 +0000 (08:19 +0000)
committerMikko Rasa <tdb@tdb.fi>
Tue, 18 Jan 2011 08:19:31 +0000 (08:19 +0000)
Describe texture internal formats
Fix GLES2 compilation

flavors/gles2/egl.io
flavors/gles2/gles2.io
source/glprint.c
source/glprint.funcs.t

index 3f795dd6d79e2a23db0d27ae47da51d0dd0e374f..511bc33aa5e85ea950ec156be01dd25eed1f891b 100644 (file)
@@ -7,8 +7,8 @@ EGLConfig, pointer, %p
 EGLSurface, pointer, %p
 EGLNativeWindowType, int, %lx
 EGLNativePixmapType, int, %lx
-EGLenum, int, %s, describe_enum:p.name:'"%s"'%p.type
-EGLenumHack, int, %s, describe_enum:p.name:'"%s"'%p.type
+EGLenum, int, %s, describe_enum
+EGLenumHack, int, %s, describe_enum
 EGLClientBuffer, pointer, %p
 EGLContext, pointer, %p
 __eglMustCastToProperFunctionPointerType, pointer, %p
index f64dab6210cbdfdfb624f9b5208bd10081f1c8d9..983321e775bde4191ed3612caced96e32ec53061 100644 (file)
@@ -1,6 +1,6 @@
-enum, int, %s, describe_enum:p.name:'"%s"'%p.type
+enum, int, %s, describe_enum
 boolean, char, %i
-bitfield, int, %s, describe_bitfield:p.name:'"%s"'%p.type
+bitfield, int, %s, describe_bitfield
 byte, char, %i
 ubyte, char, %u
 short, short, %i
index dff66f47f080156cf08b6958e9d68c66654ba560..33d083d0d59a1e7c91aef8c6c02cae1ce7d73f7c 100644 (file)
@@ -155,6 +155,37 @@ static const char *print_array_described(const char *(*describe)(GLenum, const c
        return buffer;
 }
 
+static const char *print_parameter(int pname, int param)
+{
+       char *buffer;
+
+       // XXX Need to move the param names to flavor
+       switch(pname)
+       {
+       case GL_TEXTURE_MIN_FILTER:
+       case GL_TEXTURE_MAG_FILTER:
+       case GL_TEXTURE_WRAP_S:
+       case GL_TEXTURE_WRAP_T:
+               return describe_enum(param, "");
+       }
+
+       buffer = tmpalloc(11);
+       snprintf(buffer, 11, "%i", param);
+       return buffer;
+}
+
+static const char *print_internal_format(int fmt)
+{
+       char *buffer;
+
+       if(fmt>4)
+               return describe_enum(fmt, "PixelFormat");
+
+       buffer = tmpalloc(2);
+       snprintf(buffer, 2, "%i", fmt);
+       return buffer;
+}
+
 static const char *print_data(const void *data, unsigned size)
 {
        if(!data)
index 5f703e1be510ff81272d0765d53530308930923c..b2fa11977580eefe8b7616e73ba7aaeac4e7f744 100644 (file)
@@ -9,11 +9,19 @@ wl('{')
 wl('   GlPrintData *gpd = (GlPrintData *)user_data;')
 w('    snprintf(gpd->buffer, gpd->bufsize, "%s(', func.name)
 first = True
+pname = None
 for p in params:
        if not first:
                w(', ')
+       if p.name=="pname":
+               pname = p
        if p.kind=="value":
-               w('%s', p.io[1])
+               if pname and p.name=="param" and p.base_ctype=="GLint":
+                       w('%%s')
+               elif p.type=="TextureComponentCount":
+                       w('%%s')
+               else:
+                       w('%s', p.io[1])
        elif p.kind=="reference" and not p.io:
                w('<ref:%s %%p>', p.type)
        else:
@@ -26,7 +34,11 @@ w('"')
 for p in params+[ret]:
        if p.ctype!="void":
                if p.kind=="value":
-                       if len(p.io)>=3 and p.io[2]:
+                       if pname and p.name=="param" and p.base_ctype=="GLint":
+                               w(', print_parameter(%s, %s)', pname.name, p.name)
+                       elif p.type=="TextureComponentCount":
+                               w(', print_internal_format(%s)', p.name)
+                       elif len(p.io)>=3 and p.io[2]:
                                w(', %s(%s, "%s")', p.io[2], p.name, p.type)
                        else:
                                w(', %s', p.name)