#include <array>
#include <sstream>
+#define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0]))
+
// Function pointer to different storing functions for color, depth, and stencil based on incoming formats.
typedef void(*PFN_STORE_TILES)(uint8_t*, SWR_SURFACE_STATE*, uint32_t, uint32_t, uint32_t);
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;
}
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;
}
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;
}
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;
}