Commit a6d640e8 authored by Henri Verbeet's avatar Henri Verbeet Committed by Alexandre Julliard

wined3d: Do not create DCs for all textures on WINED3D_NO3D adapters.

WINED3DFMT_D16_UNORM for example doesn't have a corresponding ddi_format. Signed-off-by: 's avatarHenri Verbeet <hverbeet@codeweavers.com> Signed-off-by: 's avatarAlexandre Julliard <julliard@winehq.org>
parent 71f3a225
......@@ -39,7 +39,8 @@ static void resource_check_usage(DWORD usage)
| WINED3DUSAGE_SCRATCH
| WINED3DUSAGE_PRIVATE
| WINED3DUSAGE_LEGACY_CUBEMAP
| WINED3DUSAGE_TEXTURE;
| WINED3DUSAGE_TEXTURE
| ~WINED3DUSAGE_MASK;
/* WINED3DUSAGE_WRITEONLY is supposed to result in write-combined mappings
* being returned. OpenGL doesn't give us explicit control over that, but
......
......@@ -834,6 +834,8 @@ static HRESULT swapchain_init(struct wined3d_swapchain *swapchain, struct wined3
texture_desc.multisample_type = swapchain->desc.multisample_type;
texture_desc.multisample_quality = swapchain->desc.multisample_quality;
texture_desc.usage = 0;
if (device->wined3d->flags & WINED3D_NO3D)
texture_desc.usage |= WINED3DUSAGE_OWNDC;
texture_desc.access = WINED3D_RESOURCE_ACCESS_GPU;
texture_desc.width = swapchain->desc.backbuffer_width;
texture_desc.height = swapchain->desc.backbuffer_height;
......@@ -915,6 +917,8 @@ static HRESULT swapchain_init(struct wined3d_swapchain *swapchain, struct wined3
}
texture_desc.usage = swapchain->desc.backbuffer_usage;
if (device->wined3d->flags & WINED3D_NO3D)
texture_desc.usage |= WINED3DUSAGE_OWNDC;
for (i = 0; i < swapchain->desc.backbuffer_count; ++i)
{
TRACE("Creating back buffer %u.\n", i);
......
......@@ -2896,7 +2896,7 @@ static HRESULT wined3d_texture_init(struct wined3d_texture *texture, const struc
TRACE("Created sub-resource %u (level %u, layer %u).\n",
i, i % texture->level_count, i / texture->level_count);
if ((desc->usage & WINED3DUSAGE_OWNDC) || (device->wined3d->flags & WINED3D_NO3D))
if (desc->usage & WINED3DUSAGE_OWNDC)
{
struct wined3d_texture_idx texture_idx = {texture, i};
......@@ -3515,7 +3515,7 @@ HRESULT CDECL wined3d_texture_release_dc(struct wined3d_texture *texture, unsign
return WINED3DERR_INVALIDCALL;
}
if (!(texture->resource.usage & WINED3DUSAGE_OWNDC) && !(device->wined3d->flags & WINED3D_NO3D))
if (!(texture->resource.usage & WINED3DUSAGE_OWNDC))
{
struct wined3d_texture_idx texture_idx = {texture, sub_resource_idx};
......
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