[Mesa-dev] [PATCH 5/7] st/mesa: fix handling the fallback texture

Miklós Máté mtmkls at gmail.com
Fri Feb 5 21:11:17 UTC 2016


v2: fix const-ness
---
 src/mesa/state_tracker/st_atom_sampler.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/src/mesa/state_tracker/st_atom_sampler.c b/src/mesa/state_tracker/st_atom_sampler.c
index 94231cf..7c8fa13 100644
--- a/src/mesa/state_tracker/st_atom_sampler.c
+++ b/src/mesa/state_tracker/st_atom_sampler.c
@@ -133,7 +133,7 @@ convert_sampler(struct st_context *st,
 {
    const struct gl_texture_object *texobj;
    struct gl_context *ctx = st->ctx;
-   struct gl_sampler_object *msamp;
+   const struct gl_sampler_object *msamp;
    GLenum texBaseFormat;
 
    texobj = ctx->Texture.Unit[texUnit]._Current;
@@ -144,6 +144,10 @@ convert_sampler(struct st_context *st,
    texBaseFormat = _mesa_texture_base_format(texobj);
 
    msamp = _mesa_get_samplerobj(ctx, texUnit);
+   if (!msamp) {
+      /* handle the fallback texture */
+      msamp = &texobj->Sampler;
+   }
 
    memset(sampler, 0, sizeof(*sampler));
    sampler->wrap_s = gl_wrap_xlate(msamp->WrapS);
-- 
2.7.0



More information about the mesa-dev mailing list