Open YaaZ opened 3 weeks ago
@YaaZ I confirmed with some driver developers, yes, this is telling you that the HW will ignore any logical operations, so there is no "undefined behavior" and it is not a spec violation as it is actually very well specified what will not happen
With that, I think this is a good thing to add as a warning since I was not even aware of this case and assume others might also not as well
Ok, I got it. So you actually can use logicOp with sRGB attachments, though it must have no effect. Then this is a spec violation by my HW, because clearly, there is an effect 😃
Can you tell me what driver/gpu you are seeing this effect on? Also which exact format you see an effect? This seems like a lack of CTS coverage as there should be tests that this is ignored
VGA compatible controller [0300]: Advanced Micro Devices, Inc. [AMD/ATI] Rembrandt [Radeon 680M] [1002:1681] (rev 11) Subsystem: Lenovo Device [17aa:22f2] Kernel driver in use: amdgpu
No idea about the drivers, something default for Fedora 40, but here are versions from vulkaninfo
:
Vulkan Instance Version: 1.3.283 VK_LAYER_KHRONOS_validation (Khronos Validation Layer) Vulkan version 1.3.261, layer version 1 VkPhysicalDeviceProperties: apiVersion = 1.3.278 (4206870) driverVersion = 24.1.5 (100667397)
XOR logicOp worked for me at least with VK_FORMAT_B8G8R8A8_SRGB
and VK_FORMAT_R32G32B32A32_SFLOAT
.
created https://gitlab.khronos.org/vulkan/vulkan/-/issues/3981 to track this
update: was discussed and seems this might just be a driver bug, we are going to create CTS tests and make sure the drivers are doing what the spec says should happen, Thanks again for reporting this btw!
CTS issue is being tracked here https://gitlab.khronos.org/Tracker/vk-gl-cts/-/issues/5278
For the time being, moved to a Spec issue, if we decide to add a Validation restriction, will bring back to Validation Layer repo, but for now there is nothing actionable from the Validation Layers point of view
Spec states:
https://registry.khronos.org/vulkan/specs/1.3-extensions/html/vkspec.html#framebuffer-logicop
Although for me they work for much more attachment formats, including SRGB and even SFLOAT. It's nice that they still work, but this is a spec violation and deserves to be caught by validation layers.