wined3d: Make "driver private" formats always mappable.

Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Henri Verbeet 2018-11-18 22:09:16 +03:30 committed by Alexandre Julliard
parent 54d63891f3
commit 826be9ee10
5 changed files with 10 additions and 7 deletions

View File

@ -9045,11 +9045,9 @@ static void test_resource_access(void)
expected_hr = D3D_OK;
else
expected_hr = D3DERR_INVALIDCALL;
todo_wine_if(j == 1 && surface_types[i].type != SURFACE_IMAGE)
ok(hr == expected_hr, "Test %s %u: Got unexpected hr %#x.\n", surface_types[i].name, j, hr);
ok(hr == expected_hr, "Test %s %u: Got unexpected hr %#x.\n", surface_types[i].name, j, hr);
hr = IDirect3DSurface8_UnlockRect(surface);
todo_wine_if((expected_hr != D3D_OK && surface_types[i].type == SURFACE_2D)
|| (j == 1 && surface_types[i].type == SURFACE_CUBE))
todo_wine_if(expected_hr != D3D_OK && surface_types[i].type == SURFACE_2D)
ok(hr == expected_hr, "Test %s %u: Got unexpected hr %#x.\n", surface_types[i].name, j, hr);
if (SUCCEEDED(IDirect3DSurface8_GetContainer(surface, &IID_IDirect3DBaseTexture8, (void **)&texture)))

View File

@ -186,6 +186,8 @@ HRESULT resource_init(struct wined3d_resource *resource, struct wined3d_device *
resource->multisample_quality = multisample_quality;
resource->usage = usage;
resource->bind_flags = bind_flags;
if (resource->format_flags & WINED3DFMT_FLAG_MAPPABLE)
access |= WINED3D_RESOURCE_ACCESS_MAP_R | WINED3D_RESOURCE_ACCESS_MAP_W;
resource->access = access;
resource->width = width;
resource->height = height;

View File

@ -3012,7 +3012,7 @@ static HRESULT wined3d_texture_init(struct wined3d_texture *texture, const struc
return hr;
}
wined3d_resource_update_draw_binding(&texture->resource);
if ((flags & WINED3D_TEXTURE_CREATE_MAPPABLE) || desc->format == WINED3DFMT_D16_LOCKABLE)
if (flags & WINED3D_TEXTURE_CREATE_MAPPABLE)
texture->resource.access |= WINED3D_RESOURCE_ACCESS_MAP_R | WINED3D_RESOURCE_ACCESS_MAP_W;
texture->texture_ops = texture_ops;

View File

@ -328,8 +328,10 @@ struct wined3d_format_base_flags
* resource size. */
static const struct wined3d_format_base_flags format_base_flags[] =
{
{WINED3DFMT_ATI1N, WINED3DFMT_FLAG_BROKEN_PITCH},
{WINED3DFMT_ATI2N, WINED3DFMT_FLAG_BROKEN_PITCH},
{WINED3DFMT_ATI1N, WINED3DFMT_FLAG_MAPPABLE | WINED3DFMT_FLAG_BROKEN_PITCH},
{WINED3DFMT_ATI2N, WINED3DFMT_FLAG_MAPPABLE | WINED3DFMT_FLAG_BROKEN_PITCH},
{WINED3DFMT_D16_LOCKABLE, WINED3DFMT_FLAG_MAPPABLE},
{WINED3DFMT_INTZ, WINED3DFMT_FLAG_MAPPABLE},
{WINED3DFMT_R11G11B10_FLOAT, WINED3DFMT_FLAG_FLOAT},
{WINED3DFMT_D32_FLOAT, WINED3DFMT_FLAG_FLOAT},
{WINED3DFMT_S8_UINT_D24_FLOAT, WINED3DFMT_FLAG_FLOAT},

View File

@ -4401,6 +4401,7 @@ extern enum wined3d_format_id pixelformat_for_depth(DWORD depth) DECLSPEC_HIDDEN
#define WINED3DFMT_FLAG_NORMALISED 0x00800000
#define WINED3DFMT_FLAG_VERTEX_ATTRIBUTE 0x01000000
#define WINED3DFMT_FLAG_BLIT 0x02000000
#define WINED3DFMT_FLAG_MAPPABLE 0x04000000
struct wined3d_rational
{