Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

VkLogicOp with floating and sRGB color attachments #2426

Open
YaaZ opened this issue Aug 24, 2024 · 7 comments
Open

VkLogicOp with floating and sRGB color attachments #2426

YaaZ opened this issue Aug 24, 2024 · 7 comments
Assignees

Comments

@YaaZ
Copy link

YaaZ commented Aug 24, 2024

Spec states:

Logical operations are applied only for signed and unsigned integer and normalized integer framebuffers. Logical operations are not applied to floating-point or sRGB format color attachments.

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.

@spencer-lunarg spencer-lunarg self-assigned this Aug 25, 2024
@spencer-lunarg
Copy link

@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

@YaaZ
Copy link
Author

YaaZ commented Aug 26, 2024

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 😃

@spencer-lunarg
Copy link

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

@YaaZ
Copy link
Author

YaaZ commented Aug 26, 2024

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.

@spencer-lunarg
Copy link

created https://gitlab.khronos.org/vulkan/vulkan/-/issues/3981 to track this

@spencer-lunarg
Copy link

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!

@spencer-lunarg spencer-lunarg transferred this issue from KhronosGroup/Vulkan-ValidationLayers Aug 28, 2024
@spencer-lunarg
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants