WINED3DFMT_D16_UNORM for example doesn't have a corresponding ddi_format.
Signed-off-by: Henri Verbeet hverbeet@codeweavers.com --- dlls/wined3d/resource.c | 3 ++- dlls/wined3d/swapchain.c | 4 ++++ dlls/wined3d/texture.c | 4 ++-- 3 files changed, 8 insertions(+), 3 deletions(-)
diff --git a/dlls/wined3d/resource.c b/dlls/wined3d/resource.c index 6cb1ac47b4e..9df0a0923b2 100644 --- a/dlls/wined3d/resource.c +++ b/dlls/wined3d/resource.c @@ -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 diff --git a/dlls/wined3d/swapchain.c b/dlls/wined3d/swapchain.c index 8200bdd5e0a..b068cf164cd 100644 --- a/dlls/wined3d/swapchain.c +++ b/dlls/wined3d/swapchain.c @@ -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); diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c index c0bdddcaa09..9589e493552 100644 --- a/dlls/wined3d/texture.c +++ b/dlls/wined3d/texture.c @@ -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};