On Jan 8, 2016 7:00 PM, "Ian Romanick" <i...@freedesktop.org> wrote: > > From: Ian Romanick <ian.d.roman...@intel.com> > > The path that depends on this will be avoided (by fallback_required) if > the extension is not supported. _mesa_set_sampler_srgb_decode does not > generate GL errors (by design), so there are no problems there.
Yes, drivers that don't support the extension will probably never check the flag so it shouldn't mess anything up to just always set it. > I kept this change separate and last because it is one of the few in the > series that is not a candidate for the stable branch. > > Signed-off-by: Ian Romanick <ian.d.roman...@intel.com> > --- > src/mesa/drivers/common/meta.c | 6 ++---- > src/mesa/drivers/common/meta_generate_mipmap.c | 9 ++------- > 2 files changed, 4 insertions(+), 11 deletions(-) > > diff --git a/src/mesa/drivers/common/meta.c b/src/mesa/drivers/common/meta.c > index b026e47..1ed0e4d 100644 > --- a/src/mesa/drivers/common/meta.c > +++ b/src/mesa/drivers/common/meta.c > @@ -3132,10 +3132,8 @@ decompress_texture_image(struct gl_context *ctx, > /* nearest filtering */ > _mesa_set_sampler_filters(ctx, decompress->samp_obj, GL_NEAREST, GL_NEAREST); > > - /* No sRGB decode or encode.*/ > - if (ctx->Extensions.EXT_texture_sRGB_decode) { > - _mesa_set_sampler_srgb_decode(ctx, decompress->samp_obj, GL_SKIP_DECODE_EXT); > - } > + /* We don't want to encode or decode sRGB values; treat them as linear. */ > + _mesa_set_sampler_srgb_decode(ctx, decompress->samp_obj, GL_SKIP_DECODE_EXT); > } > > _mesa_bind_sampler(ctx, ctx->Texture.CurrentUnit, decompress->samp_obj); > diff --git a/src/mesa/drivers/common/meta_generate_mipmap.c b/src/mesa/drivers/common/meta_generate_mipmap.c > index 7beae5f..f20fcac 100644 > --- a/src/mesa/drivers/common/meta_generate_mipmap.c > +++ b/src/mesa/drivers/common/meta_generate_mipmap.c > @@ -239,13 +239,8 @@ _mesa_meta_GenerateMipmap(struct gl_context *ctx, GLenum target, > _mesa_set_sampler_wrap(ctx, mipmap->samp_obj, GL_CLAMP_TO_EDGE, > GL_CLAMP_TO_EDGE, GL_CLAMP_TO_EDGE); > > - /* We don't want to encode or decode sRGB values; treat them as linear. > - * This is not technically correct for GLES3 but we don't get any API > - * error at the moment. > - */ > - if (ctx->Extensions.EXT_texture_sRGB_decode) { > - _mesa_set_sampler_srgb_decode(ctx, mipmap->samp_obj, GL_SKIP_DECODE_EXT); > - } > + /* We don't want to encode or decode sRGB values; treat them as linear. */ > + _mesa_set_sampler_srgb_decode(ctx, mipmap->samp_obj, GL_SKIP_DECODE_EXT); > } > > _mesa_bind_sampler(ctx, ctx->Texture.CurrentUnit, mipmap->samp_obj); > -- > 2.5.0 > > _______________________________________________ > mesa-dev mailing list > mesa-dev@lists.freedesktop.org > http://lists.freedesktop.org/mailman/listinfo/mesa-dev
_______________________________________________ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev