i965: Gut the separate OpenGL ES extension enabling.
authorKenneth Graunke <kenneth@whitecape.org>
Thu, 24 May 2012 00:06:45 +0000 (17:06 -0700)
committerKenneth Graunke <kenneth@whitecape.org>
Thu, 24 May 2012 00:17:54 +0000 (17:17 -0700)
We should just set the bits of functionality that we support; the
GL/ES1/ES2 flags in extensions.c will take care of advertising the
appropriate extensions for the current API.

This enables the GL_EXT_texture_compression_dxt1 extension on ES1/ES2
when libtxc_dxtn is installed or the force_s3tc driconf option is set.
The main extension code set this up properly, but the ES-specific code
failed to do so.

Otherwise, the extension strings reported by es1_info, es2_info, and
glxinfo all remain the same.

This patch manually disables the ARB_framebuffer_object bit on ES
to preserve the behavior of 1c0f5d8324c4db2720247989ddc4a45315b55a85.

v2: Rebase, fix the i915 Makefile, and unconditionally set the
    OES_draw_texture bit as core Mesa will only apply it to ES1 now.

Tested-by: Daniel Charles <daniel.charles@intel.com> [v1]
Reviewed-by: Chad Versace <chad.versace@linux.intel.com> [v1]
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
src/mesa/drivers/dri/i915/Makefile.sources
src/mesa/drivers/dri/i915/intel_extensions_es.c [deleted symlink]
src/mesa/drivers/dri/i965/Makefile.sources
src/mesa/drivers/dri/i965/intel_extensions_es.c [deleted symlink]
src/mesa/drivers/dri/intel/intel_context.c
src/mesa/drivers/dri/intel/intel_extensions.c
src/mesa/drivers/dri/intel/intel_extensions_es.c [deleted file]

index 7dcf63d960f5b56c0cd3447daabb4fa466dab142..9da2f396269e337d6a49690f5f03d9b5c9099d02 100644 (file)
@@ -14,7 +14,6 @@ i915_C_FILES = \
        intel_batchbuffer.c \
        intel_clear.c \
        intel_extensions.c \
-       intel_extensions_es.c \
        intel_mipmap_tree.c \
        intel_resolve_map.c \
        intel_tex_layout.c \
diff --git a/src/mesa/drivers/dri/i915/intel_extensions_es.c b/src/mesa/drivers/dri/i915/intel_extensions_es.c
deleted file mode 120000 (symlink)
index 4924f7b..0000000
+++ /dev/null
@@ -1 +0,0 @@
-../intel/intel_extensions_es.c
\ No newline at end of file
index 5cc720bcc824641bdccbb3ec911754075f5475b0..82143ac5b541c8f6a9ed7888e43a5acd1e3dbb89 100644 (file)
@@ -9,7 +9,6 @@ i965_C_FILES = \
        intel_buffers.c \
        intel_context.c \
        intel_extensions.c \
-       intel_extensions_es.c \
        intel_fbo.c \
        intel_mipmap_tree.c \
        intel_regions.c \
