[Mesa-dev,4/4] st/dri: enable 3D textures and sRGB colorspace for EGL

Submitted by Marek Olšák on July 12, 2015, 7:10 p.m.

Details

Message ID 1436728246-29478-5-git-send-email-maraeo@gmail.com
State New
Headers show

Not browsing as part of any series.

Commit Message

Marek Olšák July 12, 2015, 7:10 p.m.
From: Anatoli Antonovitch <anatoli.antonovitch@amd.com>

---
 src/gallium/state_trackers/dri/dri_query_renderer.c | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

Patch hide | download patch | download mbox

diff --git a/src/gallium/state_trackers/dri/dri_query_renderer.c b/src/gallium/state_trackers/dri/dri_query_renderer.c
index 4a28ac3..ea31b6c 100644
--- a/src/gallium/state_trackers/dri/dri_query_renderer.c
+++ b/src/gallium/state_trackers/dri/dri_query_renderer.c
@@ -42,6 +42,20 @@  dri2_query_renderer_integer(__DRIscreen *_screen, int param,
                                                       PIPE_CAP_UMA);
       return 0;
 
+   case __DRI2_RENDERER_HAS_TEXTURE_3D:
+      value[0] =
+         screen->base.screen->get_param(screen->base.screen,
+                                        PIPE_CAP_MAX_TEXTURE_3D_LEVELS) != 0;
+      return 0;
+
+   case __DRI2_RENDERER_HAS_FRAMEBUFFER_SRGB:
+      value[0] =
+         screen->base.screen->is_format_supported(screen->base.screen,
+                                                  PIPE_FORMAT_B8G8R8A8_SRGB,
+                                                  PIPE_TEXTURE_2D, 0,
+                                                  PIPE_BIND_RENDER_TARGET);
+      return 0;
+
    default:
       return driQueryRendererIntegerCommon(_screen, param, value);
    }

Comments

On 12 July 2015 at 20:10, Marek Olšák <maraeo@gmail.com> wrote:
> From: Anatoli Antonovitch <anatoli.antonovitch@amd.com>
>
> ---
>  src/gallium/state_trackers/dri/dri_query_renderer.c | 14 ++++++++++++++
>  1 file changed, 14 insertions(+)
>
> diff --git a/src/gallium/state_trackers/dri/dri_query_renderer.c b/src/gallium/state_trackers/dri/dri_query_renderer.c
> index 4a28ac3..ea31b6c 100644
> --- a/src/gallium/state_trackers/dri/dri_query_renderer.c
> +++ b/src/gallium/state_trackers/dri/dri_query_renderer.c
> @@ -42,6 +42,20 @@ dri2_query_renderer_integer(__DRIscreen *_screen, int param,
>                                                        PIPE_CAP_UMA);
>        return 0;
>
> +   case __DRI2_RENDERER_HAS_TEXTURE_3D:
> +      value[0] =
> +         screen->base.screen->get_param(screen->base.screen,
> +                                        PIPE_CAP_MAX_TEXTURE_3D_LEVELS) != 0;
> +      return 0;
> +
> +   case __DRI2_RENDERER_HAS_FRAMEBUFFER_SRGB:
> +      value[0] =
> +         screen->base.screen->is_format_supported(screen->base.screen,
> +                                                  PIPE_FORMAT_B8G8R8A8_SRGB,
From a quick look some drivers that handle PIPE_FORMAT_B8G8R8A8_SRGB
are not so keen on PIPE_FORMAT_B8G8R8X8_SRGB. Should the state-tracker
handle/have a fall-back for this (set the alpha channel to max and use
the former format), or it is a driver decision ?

Cheers,
Emil
On Thu, Jul 16, 2015 at 3:14 PM, Emil Velikov <emil.l.velikov@gmail.com> wrote:
> On 12 July 2015 at 20:10, Marek Olšák <maraeo@gmail.com> wrote:
>> From: Anatoli Antonovitch <anatoli.antonovitch@amd.com>
>>
>> ---
>>  src/gallium/state_trackers/dri/dri_query_renderer.c | 14 ++++++++++++++
>>  1 file changed, 14 insertions(+)
>>
>> diff --git a/src/gallium/state_trackers/dri/dri_query_renderer.c b/src/gallium/state_trackers/dri/dri_query_renderer.c
>> index 4a28ac3..ea31b6c 100644
>> --- a/src/gallium/state_trackers/dri/dri_query_renderer.c
>> +++ b/src/gallium/state_trackers/dri/dri_query_renderer.c
>> @@ -42,6 +42,20 @@ dri2_query_renderer_integer(__DRIscreen *_screen, int param,
>>                                                        PIPE_CAP_UMA);
>>        return 0;
>>
>> +   case __DRI2_RENDERER_HAS_TEXTURE_3D:
>> +      value[0] =
>> +         screen->base.screen->get_param(screen->base.screen,
>> +                                        PIPE_CAP_MAX_TEXTURE_3D_LEVELS) != 0;
>> +      return 0;
>> +
>> +   case __DRI2_RENDERER_HAS_FRAMEBUFFER_SRGB:
>> +      value[0] =
>> +         screen->base.screen->is_format_supported(screen->base.screen,
>> +                                                  PIPE_FORMAT_B8G8R8A8_SRGB,
> From a quick look some drivers that handle PIPE_FORMAT_B8G8R8A8_SRGB
> are not so keen on PIPE_FORMAT_B8G8R8X8_SRGB. Should the state-tracker
> handle/have a fall-back for this (set the alpha channel to max and use
> the former format), or it is a driver decision ?

If a driver doesn't support PIPE_FORMAT_B8G8R8X8_SRGB, such a DRI
config isn't even created, so I think the driver cannot receive a
visual requesting that format.

Marek