From 396a8d4fe77525332e04211542494b0afceff86b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B3zef=20Kucia?= Date: Tue, 4 Jun 2019 14:28:55 +0200 Subject: [PATCH] vkd3d: Check texel buffer view alignment requirements. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Józef Kucia Signed-off-by: Henri Verbeet Signed-off-by: Alexandre Julliard --- libs/vkd3d/resource.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/libs/vkd3d/resource.c b/libs/vkd3d/resource.c index 4a6af7fe..70a04eba 100644 --- a/libs/vkd3d/resource.c +++ b/libs/vkd3d/resource.c @@ -1663,6 +1663,7 @@ static bool vkd3d_create_vk_buffer_view(struct d3d12_device *device, VkDeviceSize offset, VkDeviceSize range, VkBufferView *vk_view) { const struct vkd3d_vk_device_procs *vk_procs = &device->vk_procs; + const struct vkd3d_vulkan_info *vk_info = &device->vk_info; struct VkBufferViewCreateInfo view_desc; VkResult vr; @@ -1674,6 +1675,12 @@ static bool vkd3d_create_vk_buffer_view(struct d3d12_device *device, return false; } + if (offset % vk_info->device_limits.minTexelBufferOffsetAlignment) + { + FIXME("Offset %#"PRIx64" violates the minimum required alignment %#"PRIx64".\n", + offset, vk_info->device_limits.minTexelBufferOffsetAlignment); + } + view_desc.sType = VK_STRUCTURE_TYPE_BUFFER_VIEW_CREATE_INFO; view_desc.pNext = NULL; view_desc.flags = 0;