Hi, I’ve been playing with dynamic uniform buffer for and everything went smooth until I tried my code on AMD R7 445M.

I tried sasha willems example about dynamicUniformBuffer and it crashed as well.

here is the difference between all adapter and the R7 445M:

AMD R7 : sizeof(Mystruct) = 80, minUniformBufferOffsetAlignment = 4 , alignSize = 80

OTHERs: sizeof(Mystruct) = 80, minUniformBufferOffsetAlignment = 64 , alignSize = 128

here is the code to calculate alignSize:

```
size_t minUboAlignment = _gpuProperties.limits.minUniformBufferOffsetAlignment;
size_t alignedSize = originalSize;
if (minUboAlignment > 0) {
alignedSize = (alignedSize + minUboAlignment - 1) & ~(minUboAlignment - 1);
}
```

The Specifiaction says AlignedSize should be a multiple of **minUniformBufferOffsetAlignment** , and obviously 80 is a multiple of 4 but **poxis_memalign** will fail.

```
int res = posix_memalign(&data, alignment, size);
if (res != 0)
data = nullptr;
```

To make it work I changed the alignedSize to

```
alignedSize = round_up_power_of_2(80, minUniformBufferOffsetAlignment );
```

this one will return the highest value between **minUniformBufferOffsetAlignment** and the round_up_powerof2 value. here it will be 128

then both my code and Sashawillems example are working.

My question is: As **posix_memalign** Only works with power of 2. is there another function to do the allocation or I will have to do a manual padding myself and use those usual **new/malloc/calloc** to allocate multiple of 4 instead of power of 2?