const VkDescriptorBufferInfo *buffer_info)
{
TU_FROM_HANDLE(tu_buffer, buffer, buffer_info->buffer);
- uint64_t va = buffer->bo->iova;
- va += buffer_info->offset + buffer->bo_offset;
+ uint64_t va = tu_buffer_iova(buffer) + buffer_info->offset;
dst[0] = va;
dst[1] = va >> 32;
const VkDescriptorBufferInfo *buffer_info)
{
TU_FROM_HANDLE(tu_buffer, buffer, buffer_info->buffer);
- uint64_t va = buffer->bo->iova;
+ uint64_t va = tu_buffer_iova(buffer) + buffer_info->offset;
unsigned size = buffer_info->range;
if (buffer_info->range == VK_WHOLE_SIZE)
size = buffer->size - buffer_info->offset;
- va += buffer_info->offset + buffer->bo_offset;
range->va = va;
range->size = size;
return (struct tu_blit_surf) {
.fmt = format,
.tile_mode = TILE6_LINEAR,
- .va = buffer->bo->iova + buffer->bo_offset + info->bufferOffset,
+ .va = tu_buffer_iova(buffer) + info->bufferOffset,
.pitch = pitch,
.layer_size = (info->bufferImageHeight ?: info->imageExtent.height) * pitch / vk_format_get_blockwidth(format) / vk_format_get_blockheight(format),
.width = info->imageExtent.width,
VkDeviceSize bo_offset;
};
+static inline uint64_t
+tu_buffer_iova(struct tu_buffer *buffer)
+{
+ return buffer->bo->iova + buffer->bo_offset;
+}
+
enum tu_dynamic_state_bits
{
TU_DYNAMIC_VIEWPORT = 1 << 0,