Signed-off-by: Zebediah Figura z.figura12@gmail.com --- v2: Move to device.c while we're at it.
dlls/d3d11/device.c | 6 ++++-- dlls/d3d9/texture.c | 2 +- dlls/wined3d/device.c | 23 +++++++++++++++++++++++ dlls/wined3d/view.c | 22 ---------------------- dlls/wined3d/wined3d.spec | 2 +- include/wine/wined3d.h | 3 ++- 6 files changed, 31 insertions(+), 27 deletions(-)
diff --git a/dlls/d3d11/device.c b/dlls/d3d11/device.c index d94babcbb24..ab5ad625bdf 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/device.c b/dlls/wined3d/device.c index c7b743e0ff3..7051f3749a3 100644 --- a/dlls/wined3d/device.c +++ b/dlls/wined3d/device.c @@ -5291,6 +5291,29 @@ HRESULT CDECL wined3d_device_set_depth_stencil_view(struct wined3d_device *devic return wined3d_device_context_set_depth_stencil_view(&device->cs->c, view); }
+void CDECL wined3d_device_context_generate_mipmaps(struct wined3d_device_context *context, + struct wined3d_shader_resource_view *view) +{ + struct wined3d_texture *texture; + + TRACE("context %p, view %p.\n", context, view); + + if (view->resource->type == WINED3D_RTYPE_BUFFER) + { + WARN("Called on buffer resource %p.\n", view->resource); + return; + } + + texture = texture_from_resource(view->resource); + if (!(texture->flags & WINED3D_TEXTURE_GENERATE_MIPMAPS)) + { + WARN("Texture without the WINED3D_TEXTURE_GENERATE_MIPMAPS flag, ignoring.\n"); + return; + } + + wined3d_device_context_emit_generate_mipmaps(context, view); +} + static struct wined3d_texture *wined3d_device_create_cursor_texture(struct wined3d_device *device, struct wined3d_texture *cursor_image, unsigned int sub_resource_idx) { diff --git a/dlls/wined3d/view.c b/dlls/wined3d/view.c index d386ebe1866..03abaf57102 100644 --- a/dlls/wined3d/view.c +++ b/dlls/wined3d/view.c @@ -1404,28 +1404,6 @@ 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) -{ - struct wined3d_texture *texture; - - TRACE("view %p.\n", view); - - if (view->resource->type == WINED3D_RTYPE_BUFFER) - { - WARN("Called on buffer resource %p.\n", view->resource); - return; - } - - texture = texture_from_resource(view->resource); - if (!(texture->flags & WINED3D_TEXTURE_GENERATE_MIPMAPS)) - { - WARN("Texture without the WINED3D_TEXTURE_GENERATE_MIPMAPS flag, ignoring.\n"); - return; - } - - 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) { ULONG refcount = InterlockedIncrement(&view->refcount); diff --git a/dlls/wined3d/wined3d.spec b/dlls/wined3d/wined3d.spec index a18969a7e9a..3df1f19b837 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 36e6e5aae00..35bcb45f851 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);
Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/wined3d/cs.c | 6 +++--- dlls/wined3d/device.c | 2 +- dlls/wined3d/wined3d_private.h | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c index a0b462b714a..3e74f868e58 100644 --- a/dlls/wined3d/cs.c +++ b/dlls/wined3d/cs.c @@ -2594,19 +2594,19 @@ static void wined3d_cs_exec_clear_unordered_access_view(struct wined3d_cs *cs, c wined3d_resource_release(view->resource); }
-void wined3d_cs_emit_clear_unordered_access_view_uint(struct wined3d_cs *cs, +void wined3d_device_context_emit_clear_uav_uint(struct wined3d_device_context *context, struct wined3d_unordered_access_view *view, const struct wined3d_uvec4 *clear_value) { struct wined3d_cs_clear_unordered_access_view *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_CLEAR_UNORDERED_ACCESS_VIEW; op->view = view; op->clear_value = *clear_value;
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_exec_copy_uav_counter(struct wined3d_cs *cs, const void *data) diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c index 7051f3749a3..6df68100356 100644 --- a/dlls/wined3d/device.c +++ b/dlls/wined3d/device.c @@ -5247,7 +5247,7 @@ void CDECL wined3d_device_clear_unordered_access_view_uint(struct wined3d_device { TRACE("device %p, view %p, clear_value %s.\n", device, view, debug_uvec4(clear_value));
- wined3d_cs_emit_clear_unordered_access_view_uint(device->cs, view, clear_value); + wined3d_device_context_emit_clear_uav_uint(&device->cs->c, view, clear_value); }
struct wined3d_rendertarget_view * CDECL wined3d_device_get_rendertarget_view(const struct wined3d_device *device, diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h index bc541a654e6..f00ef681215 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h @@ -4725,7 +4725,7 @@ 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_unordered_access_view_uint(struct wined3d_cs *cs, +void wined3d_device_context_emit_clear_uav_uint(struct wined3d_device_context *context, 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_preload_resource(struct wined3d_cs *cs, struct wined3d_resource *resource) DECLSPEC_HIDDEN;
Signed-off-by: Henri Verbeet hverbeet@codeweavers.com
Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/d3d11/device.c | 4 ++-- dlls/wined3d/device.c | 6 +++--- dlls/wined3d/wined3d.spec | 2 +- include/wine/wined3d.h | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/dlls/d3d11/device.c b/dlls/d3d11/device.c index ab5ad625bdf..1f64a89ec8f 100644 --- a/dlls/d3d11/device.c +++ b/dlls/d3d11/device.c @@ -1313,7 +1313,7 @@ static void STDMETHODCALLTYPE d3d11_immediate_context_ClearRenderTargetView(ID3D static void STDMETHODCALLTYPE d3d11_immediate_context_ClearUnorderedAccessViewUint(ID3D11DeviceContext1 *iface, ID3D11UnorderedAccessView *unordered_access_view, const UINT values[4]) { - struct d3d_device *device = device_from_immediate_ID3D11DeviceContext1(iface); + struct d3d11_immediate_context *context = impl_from_ID3D11DeviceContext1(iface); struct d3d11_unordered_access_view *view;
TRACE("iface %p, unordered_access_view %p, values {%u, %u, %u, %u}.\n", @@ -1321,7 +1321,7 @@ static void STDMETHODCALLTYPE d3d11_immediate_context_ClearUnorderedAccessViewUi
view = unsafe_impl_from_ID3D11UnorderedAccessView(unordered_access_view); wined3d_mutex_lock(); - wined3d_device_clear_unordered_access_view_uint(device->wined3d_device, + wined3d_device_context_clear_uav_uint(context->wined3d_context, view->wined3d_view, (const struct wined3d_uvec4 *)values); wined3d_mutex_unlock(); } diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c index 6df68100356..e62f560a0be 100644 --- a/dlls/wined3d/device.c +++ b/dlls/wined3d/device.c @@ -5242,12 +5242,12 @@ HRESULT CDECL wined3d_device_context_clear_rendertarget_view(struct wined3d_devi return WINED3D_OK; }
-void CDECL wined3d_device_clear_unordered_access_view_uint(struct wined3d_device *device, +void CDECL wined3d_device_context_clear_uav_uint(struct wined3d_device_context *context, struct wined3d_unordered_access_view *view, const struct wined3d_uvec4 *clear_value) { - TRACE("device %p, view %p, clear_value %s.\n", device, view, debug_uvec4(clear_value)); + TRACE("context %p, view %p, clear_value %s.\n", context, view, debug_uvec4(clear_value));
- wined3d_device_context_emit_clear_uav_uint(&device->cs->c, view, clear_value); + wined3d_device_context_emit_clear_uav_uint(context, view, clear_value); }
struct wined3d_rendertarget_view * CDECL wined3d_device_get_rendertarget_view(const struct wined3d_device *device, diff --git a/dlls/wined3d/wined3d.spec b/dlls/wined3d/wined3d.spec index 3df1f19b837..1055bbda0ce 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_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) @ cdecl wined3d_device_dispatch_compute(ptr long long long) @@ -163,6 +162,7 @@
@ 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_clear_uav_uint(ptr ptr ptr) @ 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 35bcb45f851..bb0f24e8226 100644 --- a/include/wine/wined3d.h +++ b/include/wine/wined3d.h @@ -2352,8 +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); -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, enum wined3d_device_type device_type, HWND focus_window, DWORD behaviour_flags, BYTE surface_alignment, const enum wined3d_feature_level *feature_levels, unsigned int feature_level_count, @@ -2549,6 +2547,8 @@ HRESULT __cdecl wined3d_device_context_blt(struct wined3d_device_context *contex 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_clear_uav_uint(struct wined3d_device_context *context, + struct wined3d_unordered_access_view *view, const struct wined3d_uvec4 *clear_value); 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
Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/wined3d/buffer.c | 2 +- dlls/wined3d/cs.c | 12 ++++++------ dlls/wined3d/device.c | 3 ++- dlls/wined3d/texture.c | 2 +- dlls/wined3d/wined3d_private.h | 6 +++--- 5 files changed, 13 insertions(+), 12 deletions(-)
diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c index 8fca81ec19c..ea21f85bc9e 100644 --- a/dlls/wined3d/buffer.c +++ b/dlls/wined3d/buffer.c @@ -1047,7 +1047,7 @@ static void wined3d_buffer_init_data(struct wined3d_buffer *buffer, if (buffer->flags & WINED3D_BUFFER_USE_BO) { wined3d_box_set(&box, 0, 0, resource->size, 1, 0, 1); - wined3d_cs_emit_update_sub_resource(device->cs, resource, + wined3d_device_context_emit_update_sub_resource(&device->cs->c, resource, 0, &box, data->data, data->row_pitch, data->slice_pitch); } else diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c index 3e74f868e58..32ea900e27d 100644 --- a/dlls/wined3d/cs.c +++ b/dlls/wined3d/cs.c @@ -2522,13 +2522,13 @@ done: wined3d_resource_release(resource); }
-void wined3d_cs_emit_update_sub_resource(struct wined3d_cs *cs, struct wined3d_resource *resource, - unsigned int sub_resource_idx, const struct wined3d_box *box, const void *data, unsigned int row_pitch, - unsigned int slice_pitch) +void wined3d_device_context_emit_update_sub_resource(struct wined3d_device_context *context, + struct wined3d_resource *resource, unsigned int sub_resource_idx, const struct wined3d_box *box, + const void *data, unsigned int row_pitch, unsigned int slice_pitch) { struct wined3d_cs_update_sub_resource *op;
- op = wined3d_device_context_require_space(&cs->c, sizeof(*op), WINED3D_CS_QUEUE_MAP); + op = wined3d_device_context_require_space(context, sizeof(*op), WINED3D_CS_QUEUE_MAP); op->opcode = WINED3D_CS_OP_UPDATE_SUB_RESOURCE; op->resource = resource; op->sub_resource_idx = sub_resource_idx; @@ -2539,10 +2539,10 @@ void wined3d_cs_emit_update_sub_resource(struct wined3d_cs *cs, struct wined3d_r
wined3d_resource_acquire(resource);
- wined3d_device_context_submit(&cs->c, WINED3D_CS_QUEUE_MAP); + wined3d_device_context_submit(context, WINED3D_CS_QUEUE_MAP); /* The data pointer may go away, so we need to wait until it is read. * Copying the data may be faster if it's small. */ - wined3d_cs_finish(cs, WINED3D_CS_QUEUE_MAP); + wined3d_device_context_finish(context, WINED3D_CS_QUEUE_MAP); }
static void wined3d_cs_exec_add_dirty_texture_region(struct wined3d_cs *cs, const void *data) diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c index e62f560a0be..bd92632e306 100644 --- a/dlls/wined3d/device.c +++ b/dlls/wined3d/device.c @@ -5149,7 +5149,8 @@ void CDECL wined3d_device_update_sub_resource(struct wined3d_device *device, str
wined3d_resource_wait_idle(resource);
- wined3d_cs_emit_update_sub_resource(device->cs, resource, sub_resource_idx, box, data, row_pitch, depth_pitch); + wined3d_device_context_emit_update_sub_resource(&device->cs->c, resource, + sub_resource_idx, box, data, row_pitch, depth_pitch); }
void CDECL wined3d_device_context_resolve_sub_resource(struct wined3d_device_context *context, diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c index 487f0806ce3..333002ebfd5 100644 --- a/dlls/wined3d/texture.c +++ b/dlls/wined3d/texture.c @@ -4259,7 +4259,7 @@ HRESULT CDECL wined3d_texture_create(struct wined3d_device *device, const struct for (i = 0; i < sub_count; ++i) { wined3d_texture_get_level_box(*texture, i % (*texture)->level_count, &box); - wined3d_cs_emit_update_sub_resource(device->cs, &(*texture)->resource, + wined3d_device_context_emit_update_sub_resource(&device->cs->c, &(*texture)->resource, i, &box, data[i].data, data[i].row_pitch, data[i].slice_pitch); } } diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h index f00ef681215..34ec814685c 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h @@ -4753,9 +4753,6 @@ void wined3d_cs_emit_set_texture_state(struct wined3d_cs *cs, UINT stage, void wined3d_cs_emit_set_transform(struct wined3d_cs *cs, enum wined3d_transform_state state, const struct wined3d_matrix *matrix) DECLSPEC_HIDDEN; void wined3d_cs_emit_unload_resource(struct wined3d_cs *cs, struct wined3d_resource *resource) DECLSPEC_HIDDEN; -void wined3d_cs_emit_update_sub_resource(struct wined3d_cs *cs, struct wined3d_resource *resource, - unsigned int sub_resource_idx, const struct wined3d_box *box, const void *data, unsigned int row_pitch, - unsigned int slice_pitch) DECLSPEC_HIDDEN; void wined3d_cs_init_object(struct wined3d_cs *cs, void (*callback)(void *object), void *object) DECLSPEC_HIDDEN; HRESULT wined3d_cs_map(struct wined3d_cs *cs, struct wined3d_resource *resource, unsigned int sub_resource_idx, @@ -4827,6 +4824,9 @@ void wined3d_device_context_emit_set_vertex_declaration(struct wined3d_device_co struct wined3d_vertex_declaration *declaration) DECLSPEC_HIDDEN; void wined3d_device_context_emit_set_viewports(struct wined3d_device_context *context, unsigned int viewport_count, const struct wined3d_viewport *viewports) DECLSPEC_HIDDEN; +void wined3d_device_context_emit_update_sub_resource(struct wined3d_device_context *context, + struct wined3d_resource *resource, unsigned int sub_resource_idx, const struct wined3d_box *box, + const void *data, unsigned int row_pitch, unsigned int slice_pitch) DECLSPEC_HIDDEN;
static inline void wined3d_resource_wait_idle(struct wined3d_resource *resource) {
Signed-off-by: Henri Verbeet hverbeet@codeweavers.com
Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/d3d11/device.c | 8 ++++---- dlls/wined3d/device.c | 13 ++++++------- dlls/wined3d/wined3d.spec | 2 +- include/wine/wined3d.h | 6 +++--- 4 files changed, 14 insertions(+), 15 deletions(-)
diff --git a/dlls/d3d11/device.c b/dlls/d3d11/device.c index 1f64a89ec8f..9845f93eebf 100644 --- a/dlls/d3d11/device.c +++ b/dlls/d3d11/device.c @@ -1253,7 +1253,7 @@ static void STDMETHODCALLTYPE d3d11_immediate_context_UpdateSubresource(ID3D11De ID3D11Resource *resource, UINT subresource_idx, const D3D11_BOX *box, const void *data, UINT row_pitch, UINT depth_pitch) { - struct d3d_device *device = device_from_immediate_ID3D11DeviceContext1(iface); + struct d3d11_immediate_context *context = impl_from_ID3D11DeviceContext1(iface); struct wined3d_resource *wined3d_resource; struct wined3d_box wined3d_box;
@@ -1265,7 +1265,7 @@ static void STDMETHODCALLTYPE d3d11_immediate_context_UpdateSubresource(ID3D11De
wined3d_resource = wined3d_resource_from_d3d11_resource(resource); wined3d_mutex_lock(); - wined3d_device_update_sub_resource(device->wined3d_device, wined3d_resource, + wined3d_device_context_update_sub_resource(context->wined3d_context, wined3d_resource, subresource_idx, box ? &wined3d_box : NULL, data, row_pitch, depth_pitch, 0); wined3d_mutex_unlock(); } @@ -2704,7 +2704,7 @@ static void STDMETHODCALLTYPE d3d11_immediate_context_UpdateSubresource1(ID3D11D ID3D11Resource *resource, UINT subresource_idx, const D3D11_BOX *box, const void *data, UINT row_pitch, UINT depth_pitch, UINT flags) { - struct d3d_device *device = device_from_immediate_ID3D11DeviceContext1(iface); + struct d3d11_immediate_context *context = impl_from_ID3D11DeviceContext1(iface); struct wined3d_resource *wined3d_resource; struct wined3d_box wined3d_box;
@@ -2717,7 +2717,7 @@ static void STDMETHODCALLTYPE d3d11_immediate_context_UpdateSubresource1(ID3D11D
wined3d_resource = wined3d_resource_from_d3d11_resource(resource); wined3d_mutex_lock(); - wined3d_device_update_sub_resource(device->wined3d_device, wined3d_resource, subresource_idx, + wined3d_device_context_update_sub_resource(context->wined3d_context, wined3d_resource, subresource_idx, box ? &wined3d_box : NULL, data, row_pitch, depth_pitch, flags); wined3d_mutex_unlock(); } diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c index bd92632e306..b1f7568842e 100644 --- a/dlls/wined3d/device.c +++ b/dlls/wined3d/device.c @@ -5085,16 +5085,15 @@ HRESULT CDECL wined3d_device_context_copy_sub_resource_region(struct wined3d_dev return WINED3D_OK; }
-void CDECL wined3d_device_update_sub_resource(struct wined3d_device *device, struct wined3d_resource *resource, - unsigned int sub_resource_idx, const struct wined3d_box *box, const void *data, unsigned int row_pitch, - unsigned int depth_pitch, unsigned int flags) +void CDECL wined3d_device_context_update_sub_resource(struct wined3d_device_context *context, + struct wined3d_resource *resource, unsigned int sub_resource_idx, const struct wined3d_box *box, + const void *data, unsigned int row_pitch, unsigned int depth_pitch, unsigned int flags) { unsigned int width, height, depth; struct wined3d_box b;
- TRACE("device %p, resource %p, sub_resource_idx %u, box %s, data %p, row_pitch %u, depth_pitch %u, " - "flags %#x.\n", - device, resource, sub_resource_idx, debug_box(box), data, row_pitch, depth_pitch, flags); + TRACE("context %p, resource %p, sub_resource_idx %u, box %s, data %p, row_pitch %u, depth_pitch %u, flags %#x.\n", + context, resource, sub_resource_idx, debug_box(box), data, row_pitch, depth_pitch, flags);
if (flags) FIXME("Ignoring flags %#x.\n", flags); @@ -5149,7 +5148,7 @@ void CDECL wined3d_device_update_sub_resource(struct wined3d_device *device, str
wined3d_resource_wait_idle(resource);
- wined3d_device_context_emit_update_sub_resource(&device->cs->c, resource, + wined3d_device_context_emit_update_sub_resource(context, resource, sub_resource_idx, box, data, row_pitch, depth_pitch); }
diff --git a/dlls/wined3d/wined3d.spec b/dlls/wined3d/wined3d.spec index 1055bbda0ce..cff4fd86b1a 100644 --- a/dlls/wined3d/wined3d.spec +++ b/dlls/wined3d/wined3d.spec @@ -156,7 +156,6 @@ @ cdecl wined3d_device_set_vs_resource_view(ptr long ptr) @ cdecl wined3d_device_set_vs_sampler(ptr long ptr) @ cdecl wined3d_device_show_cursor(ptr long) -@ cdecl wined3d_device_update_sub_resource(ptr ptr long ptr ptr long long long) @ cdecl wined3d_device_update_texture(ptr ptr ptr) @ cdecl wined3d_device_validate_device(ptr ptr)
@@ -190,6 +189,7 @@ @ cdecl wined3d_device_context_set_unordered_access_view(ptr long long ptr long) @ cdecl wined3d_device_context_set_vertex_declaration(ptr ptr) @ cdecl wined3d_device_context_set_viewports(ptr long ptr) +@ cdecl wined3d_device_context_update_sub_resource(ptr ptr long ptr ptr long long long)
@ cdecl wined3d_output_find_closest_matching_mode(ptr ptr) @ cdecl wined3d_output_get_adapter(ptr) diff --git a/include/wine/wined3d.h b/include/wine/wined3d.h index bb0f24e8226..c6c97da4fbe 100644 --- a/include/wine/wined3d.h +++ b/include/wine/wined3d.h @@ -2533,9 +2533,6 @@ void __cdecl wined3d_device_set_vs_resource_view(struct wined3d_device *device, UINT idx, struct wined3d_shader_resource_view *view); void __cdecl wined3d_device_set_vs_sampler(struct wined3d_device *device, UINT idx, struct wined3d_sampler *sampler); BOOL __cdecl wined3d_device_show_cursor(struct wined3d_device *device, BOOL show); -void __cdecl wined3d_device_update_sub_resource(struct wined3d_device *device, struct wined3d_resource *resource, - unsigned int sub_resource_idx, const struct wined3d_box *box, const void *data, unsigned int row_pitch, - unsigned int depth_pitch, unsigned int flags); HRESULT __cdecl wined3d_device_update_texture(struct wined3d_device *device, struct wined3d_texture *src_texture, struct wined3d_texture *dst_texture); HRESULT __cdecl wined3d_device_validate_device(const struct wined3d_device *device, DWORD *num_passes); @@ -2607,6 +2604,9 @@ void __cdecl wined3d_device_context_set_vertex_declaration(struct wined3d_device struct wined3d_vertex_declaration *declaration); void __cdecl wined3d_device_context_set_viewports(struct wined3d_device_context *context, unsigned int viewport_count, const struct wined3d_viewport *viewports); +void __cdecl wined3d_device_context_update_sub_resource(struct wined3d_device_context *context, + struct wined3d_resource *resource, unsigned int sub_resource_idx, const struct wined3d_box *box, + const void *data, unsigned int row_pitch, unsigned int depth_pitch, unsigned int flags);
HRESULT __cdecl wined3d_output_find_closest_matching_mode(const struct wined3d_output *output, struct wined3d_display_mode *mode);
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=88488
Your paranoid android.
=== debiant2 (64 bit WoW report) ===
d3d11: d3d11.c:4402: Test failed: Test 0: Failed to create a shader resource view, hr 0x80070057. Unhandled exception: page fault on read access to 0xffffffffffffffff in 64-bit code (0x0000000000411835).