diff options
Diffstat (limited to 'src/mesa/main/samplerobj.c')
-rw-r--r-- | src/mesa/main/samplerobj.c | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/src/mesa/main/samplerobj.c b/src/mesa/main/samplerobj.c index 62078f8ad05..fe15508696e 100644 --- a/src/mesa/main/samplerobj.c +++ b/src/mesa/main/samplerobj.c @@ -270,6 +270,17 @@ _mesa_IsSampler(GLuint sampler) return sampObj != NULL; } +void +_mesa_bind_sampler(struct gl_context *ctx, GLuint unit, + struct gl_sampler_object *sampObj) +{ + if (ctx->Texture.Unit[unit].Sampler != sampObj) { + FLUSH_VERTICES(ctx, _NEW_TEXTURE); + } + + _mesa_reference_sampler_object(ctx, &ctx->Texture.Unit[unit].Sampler, + sampObj); +} void GLAPIENTRY _mesa_BindSampler(GLuint unit, GLuint sampler) @@ -297,13 +308,8 @@ _mesa_BindSampler(GLuint unit, GLuint sampler) } } - if (ctx->Texture.Unit[unit].Sampler != sampObj) { - FLUSH_VERTICES(ctx, _NEW_TEXTURE); - } - /* bind new sampler */ - _mesa_reference_sampler_object(ctx, &ctx->Texture.Unit[unit].Sampler, - sampObj); + _mesa_bind_sampler(ctx, unit, sampObj); } |