[Mesa-dev] [PATCH 30/39] st/nine: Fix CheckDeviceFormat advertising for surfaces

Axel Davy axel.davy at ens.fr
Sun May 15 10:45:44 UTC 2016


Signed-off-by: Axel Davy <axel.davy at ens.fr>
---
 src/gallium/state_trackers/nine/adapter9.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/src/gallium/state_trackers/nine/adapter9.c b/src/gallium/state_trackers/nine/adapter9.c
index 48e1e44..b06528d 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;
     }
-- 
2.8.2



More information about the mesa-dev mailing list