summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/gallium/state_trackers/nine/basetexture9.c12
-rw-r--r--src/gallium/state_trackers/nine/nine_pipe.h6
2 files changed, 14 insertions, 4 deletions
diff --git a/src/gallium/state_trackers/nine/basetexture9.c b/src/gallium/state_trackers/nine/basetexture9.c
index 8d183e65d46..f2ca35b0205 100644
--- a/src/gallium/state_trackers/nine/basetexture9.c
+++ b/src/gallium/state_trackers/nine/basetexture9.c
@@ -69,8 +69,16 @@ NineBaseTexture9_ctor( struct NineBaseTexture9 *This,
D3DTEXF_LINEAR : D3DTEXF_NONE;
This->lod = 0;
This->lod_resident = -1;
- This->shadow = This->format != D3DFMT_INTZ && util_format_has_depth(
- util_format_description(This->base.info.format));
+ /* When a depth buffer is sampled, it is for shadow mapping, except for
+ * D3DFMT_INTZ, D3DFMT_DF16 and D3DFMT_DF24.
+ * In addition D3DFMT_INTZ can be used for both texturing and depth buffering
+ * if z write is disabled. This particular feature may not work for us in
+ * practice because OGL doesn't have that. However apparently it is known
+ * some cards have performance issues with this feature, so real apps
+ * shouldn't use it. */
+ This->shadow = (This->format != D3DFMT_INTZ && This->format != D3DFMT_DF16 &&
+ This->format != D3DFMT_DF24) &&
+ util_format_has_depth(util_format_description(This->base.info.format));
list_inithead(&This->list);
diff --git a/src/gallium/state_trackers/nine/nine_pipe.h b/src/gallium/state_trackers/nine/nine_pipe.h
index 6e4ee43f5a5..640bbdbfbf2 100644
--- a/src/gallium/state_trackers/nine/nine_pipe.h
+++ b/src/gallium/state_trackers/nine/nine_pipe.h
@@ -182,6 +182,7 @@ d3d9_to_pipe_format_internal(D3DFORMAT format)
return nine_d3d9_to_pipe_format_map[format];
switch (format) {
case D3DFMT_INTZ: return PIPE_FORMAT_S8_UINT_Z24_UNORM;
+ case D3DFMT_DF16: return PIPE_FORMAT_Z16_UNORM;
case D3DFMT_DXT1: return PIPE_FORMAT_DXT1_RGBA;
case D3DFMT_DXT2: return PIPE_FORMAT_DXT3_RGBA; /* XXX */
case D3DFMT_DXT3: return PIPE_FORMAT_DXT3_RGBA;
@@ -199,8 +200,9 @@ d3d9_to_pipe_format_internal(D3DFORMAT format)
case D3DFMT_Y210: /* XXX */
case D3DFMT_Y216:
case D3DFMT_NV11:
- case D3DFMT_DF16: /* useless, not supported by wine either */
- case D3DFMT_DF24: /* useless, not supported by wine either */
+ case D3DFMT_DF24: /* Similar to D3DFMT_DF16 but for 24-bits.
+ We don't advertise it because when it is supported, Fetch-4 is
+ supposed to be supported, which we don't support yet. */
case D3DFMT_NULL: /* special cased, only for surfaces */
return PIPE_FORMAT_NONE;
default: