Commit cce051b7 authored by Henri Verbeet's avatar Henri Verbeet Committed by Alexandre Julliard

d3d11: Ensure sampler max_lod is >= min_lod.

A maximum level of detail smaller than the minimum is poorly defined in OpenGL and D3D, and disallowed by Vulkan. Found by the Vulkan validation layers. Signed-off-by: 's avatarHenri Verbeet <hverbeet@codeweavers.com> Signed-off-by: 's avatarAlexandre Julliard <julliard@winehq.org>
parent 98137fae
......@@ -1551,7 +1551,7 @@ static HRESULT d3d_sampler_state_init(struct d3d_sampler_state *state, struct d3
wined3d_desc.mip_filter = wined3d_texture_filter_mip_from_d3d11(desc->Filter);
wined3d_desc.lod_bias = desc->MipLODBias;
wined3d_desc.min_lod = desc->MinLOD;
wined3d_desc.max_lod = desc->MaxLOD;
wined3d_desc.max_lod = max(desc->MinLOD, desc->MaxLOD);
wined3d_desc.mip_base_level = 0;
wined3d_desc.max_anisotropy = D3D11_DECODE_IS_ANISOTROPIC_FILTER(desc->Filter) ? desc->MaxAnisotropy : 1;
wined3d_desc.compare = wined3d_texture_compare_from_d3d11(desc->Filter);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment