mirror of
git://source.winehq.org/git/wine.git
synced 2024-10-06 09:35:52 +00:00
ddraw: Sync draw textures even for hardware device.
Fixes a regression introduced by commit
d2d9f713df
.
This commit is contained in:
parent
c7a167ea41
commit
fffde3ca52
|
@ -328,6 +328,7 @@ struct d3d_device
|
||||||
LONG ref;
|
LONG ref;
|
||||||
UINT version;
|
UINT version;
|
||||||
BOOL hardware_device;
|
BOOL hardware_device;
|
||||||
|
BOOL have_draw_textures;
|
||||||
|
|
||||||
IUnknown *outer_unknown;
|
IUnknown *outer_unknown;
|
||||||
struct wined3d_device *wined3d_device;
|
struct wined3d_device *wined3d_device;
|
||||||
|
|
|
@ -3409,11 +3409,11 @@ void d3d_device_sync_surfaces(struct d3d_device *device)
|
||||||
struct ddraw_surface *surface;
|
struct ddraw_surface *surface;
|
||||||
unsigned int i, j;
|
unsigned int i, j;
|
||||||
|
|
||||||
if (device->hardware_device)
|
|
||||||
return;
|
|
||||||
|
|
||||||
d3d_device_sync_rendertarget(device);
|
d3d_device_sync_rendertarget(device);
|
||||||
|
|
||||||
|
if (!device->have_draw_textures)
|
||||||
|
return;
|
||||||
|
|
||||||
for (i = 0; i < ARRAY_SIZE(state->textures); ++i)
|
for (i = 0; i < ARRAY_SIZE(state->textures); ++i)
|
||||||
{
|
{
|
||||||
if (!state->textures[i])
|
if (!state->textures[i])
|
||||||
|
@ -4642,7 +4642,17 @@ static HRESULT d3d_device7_SetTexture(IDirect3DDevice7 *iface,
|
||||||
TRACE("iface %p, stage %lu, texture %p.\n", iface, stage, texture);
|
TRACE("iface %p, stage %lu, texture %p.\n", iface, stage, texture);
|
||||||
|
|
||||||
if (surf && (surf->surface_desc.ddsCaps.dwCaps & DDSCAPS_TEXTURE))
|
if (surf && (surf->surface_desc.ddsCaps.dwCaps & DDSCAPS_TEXTURE))
|
||||||
wined3d_texture = surf->draw_texture ? surf->draw_texture : surf->wined3d_texture;
|
{
|
||||||
|
if (surf->draw_texture)
|
||||||
|
{
|
||||||
|
wined3d_texture = surf->draw_texture;
|
||||||
|
device->have_draw_textures = TRUE;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
wined3d_texture = surf->wined3d_texture;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
wined3d_mutex_lock();
|
wined3d_mutex_lock();
|
||||||
wined3d_stateblock_set_texture(device->update_state, stage, wined3d_texture);
|
wined3d_stateblock_set_texture(device->update_state, stage, wined3d_texture);
|
||||||
|
@ -4682,7 +4692,17 @@ static HRESULT WINAPI d3d_device3_SetTexture(IDirect3DDevice3 *iface,
|
||||||
wined3d_mutex_lock();
|
wined3d_mutex_lock();
|
||||||
|
|
||||||
if (tex && ((tex->surface_desc.ddsCaps.dwCaps & DDSCAPS_TEXTURE) || !device->hardware_device))
|
if (tex && ((tex->surface_desc.ddsCaps.dwCaps & DDSCAPS_TEXTURE) || !device->hardware_device))
|
||||||
wined3d_texture = tex->draw_texture ? tex->draw_texture : tex->wined3d_texture;
|
{
|
||||||
|
if (tex->draw_texture)
|
||||||
|
{
|
||||||
|
wined3d_texture = tex->draw_texture;
|
||||||
|
device->have_draw_textures = TRUE;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
wined3d_texture = tex->wined3d_texture;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
wined3d_stateblock_set_texture(device->state, stage, wined3d_texture);
|
wined3d_stateblock_set_texture(device->state, stage, wined3d_texture);
|
||||||
fixup_texture_alpha_op(device);
|
fixup_texture_alpha_op(device);
|
||||||
|
|
Loading…
Reference in a new issue