diff options
author | Francisco Jerez <[email protected]> | 2013-11-22 19:49:58 -0800 |
---|---|---|
committer | Francisco Jerez <[email protected]> | 2014-01-15 16:42:07 +0100 |
commit | 7510c10209d95458ededf01234b644bf2020d768 (patch) | |
tree | 817d5a1b7d5cde0579746a2a081a0d10b2f8820f /src/mesa/main/formats.c | |
parent | 87942749a327725014b0d160b3e48d6d83723ac2 (diff) |
mesa: Add MESA_FORMAT_SIGNED_RG88 and _RG1616.
Including pack/unpack and texstore code. ARB_shader_image_load_store
requires support for the GL_RG8_SNORM and GL_RG16_SNORM formats, which
map to MESA_FORMAT_SIGNED_GR88 and MESA_FORMAT_SIGNED_GR1616 on
little-endian hosts, and MESA_FORMAT_SIGNED_RG88 and
MESA_FORMAT_SIGNED_RG1616 respectively on big-endian hosts -- only the
former were already present, add support for the latter.
Acked-by: Chris Forbes <[email protected]>
Reviewed-by: Paul Berry <[email protected]>
Diffstat (limited to 'src/mesa/main/formats.c')
-rw-r--r-- | src/mesa/main/formats.c | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/src/mesa/main/formats.c b/src/mesa/main/formats.c index 0da0dfa8ce9..1246c4d9265 100644 --- a/src/mesa/main/formats.c +++ b/src/mesa/main/formats.c @@ -1772,6 +1772,24 @@ static struct gl_format_info format_info[MESA_FORMAT_COUNT] = 0, 0, 0, 0, 0, 1, 1, 4 }, + { + MESA_FORMAT_SIGNED_RG88, + "MESA_FORMAT_SIGNED_RG88", + GL_RG, + GL_SIGNED_NORMALIZED, + 8, 8, 0, 0, + 0, 0, 0, 0, 0, + 1, 1, 2 + }, + { + MESA_FORMAT_SIGNED_RG1616, + "MESA_FORMAT_SIGNED_RG1616", + GL_RG, + GL_SIGNED_NORMALIZED, + 16, 16, 0, 0, + 0, 0, 0, 0, 0, + 1, 1, 4 + }, }; @@ -2855,6 +2873,16 @@ _mesa_format_to_type_and_comps(gl_format format, *comps = 4; return; + case MESA_FORMAT_SIGNED_RG88: + *datatype = GL_BYTE; + *comps = 2; + return; + + case MESA_FORMAT_SIGNED_RG1616: + *datatype = GL_SHORT; + *comps = 2; + return; + case MESA_FORMAT_COUNT: assert(0); return; @@ -3401,6 +3429,13 @@ _mesa_format_matches_format_and_type(gl_format gl_format, return format == GL_RGBA && type == GL_UNSIGNED_INT_2_10_10_10_REV && !swapBytes; + case MESA_FORMAT_SIGNED_RG88: + return format == GL_RG && type == GL_BYTE && !littleEndian && + !swapBytes; + + case MESA_FORMAT_SIGNED_RG1616: + return format == GL_RG && type == GL_SHORT && !littleEndian && + !swapBytes; } return GL_FALSE; |