aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJosé Fonseca <[email protected]>2011-04-08 15:21:10 +0100
committerBrian Paul <[email protected]>2011-09-23 07:58:45 -0600
commit6759ad53e20c5a12b1722c6653f54eff9f44c062 (patch)
treef4546cdab647873673524ec2fcc3ee6552cbad41
parent846a21d352b0bd965c38d0308c75f220e70e3ba3 (diff)
svga: Add a comment about depth format selection.
-rw-r--r--src/gallium/drivers/svga/svga_screen.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/gallium/drivers/svga/svga_screen.c b/src/gallium/drivers/svga/svga_screen.c
index 5b759627f73..e8f17ba30b0 100644
--- a/src/gallium/drivers/svga/svga_screen.c
+++ b/src/gallium/drivers/svga/svga_screen.c
@@ -519,6 +519,15 @@ svga_screen_create(struct svga_winsys_screen *sws)
sws->get_cap(sws, SVGA3D_DEVCAP_VERTEX_SHADER_VERSION, &result) &&
result.u >= SVGA3DVSVERSION_30 ? TRUE : FALSE;
+ /*
+ * The D16, D24X8, and D24S8 formats always do an implicit shadow compare
+ * when sampled from, where as the DF16, DF24, and D24S8_INT do not. So
+ * we prefer the later when available.
+ *
+ * This mimics hardware vendors extensions for D3D depth sampling. See also
+ * http://aras-p.info/texts/D3D9GPUHacks.html
+ */
+
{
SVGA3dSurfaceFormatCaps mask;
mask.value = 0;
@@ -551,7 +560,7 @@ svga_screen_create(struct svga_winsys_screen *sws)
sws->get_cap(sws, SVGA3D_DEVCAP_SURFACEFMT_Z_D24S8_INT, &result) &&
(result.u & mask.value) == mask.value ?
SVGA3D_Z_D24S8_INT : svgascreen->depth.s8z24;
- }
+ }
#if 1