wined3d: Make resources 16 byte aligned.

This commit is contained in:
Stefan Dösinger 2010-03-11 15:41:31 +01:00 committed by Alexandre Julliard
parent b621fac215
commit d790530df3
2 changed files with 4 additions and 3 deletions

View File

@ -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)
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);

View File

@ -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