@@ -297,8 +297,8 @@ private:
297297 auto offset = pools[type].blocks[index.blockIdx].layout[index.spanIdx].offset;
298298
299299 // Find the next aligned subarea, allocate enough space for it.
300- VkDeviceSize reqSizeAligned = size.alignTo( alignment);
301- VkDeviceSize reqOffsetAligned = offset.alignTo( alignment);
300+ VkDeviceSize reqSizeAligned = nu_alignup(size, alignment);
301+ VkDeviceSize reqOffsetAligned = nu_alignup(offset, alignment);
302302 pools[type].blocks[index.blockIdx].layout[index.spanIdx].offset += reqSizeAligned;
303303 pools[type].blocks[index.blockIdx].layout[index.spanIdx].length -= reqSizeAligned;
304304
@@ -359,8 +359,8 @@ public:
359359
360360 // Page size must be a multiple of the bufferImageGranularity.
361361 auto granularity = deviceProperties.limits.bufferImageGranularity;
362- this .pageSize = max(desc.pageSize, granularity).alignTo( granularity);
363- this .blockMinSize = desc.size.alignTo( pageSize);
362+ this .pageSize = nu_alignup( max(desc.pageSize, granularity), granularity);
363+ this .blockMinSize = nu_alignup( desc.size, pageSize);
364364 this .mutex_ = nogc_new! Mutex ();
365365 }
366366
@@ -461,7 +461,7 @@ public:
461461 scope (exit) mutex_.unlock();
462462
463463 auto pool = pools[obj.memory.type];
464- VkDeviceSize reqSize = ( size + (size % pageSize)).alignTo( obj.alignment);
464+ VkDeviceSize reqSize = nu_alignup(( size + (size % pageSize)), obj.alignment);
465465
466466 Span span = Span(obj.offset, reqSize);
467467
0 commit comments