[MESA/OPENGL32]
authorJérôme Gardou <jerome.gardou@reactos.org>
Sun, 22 Sep 2013 00:25:59 +0000 (00:25 +0000)
committerJérôme Gardou <jerome.gardou@reactos.org>
Sun, 22 Sep 2013 00:25:59 +0000 (00:25 +0000)
 - Disable un-used mesa features (ATI/NV programs) for a leaner build
 - Print a fixme instead of asserting in software version of wglGetProcAddress

svn path=/trunk/; revision=60300

reactos/dll/opengl/mesa/src/mesa/main/CMakeLists.txt
reactos/dll/opengl/mesa/src/mesa/main/arbprogram.c
reactos/dll/opengl/mesa/src/mesa/main/dlist.c
reactos/dll/opengl/mesa/src/mesa/main/mfeatures.h
reactos/dll/opengl/mesa/src/mesa/program/CMakeLists.txt
reactos/dll/opengl/opengl32/swimpl.c

index bbe7874..0d00a66 100644 (file)
@@ -8,7 +8,7 @@ list(APPEND SOURCE
     api_validate.c
     accum.c
     arbprogram.c
-    atifragshader.c
+    atifragshader.c
     attrib.c
     arrayobj.c
     blend.c
@@ -54,7 +54,7 @@ list(APPEND SOURCE
     mipmap.c
     mm.c
     multisample.c
-    nvprogram.c
+    nvprogram.c
     pack.c
     pbo.c
     pixel.c
index b83369d..957d25f 100644 (file)
@@ -370,6 +370,7 @@ _mesa_ProgramStringARB(GLenum target, GLenum format, GLsizei len,
 
       base = & prog->Base;
    }
+#if FEATURE_NV_vertex_program
    else if ((target == GL_VERTEX_PROGRAM_ARB
             || target == GL_VERTEX_STATE_PROGRAM_NV)
            && ctx->Extensions.NV_vertex_program) {
@@ -378,6 +379,7 @@ _mesa_ProgramStringARB(GLenum target, GLenum format, GLsizei len,
 
       base = & prog->Base;
    }
+#endif
    else if (target == GL_FRAGMENT_PROGRAM_ARB
             && ctx->Extensions.ARB_fragment_program) {
       struct gl_fragment_program *prog = ctx->FragmentProgram.Current;
@@ -385,6 +387,7 @@ _mesa_ProgramStringARB(GLenum target, GLenum format, GLsizei len,
 
       base = & prog->Base;
    }
+#if FEATURE_NV_fragment_program
    else if (target == GL_FRAGMENT_PROGRAM_NV
             && ctx->Extensions.NV_fragment_program) {
       struct gl_fragment_program *prog = ctx->FragmentProgram.Current;
@@ -392,6 +395,7 @@ _mesa_ProgramStringARB(GLenum target, GLenum format, GLsizei len,
 
       base = & prog->Base;
    }
+#endif
    else {
       _mesa_error(ctx, GL_INVALID_ENUM, "glProgramStringARB(target)");
       return;
index 3db7beb..c74e7da 100644 (file)
@@ -5027,7 +5027,7 @@ save_TrackMatrixNV(GLenum target, GLuint address,
 /*
  * GL_NV_fragment_program
  */
-#if FEATURE_NV_fragment_program
+#if FEATURE_NV_fragment_program || FEATURE_ARB_fragment_program
 static void GLAPIENTRY
 save_ProgramLocalParameter4fARB(GLenum target, GLuint index,
                                 GLfloat x, GLfloat y, GLfloat z, GLfloat w)
@@ -5148,6 +5148,7 @@ save_ProgramLocalParameter4dvARB(GLenum target, GLuint index,
    }
 }
 
+#if FEATURE_NV_fragment_program
 static void GLAPIENTRY
 save_ProgramNamedParameter4fNV(GLuint id, GLsizei len, const GLubyte * name,
                                GLfloat x, GLfloat y, GLfloat z, GLfloat w)
@@ -5178,7 +5179,6 @@ save_ProgramNamedParameter4fNV(GLuint id, GLsizei len, const GLubyte * name,
    }
 }
 
-
 static void GLAPIENTRY
 save_ProgramNamedParameter4fvNV(GLuint id, GLsizei len, const GLubyte * name,
                                 const float v[])
@@ -5204,7 +5204,7 @@ save_ProgramNamedParameter4dvNV(GLuint id, GLsizei len, const GLubyte * name,
                                   (GLfloat) v[1], (GLfloat) v[2],
                                   (GLfloat) v[3]);
 }
-
+#endif
 #endif /* FEATURE_NV_fragment_program */
 
 
@@ -10218,7 +10218,9 @@ _mesa_create_save_table(void)
    SET_GetVertexAttribdvARB(table, _mesa_GetVertexAttribdvARB);
    SET_GetVertexAttribfvARB(table, _mesa_GetVertexAttribfvARB);
    SET_GetVertexAttribivARB(table, _mesa_GetVertexAttribivARB);
+#if FEATURE_NV_vertex_program
    SET_GetVertexAttribPointervNV(table, _mesa_GetVertexAttribPointervNV);
+#endif
    SET_ProgramEnvParameter4dARB(table, save_ProgramEnvParameter4dARB);
    SET_ProgramEnvParameter4dvARB(table, save_ProgramEnvParameter4dvARB);
    SET_ProgramEnvParameter4fARB(table, save_ProgramEnvParameter4fARB);
index b67f046..940151a 100644 (file)
 #define FEATURE_EXT_transform_feedback    FEATURE_GL
 
 #define FEATURE_APPLE_object_purgeable    FEATURE_GL
-#define FEATURE_ATI_fragment_shader       FEATURE_GL
+#define FEATURE_ATI_fragment_shader       0
 #define FEATURE_NV_fence                  FEATURE_GL
-#define FEATURE_NV_fragment_program       FEATURE_GL
-#define FEATURE_NV_vertex_program         FEATURE_GL
+#define FEATURE_NV_fragment_program       0
+#define FEATURE_NV_vertex_program         0
 
 #define FEATURE_OES_EGL_image             1
 #define FEATURE_OES_draw_texture          FEATURE_ES1
index 363bc53..6d9334d 100644 (file)
@@ -5,8 +5,8 @@ list(APPEND SOURCE
     arbprogparse.c
     hash_table.c
     ir_to_mesa.cpp
-    nvfragparse.c
-    nvvertparse.c
+    nvfragparse.c
+    nvvertparse.c
     program.c
     program_parse_extra.c
     prog_cache.c
index c95fea0..e1aa509 100644 (file)
@@ -103,7 +103,9 @@ sw_get_string( struct gl_context *ctx, GLenum name )
     (void) ctx;
     if(name == GL_RENDERER)
         return (const GLubyte *) "ReactOS Software Implementation";
-    
+    /* Don't claim to support the fancy extensions that mesa supports, they will be slow anyway */
+    if(name == GL_EXTENSIONS)
+        return (const GLubyte *)"";
     return NULL;
 }
 
@@ -593,7 +595,7 @@ BOOL sw_DeleteContext(DHGLRC dhglrc)
 PROC sw_GetProcAddress(LPCSTR name)
 {
     /* We don't support any extensions */
-    assert(FALSE);
+    FIXME("Asking for proc address %s, returning NULL.\n", name);
     return NULL;
 }