Jump to content
  • Advertisement
Sign in to follow this  

[D3D12] Blend state for MRT

This topic is 926 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts



I would like to render to multiple render targets with disabled blend. The first RTV has format DXGI_FORMAT_R10G10B10A2_UNORM and the second - DXGI_FORMAT_R8G8B8A8_SNORM.


The blend state has the following configuration:

AlphaToCoverageEnable = FALSE;
IndependentBlendEnable = FALSE;
RenderTarget[0].BlendEnable = FALSE;
RenderTarget[0].SrcBlend = D3D12_BLEND_ONE;
RenderTarget[0].DestBlend = D3D12_BLEND_ZERO;
RenderTarget[0].BlendOp = D3D12_BLEND_OP_ADD;
RenderTarget[0].SrcBlendAlpha = D3D12_BLEND_ONE;
RenderTarget[0].DestBlendAlpha = D3D12_BLEND_ZERO;
RenderTarget[0].BlendOpAlpha = D3D12_BLEND_OP_ADD;		
RenderTarget[0].LogicOpEnable = FALSE;
RenderTarget[0].LogicOp = D3D12_LOGIC_OP_NOOP;		
RenderTarget[0].RenderTargetWriteMask = D3D12_COLOR_WRITE_ENABLE_ALL;

At pipeline state creation, I get the following error:


ID3D12Device::CreateGraphicsPipelineState: The render target format at slot 1 is format (R8G8B8A8_SNORM).

This format does not support logic ops. The Pixel Shader output signature indicates this output could be written,

and the Blend State indicates logic op is enabled for this slot. [ STATE_CREATION ERROR #678: CREATEGRAPHICSPIPELINESTATE_OM_RENDER_TARGET_DOES_NOT_SUPPORT_LOGIC_OPS]


Should not IndependentBlendEnable = FALSE; be sufficient to disable blend from 1 to 7 render targets?

I disabled blend explicitly for the second render target. That fixed the problem.

RenderTarget[1].BlendEnable = FALSE;
RenderTarget[1].LogicOpEnable = FALSE;

Still thinking if IndependentBlendEnable = FALSE; should not be enough as they mention on MSDN



Edited by _void_

Share this post

Link to post
Share on other sites

Should not IndependentBlendEnable = FALSE; be sufficient to disable blend from 1 to 7 render targets?

Yep, the documentation says that if it's false, then only RenderTarget[0]'s settings will be used...
You might've found a bug sad.png

Share this post

Link to post
Share on other sites

IndependentBlendEnable=FALSE will use RenderTarget[0]'s settings across all 8 render targets, so they need to be valid for all render targets formats being bound. It's not true to say that setting IndependentBlendEnable to FALSE will "be sufficient to disable blend from 1 to 7 render targets". If you want to blend on RT0 and not blend on RT1-7 then you need to set IndependentBlendEnable to TRUE and set RenderTarget[1-7] appropriately (BlendEnable = FALSE).


Still, since you've set IndependentBlendEnable to FALSE and LogicOpEnable is FALSE, then it should neither be validating the LogicOp against the bound set of render target formats nor validating RenderTarget[1-7] (whichever it's doing). I'll report this to the team responsible for getting it fixed.

Edited by Adam Miles

Share this post

Link to post
Share on other sites
Sign in to follow this  

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!