Directx 是D3D11混合描述和x27;在D3D_功能_级别_10_0中使用的独立可变性安全?
我正在使用DirectX 11 API开发延迟渲染器,需要在渲染目标之间改变混合状态。DX10.0仅允许一组混合操作:Directx 是D3D11混合描述和x27;在D3D_功能_级别_10_0中使用的独立可变性安全?,directx,Directx,我正在使用DirectX 11 API开发延迟渲染器,需要在渲染目标之间改变混合状态。DX10.0仅允许一组混合操作: typedef struct D3D10_BLEND_DESC { BOOL AlphaToCoverageEnable; BOOL BlendEnable[8]; D3D10_BLEND SrcBlend; D3D10_BLEND DestBlend; D3D10_BLEND_OP BlendOp;
typedef struct D3D10_BLEND_DESC {
BOOL AlphaToCoverageEnable;
BOOL BlendEnable[8];
D3D10_BLEND SrcBlend;
D3D10_BLEND DestBlend;
D3D10_BLEND_OP BlendOp;
D3D10_BLEND SrcBlendAlpha;
D3D10_BLEND DestBlendAlpha;
D3D10_BLEND_OP BlendOpAlpha;
UINT8 RenderTargetWriteMask[8];
} D3D10_BLEND_DESC;
而DX11API可以灵活地指定8
typedef struct D3D11_BLEND_DESC {
BOOL AlphaToCoverageEnable;
BOOL IndependentBlendEnable;
D3D11_RENDER_TARGET_BLEND_DESC RenderTarget[8];
} D3D11_BLEND_DESC;
typedef struct D3D11_RENDER_TARGET_BLEND_DESC {
BOOL BlendEnable;
D3D11_BLEND SrcBlend;
D3D11_BLEND DestBlend;
D3D11_BLEND_OP BlendOp;
D3D11_BLEND SrcBlendAlpha;
D3D11_BLEND DestBlendAlpha;
D3D11_BLEND_OP BlendOpAlpha;
UINT8 RenderTargetWriteMask;
} D3D11_RENDER_TARGET_BLEND_DESC;
现在使用我的D3D_FEATURE_LEVEL_10_0的DX11卡,我不会在创建和设置状态时收到错误或警告,该状态为IndependentBlendEnable true。将此结果视为DX10.0硬件上会发生的情况的代表是否安全,或者功能级别检查只是一个近似的指南?它将在DX10.0硬件上失败。由于我的测试在RenderTarget[]数组中没有变化,DX似乎检测到IndependentBlendEnable的值没有区别,并忽略了它。给我一个警告可能会有帮助,但没有输出,这让我怀疑独立混合是在软件而不是硬件中解决的。无论如何,在更改RenderTarget[]数据时,会弹出下面的错误,并且一切都有意义,尽管在这种情况下很不方便
D3D11 ERROR: ID3D11Device::CreateBlendState: SrcBlend[ 4 ] does not equal SrcBlend[ 0 ]
and D3D10.1 hardware is not supported. When GetFeatureLevel returns
D3D_FEATURE_LEVEL_10_0 or less, any enabled render target blending must use the same
blending configuration. [ STATE_CREATION ERROR #212: CREATEBLENDSTATE_INVALIDSRCBLEND]