[Mesa-dev] [PATCH mesa 4/6] swr: use ARRAY_SIZE macro

Cherniak, Bruce bruce.cherniak at intel.com
Mon Sep 11 15:58:11 UTC 2017


> 
> On Sep 7, 2017, at 5:21 AM, Eric Engestrom <eric.engestrom at imgtec.com> wrote:
> 
> Signed-off-by: Eric Engestrom <eric.engestrom at imgtec.com>
> ---
> src/gallium/drivers/swr/rasterizer/memory/StoreTile.h | 10 ++++++----
> 1 file changed, 6 insertions(+), 4 deletions(-)
> 
> diff --git a/src/gallium/drivers/swr/rasterizer/memory/StoreTile.h b/src/gallium/drivers/swr/rasterizer/memory/StoreTile.h
> index c3d14e9509..31739f9237 100644
> --- a/src/gallium/drivers/swr/rasterizer/memory/StoreTile.h
> +++ b/src/gallium/drivers/swr/rasterizer/memory/StoreTile.h
> @@ -37,6 +37,8 @@
> #include "memory/Convert.h"
> #include "core/multisample.h"
> 
> +#include "util/macros.h"

The openswr core (anything under .../rasterizer) cannot depend on anything outside the core.  Respectfully, we cannot approve this patch.

> +
> #include <array>
> #include <sstream>
> 
> @@ -1523,7 +1525,7 @@ struct OptStoreRasterTile< TilingTraits<SWR_TILE_NONE, 64>, SrcFormat, DstFormat
> 
>             pSrc += KNOB_SIMD16_WIDTH * SRC_BYTES_PER_PIXEL;
> 
> -            for (uint32_t i = 0; i < sizeof(ppDsts) / sizeof(ppDsts[0]); i += 1)
> +            for (uint32_t i = 0; i < ARRAY_SIZE(ppDsts); i += 1)
>             {
>                 ppDsts[i] += dy;
>             }
> @@ -1641,7 +1643,7 @@ struct OptStoreRasterTile< TilingTraits<SWR_TILE_NONE, 128>, SrcFormat, DstForma
> 
>             pSrc += KNOB_SIMD16_WIDTH * SRC_BYTES_PER_PIXEL;
> 
> -            for (uint32_t i = 0; i < sizeof(ppDsts) / sizeof(ppDsts[0]); i += 1)
> +            for (uint32_t i = 0; i < ARRAY_SIZE(ppDsts); i += 1)
>             {
>                 ppDsts[i] += dy;
>             }
> @@ -2124,7 +2126,7 @@ struct OptStoreRasterTile< TilingTraits<SWR_TILE_MODE_YMAJOR, 64>, SrcFormat, Ds
> 
>             pSrc += KNOB_SIMD16_WIDTH * SRC_BYTES_PER_PIXEL;
> 
> -            for (uint32_t i = 0; i < sizeof(ppDsts) / sizeof(ppDsts[0]); i += 1)
> +            for (uint32_t i = 0; i < ARRAY_SIZE(ppDsts); i += 1)
>             {
>                 ppDsts[i] += dy;
>             }
> @@ -2253,7 +2255,7 @@ struct OptStoreRasterTile< TilingTraits<SWR_TILE_MODE_YMAJOR, 128>, SrcFormat, D
> 
>             pSrc += KNOB_SIMD16_WIDTH * SRC_BYTES_PER_PIXEL;
> 
> -            for (uint32_t i = 0; i < sizeof(ppDsts) / sizeof(ppDsts[0]); i += 1)
> +            for (uint32_t i = 0; i < ARRAY_SIZE(ppDsts); i += 1)
>             {
>                 ppDsts[i] += dy;
>             }
> -- 
> Cheers,
>  Eric
> 
> _______________________________________________
> 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