Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-86111

rhi: Setting srcAlpha or dstAlpha to a xxxxColor blend factor fails on D3D11

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: P2: Important P2: Important
    • 5.15.1
    • 5.15, 6.0.0
    • Qt RHI, Quick: 3D
    • None
    • 2da2e24bbc9511776c0d4ad5c60d0de5dff54e4b (qt/qtbase/dev) 64abf5a21f5c1c1c6eda5ec27a673e6b3c83387a (qt/qtbase/5.15)

      ...and only on D3D11 (although Metal has not been tested but based on the docs it should behave similarly to OpenGL and Vulkan)

      This would show up with, for example, a CustomMaterial that has its source/destination factors set to one of the Color contants, say OneMinusSrcColor. The value then ends up in both srcColor/srcAlpha (or dstColor/dstAlpha). So far so good.

      However, D3D11 explicitly disallows using _COLOR (e.g. D3D11_BLEND_SRC_COLOR) in SrcBlendAlpha and DstBlendAlpha in D3D11_RENDER_TARGET_BLEND_DESC. Which is only bad because everything else accepts the equivalents, presumably mapping internally based on being a color or alpha factor (e.g. see the table in https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkBlendFactor.html )

      So it's up to the D3D11 backend of QRhi to do some mapping as appropriate. (so that SrcColor maps to D3D11_BLEND_SRC_COLOR for SrcBlend/DstBlend but to D3D11_BLEND_SRC_ALPHA for SrcBlendAlpha/DstBlendAlpha etc.)

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

            lagocs Laszlo Agocs
            lagocs Laszlo Agocs
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes