[Mesa-dev] [PATCH] main: Allow external textures to use fallback (0, 0, 0, 1)

Brian Paul brianp at vmware.com
Wed Oct 9 19:02:15 CEST 2013


On 10/09/2013 10:54 AM, Topi Pohjolainen wrote:
> Fixes GL2ExtensionTests/egl_image_external/TestSimpleUnassociated.test
> which is part of gles2/3 conformance suite. Here image external
> textures are switched to be treated the same as 2D textures. These
> can be associated with the fallback texture providing fixed sample
> values of (0, 0, 0, 1).
>
> The OES_EGL_image_external spec says:
>
>    "Sampling an external texture which is not associated with any EGLImage
>     sibling will return a sample value of (0,0,0,1)."
>
>    "External textures cannot be used with TexImage2D, TexSubImage2D,
>     CompressedTexImage2D, CompressedTexSubImage2D, CopyTexImage2D, or
>     CopyTexSubImage2D, and an INVALID_ENUM error will be generated if
>     this is attempted."
>
> And quoting Chad:
>
>    "That's enforced in _mesa_TexImage*() by calling
>     legal_teximage_target(), and enforced in _mesa_TexSubImage*() by
>     calling legal_texsubmimage_target(). Each of the
>     legal_tex*image_target() functions reject external textures.
>     Therefore, allowing GL_TEXTURE_EXTERNAL_OES in store_texsubimage()
>     won't violate the above spec quote.
>
>     I think it's safe to allow GL_TEXTURE_EXTERNAL_OES in
>     store_texsubimage(), as long as the texture has only a single
>     plane. Luckily, that's the only type of external textures that
>     Mesa currently supports."
>
> CC: Chad Versace <chad.versace at linux.intel.com>
> Signed-off-by: Topi Pohjolainen <topi.pohjolainen at intel.com>
> ---
>   src/mesa/main/texstore.c | 1 +
>   1 file changed, 1 insertion(+)
>
> diff --git a/src/mesa/main/texstore.c b/src/mesa/main/texstore.c
> index 04385e1..76d8d9b 100644
> --- a/src/mesa/main/texstore.c
> +++ b/src/mesa/main/texstore.c
> @@ -3961,6 +3961,7 @@ store_texsubimage(struct gl_context *ctx,
>      case GL_TEXTURE_2D:
>      case GL_TEXTURE_RECTANGLE:
>      case GL_TEXTURE_CUBE_MAP:
> +   case GL_TEXTURE_EXTERNAL_OES:
>         /* one image slice, nothing special needs to be done */
>         break;
>      case GL_TEXTURE_1D:
>

I'll let others review, but the subjects should start with "mesa:", not 
"main:".

-Brian



More information about the mesa-dev mailing list