Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/d3d11/device.c | 6 ++++-- dlls/d3d8/device.c | 6 +++--- dlls/d3d9/device.c | 6 +++--- dlls/ddraw/ddraw.c | 2 +- dlls/ddraw/device.c | 4 ++-- dlls/ddraw/surface.c | 2 +- dlls/ddraw/viewport.c | 4 ++-- dlls/wined3d/device.c | 10 +++++----- dlls/wined3d/wined3d.spec | 2 +- include/wine/wined3d.h | 4 ++-- 10 files changed, 24 insertions(+), 22 deletions(-)
diff --git a/dlls/d3d11/device.c b/dlls/d3d11/device.c index 460e9c2bf4a..b95423c4c7c 100644 --- a/dlls/d3d11/device.c +++ b/dlls/d3d11/device.c @@ -2054,6 +2054,7 @@ static void STDMETHODCALLTYPE d3d11_immediate_context_OMGetRenderTargets(ID3D11D UINT render_target_view_count, ID3D11RenderTargetView **render_target_views, ID3D11DepthStencilView **depth_stencil_view) { + struct d3d11_immediate_context *context = impl_from_ID3D11DeviceContext1(iface); struct d3d_device *device = device_from_immediate_ID3D11DeviceContext1(iface); struct wined3d_rendertarget_view *wined3d_view;
@@ -2068,7 +2069,7 @@ static void STDMETHODCALLTYPE d3d11_immediate_context_OMGetRenderTargets(ID3D11D
for (i = 0; i < render_target_view_count; ++i) { - if (!(wined3d_view = wined3d_device_get_rendertarget_view(device->wined3d_device, i)) + if (!(wined3d_view = wined3d_device_context_get_rendertarget_view(context->wined3d_context, i)) || !(view_impl = wined3d_rendertarget_view_get_parent(wined3d_view))) { render_target_views[i] = NULL; @@ -5417,7 +5418,8 @@ static void STDMETHODCALLTYPE d3d10_device_OMGetRenderTargets(ID3D10Device1 *ifa
for (i = 0; i < view_count; ++i) { - if (!(wined3d_view = wined3d_device_get_rendertarget_view(device->wined3d_device, i)) + if (!(wined3d_view = wined3d_device_context_get_rendertarget_view( + device->immediate_context.wined3d_context, i)) || !(view_impl = wined3d_rendertarget_view_get_parent(wined3d_view))) { render_target_views[i] = NULL; diff --git a/dlls/d3d8/device.c b/dlls/d3d8/device.c index fe36f70c075..4f76a55172c 100644 --- a/dlls/d3d8/device.c +++ b/dlls/d3d8/device.c @@ -1505,7 +1505,7 @@ static HRESULT WINAPI d3d8_device_SetRenderTarget(IDirect3DDevice8 *iface, /* If no render target is passed in check the size against the current RT */ if (!render_target) { - if (!(original_rtv = wined3d_device_get_rendertarget_view(device->wined3d_device, 0))) + if (!(original_rtv = wined3d_device_context_get_rendertarget_view(device->immediate_context, 0))) { wined3d_mutex_unlock(); return D3DERR_NOTFOUND; @@ -1570,7 +1570,7 @@ static HRESULT WINAPI d3d8_device_GetRenderTarget(IDirect3DDevice8 *iface, IDire return D3DERR_INVALIDCALL;
wined3d_mutex_lock(); - if ((wined3d_rtv = wined3d_device_get_rendertarget_view(device->wined3d_device, 0))) + if ((wined3d_rtv = wined3d_device_context_get_rendertarget_view(device->immediate_context, 0))) { /* We want the sub resource parent here, since the view itself may be * internal to wined3d and may not have a parent. */ @@ -1737,7 +1737,7 @@ static HRESULT WINAPI d3d8_device_SetViewport(IDirect3DDevice8 *iface, const D3D TRACE("iface %p, viewport %p.\n", iface, viewport);
wined3d_mutex_lock(); - if (!(rtv = wined3d_device_get_rendertarget_view(device->wined3d_device, 0))) + if (!(rtv = wined3d_device_context_get_rendertarget_view(device->immediate_context, 0))) { wined3d_mutex_unlock(); return D3DERR_NOTFOUND; diff --git a/dlls/d3d9/device.c b/dlls/d3d9/device.c index 139e4f3f6e4..f7a6e04beae 100644 --- a/dlls/d3d9/device.c +++ b/dlls/d3d9/device.c @@ -1151,7 +1151,7 @@ static HRESULT d3d9_device_reset(struct d3d9_device *device, } }
- rtv = wined3d_device_get_rendertarget_view(device->wined3d_device, 0); + rtv = wined3d_device_context_get_rendertarget_view(device->immediate_context, 0); device->render_targets[0] = wined3d_rendertarget_view_get_sub_resource_parent(rtv); for (i = 1; i < ARRAY_SIZE(device->render_targets); ++i) device->render_targets[i] = NULL; @@ -2060,7 +2060,7 @@ static HRESULT WINAPI d3d9_device_GetRenderTarget(IDirect3DDevice9Ex *iface, DWO }
wined3d_mutex_lock(); - if ((wined3d_rtv = wined3d_device_get_rendertarget_view(device->wined3d_device, idx))) + if ((wined3d_rtv = wined3d_device_context_get_rendertarget_view(device->immediate_context, idx))) { /* We want the sub resource parent here, since the view itself may be * internal to wined3d and may not have a parent. */ @@ -4852,7 +4852,7 @@ HRESULT device_init(struct d3d9_device *device, struct d3d9 *parent, struct wine * generation). */ wined3d_mutex_lock(); device->render_targets[0] = wined3d_rendertarget_view_get_sub_resource_parent( - wined3d_device_get_rendertarget_view(device->wined3d_device, 0)); + wined3d_device_context_get_rendertarget_view(device->immediate_context, 0)); wined3d_mutex_unlock();
IDirect3D9Ex_AddRef(&parent->IDirect3D9Ex_iface); diff --git a/dlls/ddraw/ddraw.c b/dlls/ddraw/ddraw.c index 5582e9862a1..9063c64b41f 100644 --- a/dlls/ddraw/ddraw.c +++ b/dlls/ddraw/ddraw.c @@ -931,7 +931,7 @@ static HRESULT ddraw_set_cooperative_level(struct ddraw *ddraw, HWND window, goto done; }
- rtv = wined3d_device_get_rendertarget_view(ddraw->wined3d_device, 0); + rtv = wined3d_device_context_get_rendertarget_view(ddraw->immediate_context, 0); /* Rendering to ddraw->wined3d_frontbuffer. */ if (rtv && !wined3d_rendertarget_view_get_sub_resource_parent(rtv)) rtv = NULL; diff --git a/dlls/ddraw/device.c b/dlls/ddraw/device.c index 0a0d1edd848..c3681cc9440 100644 --- a/dlls/ddraw/device.c +++ b/dlls/ddraw/device.c @@ -3434,7 +3434,7 @@ static void d3d_device_sync_rendertarget(struct d3d_device *device) if (device->hardware_device) return;
- if ((rtv = wined3d_device_get_rendertarget_view(device->wined3d_device, 0))) + if ((rtv = wined3d_device_context_get_rendertarget_view(device->immediate_context, 0))) ddraw_surface_get_draw_texture(wined3d_rendertarget_view_get_parent(rtv), DDRAW_SURFACE_RW);
if ((rtv = wined3d_device_get_depth_stencil_view(device->wined3d_device))) @@ -5359,7 +5359,7 @@ static HRESULT d3d_device7_SetViewport(IDirect3DDevice7 *iface, D3DVIEWPORT7 *vi return DDERR_INVALIDPARAMS;
wined3d_mutex_lock(); - if (!(rtv = wined3d_device_get_rendertarget_view(device->wined3d_device, 0))) + if (!(rtv = wined3d_device_context_get_rendertarget_view(device->immediate_context, 0))) { wined3d_mutex_unlock(); return DDERR_INVALIDCAPS; diff --git a/dlls/ddraw/surface.c b/dlls/ddraw/surface.c index 86cda045d92..51179db05dd 100644 --- a/dlls/ddraw/surface.c +++ b/dlls/ddraw/surface.c @@ -1343,7 +1343,7 @@ static HRESULT WINAPI DECLSPEC_HOTPATCH ddraw_surface1_Flip(IDirectDrawSurface * if (dst_impl->sub_resource_idx) ERR("Invalid sub-resource index %u on surface %p.\n", dst_impl->sub_resource_idx, dst_impl); texture = dst_impl->wined3d_texture; - rtv = wined3d_device_get_rendertarget_view(dst_impl->ddraw->wined3d_device, 0); + rtv = wined3d_device_context_get_rendertarget_view(dst_impl->ddraw->immediate_context, 0); dst_ddraw_texture = wined3d_texture_get_parent(dst_impl->wined3d_texture); texture_memory = dst_ddraw_texture->texture_memory; draw_texture = dst_impl->draw_texture; diff --git a/dlls/ddraw/viewport.c b/dlls/ddraw/viewport.c index 4a415c4daf1..ada3f1757b7 100644 --- a/dlls/ddraw/viewport.c +++ b/dlls/ddraw/viewport.c @@ -406,7 +406,7 @@ static HRESULT WINAPI d3d_viewport_SetViewport(IDirect3DViewport3 *iface, D3DVIE
if (device->version > 1) { - if (!(rtv = wined3d_device_get_rendertarget_view(device->wined3d_device, 0))) + if (!(rtv = wined3d_device_context_get_rendertarget_view(device->immediate_context, 0))) { wined3d_mutex_unlock(); return DDERR_INVALIDCAPS; @@ -1035,7 +1035,7 @@ static HRESULT WINAPI d3d_viewport_SetViewport2(IDirect3DViewport3 *iface, D3DVI
if (device->version > 1) { - if (!(rtv = wined3d_device_get_rendertarget_view(device->wined3d_device, 0))) + if (!(rtv = wined3d_device_context_get_rendertarget_view(device->immediate_context, 0))) { wined3d_mutex_unlock(); return DDERR_INVALIDCAPS; diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c index 33b06b44c29..40ee9739c5e 100644 --- a/dlls/wined3d/device.c +++ b/dlls/wined3d/device.c @@ -5391,21 +5391,21 @@ void CDECL wined3d_device_context_issue_query(struct wined3d_device_context *con query->state = QUERY_SIGNALLED; }
-struct wined3d_rendertarget_view * CDECL wined3d_device_get_rendertarget_view(const struct wined3d_device *device, - unsigned int view_idx) +struct wined3d_rendertarget_view * CDECL wined3d_device_context_get_rendertarget_view( + const struct wined3d_device_context *context, unsigned int view_idx) { unsigned int max_rt_count;
- TRACE("device %p, view_idx %u.\n", device, view_idx); + TRACE("context %p, view_idx %u.\n", context, view_idx);
- max_rt_count = device->adapter->d3d_info.limits.max_rt_count; + max_rt_count = context->device->adapter->d3d_info.limits.max_rt_count; if (view_idx >= max_rt_count) { WARN("Only %u render targets are supported.\n", max_rt_count); return NULL; }
- return device->cs->c.state->fb.render_targets[view_idx]; + return context->state->fb.render_targets[view_idx]; }
struct wined3d_rendertarget_view * CDECL wined3d_device_get_depth_stencil_view(const struct wined3d_device *device) diff --git a/dlls/wined3d/wined3d.spec b/dlls/wined3d/wined3d.spec index 442b06ed4ea..8a01bf1711f 100644 --- a/dlls/wined3d/wined3d.spec +++ b/dlls/wined3d/wined3d.spec @@ -85,7 +85,6 @@ @ cdecl wined3d_device_get_ps_sampler(ptr long) @ cdecl wined3d_device_get_raster_status(ptr long ptr) @ cdecl wined3d_device_get_render_state(ptr long) -@ cdecl wined3d_device_get_rendertarget_view(ptr long) @ cdecl wined3d_device_get_software_vertex_processing(ptr) @ cdecl wined3d_device_get_state(ptr) @ cdecl wined3d_device_get_stream_output(ptr long ptr) @@ -169,6 +168,7 @@ @ cdecl wined3d_device_context_get_constant_buffer(ptr long long) @ cdecl wined3d_device_context_get_depth_stencil_state(ptr ptr) @ cdecl wined3d_device_context_get_rasterizer_state(ptr) +@ cdecl wined3d_device_context_get_rendertarget_view(ptr long) @ cdecl wined3d_device_context_get_sampler(ptr long long) @ cdecl wined3d_device_context_get_scissor_rects(ptr ptr ptr) @ cdecl wined3d_device_context_get_shader(ptr long) diff --git a/include/wine/wined3d.h b/include/wine/wined3d.h index e5e522e9fb2..fd9840379d3 100644 --- a/include/wine/wined3d.h +++ b/include/wine/wined3d.h @@ -2418,8 +2418,6 @@ struct wined3d_sampler * __cdecl wined3d_device_get_ps_sampler(const struct wine HRESULT __cdecl wined3d_device_get_raster_status(const struct wined3d_device *device, UINT swapchain_idx, struct wined3d_raster_status *raster_status); DWORD __cdecl wined3d_device_get_render_state(const struct wined3d_device *device, enum wined3d_render_state state); -struct wined3d_rendertarget_view * __cdecl wined3d_device_get_rendertarget_view(const struct wined3d_device *device, - unsigned int view_idx); BOOL __cdecl wined3d_device_get_software_vertex_processing(const struct wined3d_device *device); struct wined3d_state * __cdecl wined3d_device_get_state(struct wined3d_device *device); struct wined3d_buffer * __cdecl wined3d_device_get_stream_output(struct wined3d_device *device, @@ -2564,6 +2562,8 @@ struct wined3d_depth_stencil_state * __cdecl wined3d_device_context_get_depth_st const struct wined3d_device_context *context, unsigned int *stencil_ref); struct wined3d_rasterizer_state * __cdecl wined3d_device_context_get_rasterizer_state( struct wined3d_device_context *context); +struct wined3d_rendertarget_view * __cdecl wined3d_device_context_get_rendertarget_view( + const struct wined3d_device_context *context, unsigned int view_idx); struct wined3d_sampler * __cdecl wined3d_device_context_get_sampler(const struct wined3d_device_context *context, enum wined3d_shader_type shader_type, unsigned int idx); void __cdecl wined3d_device_context_get_scissor_rects(const struct wined3d_device_context *context,