[virglrenderer-devel] [PATCH v2 1/2] vrend, feat: Add feat_texture_srgb_decode and protect calls

Tomeu Vizoso tomeu.vizoso at collabora.com
Wed Aug 1 05:14:31 UTC 2018


Have just tested both patches and they do what is in the box:

Tested-by: Tomeu Vizoso <tomeu.vizoso at collabora.com>

Thanks!

Tomeu

On 07/26/2018 03:03 PM, Gert Wollny wrote:
> This seems to be quite common, but we should still test for its
> availability because it doesn't seem to be part of any standard.
> 
> Signed-off-by: Gert Wollny <gert.wollny at collabora.com>
> ---
>   src/vrend_renderer.c | 9 ++++++---
>   1 file changed, 6 insertions(+), 3 deletions(-)
> 
> diff --git a/src/vrend_renderer.c b/src/vrend_renderer.c
> index 6536dd8..8829d97 100644
> --- a/src/vrend_renderer.c
> +++ b/src/vrend_renderer.c
> @@ -122,6 +122,7 @@ enum features_id
>      feat_texture_array,
>      feat_texture_buffer_range,
>      feat_texture_multisample,
> +   feat_texture_srgb_decode,
>      feat_texture_storage,
>      feat_texture_view,
>      feat_transform_feedback,
> @@ -174,6 +175,7 @@ static const  struct {
>      [feat_texture_array] = { 30, 30, { "GL_EXT_texture_array" } },
>      [feat_texture_buffer_range] = { 43, UNAVAIL, { "GL_ARB_texture_buffer_range" } },
>      [feat_texture_multisample] = { 32, 30, { "GL_ARB_texture_multisample" } },
> +   [feat_texture_srgb_decode] = { UNAVAIL, UNAVAIL, { "GL_EXT_texture_sRGB_decode" } },
>      [feat_texture_storage] = { 42, UNAVAIL, { "GL_ARB_texture_storage" } },
>      [feat_texture_view] = { 43, UNAVAIL, { "GL_ARB_texture_view" } },
>      [feat_transform_feedback] = { 30, 30, { "GL_EXT_transform_feedback" } },
> @@ -2355,7 +2357,7 @@ void vrend_set_single_sampler_view(struct vrend_context *ctx,
>            if (view->cur_srgb_decode != view->srgb_decode && util_format_is_srgb(view->format)) {
>               if (has_feature(feat_samplers))
>                  ctx->sub->sampler_state_dirty = true;
> -            else {
> +            else if (has_feature(feat_texture_srgb_decode)) {
>                  glTexParameteri(view->texture->target, GL_TEXTURE_SRGB_DECODE_EXT,
>                                  view->srgb_decode);
>                  view->cur_srgb_decode = view->srgb_decode;
> @@ -4428,8 +4430,9 @@ static void vrend_apply_sampler_state(struct vrend_context *ctx,
>            glSamplerParameterIuiv(vstate->id, GL_TEXTURE_BORDER_COLOR, border_color.ui);
>         }
>         glBindSampler(sampler_id, vstate->id);
> -      glSamplerParameteri(vstate->id, GL_TEXTURE_SRGB_DECODE_EXT,
> -                          srgb_decode);
> +      if (has_feature(feat_texture_srgb_decode))
> +         glSamplerParameteri(vstate->id, GL_TEXTURE_SRGB_DECODE_EXT,
> +                             srgb_decode);
>         return;
>      }
>   
> 


More information about the virglrenderer-devel mailing list