fixed bug added support for Programiv
authorEleni Maria Stea <elene.mst@gmail.com>
Wed, 13 Mar 2013 12:21:20 +0000 (14:21 +0200)
committerEleni Maria Stea <elene.mst@gmail.com>
Wed, 13 Mar 2013 12:21:20 +0000 (14:21 +0200)
fixed conf

gliar.conf
src/gliar.c
tests/glinfo/glinfo.c

index c6d3dfb..61d17d5 100644 (file)
@@ -1,10 +1,10 @@
-# Example GLIAR configuration
-# Copyright: Canonical Ltd, 2013
-# Author: Eleni Maria Stea <elene.mst@gmail.com>
+# example GLIAR configuration that emulates the asus eee GPU
+# copyright]Canonical Ltd, 2013
+# author]Eleni Maria Stea <elene.mst@gmail.com>
 #
 # Instructions:
 #
 # Instructions:
-# Copy this file to ~/.gliar.conf or to gliar.conf in the 
-# libgliar directory. Then run: 
+# Copy this file to ~/.gliar.con[f or to gliar.conf in the 
+# libgliar directory. Then run]
 # gliar <opengl_program_name> 
 #
 
 # gliar <opengl_program_name> 
 #
 
@@ -220,8 +220,134 @@ GL_ARB_robustness,
 GL_ARB_texture_storage
 GL_ARB_invalidate_subdata
 
 GL_ARB_texture_storage
 GL_ARB_invalidate_subdata
 
+[major version]
+2
+
+[minor version]
+1
+
+[max texture units]
+8
+
+[max texture image units]
+16
+
+[max combined texture image units]
+32
+
+[max vertex texture image units]
+16
+
 [max texture size]
 8192
 
 [max texture size]
 8192
 
-[max texture units]
+[max cube map texture size]
+8192
+
+[max texture coordinates]
 8
 8
+
+[max vertex attributes]
+16
+
+[max vertex uniform vectors]
+4096
+
+[max fragment uniform vectors]
+4096
+
+[max varying vectors]
+32
+
+[max color attachments]
+8
+
+[max renderbuffer size ext]
+8192
+
+[max program attribs arb]
+8
+
+[v max program instructions arb]
+16384
+
+[v max program native instructions arb]
+1048576
+
+[v max program temporaries arb]
+256
+
+[v max program native temporaries arb]
+256
+
+[v max program program parameters arb]
+32384
+
+[v max program native parameters arb]
+32384
+
+[v max program attribs arb]
+16
+
+[v max program native attribs arb]
+32
+
+[v max program address registers arb]
+1
+
+[v max program native address registers arb]
+16
+
+[v max program local parameters arb]
+4096
+
+[v max program env parameters arb]
+256
+
+[v max program alu instructions arb]
+256
+
+[v max program native alu instructions arb]
+256
+
+[f max program instructions arb]
+16384
+
+[f max program native instructions arb]
+1048576
+
+[f max program temporaries arb]
+256
+
+[f max program native temporaries arb]
+256
+
+[f max program program parameters arb]
+32384
+
+[f max program native parameters arb]
+32384
+
+[f max program attribs arb]
+12
+
+[f max program native attribs arb]
+32
+
+[f max program address registers arb]
+0
+
+[f max program native address registers arb]
+16
+
+[f max program local parameters arb]
+4096
+
+[f max program en[v parameters arb]
+256
+
+[f max program alu instructions arb]
+16384
+
+[f max program native alu instructions arb]
+1048576       
index 2bfa043..23164d5 100644 (file)
@@ -327,7 +327,7 @@ void glGetProgramivARB(GLuint program, GLenum pname, GLint *params)
        init();
 
        if(!gl_get_programiv) {
        init();
 
        if(!gl_get_programiv) {
-               fprintf(stderr, "Unable to fake the %s function. It is not supported by your OpenGL implementation.\n", __func__);
+               fprintf(stderr, "GLIAR: Unable to fake the %s function. It is not supported by your OpenGL implementation.\n", __func__);
                return;
        }
 
                return;
        }
 
@@ -422,17 +422,16 @@ void glGetProgramivARB(GLuint program, GLenum pname, GLint *params)
 
 void *glXGetProcAddress(const unsigned char *procname)
 {
 
 void *glXGetProcAddress(const unsigned char *procname)
 {
-       if(!glx_get_proc_address) {
-               glx_get_proc_address = dlsym(RTLD_NEXT, "glXGetProcAddress");
-               if(!glx_get_proc_address) {
-                       return 0;
-               }
-       }
+       init();
 
 
-       if(!strcmp((char*)procname, "glGetProgramivARB")) {
-               char *overr_name = "gl_get_programiv";
-               return glx_get_proc_address((unsigned char*)overr_name);
+       if(!strcmp((char*)procname, "glGetProgramivARB") || !strcmp((char*)procname, "glGetProgramiv")) {
+               return glGetProgramivARB;
        }
 
        return glx_get_proc_address(procname);
 }
        }
 
        return glx_get_proc_address(procname);
 }
+
+void *glXGetProcAddressARB(const unsigned char *procname)
+{
+       return glXGetProcAddress(procname);
+}
index 4dcff93..95b0148 100644 (file)
@@ -21,21 +21,26 @@ Author: Eleni Maria Stea <elene.mst@gmail.com>
 */
 
 #include <stdio.h>
 */
 
 #include <stdio.h>
-#include <GL/glew.h>
+//#include <GL/glew.h>
 #include <GL/glut.h>
 #include <GL/glut.h>
+#include <GL/glx.h>
 
 #define GET_INTEGER(x) (glGetIntegerv(x, &val), val)
 
 #define GET_INTEGER(x) (glGetIntegerv(x, &val), val)
-#define GET_PROGRAMIV_ARB_V(x) (glGetProgramivARB(GL_VERTEX_PROGRAM_ARB, x, &val), val)
-#define GET_PROGRAMIV_ARB_F(x) (glGetProgramivARB(GL_FRAGMENT_PROGRAM_ARB, x, &val), val)
+#define GET_PROGRAMIV_ARB_V(x) (gl_get_progiv(GL_VERTEX_PROGRAM_ARB, x, &val), val)
+#define GET_PROGRAMIV_ARB_F(x) (gl_get_progiv(GL_FRAGMENT_PROGRAM_ARB, x, &val), val)
 
 int main(int argc, char **argv)
 {
        int val;
 
 
 int main(int argc, char **argv)
 {
        int val;
 
+       void (*gl_get_progiv)(GLuint, GLenum, GLint*);
+
        glutInit(&argc, argv);
        glutCreateWindow("glinfo");
 
        glutInit(&argc, argv);
        glutCreateWindow("glinfo");
 
-       glewInit();
+//     glewInit();
+
+       gl_get_progiv = glXGetProcAddress("glGetProgramivARB");
 
        printf("vendor: %s\n", glGetString(GL_VENDOR));
        printf("renderer: %s\n", glGetString(GL_RENDERER));
 
        printf("vendor: %s\n", glGetString(GL_VENDOR));
        printf("renderer: %s\n", glGetString(GL_RENDERER));