diff --git a/src/mesa/drivers/dri/i965/intel_extensions_es.c b/src/mesa/drivers/dri/i965/intel_extensions_es.c
deleted file mode 120000 (symlink)
index 4924f7b..0000000
+++ /dev/null
@@ -1 +0,0 @@
-../intel/intel_extensions_es.c
\ No newline at end of file
index b770aa250d371ef0bdc8d2d96238c2294be8e015..9deb4ca19d7ba6263b55112e575fba333e762f7b 100644 (file)
@@ -728,17 +728,7 @@ intelInitContext(struct intel_context *intel,
 
    intel->RenderIndex = ~0;
 
-   switch (ctx->API) {
-   case API_OPENGL:
-      intelInitExtensions(ctx);
-      break;
-   case API_OPENGLES:
-      intelInitExtensionsES1(ctx);
-      break;
-   case API_OPENGLES2:
-      intelInitExtensionsES2(ctx);
-      break;
-   }
+   intelInitExtensions(ctx);
 
    INTEL_DEBUG = driParseDebugString(getenv("INTEL_DEBUG"), debug_control);
    if (INTEL_DEBUG & DEBUG_BUFMGR)
index b81770c067d1e7344376fb5c38239cc37cc078f2..6c29aff6523d84a6e1f34bc99e4ad335c9b4347c 100755 (executable)
@@ -44,7 +44,8 @@ intelInitExtensions(struct gl_context *ctx)
 
    ctx->Extensions.ARB_draw_elements_base_vertex = true;
    ctx->Extensions.ARB_explicit_attrib_location = true;
-   ctx->Extensions.ARB_framebuffer_object = true;
+   if (ctx->API == API_OPENGL)
+      ctx->Extensions.ARB_framebuffer_object = true;
    ctx->Extensions.ARB_half_float_pixel = true;
    ctx->Extensions.ARB_map_buffer_range = true;
    ctx->Extensions.ARB_point_sprite = true;
@@ -89,6 +90,7 @@ intelInitExtensions(struct gl_context *ctx)
 #if FEATURE_OES_EGL_image
    ctx->Extensions.OES_EGL_image = true;
 #endif
+   ctx->Extensions.OES_draw_texture = true;
 
    if (intel->gen >= 6)
       ctx->Const.GLSLVersion = 130;
diff --git a/src/mesa/drivers/dri/intel/intel_extensions_es.c b/src/mesa/drivers/dri/intel/intel_extensions_es.c
deleted file mode 100644 (file)
index b42907c..0000000
+++ /dev/null
@@ -1,132 +0,0 @@
-/**************************************************************************
- * 
- * Copyright 2003 Tungsten Graphics, Inc., Cedar Park, Texas.
- * All Rights Reserved.
- * 
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the
- * "Software"), to deal in the Software without restriction, including
- * without limitation the rights to use, copy, modify, merge, publish,
- * distribute, sub license, and/or sell copies of the Software, and to
- * permit persons to whom the Software is furnished to do so, subject to
- * the following conditions:
- * 
- * The above copyright notice and this permission notice (including the
- * next paragraph) shall be included in all copies or substantial portions
- * of the Software.
- * 
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
- * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR
- * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
- * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
- * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- * 
- **************************************************************************/
-
-#include "main/extensions.h"
-#include "main/mfeatures.h"
-
-#include "intel_context.h"
-#include "intel_extensions.h"
-
-static const char *common_extensions[] = {
-   /* Used by mesa internally (cf all_mesa_extensions in ../common/utils.c) */
-   "GL_ARB_transpose_matrix",
-   "GL_ARB_window_pos",
-   "GL_EXT_blend_func_separate",
-   "GL_EXT_compiled_vertex_array",
-   "GL_EXT_framebuffer_blit",
-   "GL_IBM_multimode_draw_arrays",
-   "GL_MESA_window_pos",
-   "GL_NV_vertex_program",
-
-   /* Optional GLES1 or GLES2 */
-#if FEATURE_OES_EGL_image
-   "GL_OES_EGL_image",
-#endif
-   "GL_EXT_texture_filter_anisotropic",
-   "GL_EXT_packed_depth_stencil",
-   "GL_EXT_blend_minmax",
-
-   NULL
-};
-
-static const char *es1_extensions[] = {
-   /* Required by GLES1 */
-   "GL_ARB_multitexture",
-   "GL_ARB_texture_env_add",
-   "GL_ARB_texture_env_combine",
-   "GL_ARB_texture_env_dot3",
-   "GL_ARB_point_parameters",
-
-   /* Optional GLES1 */
-   "GL_EXT_blend_equation_separate",
-   "GL_EXT_blend_func_separate",
-   "GL_EXT_blend_subtract",
-   "GL_OES_draw_texture",
-   "GL_EXT_framebuffer_object",
-   "GL_ARB_point_sprite",
-   "GL_EXT_stencil_wrap",
-   "GL_ARB_texture_cube_map",
-   "GL_ARB_texture_env_crossbar",
-   "GL_ARB_texture_mirrored_repeat",
-   "GL_EXT_texture_lod_bias",
-
-   NULL
-};
-
-static const char *es2_extensions[] = {
-   /* Required by GLES2 */
-   "GL_ARB_fragment_program",
-   "GL_ARB_fragment_shader",
-   "GL_ARB_shader_objects",
-   "GL_ARB_texture_cube_map",
-   "GL_ARB_texture_non_power_of_two",
-   "GL_ARB_vertex_shader",
-   "GL_EXT_blend_color",
-   "GL_EXT_blend_equation_separate",
-   "GL_EXT_blend_minmax",
-   "GL_NV_blend_square",
-
-   /* Optional GLES2 */
-   "GL_ARB_depth_texture",
-   "GL_EXT_framebuffer_object",
-
-   NULL,
-};
-
-void
-intelInitExtensionsES1(struct gl_context *ctx)
-{
-   int i;
-
-   for (i = 0; common_extensions[i]; i++)
-      _mesa_enable_extension(ctx, common_extensions[i]);
-   for (i = 0; es1_extensions[i]; i++)
-      _mesa_enable_extension(ctx, es1_extensions[i]);
-}
-
-/**
- * Initializes potential list of extensions if ctx == NULL, or actually enables
- * extensions for a context.
- */
-void
-intelInitExtensionsES2(struct gl_context *ctx)
-{
-   int i;
-   struct intel_context *intel = intel_context(ctx);
-
-   for (i = 0; common_extensions[i]; i++)
-      _mesa_enable_extension(ctx, common_extensions[i]);
-   for (i = 0; es2_extensions[i]; i++)
-      _mesa_enable_extension(ctx, es2_extensions[i]);
-
-   /* This extension must be manually disabled on GEN3 because it may have
-    * been enabled by default.
-    */
-   if (intel->gen < 4) {
-      ctx->Extensions.OES_standard_derivatives = false;
-   }
-}