Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/wined3d/cs.c | 7 ++++--- dlls/wined3d/view.c | 2 +- dlls/wined3d/wined3d_private.h | 3 ++- 3 files changed, 7 insertions(+), 5 deletions(-)
diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c index fb8411b3048..16a8385c0b4 100644 --- a/dlls/wined3d/cs.c +++ b/dlls/wined3d/cs.c @@ -2650,17 +2650,18 @@ static void wined3d_cs_exec_generate_mipmaps(struct wined3d_cs *cs, const void * wined3d_resource_release(view->resource); }
-void wined3d_cs_emit_generate_mipmaps(struct wined3d_cs *cs, struct wined3d_shader_resource_view *view) +void wined3d_device_context_emit_generate_mipmaps(struct wined3d_device_context *context, + struct wined3d_shader_resource_view *view) { struct wined3d_cs_generate_mipmaps *op;
- op = wined3d_device_context_require_space(&cs->c, sizeof(*op), WINED3D_CS_QUEUE_DEFAULT); + op = wined3d_device_context_require_space(context, sizeof(*op), WINED3D_CS_QUEUE_DEFAULT); op->opcode = WINED3D_CS_OP_GENERATE_MIPMAPS; op->view = view;
wined3d_resource_acquire(view->resource);
- wined3d_device_context_submit(&cs->c, WINED3D_CS_QUEUE_DEFAULT); + wined3d_device_context_submit(context, WINED3D_CS_QUEUE_DEFAULT); }
static void wined3d_cs_emit_stop(struct wined3d_cs *cs) diff --git a/dlls/wined3d/view.c b/dlls/wined3d/view.c index f0833ff9e49..d386ebe1866 100644 --- a/dlls/wined3d/view.c +++ b/dlls/wined3d/view.c @@ -1423,7 +1423,7 @@ void CDECL wined3d_shader_resource_view_generate_mipmaps(struct wined3d_shader_r return; }
- wined3d_cs_emit_generate_mipmaps(view->resource->device->cs, view); + wined3d_device_context_emit_generate_mipmaps(&view->resource->device->cs->c, view); }
ULONG CDECL wined3d_unordered_access_view_incref(struct wined3d_unordered_access_view *view) diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h index 38f19b21fbf..5fee3bf14aa 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h @@ -4730,7 +4730,6 @@ void wined3d_cs_emit_clear_rendertarget_view(struct wined3d_cs *cs, struct wined void wined3d_cs_emit_clear_unordered_access_view_uint(struct wined3d_cs *cs, struct wined3d_unordered_access_view *view, const struct wined3d_uvec4 *clear_value) DECLSPEC_HIDDEN; void wined3d_cs_emit_flush(struct wined3d_cs *cs) DECLSPEC_HIDDEN; -void wined3d_cs_emit_generate_mipmaps(struct wined3d_cs *cs, struct wined3d_shader_resource_view *view) DECLSPEC_HIDDEN; void wined3d_cs_emit_preload_resource(struct wined3d_cs *cs, struct wined3d_resource *resource) DECLSPEC_HIDDEN; void wined3d_cs_emit_present(struct wined3d_cs *cs, struct wined3d_swapchain *swapchain, const RECT *src_rect, const RECT *dst_rect, HWND dst_window_override, unsigned int swap_interval, DWORD flags) DECLSPEC_HIDDEN; @@ -4788,6 +4787,8 @@ void wined3d_device_context_emit_draw(struct wined3d_device_context *context, enum wined3d_primitive_type primitive_type, unsigned int patch_vertex_count, int base_vertex_idx, unsigned int start_idx, unsigned int index_count, unsigned int start_instance, unsigned int instance_count, bool indexed) DECLSPEC_HIDDEN; +void wined3d_device_context_emit_generate_mipmaps(struct wined3d_device_context *context, + struct wined3d_shader_resource_view *view) DECLSPEC_HIDDEN; void wined3d_device_context_emit_set_blend_state(struct wined3d_device_context *context, struct wined3d_blend_state *state, const struct wined3d_color *blend_factor, unsigned int sample_mask) DECLSPEC_HIDDEN;
Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/d3d9/d3d9_private.h | 2 +- dlls/d3d9/surface.c | 2 +- dlls/d3d9/texture.c | 26 +++++++++++++------------- 3 files changed, 15 insertions(+), 15 deletions(-)
diff --git a/dlls/d3d9/d3d9_private.h b/dlls/d3d9/d3d9_private.h index 7bb277c2a75..50c3b38d795 100644 --- a/dlls/d3d9/d3d9_private.h +++ b/dlls/d3d9/d3d9_private.h @@ -225,7 +225,7 @@ struct d3d9_texture IDirect3DBaseTexture9 IDirect3DBaseTexture9_iface; struct d3d9_resource resource; struct wined3d_texture *wined3d_texture; - IDirect3DDevice9Ex *parent_device; + struct d3d9_device *parent_device; struct list rtv_list; DWORD usage; BOOL flags; diff --git a/dlls/d3d9/surface.c b/dlls/d3d9/surface.c index 3d1fbf12f99..d4738d2ca9f 100644 --- a/dlls/d3d9/surface.c +++ b/dlls/d3d9/surface.c @@ -401,7 +401,7 @@ static const struct wined3d_parent_ops d3d9_view_wined3d_parent_ops = struct d3d9_device *d3d9_surface_get_device(const struct d3d9_surface *surface) { IDirect3DDevice9Ex *device; - device = surface->texture ? surface->texture->parent_device : surface->parent_device; + device = surface->texture ? &surface->texture->parent_device->IDirect3DDevice9Ex_iface : surface->parent_device; return impl_from_IDirect3DDevice9Ex(device); }
diff --git a/dlls/d3d9/texture.c b/dlls/d3d9/texture.c index a8c2985c4ea..989e6fd81c1 100644 --- a/dlls/d3d9/texture.c +++ b/dlls/d3d9/texture.c @@ -79,7 +79,7 @@ static struct wined3d_shader_resource_view *d3d9_texture_acquire_shader_resource
static void d3d9_texture_cleanup(struct d3d9_texture *texture) { - IDirect3DDevice9Ex *parent_device = texture->parent_device; + IDirect3DDevice9Ex *parent_device = &texture->parent_device->IDirect3DDevice9Ex_iface; struct d3d9_surface *surface;
wined3d_mutex_lock(); @@ -141,7 +141,7 @@ static ULONG WINAPI d3d9_texture_2d_AddRef(IDirect3DTexture9 *iface) { struct d3d9_surface *surface;
- IDirect3DDevice9Ex_AddRef(texture->parent_device); + IDirect3DDevice9Ex_AddRef(&texture->parent_device->IDirect3DDevice9Ex_iface); wined3d_mutex_lock(); LIST_FOR_EACH_ENTRY(surface, &texture->rtv_list, struct d3d9_surface, rtv_entry) { @@ -172,7 +172,7 @@ static HRESULT WINAPI d3d9_texture_2d_GetDevice(IDirect3DTexture9 *iface, IDirec
TRACE("iface %p, device %p.\n", iface, device);
- *device = (IDirect3DDevice9 *)texture->parent_device; + *device = (IDirect3DDevice9 *)&texture->parent_device->IDirect3DDevice9Ex_iface; IDirect3DDevice9_AddRef(*device);
TRACE("Returning device %p.\n", *device); @@ -539,7 +539,7 @@ static ULONG WINAPI d3d9_texture_cube_AddRef(IDirect3DCubeTexture9 *iface) { struct d3d9_surface *surface;
- IDirect3DDevice9Ex_AddRef(texture->parent_device); + IDirect3DDevice9Ex_AddRef(&texture->parent_device->IDirect3DDevice9Ex_iface); wined3d_mutex_lock(); LIST_FOR_EACH_ENTRY(surface, &texture->rtv_list, struct d3d9_surface, rtv_entry) { @@ -570,7 +570,7 @@ static HRESULT WINAPI d3d9_texture_cube_GetDevice(IDirect3DCubeTexture9 *iface,
TRACE("iface %p, device %p.\n", iface, device);
- *device = (IDirect3DDevice9 *)texture->parent_device; + *device = (IDirect3DDevice9 *)&texture->parent_device->IDirect3DDevice9Ex_iface; IDirect3DDevice9_AddRef(*device);
TRACE("Returning device %p.\n", *device); @@ -961,7 +961,7 @@ static ULONG WINAPI d3d9_texture_3d_AddRef(IDirect3DVolumeTexture9 *iface)
if (ref == 1) { - IDirect3DDevice9Ex_AddRef(texture->parent_device); + IDirect3DDevice9Ex_AddRef(&texture->parent_device->IDirect3DDevice9Ex_iface); wined3d_mutex_lock(); wined3d_texture_incref(texture->wined3d_texture); wined3d_mutex_unlock(); @@ -988,7 +988,7 @@ static HRESULT WINAPI d3d9_texture_3d_GetDevice(IDirect3DVolumeTexture9 *iface,
TRACE("iface %p, device %p.\n", iface, device);
- *device = (IDirect3DDevice9 *)texture->parent_device; + *device = (IDirect3DDevice9 *)&texture->parent_device->IDirect3DDevice9Ex_iface; IDirect3DDevice9_AddRef(*device);
TRACE("Returning device %p.\n", *device); @@ -1386,8 +1386,8 @@ HRESULT texture_init(struct d3d9_texture *texture, struct d3d9_device *device, return hr; }
- texture->parent_device = &device->IDirect3DDevice9Ex_iface; - IDirect3DDevice9Ex_AddRef(texture->parent_device); + texture->parent_device = device; + IDirect3DDevice9Ex_AddRef(&texture->parent_device->IDirect3DDevice9Ex_iface);
return D3D_OK; } @@ -1468,8 +1468,8 @@ HRESULT cubetexture_init(struct d3d9_texture *texture, struct d3d9_device *devic return hr; }
- texture->parent_device = &device->IDirect3DDevice9Ex_iface; - IDirect3DDevice9Ex_AddRef(texture->parent_device); + texture->parent_device = device; + IDirect3DDevice9Ex_AddRef(&texture->parent_device->IDirect3DDevice9Ex_iface);
return D3D_OK; } @@ -1535,8 +1535,8 @@ HRESULT volumetexture_init(struct d3d9_texture *texture, struct d3d9_device *dev return hr; }
- texture->parent_device = &device->IDirect3DDevice9Ex_iface; - IDirect3DDevice9Ex_AddRef(texture->parent_device); + texture->parent_device = device; + IDirect3DDevice9Ex_AddRef(&texture->parent_device->IDirect3DDevice9Ex_iface);
return D3D_OK; }
Signed-off-by: Henri Verbeet hverbeet@codeweavers.com
Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/d3d11/device.c | 6 ++++-- dlls/d3d9/texture.c | 2 +- dlls/wined3d/view.c | 7 ++++--- dlls/wined3d/wined3d.spec | 2 +- include/wine/wined3d.h | 3 ++- 5 files changed, 12 insertions(+), 8 deletions(-)
diff --git a/dlls/d3d11/device.c b/dlls/d3d11/device.c index ada668e3164..46cede6a2b8 100644 --- a/dlls/d3d11/device.c +++ b/dlls/d3d11/device.c @@ -1359,12 +1359,13 @@ static void STDMETHODCALLTYPE d3d11_immediate_context_ClearDepthStencilView(ID3D static void STDMETHODCALLTYPE d3d11_immediate_context_GenerateMips(ID3D11DeviceContext1 *iface, ID3D11ShaderResourceView *view) { + struct d3d11_immediate_context *context = impl_from_ID3D11DeviceContext1(iface); struct d3d_shader_resource_view *srv = unsafe_impl_from_ID3D11ShaderResourceView(view);
TRACE("iface %p, view %p.\n", iface, view);
wined3d_mutex_lock(); - wined3d_shader_resource_view_generate_mipmaps(srv->wined3d_view); + wined3d_device_context_generate_mipmaps(context->wined3d_context, srv->wined3d_view); wined3d_mutex_unlock(); }
@@ -4965,12 +4966,13 @@ static void STDMETHODCALLTYPE d3d10_device_ClearDepthStencilView(ID3D10Device1 * static void STDMETHODCALLTYPE d3d10_device_GenerateMips(ID3D10Device1 *iface, ID3D10ShaderResourceView *view) { + struct d3d_device *device = impl_from_ID3D10Device(iface); struct d3d_shader_resource_view *srv = unsafe_impl_from_ID3D10ShaderResourceView(view);
TRACE("iface %p, view %p.\n", iface, view);
wined3d_mutex_lock(); - wined3d_shader_resource_view_generate_mipmaps(srv->wined3d_view); + wined3d_device_context_generate_mipmaps(device->immediate_context.wined3d_context, srv->wined3d_view); wined3d_mutex_unlock(); }
diff --git a/dlls/d3d9/texture.c b/dlls/d3d9/texture.c index 989e6fd81c1..19f0363db07 100644 --- a/dlls/d3d9/texture.c +++ b/dlls/d3d9/texture.c @@ -100,7 +100,7 @@ void d3d9_texture_gen_auto_mipmap(struct d3d9_texture *texture) if (!(texture->flags & D3D9_TEXTURE_MIPMAP_DIRTY)) return; d3d9_texture_acquire_shader_resource_view(texture); - wined3d_shader_resource_view_generate_mipmaps(texture->wined3d_srv); + wined3d_device_context_generate_mipmaps(texture->parent_device->immediate_context, texture->wined3d_srv); texture->flags &= ~D3D9_TEXTURE_MIPMAP_DIRTY; }
diff --git a/dlls/wined3d/view.c b/dlls/wined3d/view.c index d386ebe1866..2d86f70f1bf 100644 --- a/dlls/wined3d/view.c +++ b/dlls/wined3d/view.c @@ -1404,11 +1404,12 @@ void wined3d_shader_resource_view_vk_generate_mipmap(struct wined3d_shader_resou wined3d_context_vk_reference_texture(context_vk, texture_vk); }
-void CDECL wined3d_shader_resource_view_generate_mipmaps(struct wined3d_shader_resource_view *view) +void CDECL wined3d_device_context_generate_mipmaps(struct wined3d_device_context *context, + struct wined3d_shader_resource_view *view) { struct wined3d_texture *texture;
- TRACE("view %p.\n", view); + TRACE("context %p, view %p.\n", context, view);
if (view->resource->type == WINED3D_RTYPE_BUFFER) { @@ -1423,7 +1424,7 @@ void CDECL wined3d_shader_resource_view_generate_mipmaps(struct wined3d_shader_r return; }
- wined3d_device_context_emit_generate_mipmaps(&view->resource->device->cs->c, view); + wined3d_device_context_emit_generate_mipmaps(context, view); }
ULONG CDECL wined3d_unordered_access_view_incref(struct wined3d_unordered_access_view *view) diff --git a/dlls/wined3d/wined3d.spec b/dlls/wined3d/wined3d.spec index 34eca80a94e..70b73f1c710 100644 --- a/dlls/wined3d/wined3d.spec +++ b/dlls/wined3d/wined3d.spec @@ -171,6 +171,7 @@ @ cdecl wined3d_device_context_draw_indirect(ptr ptr long long) @ cdecl wined3d_device_context_dispatch(ptr long long long) @ cdecl wined3d_device_context_dispatch_indirect(ptr ptr long) +@ cdecl wined3d_device_context_generate_mipmaps(ptr ptr) @ cdecl wined3d_device_context_resolve_sub_resource(ptr ptr long ptr long long) @ cdecl wined3d_device_context_set_blend_state(ptr ptr ptr long) @ cdecl wined3d_device_context_set_constant_buffer(ptr long long ptr) @@ -260,7 +261,6 @@
@ cdecl wined3d_shader_resource_view_create(ptr ptr ptr ptr ptr) @ cdecl wined3d_shader_resource_view_decref(ptr) -@ cdecl wined3d_shader_resource_view_generate_mipmaps(ptr) @ cdecl wined3d_shader_resource_view_get_parent(ptr) @ cdecl wined3d_shader_resource_view_incref(ptr)
diff --git a/include/wine/wined3d.h b/include/wine/wined3d.h index 0e356aa7ecb..05b07bd7e29 100644 --- a/include/wine/wined3d.h +++ b/include/wine/wined3d.h @@ -2567,6 +2567,8 @@ void __cdecl wined3d_device_context_draw_indexed(struct wined3d_device_context * unsigned int start_index, unsigned int index_count, unsigned int start_instance, unsigned int instance_count); void __cdecl wined3d_device_context_draw_indirect(struct wined3d_device_context *context, struct wined3d_buffer *buffer, unsigned int offset, bool indexed); +void __cdecl wined3d_device_context_generate_mipmaps(struct wined3d_device_context *context, + struct wined3d_shader_resource_view *view); void __cdecl wined3d_device_context_resolve_sub_resource(struct wined3d_device_context *context, struct wined3d_resource *dst_resource, unsigned int dst_sub_resource_idx, struct wined3d_resource *src_resource, unsigned int src_sub_resource_idx, enum wined3d_format_id format_id); @@ -2789,7 +2791,6 @@ HRESULT __cdecl wined3d_shader_resource_view_create(const struct wined3d_view_de struct wined3d_resource *resource, void *parent, const struct wined3d_parent_ops *parent_ops, struct wined3d_shader_resource_view **view); ULONG __cdecl wined3d_shader_resource_view_decref(struct wined3d_shader_resource_view *view); -void __cdecl wined3d_shader_resource_view_generate_mipmaps(struct wined3d_shader_resource_view *view); void * __cdecl wined3d_shader_resource_view_get_parent(const struct wined3d_shader_resource_view *view); ULONG __cdecl wined3d_shader_resource_view_incref(struct wined3d_shader_resource_view *view);
On Thu, 8 Apr 2021 at 04:20, Zebediah Figura z.figura12@gmail.com wrote:
-void CDECL wined3d_shader_resource_view_generate_mipmaps(struct wined3d_shader_resource_view *view) +void CDECL wined3d_device_context_generate_mipmaps(struct wined3d_device_context *context,
struct wined3d_shader_resource_view *view)
{ struct wined3d_texture *texture;
- TRACE("view %p.\n", view);
TRACE("context %p, view %p.\n", context, view);
if (view->resource->type == WINED3D_RTYPE_BUFFER) {
@@ -1423,7 +1424,7 @@ void CDECL wined3d_shader_resource_view_generate_mipmaps(struct wined3d_shader_r return; }
- wined3d_device_context_emit_generate_mipmaps(&view->resource->device->cs->c, view);
- wined3d_device_context_emit_generate_mipmaps(context, view);
}
It would probably make sense to move this to device.c. (Or arguably cs.c, but in that case some of the device context functions currently in device.c would need to be moved to cs.c as well.)
Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/wined3d/cs.c | 11 ++++++----- dlls/wined3d/device.c | 2 +- dlls/wined3d/wined3d_private.h | 5 +++-- 3 files changed, 10 insertions(+), 8 deletions(-)
diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c index 16a8385c0b4..a0b462b714a 100644 --- a/dlls/wined3d/cs.c +++ b/dlls/wined3d/cs.c @@ -728,14 +728,15 @@ void wined3d_cs_emit_clear(struct wined3d_cs *cs, DWORD rect_count, const RECT * wined3d_device_context_submit(&cs->c, WINED3D_CS_QUEUE_DEFAULT); }
-void wined3d_cs_emit_clear_rendertarget_view(struct wined3d_cs *cs, struct wined3d_rendertarget_view *view, - const RECT *rect, DWORD flags, const struct wined3d_color *color, float depth, DWORD stencil) +void wined3d_device_context_emit_clear_rendertarget_view(struct wined3d_device_context *context, + struct wined3d_rendertarget_view *view, const RECT *rect, unsigned int flags, + const struct wined3d_color *color, float depth, unsigned int stencil) { struct wined3d_cs_clear *op; size_t size;
size = FIELD_OFFSET(struct wined3d_cs_clear, rects[1]) + sizeof(struct wined3d_fb_state); - op = wined3d_device_context_require_space(&cs->c, size, WINED3D_CS_QUEUE_DEFAULT); + op = wined3d_device_context_require_space(context, size, WINED3D_CS_QUEUE_DEFAULT); op->fb = (void *)&op->rects[1];
op->opcode = WINED3D_CS_OP_CLEAR; @@ -761,9 +762,9 @@ void wined3d_cs_emit_clear_rendertarget_view(struct wined3d_cs *cs, struct wined
wined3d_resource_acquire(view->resource);
- wined3d_device_context_submit(&cs->c, WINED3D_CS_QUEUE_DEFAULT); + wined3d_device_context_submit(context, WINED3D_CS_QUEUE_DEFAULT); if (flags & WINED3DCLEAR_SYNCHRONOUS) - wined3d_cs_finish(cs, WINED3D_CS_QUEUE_DEFAULT); + wined3d_device_context_finish(context, WINED3D_CS_QUEUE_DEFAULT); }
static void acquire_shader_resources(const struct wined3d_state *state, unsigned int shader_mask) diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c index e21e22a46f7..e0eb5968df6 100644 --- a/dlls/wined3d/device.c +++ b/dlls/wined3d/device.c @@ -5237,7 +5237,7 @@ HRESULT CDECL wined3d_device_clear_rendertarget_view(struct wined3d_device *devi return hr; }
- wined3d_cs_emit_clear_rendertarget_view(device->cs, view, rect, flags, color, depth, stencil); + wined3d_device_context_emit_clear_rendertarget_view(&device->cs->c, view, rect, flags, color, depth, stencil);
return WINED3D_OK; } diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h index 5fee3bf14aa..bc541a654e6 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h @@ -4725,8 +4725,6 @@ void wined3d_cs_emit_add_dirty_texture_region(struct wined3d_cs *cs, struct wined3d_texture *texture, unsigned int layer) DECLSPEC_HIDDEN; void wined3d_cs_emit_clear(struct wined3d_cs *cs, DWORD rect_count, const RECT *rects, DWORD flags, const struct wined3d_color *color, float depth, DWORD stencil) DECLSPEC_HIDDEN; -void wined3d_cs_emit_clear_rendertarget_view(struct wined3d_cs *cs, struct wined3d_rendertarget_view *view, - const RECT *rect, DWORD flags, const struct wined3d_color *color, float depth, DWORD stencil) DECLSPEC_HIDDEN; void wined3d_cs_emit_clear_unordered_access_view_uint(struct wined3d_cs *cs, struct wined3d_unordered_access_view *view, const struct wined3d_uvec4 *clear_value) DECLSPEC_HIDDEN; void wined3d_cs_emit_flush(struct wined3d_cs *cs) DECLSPEC_HIDDEN; @@ -4780,6 +4778,9 @@ void wined3d_device_context_emit_blt_sub_resource(struct wined3d_device_context struct wined3d_resource *dst_resource, unsigned int dst_sub_resource_idx, const struct wined3d_box *dst_box, struct wined3d_resource *src_resource, unsigned int src_sub_resource_idx, const struct wined3d_box *src_box, unsigned int flags, const struct wined3d_blt_fx *fx, enum wined3d_texture_filter_type filter) DECLSPEC_HIDDEN; +void wined3d_device_context_emit_clear_rendertarget_view(struct wined3d_device_context *context, + struct wined3d_rendertarget_view *view, const RECT *rect, unsigned int flags, + const struct wined3d_color *color, float depth, unsigned int stencil) DECLSPEC_HIDDEN; void wined3d_device_context_emit_copy_uav_counter(struct wined3d_device_context *context, struct wined3d_buffer *dst_buffer, unsigned int offset, struct wined3d_unordered_access_view *uav) DECLSPEC_HIDDEN;
Signed-off-by: Henri Verbeet hverbeet@codeweavers.com
Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/d3d11/device.c | 16 ++++++++-------- dlls/d3d9/device.c | 2 +- dlls/ddraw/surface.c | 13 +++++++------ dlls/wined3d/device.c | 12 ++++++------ dlls/wined3d/wined3d.spec | 2 +- include/wine/wined3d.h | 6 +++--- 6 files changed, 26 insertions(+), 25 deletions(-)
diff --git a/dlls/d3d11/device.c b/dlls/d3d11/device.c index 46cede6a2b8..ab5ad625bdf 100644 --- a/dlls/d3d11/device.c +++ b/dlls/d3d11/device.c @@ -1292,7 +1292,7 @@ static void STDMETHODCALLTYPE d3d11_immediate_context_CopyStructureCount(ID3D11D static void STDMETHODCALLTYPE d3d11_immediate_context_ClearRenderTargetView(ID3D11DeviceContext1 *iface, ID3D11RenderTargetView *render_target_view, const float color_rgba[4]) { - struct d3d_device *device = device_from_immediate_ID3D11DeviceContext1(iface); + struct d3d11_immediate_context *context = impl_from_ID3D11DeviceContext1(iface); struct d3d_rendertarget_view *view = unsafe_impl_from_ID3D11RenderTargetView(render_target_view); const struct wined3d_color color = {color_rgba[0], color_rgba[1], color_rgba[2], color_rgba[3]}; HRESULT hr; @@ -1304,7 +1304,7 @@ static void STDMETHODCALLTYPE d3d11_immediate_context_ClearRenderTargetView(ID3D return;
wined3d_mutex_lock(); - if (FAILED(hr = wined3d_device_clear_rendertarget_view(device->wined3d_device, view->wined3d_view, NULL, + if (FAILED(hr = wined3d_device_context_clear_rendertarget_view(context->wined3d_context, view->wined3d_view, NULL, WINED3DCLEAR_TARGET, &color, 0.0f, 0))) ERR("Failed to clear view, hr %#x.\n", hr); wined3d_mutex_unlock(); @@ -1336,7 +1336,7 @@ static void STDMETHODCALLTYPE d3d11_immediate_context_ClearUnorderedAccessViewFl static void STDMETHODCALLTYPE d3d11_immediate_context_ClearDepthStencilView(ID3D11DeviceContext1 *iface, ID3D11DepthStencilView *depth_stencil_view, UINT flags, FLOAT depth, UINT8 stencil) { - struct d3d_device *device = device_from_immediate_ID3D11DeviceContext1(iface); + struct d3d11_immediate_context *context = impl_from_ID3D11DeviceContext1(iface); struct d3d_depthstencil_view *view = unsafe_impl_from_ID3D11DepthStencilView(depth_stencil_view); DWORD wined3d_flags; HRESULT hr; @@ -1350,7 +1350,7 @@ static void STDMETHODCALLTYPE d3d11_immediate_context_ClearDepthStencilView(ID3D wined3d_flags = wined3d_clear_flags_from_d3d11_clear_flags(flags);
wined3d_mutex_lock(); - if (FAILED(hr = wined3d_device_clear_rendertarget_view(device->wined3d_device, view->wined3d_view, NULL, + if (FAILED(hr = wined3d_device_context_clear_rendertarget_view(context->wined3d_context, view->wined3d_view, NULL, wined3d_flags, NULL, depth, stencil))) ERR("Failed to clear view, hr %#x.\n", hr); wined3d_mutex_unlock(); @@ -4934,8 +4934,8 @@ static void STDMETHODCALLTYPE d3d10_device_ClearRenderTargetView(ID3D10Device1 * return;
wined3d_mutex_lock(); - if (FAILED(hr = wined3d_device_clear_rendertarget_view(device->wined3d_device, view->wined3d_view, NULL, - WINED3DCLEAR_TARGET, &color, 0.0f, 0))) + if (FAILED(hr = wined3d_device_context_clear_rendertarget_view(device->immediate_context.wined3d_context, + view->wined3d_view, NULL, WINED3DCLEAR_TARGET, &color, 0.0f, 0))) ERR("Failed to clear view, hr %#x.\n", hr); wined3d_mutex_unlock(); } @@ -4957,8 +4957,8 @@ static void STDMETHODCALLTYPE d3d10_device_ClearDepthStencilView(ID3D10Device1 * wined3d_flags = wined3d_clear_flags_from_d3d11_clear_flags(flags);
wined3d_mutex_lock(); - if (FAILED(hr = wined3d_device_clear_rendertarget_view(device->wined3d_device, view->wined3d_view, NULL, - wined3d_flags, NULL, depth, stencil))) + if (FAILED(hr = wined3d_device_context_clear_rendertarget_view(device->immediate_context.wined3d_context, + view->wined3d_view, NULL, wined3d_flags, NULL, depth, stencil))) ERR("Failed to clear view, hr %#x.\n", hr); wined3d_mutex_unlock(); } diff --git a/dlls/d3d9/device.c b/dlls/d3d9/device.c index 6492eecc7b9..25d98b4395a 100644 --- a/dlls/d3d9/device.c +++ b/dlls/d3d9/device.c @@ -1939,7 +1939,7 @@ static HRESULT WINAPI d3d9_device_ColorFill(IDirect3DDevice9Ex *iface,
wined3d_device_apply_stateblock(device->wined3d_device, device->state); rtv = d3d9_surface_acquire_rendertarget_view(surface_impl); - hr = wined3d_device_clear_rendertarget_view(device->wined3d_device, + hr = wined3d_device_context_clear_rendertarget_view(device->immediate_context, rtv, rect, WINED3DCLEAR_TARGET, &c, 0.0f, 0); d3d9_surface_release_rendertarget_view(surface_impl, rtv); if (SUCCEEDED(hr) && surface_impl->texture) diff --git a/dlls/ddraw/surface.c b/dlls/ddraw/surface.c index f5c3528cfa4..86cda045d92 100644 --- a/dlls/ddraw/surface.c +++ b/dlls/ddraw/surface.c @@ -1513,7 +1513,8 @@ static HRESULT ddraw_surface_blt(struct ddraw_surface *dst_surface, const RECT * struct ddraw_surface *src_surface, const RECT *src_rect, DWORD flags, DWORD fill_colour, const struct wined3d_blt_fx *fx, enum wined3d_texture_filter_type filter) { - struct wined3d_device *wined3d_device = dst_surface->ddraw->wined3d_device; + struct ddraw *ddraw = dst_surface->ddraw; + struct wined3d_device *wined3d_device = ddraw->wined3d_device; struct wined3d_color colour; DWORD wined3d_flags;
@@ -1527,9 +1528,9 @@ static HRESULT ddraw_surface_blt(struct ddraw_surface *dst_surface, const RECT * dst_surface->palette, fill_colour, &colour)) return DDERR_INVALIDPARAMS;
- wined3d_device_apply_stateblock(wined3d_device, dst_surface->ddraw->state); + wined3d_device_apply_stateblock(wined3d_device, ddraw->state); ddraw_surface_get_draw_texture(dst_surface, dst_rect ? DDRAW_SURFACE_RW : DDRAW_SURFACE_WRITE); - return wined3d_device_clear_rendertarget_view(wined3d_device, + return wined3d_device_context_clear_rendertarget_view(ddraw->immediate_context, ddraw_surface_get_rendertarget_view(dst_surface), dst_rect, wined3d_flags, &colour, 0.0f, 0); } @@ -1544,9 +1545,9 @@ static HRESULT ddraw_surface_blt(struct ddraw_surface *dst_surface, const RECT * dst_surface->palette, fill_colour, &colour)) return DDERR_INVALIDPARAMS;
- wined3d_device_apply_stateblock(wined3d_device, dst_surface->ddraw->state); + wined3d_device_apply_stateblock(wined3d_device, ddraw->state); ddraw_surface_get_draw_texture(dst_surface, dst_rect ? DDRAW_SURFACE_RW : DDRAW_SURFACE_WRITE); - return wined3d_device_clear_rendertarget_view(wined3d_device, + return wined3d_device_context_clear_rendertarget_view(ddraw->immediate_context, ddraw_surface_get_rendertarget_view(dst_surface), dst_rect, wined3d_flags, NULL, colour.r, 0); } @@ -1561,7 +1562,7 @@ static HRESULT ddraw_surface_blt(struct ddraw_surface *dst_surface, const RECT * if (!(flags & DDBLT_ASYNC)) wined3d_flags |= WINED3D_BLT_SYNCHRONOUS;
- return wined3d_device_context_blt(dst_surface->ddraw->immediate_context, + return wined3d_device_context_blt(ddraw->immediate_context, ddraw_surface_get_any_texture(dst_surface, DDRAW_SURFACE_RW), dst_surface->sub_resource_idx, dst_rect, ddraw_surface_get_any_texture(src_surface, DDRAW_SURFACE_READ), src_surface->sub_resource_idx, src_rect, wined3d_flags, fx, filter); diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c index e0eb5968df6..c7b743e0ff3 100644 --- a/dlls/wined3d/device.c +++ b/dlls/wined3d/device.c @@ -5201,15 +5201,15 @@ void CDECL wined3d_device_context_resolve_sub_resource(struct wined3d_device_con src_texture, src_sub_resource_idx, &src_rect, 0, &fx, WINED3D_TEXF_POINT); }
-HRESULT CDECL wined3d_device_clear_rendertarget_view(struct wined3d_device *device, - struct wined3d_rendertarget_view *view, const RECT *rect, DWORD flags, - const struct wined3d_color *color, float depth, DWORD stencil) +HRESULT CDECL wined3d_device_context_clear_rendertarget_view(struct wined3d_device_context *context, + struct wined3d_rendertarget_view *view, const RECT *rect, unsigned int flags, + const struct wined3d_color *color, float depth, unsigned int stencil) { struct wined3d_resource *resource; RECT r;
- TRACE("device %p, view %p, rect %s, flags %#x, color %s, depth %.8e, stencil %u.\n", - device, view, wine_dbgstr_rect(rect), flags, debug_color(color), depth, stencil); + TRACE("context %p, view %p, rect %s, flags %#x, color %s, depth %.8e, stencil %u.\n", + context, view, wine_dbgstr_rect(rect), flags, debug_color(color), depth, stencil);
if (!flags) return WINED3D_OK; @@ -5237,7 +5237,7 @@ HRESULT CDECL wined3d_device_clear_rendertarget_view(struct wined3d_device *devi return hr; }
- wined3d_device_context_emit_clear_rendertarget_view(&device->cs->c, view, rect, flags, color, depth, stencil); + wined3d_device_context_emit_clear_rendertarget_view(context, view, rect, flags, color, depth, stencil);
return WINED3D_OK; } diff --git a/dlls/wined3d/wined3d.spec b/dlls/wined3d/wined3d.spec index 70b73f1c710..3df1f19b837 100644 --- a/dlls/wined3d/wined3d.spec +++ b/dlls/wined3d/wined3d.spec @@ -42,7 +42,6 @@ @ cdecl wined3d_device_apply_stateblock(ptr ptr) @ cdecl wined3d_device_begin_scene(ptr) @ cdecl wined3d_device_clear(ptr long ptr long ptr float long) -@ cdecl wined3d_device_clear_rendertarget_view(ptr ptr ptr long ptr float long) @ cdecl wined3d_device_clear_unordered_access_view_uint(ptr ptr ptr) @ cdecl wined3d_device_create(ptr ptr long ptr long long ptr long ptr ptr) @ cdecl wined3d_device_decref(ptr) @@ -163,6 +162,7 @@ @ cdecl wined3d_device_validate_device(ptr ptr)
@ cdecl wined3d_device_context_blt(ptr ptr long ptr ptr long ptr long ptr long) +@ cdecl wined3d_device_context_clear_rendertarget_view(ptr ptr ptr long ptr float long) @ cdecl wined3d_device_context_copy_resource(ptr ptr ptr) @ cdecl wined3d_device_context_copy_sub_resource_region(ptr ptr long long long long ptr long ptr long) @ cdecl wined3d_device_context_copy_uav_counter(ptr ptr long ptr) diff --git a/include/wine/wined3d.h b/include/wine/wined3d.h index 05b07bd7e29..35bcb45f851 100644 --- a/include/wine/wined3d.h +++ b/include/wine/wined3d.h @@ -2352,9 +2352,6 @@ void __cdecl wined3d_device_apply_stateblock(struct wined3d_device *device, stru HRESULT __cdecl wined3d_device_begin_scene(struct wined3d_device *device); HRESULT __cdecl wined3d_device_clear(struct wined3d_device *device, DWORD rect_count, const RECT *rects, DWORD flags, const struct wined3d_color *color, float z, DWORD stencil); -HRESULT __cdecl wined3d_device_clear_rendertarget_view(struct wined3d_device *device, - struct wined3d_rendertarget_view *view, const RECT *rect, DWORD flags, - const struct wined3d_color *color, float depth, DWORD stencil); void __cdecl wined3d_device_clear_unordered_access_view_uint(struct wined3d_device *device, struct wined3d_unordered_access_view *view, const struct wined3d_uvec4 *clear_value); HRESULT __cdecl wined3d_device_create(struct wined3d *wined3d, struct wined3d_adapter *adapter, @@ -2549,6 +2546,9 @@ HRESULT __cdecl wined3d_device_context_blt(struct wined3d_device_context *contex struct wined3d_texture *dst_texture, unsigned int dst_sub_resource_idx, const RECT *dst_rect, struct wined3d_texture *src_texture, unsigned int src_sub_resource_idx, const RECT *src_rect, unsigned int flags, const struct wined3d_blt_fx *fx, enum wined3d_texture_filter_type filter); +HRESULT __cdecl wined3d_device_context_clear_rendertarget_view(struct wined3d_device_context *context, + struct wined3d_rendertarget_view *view, const RECT *rect, unsigned int flags, + const struct wined3d_color *color, float depth, unsigned int stencil); void __cdecl wined3d_device_context_copy_resource(struct wined3d_device_context *context, struct wined3d_resource *dst_resource, struct wined3d_resource *src_resource); HRESULT __cdecl wined3d_device_context_copy_sub_resource_region(struct wined3d_device_context *context,
Signed-off-by: Henri Verbeet hverbeet@codeweavers.com