mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-03-06 05:40:30 +01:00
st/mesa: fix handling the fallback texture
This fixes crash when post-processing is enabled in SW:KotOR. v2: fix const-ness v3: move assignment into the if() block Signed-off-by: Miklós Máté <mtmkls@gmail.com> Signed-off-by: Marek Olšák <marek.olsak@amd.com>
This commit is contained in:
parent
920fbecf57
commit
baab345b19
1 changed files with 4 additions and 3 deletions
|
|
@ -133,18 +133,19 @@ 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;
|
||||
if (!texobj) {
|
||||
texobj = _mesa_get_fallback_texture(ctx, TEXTURE_2D_INDEX);
|
||||
msamp = &texobj->Sampler;
|
||||
} else {
|
||||
msamp = _mesa_get_samplerobj(ctx, texUnit);
|
||||
}
|
||||
|
||||
texBaseFormat = _mesa_texture_base_format(texobj);
|
||||
|
||||
msamp = _mesa_get_samplerobj(ctx, texUnit);
|
||||
|
||||
memset(sampler, 0, sizeof(*sampler));
|
||||
sampler->wrap_s = gl_wrap_xlate(msamp->WrapS);
|
||||
sampler->wrap_t = gl_wrap_xlate(msamp->WrapT);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue