New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 630371 link

Starred by 2 users

Issue metadata

Status: Available
Owner: ----
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Bug



Sign in to add a comment

Mipmapping broken in Mesa (ES) when using GL_BGRA_EXT internal format

Project Member Reported by junov@chromium.org, Jul 21 2016

Issue description

The following workaround was added to mitigate the issue: https://crrev.com/0c614148f9336a81f3cdbc2da692528811f15fc8

IWBN to fix the problem upstream in Mesa and revert the workaround.

Repro:

GLuint tex = 0;
glGenTextures(1, &tex);
glBindTexture(GL_TEXTURE_2D, tex);
glTexImage2D(GL_TEXTURE_2D, 0, GL_BGRA_EXT, kWidth, kHeight, 0,
             GL_BGRA_EXT, GL_UNSIGNED_BYTE, nullptr);
glGenerateMipmap(GL_TEXTURE_2D);

-> GL_INVALID_OPERATION   :-(

It is not just glGenerateMipmap that fails. Skia's implementation of manual mipmap construction is also non-functional.


This problem was observed on a 2013 Chromebook Pixel (link)

The current workaround is to substitute the internal format for GL_RGBA, which is functionally equivalent in ES3.

I am not sure if there are current device configurations with this bug that are limited to ES2. If so, the current workaround will not work there.
 
Status: Started (was: Untriaged)
I think that's a recent regression in mesa. I've emailed the developer.

Comment 2 by piman@chromium.org, Jul 21 2016

Status: ExternalDependency (was: Started)
Yikes, sorry...I'll get this fixed in Mesa ASAP.
Should be fixed in Mesa master with the following commit:

commit cb7077312954299fb1febed5b016190c00cccfa0
Author: Kenneth Graunke <kenneth@whitecape.org>
Date:   Thu Jul 21 16:48:05 2016 -0700

    mesa: Add GL_BGRA_EXT to the list of GenerateMipmap internal formats.
    
    The GL_EXT_texture_format_BGRA8888 extension specification defines a
    GL_BGRA_EXT unsized internal format (which is a little odd - usually
    BGRA is a pixel transfer format).  The extension is written against
    the ES 1.0 specification, so it's a little hard to map, but I believe
    it's effectively adding it to the table used here, so we should allow
    it here as well.
    
    Note that GL_EXT_texture_format_BGRA8888 is always enabled (dummy_true),
    so we don't need to check if it's enabled here.
    
    This fixes mipmap generation in Skia and ChromeOS.
    
    Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
    References: https://bugs.chromium.org/p/chromium/issues/detail?id=630371
    Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
    Reported-by: Stéphane Marchesin <marcheu@chromium.org>
    Cc: mesa-stable@lists.freedesktop.org

Comment 5 by junov@chromium.org, Jul 22 2016

Cc: kenneth....@gmail.com
Owner: junov@chromium.org
Status: Assigned (was: ExternalDependency)
Thanks for that commit!
Assigning issue to myself for follow-up: need to test and revert the workaround once our dependency on Mesa has rolled paseed that commit.
Owner: ----
Status: Available (was: Assigned)

Sign in to add a comment