Skip to content
  • Anuj Phogat's avatar
    mesa: Add decoding functions for GL_COMPRESSED_SIGNED_R11_EAC · 7697f256
    Anuj Phogat authored
    
    
    Data in GL_COMPRESSED_SIGNED_R11_EAC format is decoded and stored in
    MESA_FORMAT_SIGNED_R16.
    
    v2:
    16 bit signed data is converted to 16 bit unsigned data by
    adding 2 ^ 15 and stored in an unsigned texture format.
    
    v3:
    1. Handle a corner case when base code word value is -128. As per
    OpenGL ES 3.0 specification -128 is not an allowed value and should
    be truncated to -127.
    2. Converting a decoded 16 bit signed data to 16 bit unsigned data by
    adding 2 ^ 15 gives us an output which matches the decompressed image
    (.ppm) generated by ericsson's etcpack tool. ericsson is also doing this
    conversion in their tool because .ppm image files don't support signed
    data. But gles 3.0 specification doesn't suggest this conversion. We
    need to keep the decoded data in signed format. Both signed format
    tests in gles3 conformance pass with these changes.
    
    Signed-off-by: default avatarAnuj Phogat <anuj.phogat@gmail.com>
    Tested-by: default avatarMatt Turner <mattst88@gmail.com>
    Reviewed-by: default avatarBrian Paul <brianp@vmware.com>
    7697f256