1
0
mirror of https://github.com/wine-mirror/wine synced 2024-07-08 20:06:18 +00:00

d3d8: Support texture dirty regions.

Signed-off-by: Akihiro Sagawa <sagawa.aki@gmail.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Akihiro Sagawa 2019-12-10 21:26:17 +03:30 committed by Alexandre Julliard
parent 54edd5b220
commit 513d3e1376
2 changed files with 17 additions and 7 deletions

View File

@ -5529,7 +5529,7 @@ static void add_dirty_rect_test(void)
ok(SUCCEEDED(hr), "Failed to set texture, hr %#x.\n", hr);
add_dirty_rect_test_draw(device);
color = getPixelColor(device, 320, 240);
todo_wine ok(color_match(color, 0x00ff0000, 1),
ok(color_match(color, 0x00ff0000, 1),
"Expected color 0x00ff0000, got 0x%08x.\n", color);
hr = IDirect3DDevice8_Present(device, NULL, NULL, NULL, NULL);
ok(SUCCEEDED(hr), "Failed to present, hr %#x.\n", hr);
@ -5542,7 +5542,7 @@ static void add_dirty_rect_test(void)
ok(SUCCEEDED(hr), "Failed to update texture, hr %#x.\n", hr);
add_dirty_rect_test_draw(device);
color = getPixelColor(device, 320, 240);
todo_wine ok(color_match(color, 0x00ff0000, 1),
ok(color_match(color, 0x00ff0000, 1),
"Expected color 0x00ff0000, got 0x%08x.\n", color);
hr = IDirect3DDevice8_Present(device, NULL, NULL, NULL, NULL);
ok(SUCCEEDED(hr), "Failed to present, hr %#x.\n", hr);
@ -5554,7 +5554,7 @@ static void add_dirty_rect_test(void)
ok(SUCCEEDED(hr), "Failed to update texture, hr %#x.\n", hr);
add_dirty_rect_test_draw(device);
color = getPixelColor(device, 320, 240);
todo_wine ok(color_match(color, 0x00ff0000, 1),
ok(color_match(color, 0x00ff0000, 1),
"Expected color 0x00ff0000, got 0x%08x.\n", color);
hr = IDirect3DDevice8_Present(device, NULL, NULL, NULL, NULL);
ok(SUCCEEDED(hr), "Failed to present, hr %#x.\n", hr);
@ -5571,7 +5571,7 @@ static void add_dirty_rect_test(void)
ok(color_match(color, 0x0000ff00, 1),
"Expected color 0x0000ff00, got 0x%08x.\n", color);
color = getPixelColor(device, 1, 1);
todo_wine ok(color_match(color, 0x00ff0000, 1),
ok(color_match(color, 0x00ff0000, 1),
"Expected color 0x00ff0000, got 0x%08x.\n", color);
hr = IDirect3DDevice8_Present(device, NULL, NULL, NULL, NULL);
ok(SUCCEEDED(hr), "Failed to present, hr %#x.\n", hr);
@ -5593,7 +5593,7 @@ static void add_dirty_rect_test(void)
ok(SUCCEEDED(hr), "Failed to update texture, hr %#x.\n", hr);
add_dirty_rect_test_draw(device);
color = getPixelColor(device, 320, 240);
todo_wine ok(color_match(color, 0x0000ff00, 1),
ok(color_match(color, 0x0000ff00, 1),
"Expected color 0x0000ff00, got 0x%08x.\n", color);
hr = IDirect3DDevice8_Present(device, NULL, NULL, NULL, NULL);
ok(SUCCEEDED(hr), "Failed to present, hr %#x.\n", hr);
@ -5605,7 +5605,7 @@ static void add_dirty_rect_test(void)
ok(SUCCEEDED(hr), "Failed to update texture, hr %#x.\n", hr);
add_dirty_rect_test_draw(device);
color = getPixelColor(device, 320, 240);
todo_wine ok(color_match(color, 0x0000ff00, 1),
ok(color_match(color, 0x0000ff00, 1),
"Expected color 0x0000ff00, got 0x%08x.\n", color);
hr = IDirect3DDevice8_Present(device, NULL, NULL, NULL, NULL);
ok(SUCCEEDED(hr), "Failed to present, hr %#x.\n", hr);

View File

@ -1124,6 +1124,9 @@ HRESULT texture_init(struct d3d8_texture *texture, struct d3d8_device *device,
if (!levels)
levels = wined3d_log2i(max(width, height)) + 1;
if (pool == D3DPOOL_SYSTEMMEM)
flags |= WINED3D_TEXTURE_CREATE_RECORD_DIRTY_REGIONS;
wined3d_mutex_lock();
hr = wined3d_texture_create(device->wined3d_device, &desc, 1, levels, flags,
NULL, texture, &d3d8_texture_wined3d_parent_ops, &texture->wined3d_texture);
@ -1175,6 +1178,9 @@ HRESULT cubetexture_init(struct d3d8_texture *texture, struct d3d8_device *devic
if (!levels)
levels = wined3d_log2i(edge_length) + 1;
if (pool == D3DPOOL_SYSTEMMEM)
flags |= WINED3D_TEXTURE_CREATE_RECORD_DIRTY_REGIONS;
wined3d_mutex_lock();
hr = wined3d_texture_create(device->wined3d_device, &desc, 6, levels, flags,
NULL, texture, &d3d8_texture_wined3d_parent_ops, &texture->wined3d_texture);
@ -1195,6 +1201,7 @@ HRESULT volumetexture_init(struct d3d8_texture *texture, struct d3d8_device *dev
UINT width, UINT height, UINT depth, UINT levels, DWORD usage, D3DFORMAT format, D3DPOOL pool)
{
struct wined3d_resource_desc desc;
DWORD flags = 0;
HRESULT hr;
/* In d3d8, 3D textures can't be used as rendertarget or depth/stencil buffer. */
@ -1228,8 +1235,11 @@ HRESULT volumetexture_init(struct d3d8_texture *texture, struct d3d8_device *dev
if (!levels)
levels = wined3d_log2i(max(max(width, height), depth)) + 1;
if (pool == D3DPOOL_SYSTEMMEM)
flags |= WINED3D_TEXTURE_CREATE_RECORD_DIRTY_REGIONS;
wined3d_mutex_lock();
hr = wined3d_texture_create(device->wined3d_device, &desc, 1, levels, 0,
hr = wined3d_texture_create(device->wined3d_device, &desc, 1, levels, flags,
NULL, texture, &d3d8_texture_wined3d_parent_ops, &texture->wined3d_texture);
wined3d_mutex_unlock();
if (FAILED(hr))