[Mesa-dev] [PATCH 2/2] intel: Support depth-15 Visuals
Chris Wilson
chris at chris-wilson.co.uk
Mon Mar 4 05:41:06 PST 2013
Note: This is a candidate for the stable branches.
Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>
---
src/mesa/drivers/dri/intel/intel_screen.c | 14 ++++++++++----
1 file changed, 10 insertions(+), 4 deletions(-)
diff --git a/src/mesa/drivers/dri/intel/intel_screen.c b/src/mesa/drivers/dri/intel/intel_screen.c
index d223a0b..5beea37 100644
--- a/src/mesa/drivers/dri/intel/intel_screen.c
+++ b/src/mesa/drivers/dri/intel/intel_screen.c
@@ -789,8 +789,10 @@ intelCreateBuffer(__DRIscreen * driScrnPriv,
_mesa_initialize_window_framebuffer(fb, mesaVis);
- if (mesaVis->redBits == 5)
+ if (mesaVis->greenBits == 6)
rgbFormat = MESA_FORMAT_RGB565;
+ else if (mesaVis->greenBits == 5)
+ rgbFormat = MESA_FORMAT_ARGB1555;
else if (mesaVis->sRGBCapable)
rgbFormat = MESA_FORMAT_SARGB8;
else if (mesaVis->alphaBits == 0)
@@ -1023,6 +1025,7 @@ static __DRIconfig**
intel_screen_make_configs(__DRIscreen *dri_screen)
{
static const gl_format formats[] = {
+ MESA_FORMAT_ARGB1555,
MESA_FORMAT_RGB565,
MESA_FORMAT_ARGB8888
};
@@ -1051,7 +1054,8 @@ intel_screen_make_configs(__DRIscreen *dri_screen)
depth_bits[0] = 0;
stencil_bits[0] = 0;
- if (formats[i] == MESA_FORMAT_RGB565) {
+ if (formats[i] == MESA_FORMAT_ARGB1555 ||
+ formats[i] == MESA_FORMAT_RGB565) {
depth_bits[1] = 16;
stencil_bits[1] = 0;
if (screen->gen >= 6) {
@@ -1080,7 +1084,8 @@ intel_screen_make_configs(__DRIscreen *dri_screen)
for (int i = 0; i < ARRAY_SIZE(formats); i++) {
__DRIconfig **new_configs;
- if (formats[i] == MESA_FORMAT_RGB565) {
+ if (formats[i] == MESA_FORMAT_ARGB1555 ||
+ formats[i] == MESA_FORMAT_RGB565) {
depth_bits[0] = 16;
stencil_bits[0] = 0;
} else {
@@ -1120,7 +1125,8 @@ intel_screen_make_configs(__DRIscreen *dri_screen)
depth_bits[0] = 0;
stencil_bits[0] = 0;
- if (formats[i] == MESA_FORMAT_RGB565) {
+ if (formats[i] == MESA_FORMAT_ARGB1555 ||
+ formats[i] == MESA_FORMAT_RGB565) {
depth_bits[1] = 16;
stencil_bits[1] = 0;
} else {
--
1.7.10.4
More information about the mesa-dev
mailing list