gallivm: disable accurate cube corner for integer textures.

Submitted by Dave Airlie on Aug. 29, 2019, 8:06 p.m.

Details

Message ID 20190829200657.23063-1-airlied@gmail.com
State New
Headers show
Series "gallivm: disable accurate cube corner for integer textures." ( rev: 1 ) in Mesa

Not browsing as part of any series.

Commit Message

Dave Airlie Aug. 29, 2019, 8:06 p.m.
From: Dave Airlie <airlied@redhat.com>

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=111511
---
 src/gallium/auxiliary/gallivm/lp_bld_sample_soa.c | 4 ++++
 1 file changed, 4 insertions(+)

Patch hide | download patch | download mbox

diff --git a/src/gallium/auxiliary/gallivm/lp_bld_sample_soa.c b/src/gallium/auxiliary/gallivm/lp_bld_sample_soa.c
index adb6adf143a..69dba78ac8a 100644
--- a/src/gallium/auxiliary/gallivm/lp_bld_sample_soa.c
+++ b/src/gallium/auxiliary/gallivm/lp_bld_sample_soa.c
@@ -1039,6 +1039,10 @@  lp_build_sample_image_linear(struct lp_build_sample_context *bld,
 
    accurate_cube_corners = ACCURATE_CUBE_CORNERS && seamless_cube_filter;
 
+   /* disable accurate cube corners for integer textures. */
+   if (is_gather && util_format_is_pure_integer(bld->static_texture_state->format))
+      accurate_cube_corners = FALSE;
+
    lp_build_extract_image_sizes(bld,
                                 &bld->int_size_bld,
                                 bld->int_coord_type,

Comments

Am 29.08.19 um 22:06 schrieb Dave Airlie:
> From: Dave Airlie <airlied@redhat.com>
> 
> Bugzilla: https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fbugs.freedesktop.org%2Fshow_bug.cgi%3Fid%3D111511&amp;data=02%7C01%7Csroland%40vmware.com%7Cfec452f1a7bc48fdf26c08d72cbc7631%7Cb39138ca3cee4b4aa4d6cd83d9dd62f0%7C0%7C0%7C637027060290077242&amp;sdata=DIFdJJllTfLtwIYd5GJVUNmCx9ecNrNKRrbSg9qkMy8%3D&amp;reserved=0
> ---
>  src/gallium/auxiliary/gallivm/lp_bld_sample_soa.c | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/src/gallium/auxiliary/gallivm/lp_bld_sample_soa.c b/src/gallium/auxiliary/gallivm/lp_bld_sample_soa.c
> index adb6adf143a..69dba78ac8a 100644
> --- a/src/gallium/auxiliary/gallivm/lp_bld_sample_soa.c
> +++ b/src/gallium/auxiliary/gallivm/lp_bld_sample_soa.c
> @@ -1039,6 +1039,10 @@ lp_build_sample_image_linear(struct lp_build_sample_context *bld,
>  
>     accurate_cube_corners = ACCURATE_CUBE_CORNERS && seamless_cube_filter;
>  
> +   /* disable accurate cube corners for integer textures. */
> +   if (is_gather && util_format_is_pure_integer(bld->static_texture_state->format))
> +      accurate_cube_corners = FALSE;

I think should drop the is_gather condition - it would crash all the
same if it ends up here (which it shouldn't as the texture would be
incomplete in this case).

So just accurate_cube_corners = ACCURATE_CUBE_CORNERS &&
seamless_cube_filter && !util_format_is_pure_integer()
(maybe with a comment that we should only end up with the linear image
path here in case of gather).
With that fixed,
Reviewed-by: Roland Scheidegger <sroland@vmware.com>


>     lp_build_extract_image_sizes(bld,
>                                  &bld->int_size_bld,
>                                  bld->int_coord_type,
>