Creating a view with an unaligned offset is legal in d3d and apparently works, both on Windows and Linux, but may violate the Vulkan specification:
VUID-VkBufferViewCreateInfo-offset-00926(ERROR / SPEC): msgNum: -833749292 - Validation Error: [ VUID-VkBufferViewCreateInfo-offset-00926 ] Object 0: handle = 0x3c000000003c, type = VK_OBJECT_TYPE_BUFFER; | MessageID = 0xce4dfed4 | vkCreateBufferView(): VkBufferViewCreateInfo offset (36) must be a multiple of VkPhysicalDeviceLimits::minTexelBufferOffsetAlignment (16). The Vulkan spec states: offset must be a multiple of VkPhysicalDeviceLimits::minTexelBufferOffsetAlignment (https://www.khronos.org/registry/vulkan/specs/1.2-khr-extensions/html/vkspec...)
Without any reason to test unaligned buffer views here, just resolve this by changing the test.
From: Zebediah Figura zfigura@codeweavers.com
Creating a view with an unaligned offset is legal in d3d and apparently works, both on Windows and Linux, but may violate the Vulkan specification:
VUID-VkBufferViewCreateInfo-offset-00926(ERROR / SPEC): msgNum: -833749292 - Validation Error: [ VUID-VkBufferViewCreateInfo-offset-00926 ] Object 0: handle = 0x3c000000003c, type = VK_OBJECT_TYPE_BUFFER; | MessageID = 0xce4dfed4 | vkCreateBufferView(): VkBufferViewCreateInfo offset (36) must be a multiple of VkPhysicalDeviceLimits::minTexelBufferOffsetAlignment (16). The Vulkan spec states: offset must be a multiple of VkPhysicalDeviceLimits::minTexelBufferOffsetAlignment (https://www.khronos.org/registry/vulkan/specs/1.2-khr-extensions/html/vkspec...)
Without any reason to test unaligned buffer views here, just resolve this by changing the test. --- dlls/d3d11/tests/d3d11.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/dlls/d3d11/tests/d3d11.c b/dlls/d3d11/tests/d3d11.c index f6623614583..c54fa67e5b1 100644 --- a/dlls/d3d11/tests/d3d11.c +++ b/dlls/d3d11/tests/d3d11.c @@ -16638,8 +16638,8 @@ static void test_clear_buffer_unordered_access_view(void) U(uav_desc).Buffer.Flags = 0; hr = ID3D11Device_CreateUnorderedAccessView(device, (ID3D11Resource *)buffer, &uav_desc, &uav); ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr); - U(uav_desc).Buffer.FirstElement = 9; - U(uav_desc).Buffer.NumElements = 7; + U(uav_desc).Buffer.FirstElement = 8; + U(uav_desc).Buffer.NumElements = 8; hr = ID3D11Device_CreateUnorderedAccessView(device, (ID3D11Resource *)buffer, &uav_desc, &uav2); ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
Without any reason to test unaligned buffer views here, just resolve this by changing the test.
I think this was deliberately testing unaligned views because it seemed like an interesting case. It probably makes sense to just drop the test though.
On Mon Jun 12 17:46:39 2023 +0000, Henri Verbeet wrote:
Without any reason to test unaligned buffer views here, just resolve
this by changing the test. I think this was deliberately testing unaligned views because it seemed like an interesting case. It probably makes sense to just drop the test though.
I figured as much, but yeah, it doesn't seem interesting enough to justify violating the spec without any evidence that programs care.
I figure we might as well keep the partial clear test, though.
Without any reason to test unaligned buffer views here, just resolve this by changing the test.
Or, you could enable `VK_EXT_texel_buffer_alignment`, or use a 1.3 device, where the functionality is always enabled--then, in [`VkPhysicalDeviceTexelBufferAlignmentProperties`](https://registry.khronos.org/vulkan/specs/1.3-extensions/html/chap46.html#Vk...), if `storageTexelBufferOffsetSingleTexelAlignment` is `VK_TRUE`, which it should be on any GPU that works with D3D, this *won't* violate the spec. (But then what do you do about devices that don't support the extension and/or don't support single-texel alignment...?)
This merge request was approved by Jan Sikorski.