summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAxel Davy <[email protected]>2016-03-11 23:30:05 +0100
committerAxel Davy <[email protected]>2016-05-18 23:37:14 +0200
commitb8d95d40872dafbd372c071455d26ab078cdd170 (patch)
tree9169824f103e7ac7bf31cd9e59afdb4f6504955c
parent6ef231c80f7bb8aa08b9402d7cdfc792e8752b39 (diff)
st/nine: Fix CheckDeviceFormat advertising for surfaces
Signed-off-by: Axel Davy <[email protected]>
-rw-r--r--src/gallium/state_trackers/nine/adapter9.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/gallium/state_trackers/nine/adapter9.c b/src/gallium/state_trackers/nine/adapter9.c
index 48e1e44c1bf..b06528d8c1b 100644
--- a/src/gallium/state_trackers/nine/adapter9.c
+++ b/src/gallium/state_trackers/nine/adapter9.c
@@ -326,6 +326,18 @@ NineAdapter9_CheckDeviceFormat( struct NineAdapter9 *This,
case D3DRTYPE_VOLUMETEXTURE: bind |= PIPE_BIND_SAMPLER_VIEW; break;
case D3DRTYPE_VERTEXBUFFER: bind |= PIPE_BIND_VERTEX_BUFFER; break;
case D3DRTYPE_INDEXBUFFER: bind |= PIPE_BIND_INDEX_BUFFER; break;
+ case D3DRTYPE_SURFACE:
+ if (!(Usage & D3DUSAGE_DEPTHSTENCIL))
+ bind |= PIPE_BIND_SAMPLER_VIEW; /* StretchRect */
+ /* Offscreen surface support: Usage = 0.
+ * In practice drivers are very restrictive on the formats supported.
+ * Basically a few common formats + YUV and compressed formats. The
+ * reason is that offscreen surface are useful only for directdraw
+ * compatibility (a WONTIMPL of nine) + format conversion (useful in
+ * particular for YUV because the format was not advertised for textures
+ * on NV chips). */
+ if (Usage == 0)
+ bind |= PIPE_BIND_RENDER_TARGET; /* A current requirement of our impl, which we should get rid of. */
default:
break;
}