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,
Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/d3d11/device.c | 5 ++--- dlls/d3d8/device.c | 6 +++--- dlls/d3d9/device.c | 4 ++-- dlls/ddraw/ddraw.c | 2 +- dlls/ddraw/device.c | 2 +- dlls/ddraw/surface.c | 5 +++-- dlls/wined3d/device.c | 7 ++++--- dlls/wined3d/wined3d.spec | 2 +- include/wine/wined3d.h | 3 ++- 9 files changed, 19 insertions(+), 17 deletions(-)
diff --git a/dlls/d3d11/device.c b/dlls/d3d11/device.c index b95423c4c7c..e58b02038c8 100644 --- a/dlls/d3d11/device.c +++ b/dlls/d3d11/device.c @@ -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; diff --git a/dlls/d3d8/device.c b/dlls/d3d8/device.c index 4f76a55172c..938eb19c8f5 100644 --- a/dlls/d3d8/device.c +++ b/dlls/d3d8/device.c @@ -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);
diff --git a/dlls/d3d9/device.c b/dlls/d3d9/device.c index f7a6e04beae..ee1cdc87567 100644 --- a/dlls/d3d9/device.c +++ b/dlls/d3d9/device.c @@ -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);
diff --git a/dlls/ddraw/ddraw.c b/dlls/ddraw/ddraw.c index 9063c64b41f..972c18fbfe9 100644 --- a/dlls/ddraw/ddraw.c +++ b/dlls/ddraw/ddraw.c @@ -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); }
diff --git a/dlls/ddraw/device.c b/dlls/ddraw/device.c index c3681cc9440..898bef5e534 100644 --- a/dlls/ddraw/device.c +++ b/dlls/ddraw/device.c @@ -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); }
diff --git a/dlls/ddraw/surface.c b/dlls/ddraw/surface.c index 51179db05dd..7834d9c943b 100644 --- a/dlls/ddraw/surface.c +++ b/dlls/ddraw/surface.c @@ -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();
diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c index 40ee9739c5e..9590c7d7341 100644 --- a/dlls/wined3d/device.c +++ b/dlls/wined3d/device.c @@ -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, diff --git a/dlls/wined3d/wined3d.spec b/dlls/wined3d/wined3d.spec index 8a01bf1711f..0a5cb608fc1 100644 --- a/dlls/wined3d/wined3d.spec +++ b/dlls/wined3d/wined3d.spec @@ -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) diff --git a/include/wine/wined3d.h b/include/wine/wined3d.h index fd9840379d3..61162819ede 100644 --- a/include/wine/wined3d.h +++ b/include/wine/wined3d.h @@ -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);
Signed-off-by: Henri Verbeet hverbeet@codeweavers.com
On Tue, 20 Apr 2021 at 06:38, Zebediah Figura z.figura12@gmail.com wrote:
@@ -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);
It would probably be best to move this down a bit, among the other wined3d_device_context functions.
Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/d3d11/device.c | 6 +++--- dlls/wined3d/device.c | 6 +++--- dlls/wined3d/wined3d.spec | 2 +- include/wine/wined3d.h | 3 ++- 4 files changed, 9 insertions(+), 8 deletions(-)
diff --git a/dlls/d3d11/device.c b/dlls/d3d11/device.c index e58b02038c8..0226d26047d 100644 --- a/dlls/d3d11/device.c +++ b/dlls/d3d11/device.c @@ -1973,14 +1973,14 @@ static void STDMETHODCALLTYPE d3d11_immediate_context_VSGetSamplers(ID3D11Device static void STDMETHODCALLTYPE d3d11_immediate_context_GetPredication(ID3D11DeviceContext1 *iface, ID3D11Predicate **predicate, BOOL *value) { - struct d3d_device *device = device_from_immediate_ID3D11DeviceContext1(iface); + struct d3d11_immediate_context *context = impl_from_ID3D11DeviceContext1(iface); struct wined3d_query *wined3d_predicate; struct d3d_query *predicate_impl;
TRACE("iface %p, predicate %p, value %p.\n", iface, predicate, value);
wined3d_mutex_lock(); - if (!(wined3d_predicate = wined3d_device_get_predication(device->wined3d_device, value))) + if (!(wined3d_predicate = wined3d_device_context_get_predication(context->wined3d_context, value))) { wined3d_mutex_unlock(); *predicate = NULL; @@ -5329,7 +5329,7 @@ static void STDMETHODCALLTYPE d3d10_device_GetPredication(ID3D10Device1 *iface, TRACE("iface %p, predicate %p, value %p.\n", iface, predicate, value);
wined3d_mutex_lock(); - if (!(wined3d_predicate = wined3d_device_get_predication(device->wined3d_device, value))) + if (!(wined3d_predicate = wined3d_device_context_get_predication(device->immediate_context.wined3d_context, value))) { wined3d_mutex_unlock(); *predicate = NULL; diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c index 9590c7d7341..3461c099a5c 100644 --- a/dlls/wined3d/device.c +++ b/dlls/wined3d/device.c @@ -4459,11 +4459,11 @@ void CDECL wined3d_device_set_predication(struct wined3d_device *device, wined3d_device_context_set_predication(&device->cs->c, predicate, value); }
-struct wined3d_query * CDECL wined3d_device_get_predication(struct wined3d_device *device, BOOL *value) +struct wined3d_query * CDECL wined3d_device_context_get_predication(struct wined3d_device_context *context, BOOL *value) { - struct wined3d_state *state = device->cs->c.state; + struct wined3d_state *state = context->state;
- TRACE("device %p, value %p.\n", device, value); + TRACE("context %p, value %p.\n", context, value);
if (value) *value = state->predicate_value; diff --git a/dlls/wined3d/wined3d.spec b/dlls/wined3d/wined3d.spec index 0a5cb608fc1..b008d192b8f 100644 --- a/dlls/wined3d/wined3d.spec +++ b/dlls/wined3d/wined3d.spec @@ -78,7 +78,6 @@ @ cdecl wined3d_device_get_max_frame_latency(ptr) @ cdecl wined3d_device_get_npatch_mode(ptr) @ cdecl wined3d_device_get_pixel_shader(ptr) -@ cdecl wined3d_device_get_predication(ptr ptr) @ cdecl wined3d_device_get_primitive_type(ptr ptr ptr) @ cdecl wined3d_device_get_ps_resource_view(ptr long) @ cdecl wined3d_device_get_ps_sampler(ptr long) @@ -167,6 +166,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_depth_stencil_view(ptr) +@ cdecl wined3d_device_context_get_predication(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) diff --git a/include/wine/wined3d.h b/include/wine/wined3d.h index 61162819ede..bc26e794582 100644 --- a/include/wine/wined3d.h +++ b/include/wine/wined3d.h @@ -2410,7 +2410,6 @@ struct wined3d_buffer * __cdecl wined3d_device_get_index_buffer(const struct win unsigned int __cdecl wined3d_device_get_max_frame_latency(const struct wined3d_device *device); float __cdecl wined3d_device_get_npatch_mode(const struct wined3d_device *device); struct wined3d_shader * __cdecl wined3d_device_get_pixel_shader(const struct wined3d_device *device); -struct wined3d_query * __cdecl wined3d_device_get_predication(struct wined3d_device *device, BOOL *value); void __cdecl wined3d_device_get_primitive_type(const struct wined3d_device *device, enum wined3d_primitive_type *primitive_topology, unsigned int *patch_vertex_count); struct wined3d_shader_resource_view * __cdecl wined3d_device_get_ps_resource_view(const struct wined3d_device *device, @@ -2561,6 +2560,8 @@ struct wined3d_buffer * __cdecl wined3d_device_context_get_constant_buffer(const enum wined3d_shader_type shader_type, unsigned int idx); struct wined3d_depth_stencil_state * __cdecl wined3d_device_context_get_depth_stencil_state( const struct wined3d_device_context *context, unsigned int *stencil_ref); +struct wined3d_query * __cdecl wined3d_device_context_get_predication(struct wined3d_device_context *context, + BOOL *value); 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(
Signed-off-by: Henri Verbeet hverbeet@codeweavers.com
Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/d3d11/device.c | 7 ++++--- dlls/wined3d/device.c | 6 +++--- dlls/wined3d/wined3d.spec | 2 +- include/wine/wined3d.h | 4 ++-- 4 files changed, 10 insertions(+), 9 deletions(-)
diff --git a/dlls/d3d11/device.c b/dlls/d3d11/device.c index 0226d26047d..daee1b580b1 100644 --- a/dlls/d3d11/device.c +++ b/dlls/d3d11/device.c @@ -1836,7 +1836,7 @@ static void STDMETHODCALLTYPE d3d11_immediate_context_IAGetVertexBuffers(ID3D11D static void STDMETHODCALLTYPE d3d11_immediate_context_IAGetIndexBuffer(ID3D11DeviceContext1 *iface, ID3D11Buffer **buffer, DXGI_FORMAT *format, UINT *offset) { - struct d3d_device *device = device_from_immediate_ID3D11DeviceContext1(iface); + struct d3d11_immediate_context *context = impl_from_ID3D11DeviceContext1(iface); enum wined3d_format_id wined3d_format; struct wined3d_buffer *wined3d_buffer; struct d3d_buffer *buffer_impl; @@ -1844,7 +1844,7 @@ static void STDMETHODCALLTYPE d3d11_immediate_context_IAGetIndexBuffer(ID3D11Dev TRACE("iface %p, buffer %p, format %p, offset %p.\n", iface, buffer, format, offset);
wined3d_mutex_lock(); - wined3d_buffer = wined3d_device_get_index_buffer(device->wined3d_device, &wined3d_format, offset); + wined3d_buffer = wined3d_device_context_get_index_buffer(context->wined3d_context, &wined3d_format, offset); *format = dxgi_format_from_wined3dformat(wined3d_format); if (!wined3d_buffer) { @@ -5201,7 +5201,8 @@ static void STDMETHODCALLTYPE d3d10_device_IAGetIndexBuffer(ID3D10Device1 *iface TRACE("iface %p, buffer %p, format %p, offset %p.\n", iface, buffer, format, offset);
wined3d_mutex_lock(); - wined3d_buffer = wined3d_device_get_index_buffer(device->wined3d_device, &wined3d_format, offset); + wined3d_buffer = wined3d_device_context_get_index_buffer( + device->immediate_context.wined3d_context, &wined3d_format, offset); *format = dxgi_format_from_wined3dformat(wined3d_format); if (!wined3d_buffer) { diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c index 3461c099a5c..ebed57f18bd 100644 --- a/dlls/wined3d/device.c +++ b/dlls/wined3d/device.c @@ -1524,12 +1524,12 @@ void CDECL wined3d_device_set_index_buffer(struct wined3d_device *device, wined3d_device_context_set_index_buffer(&device->cs->c, buffer, format_id, offset); }
-struct wined3d_buffer * CDECL wined3d_device_get_index_buffer(const struct wined3d_device *device, +struct wined3d_buffer * CDECL wined3d_device_context_get_index_buffer(const struct wined3d_device_context *context, enum wined3d_format_id *format, unsigned int *offset) { - const struct wined3d_state *state = device->cs->c.state; + const struct wined3d_state *state = context->state;
- TRACE("device %p, format %p, offset %p.\n", device, format, offset); + TRACE("context %p, format %p, offset %p.\n", context, format, offset);
*format = state->index_format; if (offset) diff --git a/dlls/wined3d/wined3d.spec b/dlls/wined3d/wined3d.spec index b008d192b8f..d0bc54d3d84 100644 --- a/dlls/wined3d/wined3d.spec +++ b/dlls/wined3d/wined3d.spec @@ -74,7 +74,6 @@ @ cdecl wined3d_device_get_hs_sampler(ptr long) @ cdecl wined3d_device_get_hull_shader(ptr) @ cdecl wined3d_device_get_immediate_context(ptr) -@ cdecl wined3d_device_get_index_buffer(ptr ptr ptr) @ cdecl wined3d_device_get_max_frame_latency(ptr) @ cdecl wined3d_device_get_npatch_mode(ptr) @ cdecl wined3d_device_get_pixel_shader(ptr) @@ -166,6 +165,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_depth_stencil_view(ptr) +@ cdecl wined3d_device_context_get_index_buffer(ptr ptr ptr) @ cdecl wined3d_device_context_get_predication(ptr ptr) @ cdecl wined3d_device_context_get_rasterizer_state(ptr) @ cdecl wined3d_device_context_get_rendertarget_view(ptr long) diff --git a/include/wine/wined3d.h b/include/wine/wined3d.h index bc26e794582..27378608ae8 100644 --- a/include/wine/wined3d.h +++ b/include/wine/wined3d.h @@ -2405,8 +2405,6 @@ struct wined3d_shader_resource_view * __cdecl wined3d_device_get_hs_resource_vie struct wined3d_sampler * __cdecl wined3d_device_get_hs_sampler(const struct wined3d_device *device, unsigned int idx); struct wined3d_shader * __cdecl wined3d_device_get_hull_shader(const struct wined3d_device *device); struct wined3d_device_context * __cdecl wined3d_device_get_immediate_context(struct wined3d_device *device); -struct wined3d_buffer * __cdecl wined3d_device_get_index_buffer(const struct wined3d_device *device, - enum wined3d_format_id *format, unsigned int *offset); unsigned int __cdecl wined3d_device_get_max_frame_latency(const struct wined3d_device *device); float __cdecl wined3d_device_get_npatch_mode(const struct wined3d_device *device); struct wined3d_shader * __cdecl wined3d_device_get_pixel_shader(const struct wined3d_device *device); @@ -2560,6 +2558,8 @@ struct wined3d_buffer * __cdecl wined3d_device_context_get_constant_buffer(const enum wined3d_shader_type shader_type, unsigned int idx); struct wined3d_depth_stencil_state * __cdecl wined3d_device_context_get_depth_stencil_state( const struct wined3d_device_context *context, unsigned int *stencil_ref); +struct wined3d_buffer * __cdecl wined3d_device_context_get_index_buffer(const struct wined3d_device_context *context, + enum wined3d_format_id *format, unsigned int *offset); struct wined3d_query * __cdecl wined3d_device_context_get_predication(struct wined3d_device_context *context, BOOL *value); struct wined3d_rasterizer_state * __cdecl wined3d_device_context_get_rasterizer_state(
Hi,
While running your changed tests, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check?
Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=89020
Your paranoid android.
=== debiant2 (32 bit Chinese:China report) ===
d3d11: Unhandled exception: page fault on execute access to 0x0000007a in 32-bit code (0x0000007a).
Signed-off-by: Henri Verbeet hverbeet@codeweavers.com
Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/d3d11/device.c | 7 ++++--- dlls/wined3d/device.c | 7 ++++--- dlls/wined3d/wined3d.spec | 2 +- include/wine/wined3d.h | 3 ++- 4 files changed, 11 insertions(+), 8 deletions(-)
diff --git a/dlls/d3d11/device.c b/dlls/d3d11/device.c index daee1b580b1..66fa1b24014 100644 --- a/dlls/d3d11/device.c +++ b/dlls/d3d11/device.c @@ -1776,14 +1776,14 @@ static void STDMETHODCALLTYPE d3d11_immediate_context_PSGetConstantBuffers(ID3D1 static void STDMETHODCALLTYPE d3d11_immediate_context_IAGetInputLayout(ID3D11DeviceContext1 *iface, ID3D11InputLayout **input_layout) { - struct d3d_device *device = device_from_immediate_ID3D11DeviceContext1(iface); + struct d3d11_immediate_context *context = impl_from_ID3D11DeviceContext1(iface); struct wined3d_vertex_declaration *wined3d_declaration; struct d3d_input_layout *input_layout_impl;
TRACE("iface %p, input_layout %p.\n", iface, input_layout);
wined3d_mutex_lock(); - if (!(wined3d_declaration = wined3d_device_get_vertex_declaration(device->wined3d_device))) + if (!(wined3d_declaration = wined3d_device_context_get_vertex_declaration(context->wined3d_context))) { wined3d_mutex_unlock(); *input_layout = NULL; @@ -5145,7 +5145,8 @@ static void STDMETHODCALLTYPE d3d10_device_IAGetInputLayout(ID3D10Device1 *iface TRACE("iface %p, input_layout %p.\n", iface, input_layout);
wined3d_mutex_lock(); - if (!(wined3d_declaration = wined3d_device_get_vertex_declaration(device->wined3d_device))) + if (!(wined3d_declaration = wined3d_device_context_get_vertex_declaration( + device->immediate_context.wined3d_context))) { wined3d_mutex_unlock(); *input_layout = NULL; diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c index ebed57f18bd..9e74ab00081 100644 --- a/dlls/wined3d/device.c +++ b/dlls/wined3d/device.c @@ -1876,11 +1876,12 @@ void CDECL wined3d_device_set_vertex_declaration(struct wined3d_device *device, wined3d_device_context_set_vertex_declaration(&device->cs->c, declaration); }
-struct wined3d_vertex_declaration * CDECL wined3d_device_get_vertex_declaration(const struct wined3d_device *device) +struct wined3d_vertex_declaration * CDECL wined3d_device_context_get_vertex_declaration( + const struct wined3d_device_context *context) { - TRACE("device %p.\n", device); + TRACE("context %p.\n", context);
- return device->cs->c.state->vertex_declaration; + return context->state->vertex_declaration; }
void CDECL wined3d_device_context_set_shader(struct wined3d_device_context *context, diff --git a/dlls/wined3d/wined3d.spec b/dlls/wined3d/wined3d.spec index d0bc54d3d84..9dfeb64b180 100644 --- a/dlls/wined3d/wined3d.spec +++ b/dlls/wined3d/wined3d.spec @@ -89,7 +89,6 @@ @ cdecl wined3d_device_get_swapchain(ptr long) @ cdecl wined3d_device_get_swapchain_count(ptr) @ cdecl wined3d_device_get_unordered_access_view(ptr long) -@ cdecl wined3d_device_get_vertex_declaration(ptr) @ cdecl wined3d_device_get_vertex_shader(ptr) @ cdecl wined3d_device_get_vs_resource_view(ptr long) @ cdecl wined3d_device_get_vs_sampler(ptr long) @@ -174,6 +173,7 @@ @ cdecl wined3d_device_context_get_shader(ptr long) @ cdecl wined3d_device_context_get_shader_resource_view(ptr long long) @ cdecl wined3d_device_context_get_unordered_access_view(ptr long long) +@ cdecl wined3d_device_context_get_vertex_declaration(ptr) @ cdecl wined3d_device_context_get_viewports(ptr ptr ptr) @ cdecl wined3d_device_context_issue_query(ptr ptr long) @ cdecl wined3d_device_context_map(ptr ptr long ptr ptr long) diff --git a/include/wine/wined3d.h b/include/wine/wined3d.h index 27378608ae8..07e8ba0f540 100644 --- a/include/wine/wined3d.h +++ b/include/wine/wined3d.h @@ -2427,7 +2427,6 @@ struct wined3d_swapchain * __cdecl wined3d_device_get_swapchain(const struct win UINT __cdecl wined3d_device_get_swapchain_count(const struct wined3d_device *device); struct wined3d_unordered_access_view * __cdecl wined3d_device_get_unordered_access_view( const struct wined3d_device *device, unsigned int idx); -struct wined3d_vertex_declaration * __cdecl wined3d_device_get_vertex_declaration(const struct wined3d_device *device); struct wined3d_shader * __cdecl wined3d_device_get_vertex_shader(const struct wined3d_device *device); struct wined3d_shader_resource_view * __cdecl wined3d_device_get_vs_resource_view(const struct wined3d_device *device, UINT idx); @@ -2576,6 +2575,8 @@ struct wined3d_shader_resource_view * __cdecl wined3d_device_context_get_shader_ const struct wined3d_device_context *context, enum wined3d_shader_type shader_type, unsigned int idx); struct wined3d_unordered_access_view * __cdecl wined3d_device_context_get_unordered_access_view( const struct wined3d_device_context *context, enum wined3d_pipeline pipeline, unsigned int idx); +struct wined3d_vertex_declaration * __cdecl wined3d_device_context_get_vertex_declaration( + const struct wined3d_device_context *device); void __cdecl wined3d_device_context_get_viewports(const struct wined3d_device_context *context, unsigned int *viewport_count, struct wined3d_viewport *viewports); void __cdecl wined3d_device_context_issue_query(struct wined3d_device_context *context,
Signed-off-by: Henri Verbeet hverbeet@codeweavers.com
Hi,
While running your changed tests, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check?
Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=89017
Your paranoid android.
=== debiant2 (32 bit Chinese:China report) ===
d3d11: d3d11.c:9661: Test failed: d3d11.c:15005: Test marked todo: Got hr 0 for WRITE_DISCARD. d3d11.c:19656: Test failed: d3d11.c:16285: Test marked todo: Got 0xdeadbeef, expected 0xff or 0xff at 255, uvec4 0xffffffff, 0, 0, 0.
=== debiant2 (32 bit WoW report) ===
ddraw: ddraw1.c:14214: Test failed: Expect window rect (0,0)-(1024,768), got (7,26)-(1031,794). ddraw1.c:14232: Test failed: Expect window rect (0,0)-(1024,768), got (0,-8)-(1024,760). ddraw1.c:14239: Test failed: Expect window rect (0,0)-(1024,768), got (0,-8)-(1024,760).