Commit d790530d authored by Stefan Dösinger's avatar Stefan Dösinger Committed by Alexandre Julliard

wined3d: Make resources 16 byte aligned.

parent b621fac2
...@@ -137,6 +137,7 @@ static void test_vertex_buffer_alignment(IDirect3DDevice9 *device) ...@@ -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}; DWORD sizes[] = {1, 4, 16, 17, 32, 33, 64, 65, 1024, 1025, 1048576, 1048577};
unsigned int i, j; unsigned int i, j;
void *data; void *data;
unsigned int align = 16;
for(i = 0; i < (sizeof(sizes) / sizeof(sizes[0])); i++) for(i = 0; i < (sizeof(sizes) / sizeof(sizes[0])); i++)
{ {
...@@ -156,8 +157,8 @@ static void test_vertex_buffer_alignment(IDirect3DDevice9 *device) ...@@ -156,8 +157,8 @@ static void test_vertex_buffer_alignment(IDirect3DDevice9 *device)
hr = IDirect3DVertexBuffer9_Lock(buffer, 0, 0, &data, 0); hr = IDirect3DVertexBuffer9_Lock(buffer, 0, 0, &data, 0);
ok(SUCCEEDED(hr), "IDirect3DVertexBuffer9_Lock failed (0x%08x)\n", hr); 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", ok(((DWORD_PTR) data & (align - 1)) == 0, "Vertex buffer start address is not %u byte aligned(size: %d, pool: %s, data: %p)\n",
sizes[i], debug_d3dpool(pools[j]), data); align, sizes[i], debug_d3dpool(pools[j]), data);
hr = IDirect3DVertexBuffer9_Unlock(buffer); hr = IDirect3DVertexBuffer9_Unlock(buffer);
ok(SUCCEEDED(hr), "IDirect3DVertexBuffer9_Unlock failed (0x%08x)\n", hr); ok(SUCCEEDED(hr), "IDirect3DVertexBuffer9_Unlock failed (0x%08x)\n", hr);
......
...@@ -1798,7 +1798,7 @@ HRESULT resource_set_private_data(IWineD3DResource *iface, REFGUID guid, ...@@ -1798,7 +1798,7 @@ HRESULT resource_set_private_data(IWineD3DResource *iface, REFGUID guid,
const void *data, DWORD data_size, DWORD flags) DECLSPEC_HIDDEN; const void *data, DWORD data_size, DWORD flags) DECLSPEC_HIDDEN;
/* Tests show that the start address of resources is 32 byte aligned */ /* 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 * IWineD3DBaseTexture D3D- > openGL state map lookups
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment