Commit a313daea authored by Zebediah Figura's avatar Zebediah Figura Committed by Alexandre Julliard

wined3d: Pass a wined3d_device_context to wined3d_device_get_depth_stencil_view().

parent 40e10721
......@@ -2055,7 +2055,6 @@ static void STDMETHODCALLTYPE d3d11_immediate_context_OMGetRenderTargets(ID3D11D
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;
TRACE("iface %p, render_target_view_count %u, render_target_views %p, depth_stencil_view %p.\n",
......@@ -2085,7 +2084,7 @@ static void STDMETHODCALLTYPE d3d11_immediate_context_OMGetRenderTargets(ID3D11D
{
struct d3d_depthstencil_view *view_impl;
if (!(wined3d_view = wined3d_device_get_depth_stencil_view(device->wined3d_device))
if (!(wined3d_view = wined3d_device_context_get_depth_stencil_view(context->wined3d_context))
|| !(view_impl = wined3d_rendertarget_view_get_parent(wined3d_view)))
{
*depth_stencil_view = NULL;
......@@ -5435,7 +5434,7 @@ static void STDMETHODCALLTYPE d3d10_device_OMGetRenderTargets(ID3D10Device1 *ifa
{
struct d3d_depthstencil_view *view_impl;
if (!(wined3d_view = wined3d_device_get_depth_stencil_view(device->wined3d_device))
if (!(wined3d_view = wined3d_device_context_get_depth_stencil_view(device->immediate_context.wined3d_context))
|| !(view_impl = wined3d_rendertarget_view_get_parent(wined3d_view)))
{
*depth_stencil_view = NULL;
......
......@@ -1535,7 +1535,7 @@ static HRESULT WINAPI d3d8_device_SetRenderTarget(IDirect3DDevice8 *iface,
}
}
original_dsv = wined3d_device_get_depth_stencil_view(device->wined3d_device);
original_dsv = wined3d_device_context_get_depth_stencil_view(device->immediate_context);
rtv = ds_impl ? d3d8_surface_acquire_rendertarget_view(ds_impl) : NULL;
hr = wined3d_device_context_set_depth_stencil_view(device->immediate_context, rtv);
d3d8_surface_release_rendertarget_view(ds_impl, rtv);
......@@ -1603,7 +1603,7 @@ static HRESULT WINAPI d3d8_device_GetDepthStencilSurface(IDirect3DDevice8 *iface
return D3DERR_INVALIDCALL;
wined3d_mutex_lock();
if ((wined3d_dsv = wined3d_device_get_depth_stencil_view(device->wined3d_device)))
if ((wined3d_dsv = wined3d_device_context_get_depth_stencil_view(device->immediate_context)))
{
/* We want the sub resource parent here, since the view itself may be
* internal to wined3d and may not have a parent. */
......@@ -1928,7 +1928,7 @@ static void resolve_depth_buffer(struct d3d8_device *device)
&& desc.format != WINED3DFMT_INTZ)
return;
if (!(wined3d_dsv = wined3d_device_get_depth_stencil_view(device->wined3d_device)))
if (!(wined3d_dsv = wined3d_device_context_get_depth_stencil_view(device->immediate_context)))
return;
d3d8_dsv = wined3d_rendertarget_view_get_sub_resource_parent(wined3d_dsv);
......
......@@ -2109,7 +2109,7 @@ static HRESULT WINAPI d3d9_device_GetDepthStencilSurface(IDirect3DDevice9Ex *ifa
return D3DERR_INVALIDCALL;
wined3d_mutex_lock();
if ((wined3d_dsv = wined3d_device_get_depth_stencil_view(device->wined3d_device)))
if ((wined3d_dsv = wined3d_device_context_get_depth_stencil_view(device->immediate_context)))
{
/* We want the sub resource parent here, since the view itself may be
* internal to wined3d and may not have a parent. */
......@@ -2425,7 +2425,7 @@ static void resolve_depth_buffer(struct d3d9_device *device)
&& desc.format != WINED3DFMT_INTZ)
return;
if (!(wined3d_dsv = wined3d_device_get_depth_stencil_view(device->wined3d_device)))
if (!(wined3d_dsv = wined3d_device_context_get_depth_stencil_view(device->immediate_context)))
return;
d3d9_dsv = wined3d_rendertarget_view_get_sub_resource_parent(wined3d_dsv);
......
......@@ -938,7 +938,7 @@ static HRESULT ddraw_set_cooperative_level(struct ddraw *ddraw, HWND window,
else if (rtv)
wined3d_rendertarget_view_incref(rtv);
if ((dsv = wined3d_device_get_depth_stencil_view(ddraw->wined3d_device)))
if ((dsv = wined3d_device_context_get_depth_stencil_view(ddraw->immediate_context)))
wined3d_rendertarget_view_incref(dsv);
}
......
......@@ -3437,7 +3437,7 @@ static void d3d_device_sync_rendertarget(struct d3d_device *device)
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)))
if ((rtv = wined3d_device_context_get_depth_stencil_view(device->immediate_context)))
ddraw_surface_get_draw_texture(wined3d_rendertarget_view_get_parent(rtv), DDRAW_SURFACE_RW);
}
......
......@@ -2136,6 +2136,7 @@ static HRESULT WINAPI ddraw_surface1_AddAttachedSurface(IDirectDrawSurface *ifac
static HRESULT ddraw_surface_delete_attached_surface(struct ddraw_surface *surface,
struct ddraw_surface *attachment, IUnknown *detach_iface)
{
struct wined3d_rendertarget_view *dsv;
struct ddraw_surface *prev = surface;
TRACE("surface %p, attachment %p, detach_iface %p.\n", surface, attachment, detach_iface);
......@@ -2183,8 +2184,8 @@ static HRESULT ddraw_surface_delete_attached_surface(struct ddraw_surface *surfa
* QueryInterface(). Some applications, SCP - Containment Breach in
* particular, modify the QueryInterface() pointer in the surface vtbl
* but don't cleanup properly after the relevant dll is unloaded. */
if (attachment->surface_desc.ddsCaps.dwCaps & DDSCAPS_ZBUFFER
&& wined3d_device_get_depth_stencil_view(surface->ddraw->wined3d_device) == attachment->wined3d_rtv)
dsv = wined3d_device_context_get_depth_stencil_view(surface->ddraw->immediate_context);
if (attachment->surface_desc.ddsCaps.dwCaps & DDSCAPS_ZBUFFER && dsv == attachment->wined3d_rtv)
wined3d_device_context_set_depth_stencil_view(surface->ddraw->immediate_context, NULL);
wined3d_mutex_unlock();
......
......@@ -5408,11 +5408,12 @@ struct wined3d_rendertarget_view * CDECL wined3d_device_context_get_rendertarget
return context->state->fb.render_targets[view_idx];
}
struct wined3d_rendertarget_view * CDECL wined3d_device_get_depth_stencil_view(const struct wined3d_device *device)
struct wined3d_rendertarget_view * CDECL wined3d_device_context_get_depth_stencil_view(
const struct wined3d_device_context *context)
{
TRACE("device %p.\n", device);
TRACE("context %p.\n", context);
return device->cs->c.state->fb.depth_stencil;
return context->state->fb.depth_stencil;
}
HRESULT CDECL wined3d_device_set_rendertarget_view(struct wined3d_device *device,
......
......@@ -61,7 +61,6 @@
@ cdecl wined3d_device_get_cs_resource_view(ptr long)
@ cdecl wined3d_device_get_cs_sampler(ptr long)
@ cdecl wined3d_device_get_cs_uav(ptr long)
@ cdecl wined3d_device_get_depth_stencil_view(ptr)
@ cdecl wined3d_device_get_device_caps(ptr ptr)
@ cdecl wined3d_device_get_display_mode(ptr long ptr ptr)
@ cdecl wined3d_device_get_domain_shader(ptr)
......@@ -167,6 +166,7 @@
@ cdecl wined3d_device_context_get_blend_state(ptr ptr ptr)
@ 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_depth_stencil_view(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)
......
......@@ -2385,7 +2385,8 @@ struct wined3d_shader_resource_view * __cdecl wined3d_device_get_cs_resource_vie
struct wined3d_sampler * __cdecl wined3d_device_get_cs_sampler(const struct wined3d_device *device, unsigned int idx);
struct wined3d_unordered_access_view * __cdecl wined3d_device_get_cs_uav(const struct wined3d_device *device,
unsigned int idx);
struct wined3d_rendertarget_view * __cdecl wined3d_device_get_depth_stencil_view(const struct wined3d_device *device);
struct wined3d_rendertarget_view * __cdecl wined3d_device_context_get_depth_stencil_view(
const struct wined3d_device_context *context);
HRESULT __cdecl wined3d_device_get_device_caps(const struct wined3d_device *device, struct wined3d_caps *caps);
HRESULT __cdecl wined3d_device_get_display_mode(const struct wined3d_device *device, UINT swapchain_idx,
struct wined3d_display_mode *mode, enum wined3d_display_rotation *rotation);
......
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