vkGetImageSubresourceLayout(screen->dev, res->image, &isr, &srl);
trans->base.stride = srl.rowPitch;
trans->base.layer_stride = srl.arrayPitch;
- const struct util_format_description *desc = util_format_description(res->format);
+ const struct util_format_description *desc = util_format_description(res->base.format);
unsigned offset = srl.offset +
box->z * srl.depthPitch +
(box->y / desc->block.height) * srl.rowPitch +
- (box->x / desc->block.width) * (util_format_get_blocksize(res->format) / desc->nr_channels);
+ (box->x / desc->block.width) * (desc->block.bits / 8);
ptr = ((uint8_t *)ptr) + offset;
}
}