[PATCH] wined3d: bind default sampler object when setting sampler state with no texture.

Matteo Bruni matteo.mystral at gmail.com
Mon Feb 22 17:07:27 CST 2016


2016-02-20 15:00 GMT+01:00 Paul Gofman <gofmanp at gmail.com>:
> When sampler state was applied and no stage texture was present in state, no glBindSampler
> was issued for the stage after dummy texture was bound, and previously bound
> sampler was still active. This could result in undefined behaviour, especially if previously
> bound sampler was a shadow sample (this caused warnings from Nvidia driver).
>
> Signed-off-by: Paul Gofman <gofmanp at gmail.com>
> ---
>  dlls/wined3d/state.c | 5 +++++
>  1 file changed, 5 insertions(+)
>
> diff --git a/dlls/wined3d/state.c b/dlls/wined3d/state.c
> index 60bfd41..aa13a95 100644
> --- a/dlls/wined3d/state.c
> +++ b/dlls/wined3d/state.c
> @@ -3627,6 +3627,11 @@ static void sampler(struct wined3d_context *context, const struct wined3d_state
>      else
>      {
>          context_bind_texture(context, GL_NONE, 0);
> +        if (gl_info->supported[ARB_SAMPLER_OBJECTS])
> +        {
> +            GL_EXTCALL(glBindSampler(mapped_stage, 0));
> +            checkGLcall("glBindSampler");
> +        }
>      }
>  }
>
> --
> 2.5.0

Henri is away this week so this patch will probably have to wait until
he's back. FWIW I think this patch is fine, thank you.



More information about the wine-devel mailing list