From: Eleni Maria Stea Date: Wed, 13 Mar 2013 12:21:20 +0000 (+0200) Subject: fixed bug added support for Programiv X-Git-Url: https://eleni.mutantstargoat.com/git/?p=libgliar;a=commitdiff_plain;h=00bfdd4a8d29cac26588295e8d115cd1463b2a44 fixed bug added support for Programiv fixed conf --- diff --git a/gliar.conf b/gliar.conf index c6d3dfb..61d17d5 100644 --- a/gliar.conf +++ b/gliar.conf @@ -1,10 +1,10 @@ -# Example GLIAR configuration -# Copyright: Canonical Ltd, 2013 -# Author: Eleni Maria Stea +# example GLIAR configuration that emulates the asus eee GPU +# copyright]Canonical Ltd, 2013 +# author]Eleni Maria Stea # # 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 # @@ -220,8 +220,134 @@ GL_ARB_robustness, 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 units] +[max cube map texture size] +8192 + +[max texture coordinates] 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 diff --git a/src/gliar.c b/src/gliar.c index 2bfa043..23164d5 100644 --- a/src/gliar.c +++ b/src/gliar.c @@ -327,7 +327,7 @@ void glGetProgramivARB(GLuint program, GLenum pname, GLint *params) 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; } @@ -422,17 +422,16 @@ void glGetProgramivARB(GLuint program, GLenum pname, GLint *params) 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); } + +void *glXGetProcAddressARB(const unsigned char *procname) +{ + return glXGetProcAddress(procname); +} diff --git a/tests/glinfo/glinfo.c b/tests/glinfo/glinfo.c index 4dcff93..95b0148 100644 --- a/tests/glinfo/glinfo.c +++ b/tests/glinfo/glinfo.c @@ -21,21 +21,26 @@ Author: Eleni Maria Stea */ #include -#include +//#include #include +#include #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; + void (*gl_get_progiv)(GLuint, GLenum, GLint*); + 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));