Commit 9b74ebd7 authored by Henri Verbeet's avatar Henri Verbeet Committed by Alexandre Julliard

wined3d: Get rid of the "lockable" parameter to device_parent_create_rendertarget().

parent f8077a56
...@@ -1400,7 +1400,7 @@ static HRESULT CDECL device_parent_create_surface(struct wined3d_device_parent * ...@@ -1400,7 +1400,7 @@ static HRESULT CDECL device_parent_create_surface(struct wined3d_device_parent *
static HRESULT CDECL device_parent_create_rendertarget(struct wined3d_device_parent *device_parent, static HRESULT CDECL device_parent_create_rendertarget(struct wined3d_device_parent *device_parent,
void *container_parent, UINT width, UINT height, enum wined3d_format_id format, void *container_parent, UINT width, UINT height, enum wined3d_format_id format,
enum wined3d_multisample_type multisample_type, DWORD multisample_quality, BOOL lockable, enum wined3d_multisample_type multisample_type, DWORD multisample_quality,
struct wined3d_surface **surface) struct wined3d_surface **surface)
{ {
struct d3d10_device *device = device_from_wined3d_device_parent(device_parent); struct d3d10_device *device = device_from_wined3d_device_parent(device_parent);
...@@ -1409,9 +1409,9 @@ static HRESULT CDECL device_parent_create_rendertarget(struct wined3d_device_par ...@@ -1409,9 +1409,9 @@ static HRESULT CDECL device_parent_create_rendertarget(struct wined3d_device_par
HRESULT hr; HRESULT hr;
FIXME("device_parent %p, container_parent %p, width %u, height %u, format %#x, multisample_type %#x,\n" FIXME("device_parent %p, container_parent %p, width %u, height %u, format %#x, multisample_type %#x,\n"
"\tmultisample_quality %u, lockable %u, surface %p partial stub!\n", "\tmultisample_quality %u, surface %p partial stub!\n",
device_parent, container_parent, width, height, format, multisample_type, device_parent, container_parent, width, height, format, multisample_type,
multisample_quality, lockable, surface); multisample_quality, surface);
FIXME("Implement DXGI<->wined3d usage conversion\n"); FIXME("Implement DXGI<->wined3d usage conversion\n");
......
...@@ -2856,7 +2856,7 @@ static HRESULT CDECL device_parent_create_surface(struct wined3d_device_parent * ...@@ -2856,7 +2856,7 @@ static HRESULT CDECL device_parent_create_surface(struct wined3d_device_parent *
static HRESULT CDECL device_parent_create_rendertarget(struct wined3d_device_parent *device_parent, static HRESULT CDECL device_parent_create_rendertarget(struct wined3d_device_parent *device_parent,
void *container_parent, UINT width, UINT height, enum wined3d_format_id format, void *container_parent, UINT width, UINT height, enum wined3d_format_id format,
enum wined3d_multisample_type multisample_type, DWORD multisample_quality, BOOL lockable, enum wined3d_multisample_type multisample_type, DWORD multisample_quality,
struct wined3d_surface **surface) struct wined3d_surface **surface)
{ {
struct d3d8_device *device = device_from_device_parent(device_parent); struct d3d8_device *device = device_from_device_parent(device_parent);
...@@ -2864,12 +2864,12 @@ static HRESULT CDECL device_parent_create_rendertarget(struct wined3d_device_par ...@@ -2864,12 +2864,12 @@ static HRESULT CDECL device_parent_create_rendertarget(struct wined3d_device_par
HRESULT hr; HRESULT hr;
TRACE("device_parent %p, container_parent %p, width %u, height %u, format %#x, multisample_type %#x,\n" TRACE("device_parent %p, container_parent %p, width %u, height %u, format %#x, multisample_type %#x,\n"
"\tmultisample_quality %u, lockable %u, surface %p.\n", "\tmultisample_quality %u, surface %p.\n",
device_parent, container_parent, width, height, format, device_parent, container_parent, width, height, format,
multisample_type, multisample_quality, lockable, surface); multisample_type, multisample_quality, surface);
hr = IDirect3DDevice8_CreateRenderTarget(&device->IDirect3DDevice8_iface, width, height, hr = IDirect3DDevice8_CreateRenderTarget(&device->IDirect3DDevice8_iface, width, height,
d3dformat_from_wined3dformat(format), multisample_type, lockable, (IDirect3DSurface8 **)&d3d_surface); d3dformat_from_wined3dformat(format), multisample_type, TRUE, (IDirect3DSurface8 **)&d3d_surface);
if (FAILED(hr)) if (FAILED(hr))
{ {
WARN("Failed to create rendertarget, hr %#x.\n", hr); WARN("Failed to create rendertarget, hr %#x.\n", hr);
......
...@@ -3210,7 +3210,7 @@ static HRESULT CDECL device_parent_create_surface(struct wined3d_device_parent * ...@@ -3210,7 +3210,7 @@ static HRESULT CDECL device_parent_create_surface(struct wined3d_device_parent *
static HRESULT CDECL device_parent_create_rendertarget(struct wined3d_device_parent *device_parent, static HRESULT CDECL device_parent_create_rendertarget(struct wined3d_device_parent *device_parent,
void *container_parent, UINT width, UINT height, enum wined3d_format_id format, void *container_parent, UINT width, UINT height, enum wined3d_format_id format,
enum wined3d_multisample_type multisample_type, DWORD multisample_quality, BOOL lockable, enum wined3d_multisample_type multisample_type, DWORD multisample_quality,
struct wined3d_surface **surface) struct wined3d_surface **surface)
{ {
struct d3d9_device *device = device_from_device_parent(device_parent); struct d3d9_device *device = device_from_device_parent(device_parent);
...@@ -3218,12 +3218,12 @@ static HRESULT CDECL device_parent_create_rendertarget(struct wined3d_device_par ...@@ -3218,12 +3218,12 @@ static HRESULT CDECL device_parent_create_rendertarget(struct wined3d_device_par
HRESULT hr; HRESULT hr;
TRACE("device_parent %p, container_parent %p, width %u, height %u, format %#x, multisample_type %#x,\n" TRACE("device_parent %p, container_parent %p, width %u, height %u, format %#x, multisample_type %#x,\n"
"\tmultisample_quality %u, lockable %u, surface %p.\n", "\tmultisample_quality %u, surface %p.\n",
device_parent, container_parent, width, height, format, multisample_type, device_parent, container_parent, width, height, format, multisample_type,
multisample_quality, lockable, surface); multisample_quality, surface);
hr = d3d9_device_CreateRenderTarget(&device->IDirect3DDevice9Ex_iface, width, height, hr = d3d9_device_CreateRenderTarget(&device->IDirect3DDevice9Ex_iface, width, height,
d3dformat_from_wined3dformat(format), multisample_type, multisample_quality, lockable, d3dformat_from_wined3dformat(format), multisample_type, multisample_quality, TRUE,
(IDirect3DSurface9 **)&d3d_surface, NULL); (IDirect3DSurface9 **)&d3d_surface, NULL);
if (FAILED(hr)) if (FAILED(hr))
{ {
......
...@@ -5444,17 +5444,16 @@ static const struct wined3d_parent_ops ddraw_frontbuffer_parent_ops = ...@@ -5444,17 +5444,16 @@ static const struct wined3d_parent_ops ddraw_frontbuffer_parent_ops =
static HRESULT CDECL device_parent_create_rendertarget(struct wined3d_device_parent *device_parent, static HRESULT CDECL device_parent_create_rendertarget(struct wined3d_device_parent *device_parent,
void *container_parent, UINT width, UINT height, enum wined3d_format_id format, void *container_parent, UINT width, UINT height, enum wined3d_format_id format,
enum wined3d_multisample_type multisample_type, DWORD multisample_quality, BOOL lockable, enum wined3d_multisample_type multisample_type, DWORD multisample_quality,
struct wined3d_surface **surface) struct wined3d_surface **surface)
{ {
struct ddraw *ddraw = ddraw_from_device_parent(device_parent); struct ddraw *ddraw = ddraw_from_device_parent(device_parent);
DWORD flags = 0;
HRESULT hr; HRESULT hr;
TRACE("device_parent %p, container_parent %p, width %u, height %u, format %#x, multisample_type %#x,\n" TRACE("device_parent %p, container_parent %p, width %u, height %u, format %#x, multisample_type %#x,\n"
"\tmultisample_quality %u, lockable %u, surface %p.\n", "\tmultisample_quality %u, surface %p.\n",
device_parent, container_parent, width, height, format, multisample_type, device_parent, container_parent, width, height, format, multisample_type,
multisample_quality, lockable, surface); multisample_quality, surface);
if (ddraw->wined3d_frontbuffer) if (ddraw->wined3d_frontbuffer)
{ {
...@@ -5462,12 +5461,9 @@ static HRESULT CDECL device_parent_create_rendertarget(struct wined3d_device_par ...@@ -5462,12 +5461,9 @@ static HRESULT CDECL device_parent_create_rendertarget(struct wined3d_device_par
return E_FAIL; return E_FAIL;
} }
if (lockable)
flags |= WINED3D_SURFACE_MAPPABLE;
hr = wined3d_surface_create(ddraw->wined3d_device, width, height, format, 0, hr = wined3d_surface_create(ddraw->wined3d_device, width, height, format, 0,
WINED3DUSAGE_RENDERTARGET, WINED3D_POOL_DEFAULT, multisample_type, multisample_quality, WINED3DUSAGE_RENDERTARGET, WINED3D_POOL_DEFAULT, multisample_type, multisample_quality,
DefaultSurfaceType, flags, ddraw, &ddraw_frontbuffer_parent_ops, surface); DefaultSurfaceType, WINED3D_SURFACE_MAPPABLE, ddraw, &ddraw_frontbuffer_parent_ops, surface);
if (SUCCEEDED(hr)) if (SUCCEEDED(hr))
ddraw->wined3d_frontbuffer = *surface; ddraw->wined3d_frontbuffer = *surface;
......
...@@ -943,12 +943,10 @@ static HRESULT swapchain_init(struct wined3d_swapchain *swapchain, enum wined3d_ ...@@ -943,12 +943,10 @@ static HRESULT swapchain_init(struct wined3d_swapchain *swapchain, enum wined3d_
swapchain_update_render_to_fbo(swapchain); swapchain_update_render_to_fbo(swapchain);
TRACE("Creating front buffer.\n"); TRACE("Creating front buffer.\n");
hr = device->device_parent->ops->create_rendertarget(device->device_parent, parent, if (FAILED(hr = device->device_parent->ops->create_rendertarget(device->device_parent, parent,
swapchain->desc.backbuffer_width, swapchain->desc.backbuffer_height, swapchain->desc.backbuffer_width, swapchain->desc.backbuffer_height,
swapchain->desc.backbuffer_format, swapchain->desc.multisample_type, swapchain->desc.backbuffer_format, swapchain->desc.multisample_type,
swapchain->desc.multisample_quality, TRUE /* Lockable */, swapchain->desc.multisample_quality, &swapchain->front_buffer)))
&swapchain->front_buffer);
if (FAILED(hr))
{ {
WARN("Failed to create front buffer, hr %#x.\n", hr); WARN("Failed to create front buffer, hr %#x.\n", hr);
goto err; goto err;
...@@ -1053,12 +1051,10 @@ static HRESULT swapchain_init(struct wined3d_swapchain *swapchain, enum wined3d_ ...@@ -1053,12 +1051,10 @@ static HRESULT swapchain_init(struct wined3d_swapchain *swapchain, enum wined3d_
for (i = 0; i < swapchain->desc.backbuffer_count; ++i) for (i = 0; i < swapchain->desc.backbuffer_count; ++i)
{ {
TRACE("Creating back buffer %u.\n", i); TRACE("Creating back buffer %u.\n", i);
hr = device->device_parent->ops->create_rendertarget(device->device_parent, parent, if (FAILED(hr = device->device_parent->ops->create_rendertarget(device->device_parent, parent,
swapchain->desc.backbuffer_width, swapchain->desc.backbuffer_height, swapchain->desc.backbuffer_width, swapchain->desc.backbuffer_height,
swapchain->desc.backbuffer_format, swapchain->desc.multisample_type, swapchain->desc.backbuffer_format, swapchain->desc.multisample_type,
swapchain->desc.multisample_quality, TRUE /* Lockable */, swapchain->desc.multisample_quality, &swapchain->back_buffers[i])))
&swapchain->back_buffers[i]);
if (FAILED(hr))
{ {
WARN("Failed to create back buffer %u, hr %#x.\n", i, hr); WARN("Failed to create back buffer %u, hr %#x.\n", i, hr);
goto err; goto err;
......
...@@ -2002,7 +2002,7 @@ struct wined3d_device_parent_ops ...@@ -2002,7 +2002,7 @@ struct wined3d_device_parent_ops
UINT level, enum wined3d_cubemap_face face, struct wined3d_surface **surface); UINT level, enum wined3d_cubemap_face face, struct wined3d_surface **surface);
HRESULT (__cdecl *create_rendertarget)(struct wined3d_device_parent *device_parent, void *container_parent, HRESULT (__cdecl *create_rendertarget)(struct wined3d_device_parent *device_parent, void *container_parent,
UINT width, UINT height, enum wined3d_format_id format_id, enum wined3d_multisample_type multisample_type, UINT width, UINT height, enum wined3d_format_id format_id, enum wined3d_multisample_type multisample_type,
DWORD multisample_quality, BOOL lockable, struct wined3d_surface **surface); DWORD multisample_quality, struct wined3d_surface **surface);
HRESULT (__cdecl *create_depth_stencil)(struct wined3d_device_parent *device_parent, HRESULT (__cdecl *create_depth_stencil)(struct wined3d_device_parent *device_parent,
UINT width, UINT height, enum wined3d_format_id format_id, enum wined3d_multisample_type multisample_type, UINT width, UINT height, enum wined3d_format_id format_id, enum wined3d_multisample_type multisample_type,
DWORD multisample_quality, BOOL discard, struct wined3d_surface **surface); DWORD multisample_quality, BOOL discard, struct wined3d_surface **surface);
......
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