d3d8/tests: Avoid a crash, when CreateTexture failed
Henri Verbeet
hverbeet at gmail.com
Wed Nov 11 08:16:09 CST 2009
2009/11/6 Henri Verbeet <hverbeet at gmail.com>:
> If changing the usage makes it work, that's ok. Maybe try just passing
> 0 for usage. The texture doesn't have to be lockable, all we care
> about is having a unique texture pointer for the
> SetTexture()/GetTexture() calls.
>
I.e., does the attached patch work for you?
-------------- next part --------------
diff --git a/dlls/d3d8/tests/stateblock.c b/dlls/d3d8/tests/stateblock.c
index 30d022c..630c4de 100644
--- a/dlls/d3d8/tests/stateblock.c
+++ b/dlls/d3d8/tests/stateblock.c
@@ -1737,7 +1737,7 @@ static void resource_test_data_init(IDirect3DDevice8 *device,
data->tex = HeapAlloc(GetProcessHeap(), 0, arg->tex_count * sizeof(*data->tex));
for (i = 0; i < arg->tex_count; ++i)
{
- hr = IDirect3DDevice8_CreateTexture(device, 64, 64, 0, D3DUSAGE_DYNAMIC,
+ hr = IDirect3DDevice8_CreateTexture(device, 64, 64, 0, 0,
D3DFMT_A8R8G8B8, D3DPOOL_DEFAULT, &data->tex[i]);
ok(SUCCEEDED(hr), "CreateTexture (%u) returned hr %#x.\n", i, hr);
}
More information about the wine-devel
mailing list