Mesa (7.8-gles): mesa: Add missing features.
Kristian Høgsberg
krh at kemper.freedesktop.org
Wed May 12 20:00:04 UTC 2010
Module: Mesa
Branch: 7.8-gles
Commit: bf3b9187f02155d9c6bb9e7b9cb499b881316c68
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=bf3b9187f02155d9c6bb9e7b9cb499b881316c68
Author: Chia-I Wu <olv at lunarg.com>
Date: Tue Mar 30 13:13:20 2010 +0800
mesa: Add missing features.
Add features tested in the code but missing from mfeatures.h.
This also fixes some tests of features. They should be tested with
"#if", not "#ifdef".
---
src/mesa/main/bufferobj.c | 2 +-
src/mesa/main/extensions.c | 2 +-
src/mesa/main/fbobject.c | 2 +-
src/mesa/main/mfeatures.h | 4 ++++
src/mesa/main/texparam.c | 8 ++++----
5 files changed, 11 insertions(+), 7 deletions(-)
diff --git a/src/mesa/main/bufferobj.c b/src/mesa/main/bufferobj.c
index 71d1514..a3a2905 100644
--- a/src/mesa/main/bufferobj.c
+++ b/src/mesa/main/bufferobj.c
@@ -46,7 +46,7 @@
/*#define BOUNDS_CHECK*/
-#ifdef FEATURE_OES_mapbuffer
+#if FEATURE_OES_mapbuffer
#define DEFAULT_ACCESS GL_MAP_WRITE_BIT
#else
#define DEFAULT_ACCESS (GL_MAP_READ_BIT | GL_MAP_WRITE_BIT)
diff --git a/src/mesa/main/extensions.c b/src/mesa/main/extensions.c
index 52d422b..92d5aac 100644
--- a/src/mesa/main/extensions.c
+++ b/src/mesa/main/extensions.c
@@ -483,7 +483,7 @@ _mesa_enable_2_1_extensions(GLcontext *ctx)
#if FEATURE_EXT_texture_sRGB
ctx->Extensions.EXT_texture_sRGB = GL_TRUE;
#endif
-#ifdef FEATURE_ARB_shading_language_120
+#if FEATURE_ARB_shading_language_120
ctx->Extensions.ARB_shading_language_120 = GL_TRUE;
#endif
}
diff --git a/src/mesa/main/fbobject.c b/src/mesa/main/fbobject.c
index a95115e..849610e 100644
--- a/src/mesa/main/fbobject.c
+++ b/src/mesa/main/fbobject.c
@@ -625,7 +625,7 @@ _mesa_test_framebuffer_completeness(GLcontext *ctx, struct gl_framebuffer *fb)
}
}
-#ifndef FEATURE_OES_framebuffer_object
+#if !FEATURE_OES_framebuffer_object
/* Check that all DrawBuffers are present */
for (j = 0; j < ctx->Const.MaxDrawBuffers; j++) {
if (fb->ColorDrawBuffer[j] != GL_NONE) {
diff --git a/src/mesa/main/mfeatures.h b/src/mesa/main/mfeatures.h
index d3189b3..54edf9e 100644
--- a/src/mesa/main/mfeatures.h
+++ b/src/mesa/main/mfeatures.h
@@ -110,6 +110,7 @@
#define FEATURE_texture_fxt1 FEATURE_GL
#define FEATURE_texture_s3tc FEATURE_GL
+#define FEATURE_extra_context_init FEATURE_ES
#define FEATURE_fixedpt FEATURE_ES
#define FEATURE_point_size_array FEATURE_ES
#define FEATURE_vertex_array_byte FEATURE_ES
@@ -142,5 +143,8 @@
#define FEATURE_NV_vertex_program FEATURE_GL
#define FEATURE_OES_EGL_image 1
+#define FEATURE_OES_draw_texture FEATURE_ES1
+#define FEATURE_OES_framebuffer_object FEATURE_ES
+#define FEATURE_OES_mapbuffer FEATURE_ES
#endif /* FEATURES_H */
diff --git a/src/mesa/main/texparam.c b/src/mesa/main/texparam.c
index 0fde89b..cd0ec65 100644
--- a/src/mesa/main/texparam.c
+++ b/src/mesa/main/texparam.c
@@ -371,7 +371,7 @@ set_tex_parameteri(GLcontext *ctx,
}
return GL_FALSE;
-#ifdef FEATURE_OES_draw_texture
+#if FEATURE_OES_draw_texture
case GL_TEXTURE_CROP_RECT_OES:
texObj->CropRect[0] = params[0];
texObj->CropRect[1] = params[1];
@@ -604,7 +604,7 @@ _mesa_TexParameterfv(GLenum target, GLenum pname, const GLfloat *params)
}
break;
-#ifdef FEATURE_OES_draw_texture
+#if FEATURE_OES_draw_texture
case GL_TEXTURE_CROP_RECT_OES:
{
/* convert float params to int */
@@ -1148,7 +1148,7 @@ _mesa_GetTexParameterfv( GLenum target, GLenum pname, GLfloat *params )
else
error = GL_TRUE;
break;
-#ifdef FEATURE_OES_draw_texture
+#if FEATURE_OES_draw_texture
case GL_TEXTURE_CROP_RECT_OES:
params[0] = obj->CropRect[0];
params[1] = obj->CropRect[1];
@@ -1318,7 +1318,7 @@ _mesa_GetTexParameteriv( GLenum target, GLenum pname, GLint *params )
error = GL_TRUE;
}
break;
-#ifdef FEATURE_OES_draw_texture
+#if FEATURE_OES_draw_texture
case GL_TEXTURE_CROP_RECT_OES:
params[0] = obj->CropRect[0];
params[1] = obj->CropRect[1];
More information about the mesa-commit
mailing list