[-,Mesa,06/10] Revert "st/mesa: use sRGB formats for MSAA resolving if destination is sRGB"

Submitted by Kenneth Graunke on Aug. 4, 2016, 11:14 p.m.

Details

Message ID 20160804231451.9994-7-kenneth@whitecape.org
State New
Headers show
Series "Series without cover letter" ( rev: 1 ) in Piglit

Not browsing as part of any series.

Commit Message

Kenneth Graunke Aug. 4, 2016, 11:14 p.m.
This reverts commit 4e549ddb500cf677b6fa16d9ebdfa67cc23da097,
dropping the hack from Gallium that I just deleted from i965.

See the previous commit for rationale.
---
 src/mesa/state_tracker/st_cb_blit.c | 32 --------------------------------
 1 file changed, 32 deletions(-)

Patch hide | download patch | download mbox

diff --git a/src/mesa/state_tracker/st_cb_blit.c b/src/mesa/state_tracker/st_cb_blit.c
index 826152d..5e7c34c 100644
--- a/src/mesa/state_tracker/st_cb_blit.c
+++ b/src/mesa/state_tracker/st_cb_blit.c
@@ -46,34 +46,6 @@ 
 
 
 static void
-st_adjust_blit_for_msaa_resolve(struct pipe_blit_info *blit)
-{
-   /* Even though we do multisample resolves at the time of the blit, OpenGL
-    * specification defines them as if they happen at the time of rendering,
-    * which means that the type of averaging we do during the resolve should
-    * only depend on the source format; the destination format should be
-    * ignored. But, specification doesn't seem to be strict about it.
-    *
-    * It has been observed that mulitisample resolves produce slightly better
-    * looking images when averaging is done using destination format. NVIDIA's
-    * proprietary OpenGL driver also follows this approach.
-    *
-    * When multisampling, if the source and destination formats are equal
-    * (aside from the color space), we choose to blit in sRGB space to get
-    * this higher quality image.
-    */
-   if (blit->src.resource->nr_samples > 1 &&
-       blit->dst.resource->nr_samples <= 1) {
-      blit->dst.format = blit->dst.resource->format;
-
-      if (util_format_is_srgb(blit->dst.resource->format))
-         blit->src.format = util_format_srgb(blit->src.resource->format);
-      else
-         blit->src.format = util_format_linear(blit->src.resource->format);
-   }
-}
-
-static void
 st_BlitFramebuffer(struct gl_context *ctx,
                    struct gl_framebuffer *readFB,
                    struct gl_framebuffer *drawFB,
@@ -232,8 +204,6 @@  st_BlitFramebuffer(struct gl_context *ctx,
                   blit.src.box.z = srcAtt->Zoffset + srcAtt->CubeMapFace;
                   blit.src.format = util_format_linear(srcObj->pt->format);
 
-                  st_adjust_blit_for_msaa_resolve(&blit);
-
                   st->pipe->blit(st->pipe, &blit);
                   dstRb->defined = true; /* front buffer tracking */
                }
@@ -270,8 +240,6 @@  st_BlitFramebuffer(struct gl_context *ctx,
                   blit.src.box.z = srcSurf->u.tex.first_layer;
                   blit.src.format = util_format_linear(srcSurf->format);
 
-                  st_adjust_blit_for_msaa_resolve(&blit);
-
                   st->pipe->blit(st->pipe, &blit);
                   dstRb->defined = true; /* front buffer tracking */
                }

Comments

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>

On 05.08.2016 01:14, Kenneth Graunke wrote:
> This reverts commit 4e549ddb500cf677b6fa16d9ebdfa67cc23da097,
> dropping the hack from Gallium that I just deleted from i965.
>
> See the previous commit for rationale.
> ---
>  src/mesa/state_tracker/st_cb_blit.c | 32 --------------------------------
>  1 file changed, 32 deletions(-)
>
> diff --git a/src/mesa/state_tracker/st_cb_blit.c b/src/mesa/state_tracker/st_cb_blit.c
> index 826152d..5e7c34c 100644
> --- a/src/mesa/state_tracker/st_cb_blit.c
> +++ b/src/mesa/state_tracker/st_cb_blit.c
> @@ -46,34 +46,6 @@
>
>
>  static void
> -st_adjust_blit_for_msaa_resolve(struct pipe_blit_info *blit)
> -{
> -   /* Even though we do multisample resolves at the time of the blit, OpenGL
> -    * specification defines them as if they happen at the time of rendering,
> -    * which means that the type of averaging we do during the resolve should
> -    * only depend on the source format; the destination format should be
> -    * ignored. But, specification doesn't seem to be strict about it.
> -    *
> -    * It has been observed that mulitisample resolves produce slightly better
> -    * looking images when averaging is done using destination format. NVIDIA's
> -    * proprietary OpenGL driver also follows this approach.
> -    *
> -    * When multisampling, if the source and destination formats are equal
> -    * (aside from the color space), we choose to blit in sRGB space to get
> -    * this higher quality image.
> -    */
> -   if (blit->src.resource->nr_samples > 1 &&
> -       blit->dst.resource->nr_samples <= 1) {
> -      blit->dst.format = blit->dst.resource->format;
> -
> -      if (util_format_is_srgb(blit->dst.resource->format))
> -         blit->src.format = util_format_srgb(blit->src.resource->format);
> -      else
> -         blit->src.format = util_format_linear(blit->src.resource->format);
> -   }
> -}
> -
> -static void
>  st_BlitFramebuffer(struct gl_context *ctx,
>                     struct gl_framebuffer *readFB,
>                     struct gl_framebuffer *drawFB,
> @@ -232,8 +204,6 @@ st_BlitFramebuffer(struct gl_context *ctx,
>                    blit.src.box.z = srcAtt->Zoffset + srcAtt->CubeMapFace;
>                    blit.src.format = util_format_linear(srcObj->pt->format);
>
> -                  st_adjust_blit_for_msaa_resolve(&blit);
> -
>                    st->pipe->blit(st->pipe, &blit);
>                    dstRb->defined = true; /* front buffer tracking */
>                 }
> @@ -270,8 +240,6 @@ st_BlitFramebuffer(struct gl_context *ctx,
>                    blit.src.box.z = srcSurf->u.tex.first_layer;
>                    blit.src.format = util_format_linear(srcSurf->format);
>
> -                  st_adjust_blit_for_msaa_resolve(&blit);
> -
>                    st->pipe->blit(st->pipe, &blit);
>                    dstRb->defined = true; /* front buffer tracking */
>                 }
>