diff options
author | Eric Anholt <eric@anholt.net> | 2020-12-09 11:33:16 -0800 |
---|---|---|
committer | Dylan Baker <dylan.c.baker@intel.com> | 2020-12-09 19:15:48 -0800 |
commit | 7f485f1e8f86c47b63ad7eeffe62315acc01e991 (patch) | |
tree | bae94600b64a3f86896ab07552cdd1c2b2c86beb | |
parent | 4e05bd1d134428dd7014f36f260c4cda988077f8 (diff) |
softpipe: Fix swizzled texture gather of int textures.
We need to pick 1u vs 1.0f based on the type of the texture, just like for
normal samples. Move the decision up to the create_sampler_view, and use
that value from both sampler paths.
Cc: mesa-stable
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8012>
(cherry picked from commit 4ba884b8140fc64d433959cbe9ef46fa12f4fd07)
-rw-r--r-- | .gitlab-ci/deqp-softpipe-fails.txt | 56 | ||||
-rw-r--r-- | .pick_status.json | 2 | ||||
-rw-r--r-- | src/gallium/drivers/softpipe/sp_tex_sample.c | 14 | ||||
-rw-r--r-- | src/gallium/drivers/softpipe/sp_tex_sample.h | 2 |
4 files changed, 11 insertions, 63 deletions
diff --git a/.gitlab-ci/deqp-softpipe-fails.txt b/.gitlab-ci/deqp-softpipe-fails.txt index bb1cd2c634f..d084b31577e 100644 --- a/.gitlab-ci/deqp-softpipe-fails.txt +++ b/.gitlab-ci/deqp-softpipe-fails.txt @@ -565,55 +565,15 @@ dEQP-GLES31.functional.texture.filtering.cube_array.sizes.63x63x18_nearest_mipma dEQP-GLES31.functional.texture.filtering.cube_array.sizes.64x64x12_nearest_mipmap_linear,Fail dEQP-GLES31.functional.texture.filtering.cube_array.sizes.64x64x12_nearest_mipmap_nearest,Fail dEQP-GLES31.functional.texture.filtering.cube_array.sizes.8x8x6_nearest,Fail -dEQP-GLES31.functional.texture.gather.basic.2d.rgba8i.texture_swizzle.alpha_zero_one_red,Fail -dEQP-GLES31.functional.texture.gather.basic.2d.rgba8i.texture_swizzle.blue_alpha_zero_one,Fail -dEQP-GLES31.functional.texture.gather.basic.2d.rgba8i.texture_swizzle.one_red_green_blue,Fail -dEQP-GLES31.functional.texture.gather.basic.2d.rgba8i.texture_swizzle.zero_one_red_green,Fail -dEQP-GLES31.functional.texture.gather.basic.2d.rgba8ui.texture_swizzle.alpha_zero_one_red,Fail -dEQP-GLES31.functional.texture.gather.basic.2d.rgba8ui.texture_swizzle.blue_alpha_zero_one,Fail -dEQP-GLES31.functional.texture.gather.basic.2d.rgba8ui.texture_swizzle.one_red_green_blue,Fail -dEQP-GLES31.functional.texture.gather.basic.2d.rgba8ui.texture_swizzle.zero_one_red_green,Fail -dEQP-GLES31.functional.texture.gather.basic.2d_array.rgba8i.texture_swizzle.alpha_zero_one_red,Fail -dEQP-GLES31.functional.texture.gather.basic.2d_array.rgba8i.texture_swizzle.blue_alpha_zero_one,Fail -dEQP-GLES31.functional.texture.gather.basic.2d_array.rgba8i.texture_swizzle.one_red_green_blue,Fail -dEQP-GLES31.functional.texture.gather.basic.2d_array.rgba8i.texture_swizzle.zero_one_red_green,Fail -dEQP-GLES31.functional.texture.gather.basic.2d_array.rgba8ui.texture_swizzle.alpha_zero_one_red,Fail -dEQP-GLES31.functional.texture.gather.basic.2d_array.rgba8ui.texture_swizzle.blue_alpha_zero_one,Fail -dEQP-GLES31.functional.texture.gather.basic.2d_array.rgba8ui.texture_swizzle.one_red_green_blue,Fail -dEQP-GLES31.functional.texture.gather.basic.2d_array.rgba8ui.texture_swizzle.zero_one_red_green,Fail dEQP-GLES31.functional.texture.gather.basic.cube.rgba8.no_corners.size_pot.clamp_to_edge_repeat,Fail dEQP-GLES31.functional.texture.gather.basic.cube.rgba8.no_corners.size_pot.mirrored_repeat_clamp_to_edge,Fail dEQP-GLES31.functional.texture.gather.basic.cube.rgba8.no_corners.size_pot.repeat_mirrored_repeat,Fail dEQP-GLES31.functional.texture.gather.basic.cube.rgba8i.no_corners.size_pot.clamp_to_edge_repeat,Fail dEQP-GLES31.functional.texture.gather.basic.cube.rgba8i.no_corners.size_pot.mirrored_repeat_clamp_to_edge,Fail dEQP-GLES31.functional.texture.gather.basic.cube.rgba8i.no_corners.size_pot.repeat_mirrored_repeat,Fail -dEQP-GLES31.functional.texture.gather.basic.cube.rgba8i.texture_swizzle.alpha_zero_one_red,Fail -dEQP-GLES31.functional.texture.gather.basic.cube.rgba8i.texture_swizzle.blue_alpha_zero_one,Fail -dEQP-GLES31.functional.texture.gather.basic.cube.rgba8i.texture_swizzle.one_red_green_blue,Fail -dEQP-GLES31.functional.texture.gather.basic.cube.rgba8i.texture_swizzle.zero_one_red_green,Fail dEQP-GLES31.functional.texture.gather.basic.cube.rgba8ui.no_corners.size_pot.clamp_to_edge_repeat,Fail dEQP-GLES31.functional.texture.gather.basic.cube.rgba8ui.no_corners.size_pot.mirrored_repeat_clamp_to_edge,Fail dEQP-GLES31.functional.texture.gather.basic.cube.rgba8ui.no_corners.size_pot.repeat_mirrored_repeat,Fail -dEQP-GLES31.functional.texture.gather.basic.cube.rgba8ui.texture_swizzle.alpha_zero_one_red,Fail -dEQP-GLES31.functional.texture.gather.basic.cube.rgba8ui.texture_swizzle.blue_alpha_zero_one,Fail -dEQP-GLES31.functional.texture.gather.basic.cube.rgba8ui.texture_swizzle.one_red_green_blue,Fail -dEQP-GLES31.functional.texture.gather.basic.cube.rgba8ui.texture_swizzle.zero_one_red_green,Fail -dEQP-GLES31.functional.texture.gather.offset.implementation_offset.2d.rgba8i.texture_swizzle.alpha_zero_one_red,Fail -dEQP-GLES31.functional.texture.gather.offset.implementation_offset.2d.rgba8i.texture_swizzle.blue_alpha_zero_one,Fail -dEQP-GLES31.functional.texture.gather.offset.implementation_offset.2d.rgba8i.texture_swizzle.one_red_green_blue,Fail -dEQP-GLES31.functional.texture.gather.offset.implementation_offset.2d.rgba8i.texture_swizzle.zero_one_red_green,Fail -dEQP-GLES31.functional.texture.gather.offset.implementation_offset.2d.rgba8ui.texture_swizzle.alpha_zero_one_red,Fail -dEQP-GLES31.functional.texture.gather.offset.implementation_offset.2d.rgba8ui.texture_swizzle.blue_alpha_zero_one,Fail -dEQP-GLES31.functional.texture.gather.offset.implementation_offset.2d.rgba8ui.texture_swizzle.one_red_green_blue,Fail -dEQP-GLES31.functional.texture.gather.offset.implementation_offset.2d.rgba8ui.texture_swizzle.zero_one_red_green,Fail -dEQP-GLES31.functional.texture.gather.offset.implementation_offset.2d_array.rgba8i.texture_swizzle.alpha_zero_one_red,Fail -dEQP-GLES31.functional.texture.gather.offset.implementation_offset.2d_array.rgba8i.texture_swizzle.blue_alpha_zero_one,Fail -dEQP-GLES31.functional.texture.gather.offset.implementation_offset.2d_array.rgba8i.texture_swizzle.one_red_green_blue,Fail -dEQP-GLES31.functional.texture.gather.offset.implementation_offset.2d_array.rgba8i.texture_swizzle.zero_one_red_green,Fail -dEQP-GLES31.functional.texture.gather.offset.implementation_offset.2d_array.rgba8ui.texture_swizzle.alpha_zero_one_red,Fail -dEQP-GLES31.functional.texture.gather.offset.implementation_offset.2d_array.rgba8ui.texture_swizzle.blue_alpha_zero_one,Fail -dEQP-GLES31.functional.texture.gather.offset.implementation_offset.2d_array.rgba8ui.texture_swizzle.one_red_green_blue,Fail -dEQP-GLES31.functional.texture.gather.offset.implementation_offset.2d_array.rgba8ui.texture_swizzle.zero_one_red_green,Fail dEQP-GLES31.functional.texture.gather.offset_dynamic.implementation_offset.2d.depth32f.base_level.level_1,Fail dEQP-GLES31.functional.texture.gather.offset_dynamic.implementation_offset.2d.depth32f.base_level.level_2,Fail dEQP-GLES31.functional.texture.gather.offset_dynamic.implementation_offset.2d.depth32f.filter_mode.min_linear_mag_linear,Fail @@ -810,22 +770,6 @@ dEQP-GLES31.functional.texture.gather.offset_dynamic.min_required_offset.2d_arra dEQP-GLES31.functional.texture.gather.offset_dynamic.min_required_offset.2d_array.rgba8ui.size_pot.clamp_to_edge_repeat,Fail dEQP-GLES31.functional.texture.gather.offset_dynamic.min_required_offset.2d_array.rgba8ui.size_pot.mirrored_repeat_clamp_to_edge,Fail dEQP-GLES31.functional.texture.gather.offset_dynamic.min_required_offset.2d_array.rgba8ui.size_pot.repeat_mirrored_repeat,Fail -dEQP-GLES31.functional.texture.gather.offsets.implementation_offset.2d.rgba8i.texture_swizzle.alpha_zero_one_red,Fail -dEQP-GLES31.functional.texture.gather.offsets.implementation_offset.2d.rgba8i.texture_swizzle.blue_alpha_zero_one,Fail -dEQP-GLES31.functional.texture.gather.offsets.implementation_offset.2d.rgba8i.texture_swizzle.one_red_green_blue,Fail -dEQP-GLES31.functional.texture.gather.offsets.implementation_offset.2d.rgba8i.texture_swizzle.zero_one_red_green,Fail -dEQP-GLES31.functional.texture.gather.offsets.implementation_offset.2d.rgba8ui.texture_swizzle.alpha_zero_one_red,Fail -dEQP-GLES31.functional.texture.gather.offsets.implementation_offset.2d.rgba8ui.texture_swizzle.blue_alpha_zero_one,Fail -dEQP-GLES31.functional.texture.gather.offsets.implementation_offset.2d.rgba8ui.texture_swizzle.one_red_green_blue,Fail -dEQP-GLES31.functional.texture.gather.offsets.implementation_offset.2d.rgba8ui.texture_swizzle.zero_one_red_green,Fail -dEQP-GLES31.functional.texture.gather.offsets.implementation_offset.2d_array.rgba8i.texture_swizzle.alpha_zero_one_red,Fail -dEQP-GLES31.functional.texture.gather.offsets.implementation_offset.2d_array.rgba8i.texture_swizzle.blue_alpha_zero_one,Fail -dEQP-GLES31.functional.texture.gather.offsets.implementation_offset.2d_array.rgba8i.texture_swizzle.one_red_green_blue,Fail -dEQP-GLES31.functional.texture.gather.offsets.implementation_offset.2d_array.rgba8i.texture_swizzle.zero_one_red_green,Fail -dEQP-GLES31.functional.texture.gather.offsets.implementation_offset.2d_array.rgba8ui.texture_swizzle.alpha_zero_one_red,Fail -dEQP-GLES31.functional.texture.gather.offsets.implementation_offset.2d_array.rgba8ui.texture_swizzle.blue_alpha_zero_one,Fail -dEQP-GLES31.functional.texture.gather.offsets.implementation_offset.2d_array.rgba8ui.texture_swizzle.one_red_green_blue,Fail -dEQP-GLES31.functional.texture.gather.offsets.implementation_offset.2d_array.rgba8ui.texture_swizzle.zero_one_red_green,Fail dEQP-GLES31.functional.texture.multisample.samples_1.sample_mask_and_alpha_to_coverage,Fail dEQP-GLES31.functional.texture.multisample.samples_1.sample_mask_and_sample_coverage,Fail dEQP-GLES31.functional.texture.multisample.samples_1.sample_mask_and_sample_coverage_and_alpha_to_coverage,Fail diff --git a/.pick_status.json b/.pick_status.json index 372a6078a37..0934995b86c 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -67,7 +67,7 @@ "description": "softpipe: Fix swizzled texture gather of int textures.", "nominated": true, "nomination_type": 0, - "resolution": 0, + "resolution": 1, "master_sha": null, "because_sha": null }, diff --git a/src/gallium/drivers/softpipe/sp_tex_sample.c b/src/gallium/drivers/softpipe/sp_tex_sample.c index ab7f73e92bd..f7d7cee8169 100644 --- a/src/gallium/drivers/softpipe/sp_tex_sample.c +++ b/src/gallium/drivers/softpipe/sp_tex_sample.c @@ -1638,7 +1638,7 @@ get_gather_value(const struct sp_sampler_view *sp_sview, case PIPE_SWIZZLE_0: return 0.0; case PIPE_SWIZZLE_1: - return 1.0; + return sp_sview->oneval; default: return tx[chan][swizzle]; } @@ -2884,12 +2884,12 @@ do_swizzling(const struct pipe_sampler_view *sview, float in[TGSI_NUM_CHANNELS][TGSI_QUAD_SIZE], float out[TGSI_NUM_CHANNELS][TGSI_QUAD_SIZE]) { + struct sp_sampler_view *sp_sview = (struct sp_sampler_view *)sview; int j; const unsigned swizzle_r = sview->swizzle_r; const unsigned swizzle_g = sview->swizzle_g; const unsigned swizzle_b = sview->swizzle_b; const unsigned swizzle_a = sview->swizzle_a; - float oneval = util_format_is_pure_integer(sview->format) ? uif(1) : 1.0f; switch (swizzle_r) { case PIPE_SWIZZLE_0: @@ -2898,7 +2898,7 @@ do_swizzling(const struct pipe_sampler_view *sview, break; case PIPE_SWIZZLE_1: for (j = 0; j < 4; j++) - out[0][j] = oneval; + out[0][j] = sp_sview->oneval; break; default: assert(swizzle_r < 4); @@ -2913,7 +2913,7 @@ do_swizzling(const struct pipe_sampler_view *sview, break; case PIPE_SWIZZLE_1: for (j = 0; j < 4; j++) - out[1][j] = oneval; + out[1][j] = sp_sview->oneval; break; default: assert(swizzle_g < 4); @@ -2928,7 +2928,7 @@ do_swizzling(const struct pipe_sampler_view *sview, break; case PIPE_SWIZZLE_1: for (j = 0; j < 4; j++) - out[2][j] = oneval; + out[2][j] = sp_sview->oneval; break; default: assert(swizzle_b < 4); @@ -2943,7 +2943,7 @@ do_swizzling(const struct pipe_sampler_view *sview, break; case PIPE_SWIZZLE_1: for (j = 0; j < 4; j++) - out[3][j] = oneval; + out[3][j] = sp_sview->oneval; break; default: assert(swizzle_a < 4); @@ -3638,6 +3638,8 @@ softpipe_create_sampler_view(struct pipe_context *pipe, sview->xpot = util_logbase2( resource->width0 ); sview->ypot = util_logbase2( resource->height0 ); + + sview->oneval = util_format_is_pure_integer(view->format) ? uif(1) : 1.0f; } return (struct pipe_sampler_view *) sview; diff --git a/src/gallium/drivers/softpipe/sp_tex_sample.h b/src/gallium/drivers/softpipe/sp_tex_sample.h index 96fab8e3387..2770acac73b 100644 --- a/src/gallium/drivers/softpipe/sp_tex_sample.h +++ b/src/gallium/drivers/softpipe/sp_tex_sample.h @@ -122,6 +122,8 @@ struct sp_sampler_view compute_lambda_func compute_lambda; compute_lambda_from_grad_func compute_lambda_from_grad; union pipe_color_union border_color; + /* Value to use for PIPE_SWIZZLE_1 (integer vs float) */ + float oneval; }; struct sp_filter_funcs { |