foot/stride.h
Julian Orth c462bad08c shm: align the stride to 256 bytes
This is required for the compositor to import the buffer directly into
AMD hardware for zero-copy sampling.
2025-10-03 16:54:36 +02:00

9 lines
202 B
C

#pragma once
#include <pixman.h>
static inline int
stride_for_format_and_width(pixman_format_code_t format, int width)
{
return (((PIXMAN_FORMAT_BPP(format) * width + 7) / 8 + 256 - 1) & -256);
}