diff options
author | Chia-I Wu <olv@lunarg.com> | 2010-04-10 00:36:50 +0800 |
---|---|---|
committer | Chia-I Wu <olv@lunarg.com> | 2010-04-11 01:17:47 +0800 |
commit | 9b3df661bd50b34ca73ae55f98ced64fd970f443 (patch) | |
tree | 5c1567b6713fe326eee1097ec699f0c8663a1510 /src/gallium/state_trackers/egl/x11/native_ximage.c | |
parent | 5fdda9d78d7924fecd711c21910879b7a01dab3f (diff) |
st/egl: Remove depth/stencil format from the native interface.
A native display has no interest in depth/stencil format. Remove it
from the interface and let the common code derive the supported
depth/stencil formats from the pipe screen.
Diffstat (limited to 'src/gallium/state_trackers/egl/x11/native_ximage.c')
-rw-r--r-- | src/gallium/state_trackers/egl/x11/native_ximage.c | 50 |
1 files changed, 20 insertions, 30 deletions
diff --git a/src/gallium/state_trackers/egl/x11/native_ximage.c b/src/gallium/state_trackers/egl/x11/native_ximage.c index 9d6d63344c..203e06e177 100644 --- a/src/gallium/state_trackers/egl/x11/native_ximage.c +++ b/src/gallium/state_trackers/egl/x11/native_ximage.c @@ -466,7 +466,7 @@ ximage_display_get_configs(struct native_display *ndpy, int *num_configs) /* first time */ if (!xdpy->configs) { const XVisualInfo *visuals; - int num_visuals, count, j; + int num_visuals, count; visuals = x11_screen_get_visuals(xdpy->xscr, &num_visuals); if (!visuals) @@ -482,40 +482,30 @@ ximage_display_get_configs(struct native_display *ndpy, int *num_configs) count = 0; for (i = 0; i < num_visuals; i++) { - for (j = 0; j < 2; j++) { - struct ximage_config *xconf = &xdpy->configs[count]; - - xconf->visual = &visuals[i]; - xconf->base.color_format = choose_format(xconf->visual); - if (xconf->base.color_format == PIPE_FORMAT_NONE) - continue; - - xconf->base.buffer_mask = - (1 << NATIVE_ATTACHMENT_FRONT_LEFT) | - (1 << NATIVE_ATTACHMENT_BACK_LEFT); - - xconf->base.depth_format = PIPE_FORMAT_NONE; - xconf->base.stencil_format = PIPE_FORMAT_NONE; - /* create the second config with depth/stencil buffer */ - if (j == 1) { - xconf->base.depth_format = PIPE_FORMAT_Z24_UNORM_S8_USCALED; - xconf->base.stencil_format = PIPE_FORMAT_Z24_UNORM_S8_USCALED; - } - - xconf->base.window_bit = TRUE; - xconf->base.pixmap_bit = TRUE; - - xconf->base.native_visual_id = xconf->visual->visualid; + struct ximage_config *xconf = &xdpy->configs[count]; + + xconf->visual = &visuals[i]; + xconf->base.color_format = choose_format(xconf->visual); + if (xconf->base.color_format == PIPE_FORMAT_NONE) + continue; + + xconf->base.buffer_mask = + (1 << NATIVE_ATTACHMENT_FRONT_LEFT) | + (1 << NATIVE_ATTACHMENT_BACK_LEFT); + + xconf->base.window_bit = TRUE; + xconf->base.pixmap_bit = TRUE; + + xconf->base.native_visual_id = xconf->visual->visualid; #if defined(__cplusplus) || defined(c_plusplus) - xconf->base.native_visual_type = xconf->visual->c_class; + xconf->base.native_visual_type = xconf->visual->c_class; #else - xconf->base.native_visual_type = xconf->visual->class; + xconf->base.native_visual_type = xconf->visual->class; #endif - xconf->base.slow_config = TRUE; + xconf->base.slow_config = TRUE; - count++; - } + count++; } xdpy->num_configs = count; |