Commit 8cd0873d authored by Chia-I Wu's avatar Chia-I Wu Committed by Chia-I Wu

st/mesa: add support for GL_OES_EGL_image_external

To pipe drivers, external textures are just 2D textures.
Reviewed-by: Brian Paul's avatarBrian Paul <brianp@vmware.com>
Acked-by: default avatarJakob Bornecrantz <jakob@vmware.com>
parent 0c87f168
......@@ -75,6 +75,7 @@ gl_target_to_pipe(GLenum target)
case GL_TEXTURE_1D:
return PIPE_TEXTURE_1D;
case GL_TEXTURE_2D:
case GL_TEXTURE_EXTERNAL_OES:
return PIPE_TEXTURE_2D;
case GL_TEXTURE_RECTANGLE_NV:
return PIPE_TEXTURE_RECT;
......@@ -310,6 +311,7 @@ get_texture_dims(GLenum target)
case GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB:
case GL_TEXTURE_RECTANGLE_NV:
case GL_TEXTURE_2D_ARRAY_EXT:
case GL_TEXTURE_EXTERNAL_OES:
return 2;
case GL_TEXTURE_3D:
return 3;
......
......@@ -303,6 +303,8 @@ void st_init_extensions(struct st_context *st)
#if FEATURE_OES_EGL_image
ctx->Extensions.OES_EGL_image = GL_TRUE;
if (ctx->API != API_OPENGL)
ctx->Extensions.OES_EGL_image_external = GL_TRUE;
#endif
#if FEATURE_OES_draw_texture
ctx->Extensions.OES_draw_texture = GL_TRUE;
......
......@@ -2725,6 +2725,9 @@ glsl_to_tgsi_visitor::visit(ir_texture *ir)
case GLSL_SAMPLER_DIM_BUF:
assert(!"FINISHME: Implement ARB_texture_buffer_object");
break;
case GLSL_SAMPLER_DIM_EXTERNAL:
inst->tex_target = TEXTURE_EXTERNAL_INDEX;
break;
default:
assert(!"Should not get here.");
}
......
......@@ -290,6 +290,7 @@ translate_texture_target( GLuint textarget,
case TEXTURE_RECT_INDEX: return TGSI_TEXTURE_RECT;
case TEXTURE_1D_ARRAY_INDEX: return TGSI_TEXTURE_1D_ARRAY;
case TEXTURE_2D_ARRAY_INDEX: return TGSI_TEXTURE_2D_ARRAY;
case TEXTURE_EXTERNAL_INDEX: return TGSI_TEXTURE_2D;
default:
debug_assert( 0 );
return TGSI_TEXTURE_1D;
......
......@@ -133,6 +133,7 @@ st_gl_texture_dims_to_pipe_dims(GLenum texture,
break;
case GL_TEXTURE_2D:
case GL_TEXTURE_RECTANGLE:
case GL_TEXTURE_EXTERNAL_OES:
assert(depthIn == 1);
*widthOut = widthIn;
*heightOut = heightIn;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment