A few inline asserts in anv assume alignments are power of 2, but with
formats like R8G8B8 we have odd alignments.
v2: round up to power of 2 (Ilia)
v3: reuse util_next_power_of_two() from gallium/aux/util/u_math.h (Ilia)
Signed-off-by: Lionel Landwerlin
Cc: Ilia Mirkin
Cc: Jason Ekstrand
---
You may be interested in the implementation in gallium/aux/util/u_math.h:
/**
* Returns the smallest power of two >= x
*/
static inline unsigned
util_next_power_of_two(unsigned x)
{
#if defined(HAVE___BUILTIN_CLZ)
if (x <= 1)
return 1;
return (1 << ((sizeof(unsigned) * 8) - __built
A few inline asserts in anv assume alignments are power of 2, but with
formats like R8G8B8 we have odd alignments.
v2: round up to power of 2 (Ilia)
Signed-off-by: Lionel Landwerlin
Cc: Ilia Mirkin
Cc: Jason Ekstrand
---
src/intel/isl/isl.c | 1 +
src/intel/isl/isl_priv.h | 10 +
On Tue, Aug 23, 2016 at 5:41 PM, Ilia Mirkin wrote:
> On Fri, Aug 19, 2016 at 7:44 PM, Lionel Landwerlin
> wrote:
> > A few inline asserts in anv assume alignments are power of 2, but with
> > formats like R8G8B8 we have odd alignments.
> >
> > Signed-off-by: Lionel Landwerlin
> > ---
> > src/
On Fri, Aug 19, 2016 at 7:44 PM, Lionel Landwerlin
wrote:
> A few inline asserts in anv assume alignments are power of 2, but with
> formats like R8G8B8 we have odd alignments.
>
> Signed-off-by: Lionel Landwerlin
> ---
> src/intel/isl/isl.c | 1 +
> src/intel/isl/isl_priv.h | 6 ++
> 2
This seems perfectly reasonable. I don't think rounding up to a power of
two can hurt.
Reviewed-by: Jason Ekstrand
On Mon, Aug 22, 2016 at 10:46 AM, Lionel Landwerlin <
lionel.g.landwer...@intel.com> wrote:
> The one I actually wanted to Cc you on :)
>
>
> On 20/08/16 00:44, Lionel Landwerlin
The one I actually wanted to Cc you on :)
On 20/08/16 00:44, Lionel Landwerlin wrote:
A few inline asserts in anv assume alignments are power of 2, but with
formats like R8G8B8 we have odd alignments.
Signed-off-by: Lionel Landwerlin
---
src/intel/isl/isl.c | 1 +
src/intel/isl/isl_pri
A few inline asserts in anv assume alignments are power of 2, but with
formats like R8G8B8 we have odd alignments.
Signed-off-by: Lionel Landwerlin
---
src/intel/isl/isl.c | 1 +
src/intel/isl/isl_priv.h | 6 ++
2 files changed, 7 insertions(+)
diff --git a/src/intel/isl/isl.c b/src/in