Commit 510c8e39 authored by Józef Kucia's avatar Józef Kucia Committed by Alexandre Julliard

wined3d: Use dcl_sampler to determine if shadow sampler is needed.

parent d563cdb0
...@@ -869,6 +869,11 @@ static HRESULT shader_get_registers_used(struct wined3d_shader *shader, const st ...@@ -869,6 +869,11 @@ static HRESULT shader_get_registers_used(struct wined3d_shader *shader, const st
FIXME("Invalid instruction %#x for shader type %#x.\n", FIXME("Invalid instruction %#x for shader type %#x.\n",
ins.handler_idx, shader_version.type); ins.handler_idx, shader_version.type);
} }
else if (ins.handler_idx == WINED3DSIH_DCL_SAMPLER)
{
if (ins.flags & WINED3DSI_SAMPLER_COMPARISON_MODE)
reg_maps->sampler_comparison_mode |= (1u << ins.declaration.dst.reg.idx[0].offset);
}
else if (ins.handler_idx == WINED3DSIH_DCL_VERTICES_OUT) else if (ins.handler_idx == WINED3DSIH_DCL_VERTICES_OUT)
{ {
if (shader_version.type == WINED3D_SHADER_TYPE_GEOMETRY) if (shader_version.type == WINED3D_SHADER_TYPE_GEOMETRY)
...@@ -2790,6 +2795,11 @@ void find_ps_compile_args(const struct wined3d_state *state, const struct wined3 ...@@ -2790,6 +2795,11 @@ void find_ps_compile_args(const struct wined3d_state *state, const struct wined3
if (!(texture->flags & WINED3D_TEXTURE_POW2_MAT_IDENT)) if (!(texture->flags & WINED3D_TEXTURE_POW2_MAT_IDENT))
args->np2_fixup |= (1u << i); args->np2_fixup |= (1u << i);
} }
/* In SM4+ we use dcl_sampler in order to determine if we should use shadow sampler. */
if (shader->reg_maps.shader_version.major >= 4)
args->shadow = 0;
if (shader->reg_maps.shader_version.major >= 3) if (shader->reg_maps.shader_version.major >= 3)
{ {
if (position_transformed) if (position_transformed)
......
...@@ -711,6 +711,7 @@ struct wined3d_shader_reg_maps ...@@ -711,6 +711,7 @@ struct wined3d_shader_reg_maps
struct wined3d_shader_resource_info resource_info[max(MAX_FRAGMENT_SAMPLERS, MAX_VERTEX_SAMPLERS)]; struct wined3d_shader_resource_info resource_info[max(MAX_FRAGMENT_SAMPLERS, MAX_VERTEX_SAMPLERS)];
struct wined3d_shader_sampler_map sampler_map; struct wined3d_shader_sampler_map sampler_map;
DWORD sampler_comparison_mode;
BYTE bumpmat; /* MAX_TEXTURES, 8 */ BYTE bumpmat; /* MAX_TEXTURES, 8 */
BYTE luminanceparams; /* MAX_TEXTURES, 8 */ BYTE luminanceparams; /* MAX_TEXTURES, 8 */
......
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