[Mesa-dev] [PATCH] mesa: support GL_RGB for GL_EXT_texture_type_2_10_10_10_REV
Iago Toral
itoral at igalia.com
Wed Jan 14 07:51:27 PST 2015
El 2015-01-14 16:46, Tapani escribió:
> On 01/14/2015 03:16 PM, Iago Toral Quiroga wrote:
>> Hi Tapani,
>>
>> thanks for looking into this one, I certainly missed that extension...
>>
>> On mié, 2015-01-14 at 14:04 +0200, Tapani Pälli wrote:
>>> Commit 8ec6534 changed texture upload path and the way how texture
>>> format is being checked, this commit adds support for GL_RGB with
>>> GL_UNSIGNED_INT_2_10_10_10_REV as specified by the extension
>>> EXT_texture_type_2_10_10_10_REV specification.
>> The extension mentions that when this is used with RGB, the alpha
>> channel assumes a value 1.0 when expanded...
>>
>>> This fixes regression in ES3 conformance test
>>> ES3-CTS.gtf.GL3Tests.packed_pixels.packed_pixels
>>>
>>> Signed-off-by: Tapani Pälli <tapani.palli at intel.com>
>>> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=88385
>>> ---
>>> src/mesa/main/glformats.c | 3 ++-
>>> 1 file changed, 2 insertions(+), 1 deletion(-)
>>>
>>> diff --git a/src/mesa/main/glformats.c b/src/mesa/main/glformats.c
>>> index 3e913ed..e54bb90 100644
>>> --- a/src/mesa/main/glformats.c
>>> +++ b/src/mesa/main/glformats.c
>>> @@ -2666,7 +2666,8 @@ _mesa_format_from_format_and_type(GLenum
>>> format, GLenum type)
>>> return MESA_FORMAT_A2R10G10B10_UINT;
>>> break;
>>> case GL_UNSIGNED_INT_2_10_10_10_REV:
>>> - if (format == GL_RGBA)
>>> + if (format == GL_RGB || /* GL_EXT_texture_type_2_10_10_10_REV
>>> */
>>> + format == GL_RGBA)
>>> return MESA_FORMAT_R10G10B10A2_UNORM;
>> ...so I think this is not correct: with this we will lose track that
>> this was RGB data and we will not ensure A=1.0 if this is stored as
>> RGBA.
>>
>> I think what we want to do here is add a new mesa_format like
>> MESA_FORMAT_R10G10B10X2_UNORM, so we can use auto-generated
>> pack/unpack
>> functions that take care of this. We would add that enum to formats.h,
>> then add the type description to formats.csv and then return that enum
>> here for the RGB case.
>
> Ah right, seems fine for me. I just tried to do what was done
> previously, which seemed to just enable GL_RGB usage. I'll check if
> there exists a test for actually using the format and implement this.
Thanks! If this takes you away from more important stuff I can implement
the fix too, just let me know and I'll fix it tomorrow.
>> Jason, what do you think?
>>
>>> else if (format == GL_RGBA_INTEGER)
>>> return MESA_FORMAT_R10G10B10A2_UINT;
>>
More information about the mesa-dev
mailing list