diff options
author | Axel Davy <[email protected]> | 2015-01-14 12:10:48 +0100 |
---|---|---|
committer | Axel Davy <[email protected]> | 2015-02-06 00:07:19 +0100 |
commit | bf0adf248f3562e6fb205b31d14f650ab0a14c8e (patch) | |
tree | bb222a2658eb8307b41b9e859b97a569260688f3 /src/gallium/state_trackers/nine/basetexture9.c | |
parent | 34292754d2852980cd685fb0ef54b40f38235aab (diff) |
st/nine: Add D3DFMT_DF16 support
This depth buffer format, like D3DFMT_INTZ, can be used to read
the depth buffer values when bound to a shader.
Some apps may use this format to get better performance when
they don't need the precision of INTZ (24 bits for depth, 8 for
stencil, whereas DF16 is just 16 bits for depth)
We don't add support for DF24 yet, because it implies support
for FETCH4, which we don't support for now.
Reviewed-by: Tiziano Bacocco <[email protected]>
Signed-off-by: Axel Davy <[email protected]>
Diffstat (limited to 'src/gallium/state_trackers/nine/basetexture9.c')
-rw-r--r-- | src/gallium/state_trackers/nine/basetexture9.c | 12 |
1 files changed, 10 insertions, 2 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); |