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);
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;
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: