[Mesa-dev] [PATCH 27/43] st/nine: Check for aligned offset in each vertex element

Axel Davy axel.davy at ens.fr
Fri Jan 30 12:34:26 PST 2015


From: Patrick Rudolph <siro at das-labor.org>

Fixes wine test test_vertex_declaration_alignment()

Reviewed-by: Axel Davy <axel.davy at ens.fr>
Signed-off-by: Patrick Rudolph <siro at das-labor.org>
---
 src/gallium/state_trackers/nine/vertexdeclaration9.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/gallium/state_trackers/nine/vertexdeclaration9.c b/src/gallium/state_trackers/nine/vertexdeclaration9.c
index 49e5937..9e4cb55 100644
--- a/src/gallium/state_trackers/nine/vertexdeclaration9.c
+++ b/src/gallium/state_trackers/nine/vertexdeclaration9.c
@@ -184,8 +184,10 @@ NineVertexDeclaration9_ctor( struct NineVertexDeclaration9 *This,
     /* wine */
     for (This->nelems = 0;
          pElements[This->nelems].Stream != 0xFF;
-         ++This->nelems)
+         ++This->nelems) {
         user_assert(pElements[This->nelems].Type != D3DDECLTYPE_UNUSED, E_FAIL);
+        user_assert(!(pElements[This->nelems].Offset & 3), E_FAIL);
+    }
 
     caps = NineDevice9_GetCaps(This->base.device);
     user_assert(This->nelems <= caps->MaxStreams, D3DERR_INVALIDCALL);
-- 
2.1.0



More information about the mesa-dev mailing list