Signed-off-by: Matteo Bruni mbruni@codeweavers.com --- dlls/d3d11/texture.c | 8 ++++++++ 1 file changed, 8 insertions(+)
diff --git a/dlls/d3d11/texture.c b/dlls/d3d11/texture.c index 12186dcf37..e8870d5d9a 100644 --- a/dlls/d3d11/texture.c +++ b/dlls/d3d11/texture.c @@ -942,6 +942,14 @@ static HRESULT d3d_texture3d_init(struct d3d_texture3d *texture, struct d3d_devi unsigned int levels; HRESULT hr;
+ if (desc->MiscFlags & D3D11_RESOURCE_MISC_GENERATE_MIPS + && (~desc->BindFlags & (D3D11_BIND_RENDER_TARGET | D3D11_BIND_SHADER_RESOURCE))) + { + WARN("D3D11_RESOURCE_MISC_GENERATE_MIPS used without D3D11_BIND_RENDER_TARGET " + "and D3D11_BIND_SHADER_RESOURCE.\n"); + return E_INVALIDARG; + } + texture->ID3D11Texture3D_iface.lpVtbl = &d3d11_texture3d_vtbl; texture->ID3D10Texture3D_iface.lpVtbl = &d3d10_texture3d_vtbl; texture->refcount = 1;
Signed-off-by: Matteo Bruni mbruni@codeweavers.com --- dlls/d3d11/buffer.c | 6 ++++++ 1 file changed, 6 insertions(+)
diff --git a/dlls/d3d11/buffer.c b/dlls/d3d11/buffer.c index 8233742570..3ccccc8cc8 100644 --- a/dlls/d3d11/buffer.c +++ b/dlls/d3d11/buffer.c @@ -422,6 +422,12 @@ static BOOL validate_buffer_desc(D3D11_BUFFER_DESC *desc) desc->StructureByteStride = 0; }
+ if (desc->MiscFlags & D3D11_RESOURCE_MISC_GENERATE_MIPS) + { + WARN("Buffer with the D3D11_RESOURCE_MISC_GENERATE_MIPS flag.\n"); + return FALSE; + } + return TRUE; }
Signed-off-by: Henri Verbeet hverbeet@codeweavers.com
Signed-off-by: Matteo Bruni mbruni@codeweavers.com --- dlls/d3d11/texture.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/dlls/d3d11/texture.c b/dlls/d3d11/texture.c index e8870d5d9a..177c0cc939 100644 --- a/dlls/d3d11/texture.c +++ b/dlls/d3d11/texture.c @@ -526,6 +526,8 @@ HRESULT d3d_texture2d_create(struct d3d_device *device, const D3D11_TEXTURE2D_DE
if (desc->MiscFlags & D3D11_RESOURCE_MISC_GDI_COMPATIBLE) flags |= WINED3D_TEXTURE_CREATE_GET_DC; + if (desc->MiscFlags & D3D11_RESOURCE_MISC_GENERATE_MIPS) + flags |= WINED3D_TEXTURE_CREATE_GENERATE_MIPMAPS;
if (FAILED(hr = wined3d_texture_create(device->wined3d_device, &wined3d_desc, desc->ArraySize, levels, flags, (struct wined3d_sub_resource_data *)data, @@ -940,6 +942,7 @@ static HRESULT d3d_texture3d_init(struct d3d_texture3d *texture, struct d3d_devi { struct wined3d_resource_desc wined3d_desc; unsigned int levels; + DWORD flags = 0; HRESULT hr;
if (desc->MiscFlags & D3D11_RESOURCE_MISC_GENERATE_MIPS @@ -970,8 +973,11 @@ static HRESULT d3d_texture3d_init(struct d3d_texture3d *texture, struct d3d_devi
levels = desc->MipLevels ? desc->MipLevels : wined3d_log2i(max(max(desc->Width, desc->Height), desc->Depth)) + 1;
+ if (desc->MiscFlags & D3D11_RESOURCE_MISC_GENERATE_MIPS) + flags |= WINED3D_TEXTURE_CREATE_GENERATE_MIPMAPS; + if (FAILED(hr = wined3d_texture_create(device->wined3d_device, &wined3d_desc, - 1, levels, 0, (struct wined3d_sub_resource_data *)data, texture, + 1, levels, flags, (struct wined3d_sub_resource_data *)data, texture, &d3d_texture3d_wined3d_parent_ops, &texture->wined3d_texture))) { WARN("Failed to create wined3d texture, hr %#x.\n", hr);
Signed-off-by: Henri Verbeet hverbeet@codeweavers.com
Signed-off-by: Matteo Bruni mbruni@codeweavers.com --- The wined3d function does nothing anyway. FWIW doing nothing is correct with the current automatic mipmap generation code based on SGIS_generate_mipmap. There are other issues with the current implementation but that's going away soon.
dlls/d3d9/texture.c | 18 ------------------ 1 file changed, 18 deletions(-)
diff --git a/dlls/d3d9/texture.c b/dlls/d3d9/texture.c index 5080eb38b9..96c8bc37bd 100644 --- a/dlls/d3d9/texture.c +++ b/dlls/d3d9/texture.c @@ -273,13 +273,7 @@ static D3DTEXTUREFILTERTYPE WINAPI d3d9_texture_2d_GetAutoGenFilterType(IDirect3
static void WINAPI d3d9_texture_2d_GenerateMipSubLevels(IDirect3DTexture9 *iface) { - struct d3d9_texture *texture = impl_from_IDirect3DTexture9(iface); - TRACE("iface %p.\n", iface); - - wined3d_mutex_lock(); - wined3d_texture_generate_mipmaps(texture->wined3d_texture); - wined3d_mutex_unlock(); }
static HRESULT WINAPI d3d9_texture_2d_GetLevelDesc(IDirect3DTexture9 *iface, UINT level, D3DSURFACE_DESC *desc) @@ -658,13 +652,7 @@ static D3DTEXTUREFILTERTYPE WINAPI d3d9_texture_cube_GetAutoGenFilterType(IDirec
static void WINAPI d3d9_texture_cube_GenerateMipSubLevels(IDirect3DCubeTexture9 *iface) { - struct d3d9_texture *texture = impl_from_IDirect3DCubeTexture9(iface); - TRACE("iface %p.\n", iface); - - wined3d_mutex_lock(); - wined3d_texture_generate_mipmaps(texture->wined3d_texture); - wined3d_mutex_unlock(); }
static HRESULT WINAPI d3d9_texture_cube_GetLevelDesc(IDirect3DCubeTexture9 *iface, UINT level, D3DSURFACE_DESC *desc) @@ -1055,13 +1043,7 @@ static D3DTEXTUREFILTERTYPE WINAPI d3d9_texture_3d_GetAutoGenFilterType(IDirect3
static void WINAPI d3d9_texture_3d_GenerateMipSubLevels(IDirect3DVolumeTexture9 *iface) { - struct d3d9_texture *texture = impl_from_IDirect3DVolumeTexture9(iface); - TRACE("iface %p.\n", iface); - - wined3d_mutex_lock(); - wined3d_texture_generate_mipmaps(texture->wined3d_texture); - wined3d_mutex_unlock(); }
static HRESULT WINAPI d3d9_texture_3d_GetLevelDesc(IDirect3DVolumeTexture9 *iface, UINT level, D3DVOLUME_DESC *desc)
Signed-off-by: Henri Verbeet hverbeet@codeweavers.com
On 4 December 2017 at 20:37, Matteo Bruni mbruni@codeweavers.com wrote:
Signed-off-by: Matteo Bruni mbruni@codeweavers.com
The wined3d function does nothing anyway. FWIW doing nothing is correct with the current automatic mipmap generation code based on SGIS_generate_mipmap. There are other issues with the current implementation but that's going away soon.
It would have been more proper to remove the export in this patch as well, instead of in the next.
Signed-off-by: Matteo Bruni mbruni@codeweavers.com --- dlls/wined3d/cs.c | 30 ++++++++++++ dlls/wined3d/texture.c | 11 ----- dlls/wined3d/view.c | 102 +++++++++++++++++++++++++++++++++++++++++ dlls/wined3d/wined3d.spec | 2 +- dlls/wined3d/wined3d_private.h | 2 + include/wine/wined3d.h | 2 +- 6 files changed, 136 insertions(+), 13 deletions(-)
diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c index f7c943e98e..dbe9f42beb 100644 --- a/dlls/wined3d/cs.c +++ b/dlls/wined3d/cs.c @@ -71,6 +71,7 @@ enum wined3d_cs_op WINED3D_CS_OP_ADD_DIRTY_TEXTURE_REGION, WINED3D_CS_OP_CLEAR_UNORDERED_ACCESS_VIEW, WINED3D_CS_OP_COPY_UAV_COUNTER, + WINED3D_CS_OP_GENERATE_MIPMAPS, WINED3D_CS_OP_STOP, };
@@ -421,6 +422,12 @@ struct wined3d_cs_copy_uav_counter struct wined3d_unordered_access_view *view; };
+struct wined3d_cs_generate_mipmaps +{ + enum wined3d_cs_op opcode; + struct wined3d_shader_resource_view *view; +}; + struct wined3d_cs_stop { enum wined3d_cs_op opcode; @@ -2336,6 +2343,28 @@ void wined3d_cs_emit_copy_uav_counter(struct wined3d_cs *cs, struct wined3d_buff cs->ops->submit(cs, WINED3D_CS_QUEUE_DEFAULT); }
+static void wined3d_cs_exec_generate_mipmaps(struct wined3d_cs *cs, const void *data) +{ + const struct wined3d_cs_generate_mipmaps *op = data; + struct wined3d_shader_resource_view *view = op->view; + + shader_resource_view_generate_mipmaps(view); + wined3d_resource_release(view->resource); +} + +void wined3d_cs_emit_generate_mipmaps(struct wined3d_cs *cs, struct wined3d_shader_resource_view *view) +{ + struct wined3d_cs_generate_mipmaps *op; + + op = cs->ops->require_space(cs, sizeof(*op), WINED3D_CS_QUEUE_DEFAULT); + op->opcode = WINED3D_CS_OP_GENERATE_MIPMAPS; + op->view = view; + + wined3d_resource_acquire(view->resource); + + cs->ops->submit(cs, WINED3D_CS_QUEUE_DEFAULT); +} + static void wined3d_cs_emit_stop(struct wined3d_cs *cs) { struct wined3d_cs_stop *op; @@ -2394,6 +2423,7 @@ static void (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void /* WINED3D_CS_OP_ADD_DIRTY_TEXTURE_REGION */ wined3d_cs_exec_add_dirty_texture_region, /* WINED3D_CS_OP_CLEAR_UNORDERED_ACCESS_VIEW */ wined3d_cs_exec_clear_unordered_access_view, /* WINED3D_CS_OP_COPY_UAV_COUNTER */ wined3d_cs_exec_copy_uav_counter, + /* WINED3D_CS_OP_GENERATE_MIPMAPS */ wined3d_cs_exec_generate_mipmaps, };
static void *wined3d_cs_st_require_space(struct wined3d_cs *cs, size_t size, enum wined3d_cs_queue_id queue_id) diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c index 7a8e1fb7d1..ddbe340dc8 100644 --- a/dlls/wined3d/texture.c +++ b/dlls/wined3d/texture.c @@ -1580,17 +1580,6 @@ BOOL wined3d_texture_prepare_location(struct wined3d_texture *texture, unsigned } }
-void CDECL wined3d_texture_generate_mipmaps(struct wined3d_texture *texture) -{ - FIXME("texture %p stub!\n", texture); - - if (!(texture->flags & WINED3D_TEXTURE_GENERATE_MIPMAPS)) - { - WARN("Texture without the WINED3D_TEXTURE_GENERATE_MIPMAPS flag, ignoring.\n"); - return; - } -} - static struct wined3d_texture_sub_resource *wined3d_texture_get_sub_resource(struct wined3d_texture *texture, unsigned int sub_resource_idx) { diff --git a/dlls/wined3d/view.c b/dlls/wined3d/view.c index b35b66bfeb..4463fabb6a 100644 --- a/dlls/wined3d/view.c +++ b/dlls/wined3d/view.c @@ -803,6 +803,108 @@ void wined3d_shader_resource_view_bind(struct wined3d_shader_resource_view *view wined3d_sampler_bind(sampler, unit, texture, context); }
+/* Context activation is done by the caller. */ +static void shader_resource_view_bind_and_dirtify(struct wined3d_shader_resource_view *view, + struct wined3d_context *context) +{ + if (context->active_texture < ARRAY_SIZE(context->rev_tex_unit_map)) + { + DWORD active_sampler = context->rev_tex_unit_map[context->active_texture]; + if (active_sampler != WINED3D_UNMAPPED_STAGE) + context_invalidate_state(context, STATE_SAMPLER(active_sampler)); + } + /* FIXME: Ideally we'd only do this when touching a binding that's used by + * a shader. */ + context_invalidate_compute_state(context, STATE_COMPUTE_SHADER_RESOURCE_BINDING); + context_invalidate_state(context, STATE_GRAPHICS_SHADER_RESOURCE_BINDING); + + context_bind_texture(context, view->gl_view.target, view->gl_view.name); +} + +void shader_resource_view_generate_mipmaps(struct wined3d_shader_resource_view *view) +{ + struct wined3d_texture *texture = texture_from_resource(view->resource); + unsigned int i, j, layer_count, level_count, base_level, max_level; + const struct wined3d_gl_info *gl_info; + struct wined3d_context *context; + struct gl_texture *gl_tex; + DWORD location; + BOOL srgb; + + TRACE("view %p.\n", view); + + wined3d_from_cs(view->resource->device->cs); + + context = context_acquire(view->resource->device, NULL, 0); + gl_info = context->gl_info; + layer_count = view->desc.u.texture.layer_count; + level_count = view->desc.u.texture.level_count; + base_level = view->desc.u.texture.level_idx; + max_level = base_level + level_count - 1; + + srgb = !!(texture->flags & WINED3D_TEXTURE_IS_SRGB); + location = srgb ? WINED3D_LOCATION_TEXTURE_SRGB : WINED3D_LOCATION_TEXTURE_RGB; + for (i = 0; i < layer_count; ++i) + wined3d_texture_load_location(texture, i * level_count + base_level, context, location); + if (view->gl_view.name) + shader_resource_view_bind_and_dirtify(view, context); + else + wined3d_texture_bind_and_dirtify(texture, context, srgb); + if (gl_info->supported[ARB_SAMPLER_OBJECTS]) + GL_EXTCALL(glBindSampler(context->active_texture, 0)); + gl_info->gl_ops.gl.p_glTexParameteri(texture->target, GL_TEXTURE_BASE_LEVEL, base_level); + gl_info->gl_ops.gl.p_glTexParameteri(texture->target, GL_TEXTURE_MAX_LEVEL, max_level); + gl_tex = wined3d_texture_get_gl_texture(texture, srgb); + if (context->d3d_info->wined3d_creation_flags & WINED3D_SRGB_READ_WRITE_CONTROL) + { + gl_info->gl_ops.gl.p_glTexParameteri(texture->target, GL_TEXTURE_SRGB_DECODE_EXT, + GL_SKIP_DECODE_EXT); + gl_tex->sampler_desc.srgb_decode = FALSE; + } + + gl_info->fbo_ops.glGenerateMipmap(texture->target); + checkGLcall("glGenerateMipMap()"); + + for (i = 0; i < layer_count; ++i) + { + for (j = base_level + 1; j <= max_level; ++j) + { + wined3d_texture_validate_location(texture, i * level_count + j, location); + wined3d_texture_invalidate_location(texture, i * level_count + j, ~location); + } + } + + gl_info->gl_ops.gl.p_glTexParameteri(texture->target, GL_TEXTURE_MAX_LEVEL, level_count - 1); + if (srgb) + texture->texture_srgb.base_level = base_level; + else + texture->texture_rgb.base_level = base_level; + + context_release(context); +} + +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_cs_emit_generate_mipmaps(view->resource->device->cs, 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 0825b93660..74e61eab39 100644 --- a/dlls/wined3d/wined3d.spec +++ b/dlls/wined3d/wined3d.spec @@ -254,6 +254,7 @@
@ 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)
@@ -287,7 +288,6 @@ @ cdecl wined3d_texture_create(ptr ptr long long long ptr ptr ptr ptr) @ cdecl wined3d_texture_decref(ptr) @ cdecl wined3d_texture_from_resource(ptr) -@ cdecl wined3d_texture_generate_mipmaps(ptr) @ cdecl wined3d_texture_get_autogen_filter_type(ptr) @ cdecl wined3d_texture_get_dc(ptr long ptr) @ cdecl wined3d_texture_get_level_count(ptr) diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h index da06ba159f..01f0e1695b 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h @@ -3508,6 +3508,7 @@ void wined3d_cs_emit_draw(struct wined3d_cs *cs, GLenum primitive_type, unsigned void wined3d_cs_emit_draw_indirect(struct wined3d_cs *cs, GLenum primitive_type, unsigned int patch_vertex_count, struct wined3d_buffer *buffer, unsigned int offset, BOOL indexed) 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, DWORD flags) DECLSPEC_HIDDEN; @@ -3705,6 +3706,7 @@ struct wined3d_shader_resource_view struct wined3d_view_desc desc; };
+void shader_resource_view_generate_mipmaps(struct wined3d_shader_resource_view *view) DECLSPEC_HIDDEN; void wined3d_shader_resource_view_bind(struct wined3d_shader_resource_view *view, unsigned int unit, struct wined3d_sampler *sampler, struct wined3d_context *context) DECLSPEC_HIDDEN;
diff --git a/include/wine/wined3d.h b/include/wine/wined3d.h index ad9fd1362b..282e7338db 100644 --- a/include/wine/wined3d.h +++ b/include/wine/wined3d.h @@ -2609,6 +2609,7 @@ 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);
@@ -2661,7 +2662,6 @@ HRESULT __cdecl wined3d_texture_create(struct wined3d_device *device, const stru void *parent, const struct wined3d_parent_ops *parent_ops, struct wined3d_texture **texture); struct wined3d_texture * __cdecl wined3d_texture_from_resource(struct wined3d_resource *resource); ULONG __cdecl wined3d_texture_decref(struct wined3d_texture *texture); -void __cdecl wined3d_texture_generate_mipmaps(struct wined3d_texture *texture); enum wined3d_texture_filter_type __cdecl wined3d_texture_get_autogen_filter_type(const struct wined3d_texture *texture); HRESULT __cdecl wined3d_texture_get_dc(struct wined3d_texture *texture, unsigned int sub_resource_idx, HDC *dc); DWORD __cdecl wined3d_texture_get_level_count(const struct wined3d_texture *texture);
Signed-off-by: Henri Verbeet hverbeet@codeweavers.com
On 4 December 2017 at 20:37, Matteo Bruni mbruni@codeweavers.com wrote:
+void shader_resource_view_generate_mipmaps(struct wined3d_shader_resource_view *view) +{
- struct wined3d_texture *texture = texture_from_resource(view->resource);
- unsigned int i, j, layer_count, level_count, base_level, max_level;
- const struct wined3d_gl_info *gl_info;
- struct wined3d_context *context;
- struct gl_texture *gl_tex;
- DWORD location;
- BOOL srgb;
- TRACE("view %p.\n", view);
- wined3d_from_cs(view->resource->device->cs);
- context = context_acquire(view->resource->device, NULL, 0);
- gl_info = context->gl_info;
- layer_count = view->desc.u.texture.layer_count;
- level_count = view->desc.u.texture.level_count;
- base_level = view->desc.u.texture.level_idx;
- max_level = base_level + level_count - 1;
- srgb = !!(texture->flags & WINED3D_TEXTURE_IS_SRGB);
The "!!" should be superfluous, strictly speaking.
- if (srgb)
texture->texture_srgb.base_level = base_level;
- else
texture->texture_rgb.base_level = base_level;
I.e., "gl_tex->base_level = base_level;"
Signed-off-by: Matteo Bruni mbruni@codeweavers.com --- dlls/d3d11/device.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-)
diff --git a/dlls/d3d11/device.c b/dlls/d3d11/device.c index 7a8f3df5a2..33b54af506 100644 --- a/dlls/d3d11/device.c +++ b/dlls/d3d11/device.c @@ -1135,7 +1135,11 @@ static void STDMETHODCALLTYPE d3d11_immediate_context_ClearDepthStencilView(ID3D static void STDMETHODCALLTYPE d3d11_immediate_context_GenerateMips(ID3D11DeviceContext *iface, ID3D11ShaderResourceView *view) { - FIXME("iface %p, view %p stub!\n", iface, view); + struct d3d_shader_resource_view *srv = unsafe_impl_from_ID3D11ShaderResourceView(view); + + TRACE("iface %p, view %p.\n", iface, view); + + wined3d_shader_resource_view_generate_mipmaps(srv->wined3d_view); }
static void STDMETHODCALLTYPE d3d11_immediate_context_SetResourceMinLOD(ID3D11DeviceContext *iface, @@ -4193,9 +4197,13 @@ static void STDMETHODCALLTYPE d3d10_device_ClearDepthStencilView(ID3D10Device1 * }
static void STDMETHODCALLTYPE d3d10_device_GenerateMips(ID3D10Device1 *iface, - ID3D10ShaderResourceView *shader_resource_view) + ID3D10ShaderResourceView *view) { - FIXME("iface %p, shader_resource_view %p stub!\n", iface, shader_resource_view); + struct d3d_shader_resource_view *srv = unsafe_impl_from_ID3D10ShaderResourceView(view); + + TRACE("iface %p, view %p.\n", iface, view); + + wined3d_shader_resource_view_generate_mipmaps(srv->wined3d_view); }
static void STDMETHODCALLTYPE d3d10_device_ResolveSubresource(ID3D10Device1 *iface,
Signed-off-by: Matteo Bruni mbruni@codeweavers.com --- v2: Add missing wined3d_mutex_[un]lock() calls...
Supersedes 139221.
dlls/d3d11/device.c | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-)
diff --git a/dlls/d3d11/device.c b/dlls/d3d11/device.c index 7a8f3df5a2..52817929b0 100644 --- a/dlls/d3d11/device.c +++ b/dlls/d3d11/device.c @@ -1135,7 +1135,13 @@ static void STDMETHODCALLTYPE d3d11_immediate_context_ClearDepthStencilView(ID3D static void STDMETHODCALLTYPE d3d11_immediate_context_GenerateMips(ID3D11DeviceContext *iface, ID3D11ShaderResourceView *view) { - FIXME("iface %p, view %p stub!\n", iface, view); + 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_mutex_unlock(); }
static void STDMETHODCALLTYPE d3d11_immediate_context_SetResourceMinLOD(ID3D11DeviceContext *iface, @@ -4193,9 +4199,15 @@ static void STDMETHODCALLTYPE d3d10_device_ClearDepthStencilView(ID3D10Device1 * }
static void STDMETHODCALLTYPE d3d10_device_GenerateMips(ID3D10Device1 *iface, - ID3D10ShaderResourceView *shader_resource_view) + ID3D10ShaderResourceView *view) { - FIXME("iface %p, shader_resource_view %p stub!\n", iface, shader_resource_view); + 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_mutex_unlock(); }
static void STDMETHODCALLTYPE d3d10_device_ResolveSubresource(ID3D10Device1 *iface,
Signed-off-by: Henri Verbeet hverbeet@codeweavers.com