summaryrefslogtreecommitdiffstats
path: root/src/gallium/state_trackers/osmesa/osmesa.c
diff options
context:
space:
mode:
authorEric Anholt <[email protected]>2019-07-03 12:04:26 -0700
committerEric Anholt <[email protected]>2019-09-04 16:43:36 -0700
commitcc3c217ce03cdb647ae71fe382caeddeabdef9b6 (patch)
treed6fbf46e1287887ef123dd3a1cd13e15cc5d4de4 /src/gallium/state_trackers/osmesa/osmesa.c
parent9e7eb9780aaac0737095a7ce87e8af336ea42f86 (diff)
gallium/osmesa: Move 565 format selection checks where the rest are.
Reviewed-by: Timothy Arceri <[email protected]>
Diffstat (limited to 'src/gallium/state_trackers/osmesa/osmesa.c')
-rw-r--r--src/gallium/state_trackers/osmesa/osmesa.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/gallium/state_trackers/osmesa/osmesa.c b/src/gallium/state_trackers/osmesa/osmesa.c
index 88549874966..4660a53bfd2 100644
--- a/src/gallium/state_trackers/osmesa/osmesa.c
+++ b/src/gallium/state_trackers/osmesa/osmesa.c
@@ -266,6 +266,8 @@ osmesa_choose_format(GLenum format, GLenum type)
/* No gallium format for this one */
return PIPE_FORMAT_NONE;
case OSMESA_RGB_565:
+ if (type != GL_UNSIGNED_SHORT_5_6_5)
+ return PIPE_FORMAT_NONE;
return PIPE_FORMAT_B5G6R5_UNORM;
default:
; /* fall-through */
@@ -772,10 +774,6 @@ OSMesaMakeCurrent(OSMesaContext osmesa, void *buffer, GLenum type,
return GL_FALSE;
}
- if (osmesa->format == OSMESA_RGB_565 && type != GL_UNSIGNED_SHORT_5_6_5) {
- return GL_FALSE;
- }
-
color_format = osmesa_choose_format(osmesa->format, type);
if (color_format == PIPE_FORMAT_NONE) {
fprintf(stderr, "OSMesaMakeCurrent(unsupported format/type)\n");