[Mesa-dev] [PATCH] i915: add mock implementation of GL_OES_EGL_image_external
Chih-Wei Huang
cwhuang at android-x86.org
Thu Apr 2 08:17:16 PDT 2015
This is similar to commit 7420c9dab4aaf87e6b840410226c296c4668a48f
but for the i915 driver. It's necessary to support android-x86.
Signed-off-by: Chih-Wei Huang <cwhuang at linux.org.tw>
---
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 +
src/mesa/drivers/dri/i915/intel_extensions.c | 1 +
6 files changed, 7 insertions(+)
diff --git a/src/mesa/drivers/dri/i915/i830_texstate.c b/src/mesa/drivers/dri/i915/i830_texstate.c
index 00731e6..a14adb9 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 9b00223..508073a 100644
--- a/src/mesa/drivers/dri/i915/i915_fragprog.c
+++ b/src/mesa/drivers/dri/i915/i915_fragprog.c
@@ -241,6 +241,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 32e5f98..68a733b 100644
--- a/src/mesa/drivers/dri/i915/i915_state.c
+++ b/src/mesa/drivers/dri/i915/i915_state.c
@@ -777,6 +777,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 d416d46..f534bed 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 000ab6e..75123f5 100644
--- a/src/mesa/drivers/dri/i915/i915_texstate.c
+++ b/src/mesa/drivers/dri/i915/i915_texstate.c
@@ -423,6 +423,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:
diff --git a/src/mesa/drivers/dri/i915/intel_extensions.c b/src/mesa/drivers/dri/i915/intel_extensions.c
index ab7820f..eca6234 100644
--- a/src/mesa/drivers/dri/i915/intel_extensions.c
+++ b/src/mesa/drivers/dri/i915/intel_extensions.c
@@ -76,6 +76,7 @@ intelInitExtensions(struct gl_context *ctx)
ctx->Extensions.TDFX_texture_compression_FXT1 = true;
ctx->Extensions.OES_EGL_image = true;
ctx->Extensions.OES_draw_texture = true;
+ ctx->Extensions.OES_EGL_image_external = true;
ctx->Const.GLSLVersion = 120;
_mesa_override_glsl_version(&ctx->Const);
--
1.9.1
More information about the mesa-dev
mailing list