st/nine: Check for aligned offset in each vertex element
authorPatrick Rudolph <siro@das-labor.org>
Fri, 16 Jan 2015 07:17:07 +0000 (08:17 +0100)
committerAxel Davy <axel.davy@ens.fr>
Thu, 5 Feb 2015 23:07:19 +0000 (00:07 +0100)
Fixes wine test test_vertex_declaration_alignment()

Reviewed-by: Axel Davy <axel.davy@ens.fr>
Signed-off-by: Patrick Rudolph <siro@das-labor.org>
src/gallium/state_trackers/nine/vertexdeclaration9.c

index 49e5937a52ef69d16e3979874621379da22aa867..9e4cb55bc676d8358fd1e2853524216a47a1add0 100644 (file)
@@ -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);