[Mesa-dev] [PATCH] radv: fix some compiler warnings

Bas Nieuwenhuizen bas at basnieuwenhuizen.nl
Thu May 30 18:23:48 UTC 2019


maybe  use UINT32_MAX?

otherwise r-b

On Thu, May 30, 2019 at 6:50 PM Rhys Perry <pendingchaos02 at gmail.com> wrote:
>
> Fixes -Woverflow warnings with GCC 9.1.1
>
> Signed-off-by: Rhys Perry <pendingchaos02 at gmail.com>
> ---
>  src/amd/vulkan/si_cmd_buffer.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/src/amd/vulkan/si_cmd_buffer.c b/src/amd/vulkan/si_cmd_buffer.c
> index aae8d578c10..d87c00b94e9 100644
> --- a/src/amd/vulkan/si_cmd_buffer.c
> +++ b/src/amd/vulkan/si_cmd_buffer.c
> @@ -1360,7 +1360,7 @@ void radv_emit_default_sample_locations(struct radeon_cmdbuf *cs, int nr_samples
>         default:
>         case 1:
>                 radeon_set_context_reg_seq(cs, R_028BD4_PA_SC_CENTROID_PRIORITY_0, 2);
> -               radeon_emit(cs, centroid_priority_1x);
> +               radeon_emit(cs, centroid_priority_1x & 0xffffffff);
>                 radeon_emit(cs, centroid_priority_1x >> 32);
>                 radeon_set_context_reg(cs, R_028BF8_PA_SC_AA_SAMPLE_LOCS_PIXEL_X0Y0_0, sample_locs_1x);
>                 radeon_set_context_reg(cs, R_028C08_PA_SC_AA_SAMPLE_LOCS_PIXEL_X1Y0_0, sample_locs_1x);
> @@ -1369,7 +1369,7 @@ void radv_emit_default_sample_locations(struct radeon_cmdbuf *cs, int nr_samples
>                 break;
>         case 2:
>                 radeon_set_context_reg_seq(cs, R_028BD4_PA_SC_CENTROID_PRIORITY_0, 2);
> -               radeon_emit(cs, centroid_priority_2x);
> +               radeon_emit(cs, centroid_priority_2x & 0xffffffff);
>                 radeon_emit(cs, centroid_priority_2x >> 32);
>                 radeon_set_context_reg(cs, R_028BF8_PA_SC_AA_SAMPLE_LOCS_PIXEL_X0Y0_0, sample_locs_2x);
>                 radeon_set_context_reg(cs, R_028C08_PA_SC_AA_SAMPLE_LOCS_PIXEL_X1Y0_0, sample_locs_2x);
> @@ -1378,7 +1378,7 @@ void radv_emit_default_sample_locations(struct radeon_cmdbuf *cs, int nr_samples
>                 break;
>         case 4:
>                 radeon_set_context_reg_seq(cs, R_028BD4_PA_SC_CENTROID_PRIORITY_0, 2);
> -               radeon_emit(cs, centroid_priority_4x);
> +               radeon_emit(cs, centroid_priority_4x & 0xffffffff);
>                 radeon_emit(cs, centroid_priority_4x >> 32);
>                 radeon_set_context_reg(cs, R_028BF8_PA_SC_AA_SAMPLE_LOCS_PIXEL_X0Y0_0, sample_locs_4x);
>                 radeon_set_context_reg(cs, R_028C08_PA_SC_AA_SAMPLE_LOCS_PIXEL_X1Y0_0, sample_locs_4x);
> @@ -1387,7 +1387,7 @@ void radv_emit_default_sample_locations(struct radeon_cmdbuf *cs, int nr_samples
>                 break;
>         case 8:
>                 radeon_set_context_reg_seq(cs, R_028BD4_PA_SC_CENTROID_PRIORITY_0, 2);
> -               radeon_emit(cs, centroid_priority_8x);
> +               radeon_emit(cs, centroid_priority_8x & 0xffffffff);
>                 radeon_emit(cs, centroid_priority_8x >> 32);
>                 radeon_set_context_reg_seq(cs, R_028BF8_PA_SC_AA_SAMPLE_LOCS_PIXEL_X0Y0_0, 14);
>                 radeon_emit_array(cs, sample_locs_8x, 4);
> --
> 2.21.0
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev


More information about the mesa-dev mailing list