fixed examples tests
authorEleni Maria Stea <elene.mst@gmail.com>
Wed, 13 Mar 2013 11:38:47 +0000 (13:38 +0200)
committerEleni Maria Stea <elene.mst@gmail.com>
Wed, 13 Mar 2013 11:38:47 +0000 (13:38 +0200)
examples/asuseee.conf
examples/lenovo.conf
src/gliar.c
tests/glinfo/glinfo.c

index 670e84e..61d17d5 100644 (file)
@@ -1,10 +1,10 @@
 # example GLIAR configuration that emulates the asus eee GPU
-# copyright: Canonical Ltd, 2013
-# author: Eleni Maria Stea <elene.mst@gmail.com>
+# copyright]Canonical Ltd, 2013
+# author]Eleni Maria Stea <elene.mst@gmail.com>
 #
 # 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> 
 #
 
@@ -264,3 +264,90 @@ GL_ARB_invalidate_subdata
 
 [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 4484fae..8afcd62 100644 (file)
@@ -230,3 +230,91 @@ GL_ARB_invalidate_subdata
 
 [max renderbuffer size ext]
 8192
+
+#vertex shader
+
+[v max program instructions arb]
+16384
+
+[v max program native instructions arb]
+16384
+
+[v max program temporaries arb]
+256
+
+[v max program native temporaries arb]
+256
+
+[v max program program parameters arb]
+4096
+
+[v max program native parameters arb]
+1024
+
+[v max program attribs arb]
+16
+
+[v max program native attribs arb]
+16
+
+[v max program address registers arb]
+1
+
+[v max program native address registers arb]
+1
+
+[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
+
+#fragment shader
+
+[f max program instructions arb]
+16384
+
+[f max program native instructions arb]
+1024
+
+[f max program temporaries arb]
+256
+
+[f max program native temporaries arb]
+256
+
+[f max program program parameters arb]
+64
+
+[f max program native parameters arb]
+1024
+
+[f max program attribs arb]
+12
+
+[f max program native attribs arb]
+12
+
+[f max program address registers arb]
+0
+
+[f max program native address registers arb]
+0
+
+[f max program local parameters arb]
+4096
+
+[f max program env parameters arb]
+256
+
+[f max program alu instructions arb]
+16384
+
+[f max program native alu instructions arb]
+1024
index 7ba60d9..2bfa043 100644 (file)
@@ -400,9 +400,20 @@ void glGetProgramivARB(GLuint program, GLenum pname, GLint *params)
                key = 0;
        }
 
-       if(key && (option = gliar_find_opt(cfglist, key)) && option->type == GLIAR_NUMBER) {
-               *params = option->num_val;
-               return;
+       if(key) {
+               char buf[256];
+               if(program == GL_VERTEX_PROGRAM_ARB) {
+                       sprintf(buf, "v %s", key);
+               }
+               else if(program == GL_FRAGMENT_PROGRAM_ARB) {
+                       sprintf(buf, "f %s", key);
+               }
+               key = buf;
+
+               if((option = gliar_find_opt(cfglist, key)) && option->type == GLIAR_NUMBER) {
+                       *params = option->num_val;
+                       return;
+               }
        }
 
        gl_get_programiv(program, pname, params);
index e24c798..4dcff93 100644 (file)
@@ -58,35 +58,35 @@ int main(int argc, char **argv)
        printf("max color attachments: %d\n", GET_INTEGER(GL_MAX_COLOR_ATTACHMENTS_EXT));
        printf("max renderbuffer size ext: %d\n", GET_INTEGER(GL_MAX_RENDERBUFFER_SIZE_EXT));
        
-       printf("V max program instructions arb: %d\n", GET_PROGRAMIV_ARB_V(GL_MAX_PROGRAM_INSTRUCTIONS_ARB));
-       printf("V max program native instructions arb: %d\n", GET_PROGRAMIV_ARB_V(GL_MAX_PROGRAM_NATIVE_INSTRUCTIONS_ARB));
-       printf("V max program temporaries arb: %d\n", GET_PROGRAMIV_ARB_V(GL_MAX_PROGRAM_TEMPORARIES_ARB));
-       printf("V max program native temporaries arb: %d\n", GET_PROGRAMIV_ARB_V(GL_MAX_PROGRAM_NATIVE_TEMPORARIES_ARB));
-       printf("V max program program parameters arb: %d\n", GET_PROGRAMIV_ARB_V(GL_MAX_PROGRAM_PARAMETERS_ARB));
-       printf("V max program native parameters arb: %d\n", GET_PROGRAMIV_ARB_V(GL_MAX_PROGRAM_NATIVE_PARAMETERS_ARB));
-       printf("V max program attribs arb: %d\n", GET_PROGRAMIV_ARB_V(GL_MAX_PROGRAM_ATTRIBS_ARB));
-       printf("V max program native attribs arb: %d\n", GET_PROGRAMIV_ARB_V(GL_MAX_PROGRAM_NATIVE_ATTRIBS_ARB));
-       printf("V max program address registers arb: %d\n", GET_PROGRAMIV_ARB_V(GL_MAX_PROGRAM_ADDRESS_REGISTERS_ARB));
-       printf("V max program native address registers arb: %d\n", GET_PROGRAMIV_ARB_V(GL_MAX_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB));
-       printf("V max program local parameters arb: %d\n", GET_PROGRAMIV_ARB_V(GL_MAX_PROGRAM_LOCAL_PARAMETERS_ARB));
-       printf("V max program env parameters arb: %d\n", GET_PROGRAMIV_ARB_V(GL_MAX_PROGRAM_ENV_PARAMETERS_ARB));
-       printf("V max program alu instructions arb: %d\n", GET_PROGRAMIV_ARB_V(GL_MAX_PROGRAM_ALU_INSTRUCTIONS_ARB));
-       printf("V max program native alu instructions arb: %d\n", GET_PROGRAMIV_ARB_V(GL_MAX_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB));
+       printf("v max program instructions arb: %d\n", GET_PROGRAMIV_ARB_V(GL_MAX_PROGRAM_INSTRUCTIONS_ARB));
+       printf("v max program native instructions arb: %d\n", GET_PROGRAMIV_ARB_V(GL_MAX_PROGRAM_NATIVE_INSTRUCTIONS_ARB));
+       printf("v max program temporaries arb: %d\n", GET_PROGRAMIV_ARB_V(GL_MAX_PROGRAM_TEMPORARIES_ARB));
+       printf("v max program native temporaries arb: %d\n", GET_PROGRAMIV_ARB_V(GL_MAX_PROGRAM_NATIVE_TEMPORARIES_ARB));
+       printf("v max program program parameters arb: %d\n", GET_PROGRAMIV_ARB_V(GL_MAX_PROGRAM_PARAMETERS_ARB));
+       printf("v max program native parameters arb: %d\n", GET_PROGRAMIV_ARB_V(GL_MAX_PROGRAM_NATIVE_PARAMETERS_ARB));
+       printf("v max program attribs arb: %d\n", GET_PROGRAMIV_ARB_V(GL_MAX_PROGRAM_ATTRIBS_ARB));
+       printf("v max program native attribs arb: %d\n", GET_PROGRAMIV_ARB_V(GL_MAX_PROGRAM_NATIVE_ATTRIBS_ARB));
+       printf("v max program address registers arb: %d\n", GET_PROGRAMIV_ARB_V(GL_MAX_PROGRAM_ADDRESS_REGISTERS_ARB));
+       printf("v max program native address registers arb: %d\n", GET_PROGRAMIV_ARB_V(GL_MAX_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB));
+       printf("v max program local parameters arb: %d\n", GET_PROGRAMIV_ARB_V(GL_MAX_PROGRAM_LOCAL_PARAMETERS_ARB));
+       printf("v max program env parameters arb: %d\n", GET_PROGRAMIV_ARB_V(GL_MAX_PROGRAM_ENV_PARAMETERS_ARB));
+       printf("v max program alu instructions arb: %d\n", GET_PROGRAMIV_ARB_V(GL_MAX_PROGRAM_ALU_INSTRUCTIONS_ARB));
+       printf("v max program native alu instructions arb: %d\n", GET_PROGRAMIV_ARB_V(GL_MAX_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB));
        
-       printf("F max program instructions arb: %d\n", GET_PROGRAMIV_ARB_F(GL_MAX_PROGRAM_INSTRUCTIONS_ARB));
-       printf("F max program native instructions arb: %d\n", GET_PROGRAMIV_ARB_F(GL_MAX_PROGRAM_NATIVE_INSTRUCTIONS_ARB));
-       printf("F max program temporaries arb: %d\n", GET_PROGRAMIV_ARB_F(GL_MAX_PROGRAM_TEMPORARIES_ARB));
-       printf("F max program native temporaries arb: %d\n", GET_PROGRAMIV_ARB_F(GL_MAX_PROGRAM_NATIVE_TEMPORARIES_ARB));
-       printf("F max program program parameters arb: %d\n", GET_PROGRAMIV_ARB_F(GL_MAX_PROGRAM_PARAMETERS_ARB));
-       printf("F max program native parameters arb: %d\n", GET_PROGRAMIV_ARB_F(GL_MAX_PROGRAM_NATIVE_PARAMETERS_ARB));
-       printf("F max program attribs arb: %d\n", GET_PROGRAMIV_ARB_F(GL_MAX_PROGRAM_ATTRIBS_ARB));
-       printf("F max program native attribs arb: %d\n", GET_PROGRAMIV_ARB_F(GL_MAX_PROGRAM_NATIVE_ATTRIBS_ARB));
-       printf("F max program address registers arb: %d\n", GET_PROGRAMIV_ARB_F(GL_MAX_PROGRAM_ADDRESS_REGISTERS_ARB));
-       printf("F max program native address registers arb: %d\n", GET_PROGRAMIV_ARB_F(GL_MAX_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB));
-       printf("F max program local parameters arb: %d\n", GET_PROGRAMIV_ARB_F(GL_MAX_PROGRAM_LOCAL_PARAMETERS_ARB));
-       printf("F max program env parameters arb: %d\n", GET_PROGRAMIV_ARB_F(GL_MAX_PROGRAM_ENV_PARAMETERS_ARB));
-       printf("F max program alu instructions arb: %d\n", GET_PROGRAMIV_ARB_F(GL_MAX_PROGRAM_ALU_INSTRUCTIONS_ARB));
-       printf("F max program native alu instructions arb: %d\n", GET_PROGRAMIV_ARB_F(GL_MAX_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB));
+       printf("f max program instructions arb: %d\n", GET_PROGRAMIV_ARB_F(GL_MAX_PROGRAM_INSTRUCTIONS_ARB));
+       printf("f max program native instructions arb: %d\n", GET_PROGRAMIV_ARB_F(GL_MAX_PROGRAM_NATIVE_INSTRUCTIONS_ARB));
+       printf("f max program temporaries arb: %d\n", GET_PROGRAMIV_ARB_F(GL_MAX_PROGRAM_TEMPORARIES_ARB));
+       printf("f max program native temporaries arb: %d\n", GET_PROGRAMIV_ARB_F(GL_MAX_PROGRAM_NATIVE_TEMPORARIES_ARB));
+       printf("f max program program parameters arb: %d\n", GET_PROGRAMIV_ARB_F(GL_MAX_PROGRAM_PARAMETERS_ARB));
+       printf("f max program native parameters arb: %d\n", GET_PROGRAMIV_ARB_F(GL_MAX_PROGRAM_NATIVE_PARAMETERS_ARB));
+       printf("f max program attribs arb: %d\n", GET_PROGRAMIV_ARB_F(GL_MAX_PROGRAM_ATTRIBS_ARB));
+       printf("f max program native attribs arb: %d\n", GET_PROGRAMIV_ARB_F(GL_MAX_PROGRAM_NATIVE_ATTRIBS_ARB));
+       printf("f max program address registers arb: %d\n", GET_PROGRAMIV_ARB_F(GL_MAX_PROGRAM_ADDRESS_REGISTERS_ARB));
+       printf("f max program native address registers arb: %d\n", GET_PROGRAMIV_ARB_F(GL_MAX_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB));
+       printf("f max program local parameters arb: %d\n", GET_PROGRAMIV_ARB_F(GL_MAX_PROGRAM_LOCAL_PARAMETERS_ARB));
+       printf("f max program env parameters arb: %d\n", GET_PROGRAMIV_ARB_F(GL_MAX_PROGRAM_ENV_PARAMETERS_ARB));
+       printf("f max program alu instructions arb: %d\n", GET_PROGRAMIV_ARB_F(GL_MAX_PROGRAM_ALU_INSTRUCTIONS_ARB));
+       printf("f max program native alu instructions arb: %d\n", GET_PROGRAMIV_ARB_F(GL_MAX_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB));
 
        return 0;
 }