[Mesa-dev] [PATCH 12/12] i915: add mock implementation of GL_OES_EGL_image_external (v2)

Mauro Rossi issor.oruam at gmail.com
Tue Jan 10 00:53:08 UTC 2017


This is similar to commit 7420c9dab4aaf87e6b840410226c296c4668a48f
but for the i915 driver, as neeeded in android-x86.

In version v2, as per i965 implementation,
the extension GL_OES_EGL_image_external is not enabled by default.

The by-the-book way to enable the extension is mesa environment variable
MESA_EXTENSION_OVERRIDE="+GL_OES_EGL_image_external" to be set in init.rc
---
 src/mesa/drivers/dri/i915/i830_texstate.c   | 1 +
 src/mesa/drivers/dri/i915/i915_fragprog.c   | 1 +
 src/mesa/drivers/dri/i915/i915_state.c      | 1 +
 src/mesa/drivers/dri/i915/i915_tex_layout.c | 2 ++
 src/mesa/drivers/dri/i915/i915_texstate.c   | 1 +
 5 files changed, 6 insertions(+)

diff --git a/src/mesa/drivers/dri/i915/i830_texstate.c b/src/mesa/drivers/dri/i915/i830_texstate.c
index 83cd733..58deb22 100644
--- a/src/mesa/drivers/dri/i915/i830_texstate.c
+++ b/src/mesa/drivers/dri/i915/i830_texstate.c
@@ -336,6 +336,7 @@ i830UpdateTextureState(struct intel_context *intel)
          case GL_TEXTURE_1D:
          case GL_TEXTURE_2D:
          case GL_TEXTURE_CUBE_MAP:
+         case TEXTURE_EXTERNAL_BIT:
             ok = i830_update_tex_unit(intel, i, TEXCOORDS_ARE_NORMAL);
             break;
          case GL_TEXTURE_RECTANGLE:
diff --git a/src/mesa/drivers/dri/i915/i915_fragprog.c b/src/mesa/drivers/dri/i915/i915_fragprog.c
index fce649d..e566dfb 100644
--- a/src/mesa/drivers/dri/i915/i915_fragprog.c
+++ b/src/mesa/drivers/dri/i915/i915_fragprog.c
@@ -262,6 +262,7 @@ translate_tex_src_target(struct i915_fragment_program *p, GLubyte bit)
    case TEXTURE_1D_INDEX:
       return D0_SAMPLE_TYPE_2D;
    case TEXTURE_2D_INDEX:
+   case TEXTURE_EXTERNAL_INDEX:
       return D0_SAMPLE_TYPE_2D;
    case TEXTURE_RECT_INDEX:
       return D0_SAMPLE_TYPE_2D;
diff --git a/src/mesa/drivers/dri/i915/i915_state.c b/src/mesa/drivers/dri/i915/i915_state.c
index 715db1f..eefc484 100644
--- a/src/mesa/drivers/dri/i915/i915_state.c
+++ b/src/mesa/drivers/dri/i915/i915_state.c
@@ -774,6 +774,7 @@ i915Enable(struct gl_context * ctx, GLenum cap, GLboolean state)
 
    switch (cap) {
    case GL_TEXTURE_2D:
+   case GL_TEXTURE_EXTERNAL_OES:
       break;
 
    case GL_LIGHTING:
diff --git a/src/mesa/drivers/dri/i915/i915_tex_layout.c b/src/mesa/drivers/dri/i915/i915_tex_layout.c
index e76ccb0..29448e2 100644
--- a/src/mesa/drivers/dri/i915/i915_tex_layout.c
+++ b/src/mesa/drivers/dri/i915/i915_tex_layout.c
@@ -236,6 +236,7 @@ i915_miptree_layout(struct intel_mipmap_tree * mt)
       break;
    case GL_TEXTURE_1D:
    case GL_TEXTURE_2D:
+   case GL_TEXTURE_EXTERNAL_OES:
    case GL_TEXTURE_RECTANGLE_ARB:
       i915_miptree_layout_2d(mt);
       break;
@@ -468,6 +469,7 @@ i945_miptree_layout(struct intel_mipmap_tree * mt)
       break;
    case GL_TEXTURE_1D:
    case GL_TEXTURE_2D:
+   case GL_TEXTURE_EXTERNAL_OES:
    case GL_TEXTURE_RECTANGLE_ARB:
       i945_miptree_layout_2d(mt);
       break;
diff --git a/src/mesa/drivers/dri/i915/i915_texstate.c b/src/mesa/drivers/dri/i915/i915_texstate.c
index 2839b98..bbd1ac1 100644
--- a/src/mesa/drivers/dri/i915/i915_texstate.c
+++ b/src/mesa/drivers/dri/i915/i915_texstate.c
@@ -425,6 +425,7 @@ i915UpdateTextureState(struct intel_context *intel)
          case GL_TEXTURE_2D:
          case GL_TEXTURE_CUBE_MAP:
          case GL_TEXTURE_3D:
+         case GL_TEXTURE_EXTERNAL_OES:
             ok = i915_update_tex_unit(intel, i, SS3_NORMALIZED_COORDS);
             break;
          case GL_TEXTURE_RECTANGLE:
-- 
2.9.3



More information about the mesa-dev mailing list