Commit 513d3e13 authored by Akihiro Sagawa's avatar Akihiro Sagawa Committed by Alexandre Julliard

d3d8: Support texture dirty regions.

parent 54edd5b2
......@@ -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);
......
......@@ -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))
......
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