ddraw: Get the texture format from the texture in d3d_device3_SetRenderState().

Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Henri Verbeet 2016-02-29 11:38:23 +01:00 committed by Alexandre Julliard
parent 8c93a90f78
commit 3c54eefaca
1 changed files with 6 additions and 10 deletions

View File

@ -2796,18 +2796,14 @@ static HRESULT WINAPI d3d_device3_SetRenderState(IDirect3DDevice3 *iface,
DDPIXELFORMAT ddfmt; DDPIXELFORMAT ddfmt;
if ((tex = wined3d_device_get_texture(device->wined3d_device, 0))) if ((tex = wined3d_device_get_texture(device->wined3d_device, 0)))
{
struct wined3d_resource *sub_resource;
if ((sub_resource = wined3d_texture_get_sub_resource(tex, 0)))
{ {
struct wined3d_resource_desc desc; struct wined3d_resource_desc desc;
wined3d_resource_get_desc(sub_resource, &desc); wined3d_resource_get_desc(wined3d_texture_get_resource(tex), &desc);
ddfmt.dwSize = sizeof(ddfmt); ddfmt.dwSize = sizeof(ddfmt);
ddrawformat_from_wined3dformat(&ddfmt, desc.format); ddrawformat_from_wined3dformat(&ddfmt, desc.format);
if (ddfmt.u5.dwRGBAlphaBitMask) tex_alpha = TRUE; if (ddfmt.u5.dwRGBAlphaBitMask)
} tex_alpha = TRUE;
} }
if (tex_alpha) if (tex_alpha)