Stefan Dösinger : wined3d: Make resources 16 byte aligned.
Alexandre Julliard
julliard at winehq.org
Wed Mar 17 12:19:06 CDT 2010
Module: wine
Branch: master
Commit: d790530df34f9129b4e2bf80311f966ca39c752f
URL: http://source.winehq.org/git/wine.git/?a=commit;h=d790530df34f9129b4e2bf80311f966ca39c752f
Author: Stefan Dösinger <stefan at codeweavers.com>
Date: Thu Mar 11 15:41:31 2010 +0100
wined3d: Make resources 16 byte aligned.
---
dlls/d3d9/tests/buffer.c | 5 +++--
dlls/wined3d/wined3d_private.h | 2 +-
2 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/dlls/d3d9/tests/buffer.c b/dlls/d3d9/tests/buffer.c
index 57a6495..719ce7e 100644
--- a/dlls/d3d9/tests/buffer.c
+++ b/dlls/d3d9/tests/buffer.c
@@ -137,6 +137,7 @@ static void test_vertex_buffer_alignment(IDirect3DDevice9 *device)
DWORD sizes[] = {1, 4, 16, 17, 32, 33, 64, 65, 1024, 1025, 1048576, 1048577};
unsigned int i, j;
void *data;
+ unsigned int align = 16;
for(i = 0; i < (sizeof(sizes) / sizeof(sizes[0])); i++)
{
@@ -156,8 +157,8 @@ static void test_vertex_buffer_alignment(IDirect3DDevice9 *device)
hr = IDirect3DVertexBuffer9_Lock(buffer, 0, 0, &data, 0);
ok(SUCCEEDED(hr), "IDirect3DVertexBuffer9_Lock failed (0x%08x)\n", hr);
- ok(((DWORD_PTR) data & 31) == 0, "Vertex buffer start address is not 32 byte aligned(size: %d, pool: %s, data: %p)\n",
- sizes[i], debug_d3dpool(pools[j]), data);
+ ok(((DWORD_PTR) data & (align - 1)) == 0, "Vertex buffer start address is not %u byte aligned(size: %d, pool: %s, data: %p)\n",
+ align, sizes[i], debug_d3dpool(pools[j]), data);
hr = IDirect3DVertexBuffer9_Unlock(buffer);
ok(SUCCEEDED(hr), "IDirect3DVertexBuffer9_Unlock failed (0x%08x)\n", hr);
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
index 2271d4e..5c2e42d 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -1798,7 +1798,7 @@ HRESULT resource_set_private_data(IWineD3DResource *iface, REFGUID guid,
const void *data, DWORD data_size, DWORD flags) DECLSPEC_HIDDEN;
/* Tests show that the start address of resources is 32 byte aligned */
-#define RESOURCE_ALIGNMENT 32
+#define RESOURCE_ALIGNMENT 16
/*****************************************************************************
* IWineD3DBaseTexture D3D- > openGL state map lookups
More information about the wine-cvs
mailing list