summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJakob Bornecrantz <jakob@vmware.com>2009-08-26 13:45:31 +0200
committerJakob Bornecrantz <jakob@vmware.com>2009-08-26 13:45:31 +0200
commit23fe960be0d0d27fcd676534c692ab164f854acb (patch)
tree79d9bd68a3c9efed5ccfde0c5cdf1e67fa12f3a2 /src
parentaab0bedb8c791531256b9cf4ef165080ccc75e9b (diff)
downloadexternal_mesa3d-23fe960be0d0d27fcd676534c692ab164f854acb.zip
external_mesa3d-23fe960be0d0d27fcd676534c692ab164f854acb.tar.gz
external_mesa3d-23fe960be0d0d27fcd676534c692ab164f854acb.tar.bz2
st/xorg: Find out correct type for depth stencil buffers
Diffstat (limited to 'src')
-rw-r--r--src/gallium/state_trackers/xorg/xorg_dri2.c12
-rw-r--r--src/gallium/state_trackers/xorg/xorg_tracker.h2
2 files changed, 13 insertions, 1 deletions
diff --git a/src/gallium/state_trackers/xorg/xorg_dri2.c b/src/gallium/state_trackers/xorg/xorg_dri2.c
index f089965..e72710b 100644
--- a/src/gallium/state_trackers/xorg/xorg_dri2.c
+++ b/src/gallium/state_trackers/xorg/xorg_dri2.c
@@ -88,7 +88,8 @@ driCreateBuffers(DrawablePtr pDraw, unsigned int *attachments, int count)
struct pipe_texture template;
memset(&template, 0, sizeof(template));
template.target = PIPE_TEXTURE_2D;
- template.format = PIPE_FORMAT_S8Z24_UNORM;
+ template.format = ms->ds_depth_bits_last ?
+ PIPE_FORMAT_S8Z24_UNORM : PIPE_FORMAT_Z24S8_UNORM;
pf_get_block(template.format, &template.block);
template.width[0] = pDraw->width;
template.height[0] = pDraw->height;
@@ -270,6 +271,15 @@ driScreenInit(ScreenPtr pScreen)
dri2info.DestroyBuffers = driDestroyBuffers;
dri2info.CopyRegion = driCopyRegion;
+ ms->d_depth_bits_last =
+ ms->screen->is_format_supported(ms->screen, PIPE_FORMAT_X8Z24_UNORM,
+ PIPE_TEXTURE_2D,
+ PIPE_TEXTURE_USAGE_DEPTH_STENCIL, 0);
+ ms->ds_depth_bits_last =
+ ms->screen->is_format_supported(ms->screen, PIPE_FORMAT_S8Z24_UNORM,
+ PIPE_TEXTURE_2D,
+ PIPE_TEXTURE_USAGE_DEPTH_STENCIL, 0);
+
return DRI2ScreenInit(pScreen, &dri2info);
}
diff --git a/src/gallium/state_trackers/xorg/xorg_tracker.h b/src/gallium/state_trackers/xorg/xorg_tracker.h
index da850bb..8c60d50 100644
--- a/src/gallium/state_trackers/xorg/xorg_tracker.h
+++ b/src/gallium/state_trackers/xorg/xorg_tracker.h
@@ -87,6 +87,8 @@ typedef struct _modesettingRec
struct drm_api *api;
struct pipe_screen *screen;
struct pipe_context *ctx;
+ boolean d_depth_bits_last;
+ boolean ds_depth_bits_last;
/* exa */
void *exa;