void
v3dv_buffer_init(struct v3dv_device *device,
- const VkBufferCreateInfo *pCreateInfo,
- struct v3dv_buffer *buffer)
+ const VkBufferCreateInfo *pCreateInfo,
+ struct v3dv_buffer *buffer,
+ uint32_t alignment)
{
buffer->size = pCreateInfo->size;
buffer->usage = pCreateInfo->usage;
- buffer->alignment = V3D_NON_COHERENT_ATOM_SIZE;
+ buffer->alignment = alignment;
}
static void
V3DV_FROM_HANDLE(v3dv_device, device, _device);
struct v3dv_buffer buffer = { 0 };
- v3dv_buffer_init(device, pInfo->pCreateInfo, &buffer);
+ v3dv_buffer_init(device, pInfo->pCreateInfo, &buffer, V3D_NON_COHERENT_ATOM_SIZE);
get_buffer_memory_requirements(&buffer, pMemoryRequirements);
}
if (buffer == NULL)
return vk_error(device, VK_ERROR_OUT_OF_HOST_MEMORY);
- v3dv_buffer_init(device, pCreateInfo, buffer);
+ v3dv_buffer_init(device, pCreateInfo, buffer, V3D_NON_COHERENT_ATOM_SIZE);
/* Limit allocations to 32-bit */
const VkDeviceSize aligned_size = align64(buffer->size, buffer->alignment);
.usage = VK_BUFFER_USAGE_UNIFORM_TEXEL_BUFFER_BIT,
.sharingMode = VK_SHARING_MODE_EXCLUSIVE,
};
- v3dv_buffer_init(cmd_buffer->device, &buf_create_info, &src_buffer);
+ v3dv_buffer_init(cmd_buffer->device, &buf_create_info, &src_buffer,
+ src->alignment);
const VkBindBufferMemoryInfo buf_bind_info = {
.sType = VK_STRUCTURE_TYPE_BIND_BUFFER_MEMORY_INFO,
void
v3dv_buffer_init(struct v3dv_device *device,
const VkBufferCreateInfo *pCreateInfo,
- struct v3dv_buffer *buffer);
+ struct v3dv_buffer *buffer,
+ uint32_t alignment);
void
v3dv_buffer_bind_memory(const VkBindBufferMemoryInfo *info);