This fixes piglit tests general/draw-vertices and 
general/draw-vertices-half-float.

I only tested this on R700 hardware. Someone with EG hardware should probably 
check if this is necessary there, too, i.e. check if the to aforementioned 
tests fail without this patch.

Note: Some of the test's probes with non-dword aligned strides pass without 
the patch. However, if you examine the rendered image you find that the 
respective triangles are not rendered correctly.

Fabian
From 4ee935e3f698a237eeb3c43be39d3dfe7b97f936 Mon Sep 17 00:00:00 2001
From: Fabian Bieler <der.f...@gmx.net>
Date: Mon, 14 Feb 2011 22:44:42 +0100
Subject: [PATCH 2/2] r600g: Request DWORD aligned vertex buffers.

The spec says that the offsets in the vertex-fetch instructions need to be byte-aligned and makes no specification with regard to the required alignment of the offset and stride in the vertex resource constant register.

However, testing indicates that all three values need to be DWORD aligned.
---
 src/gallium/drivers/r600/r600_pipe.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/src/gallium/drivers/r600/r600_pipe.c b/src/gallium/drivers/r600/r600_pipe.c
index 9d6c9bd..79b0d02 100644
--- a/src/gallium/drivers/r600/r600_pipe.c
+++ b/src/gallium/drivers/r600/r600_pipe.c
@@ -196,7 +196,7 @@ static struct pipe_context *r600_create_context(struct pipe_screen *screen, void
 					   PIPE_BIND_VERTEX_BUFFER |
 					   PIPE_BIND_INDEX_BUFFER |
 					   PIPE_BIND_CONSTANT_BUFFER,
-					   U_VERTEX_FETCH_BYTE_ALIGNED);
+					   U_VERTEX_FETCH_DWORD_ALIGNED);
 	if (!rctx->vbuf_mgr) {
 		r600_destroy_context(&rctx->context);
 		return NULL;
-- 
1.7.2.3

_______________________________________________
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev

Reply via email to