LogicOp, LogicOpEnable, RenderTargetWriteMaskr in FBO attachments

"On the wave on bringing closer DirectX and OpenGL can be added ability like in D3D11_RENDER_TARGET_BLEND_DESC1 parameters like LogicOp, LogicOpEnable, RenderTargetWriteMask.
per color attachment in FBO?
Something like in GL_EXT_draw_buffers2, but for FBO ?
Implementation in OpenGL drivers should not be difficult because the same functionality must be in DirectX 11 driver.

Best regards,

Color write masks are already per-attachment.

So only LogicOp, LogicOpEnable are missing not mush work for greater compability with DirectX

Actually in D3D11 we have (source: https://msdn.microsoft.com/en-us/library/windows/desktop/hh404435(v=vs.85).aspx)

When you set the LogicOpEnable member of the first element of the RenderTarget array (RenderTarget[0]) to TRUE, you must also set the BlendEnable member of RenderTarget[0] to FALSE, and the IndependentBlendEnable member of this D3D11_BLEND_DESC1 to FALSE. This reflects the limitation in hardware that you can’t mix logic operations with blending across multiple render targets, and that when you use a logic operation, you must apply the same logic operation to all render targets.

So no, the functionality to have independent per-rendertarget logic op is not in D3D 11 drivers, and missing this functionality is not an issue for OpenGL.

It should be noted that Vulkan also doesn’t permit logicOps to be enabled per attachment.

[edit] And D3D 12 has that same annotation on the analogous structure.

Also that in both cases the D3D documentation notes it as a “limitation in hardware”.

This is clearly “chalk one up for OpenGL” because the API is considerable clearer; in D3D it looks as though you can do it if you just look at the structs, the documentation that says you can’t is in one place but not the other, and the struct members controlling it seem to be in the wrong struct (surely with the “when you use a logic operation, you must apply the same logic operation to all render targets” restriction in place, LogicOpEnable and LogicOp should be in D3D11_BLEND_DESC1/D3D12_BLEND_DESC rather than D3D11_RENDER_TARGET_BLEND_DESC1/D3D12_RENDER_TARGET_BLEND_DESC?)

And Vulkan, BTW.

However, it’s only cleaner until hardware improves to incorporate the feature. Then D3D looks cleaner.

Of course in Vulkan, that’s easily changed with a couple of new struct definitions. Then the API is clean again.