summaryrefslogtreecommitdiffstats
path: root/src/mesa/main
diff options
context:
space:
mode:
authorKenneth Graunke <[email protected]>2017-10-04 01:08:37 -0700
committerKenneth Graunke <[email protected]>2017-10-05 14:30:47 -0700
commit18bdf73556440ca2eaac2d22e1e3ebe1be7b6c1d (patch)
tree2f27e3e868d52ff51d0ec3122777c19ce914ff68 /src/mesa/main
parent7463d5058009d1e9d9d01292f894271a26a062b8 (diff)
mesa: Use a 565 format for GL_RGB and GL_UNSIGNED_SHORT_5_6_5 textures.
Found while trying to optimize an application. Not observed to help performance on i965, but should at least reduce the memory usage of such textures a bit. Reviewed-by: Eric Anholt <[email protected]> Tested-by: Eero Tamminen <[email protected]>
Diffstat (limited to 'src/mesa/main')
-rw-r--r--src/mesa/main/texformat.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/mesa/main/texformat.c b/src/mesa/main/texformat.c
index 3f8e7a49a27..13e77b77ecd 100644
--- a/src/mesa/main/texformat.c
+++ b/src/mesa/main/texformat.c
@@ -117,6 +117,9 @@ _mesa_choose_tex_format(struct gl_context *ctx, GLenum target,
if (type == GL_UNSIGNED_INT_2_10_10_10_REV) {
RETURN_IF_SUPPORTED(MESA_FORMAT_B10G10R10A2_UNORM);
}
+ if (type == GL_UNSIGNED_SHORT_5_6_5) {
+ RETURN_IF_SUPPORTED(MESA_FORMAT_B5G6R5_UNORM);
+ }
/* fallthrough */
case GL_RGB8:
RETURN_IF_SUPPORTED(MESA_FORMAT_RGB_UNORM8);