0

我在 DX11 游戏中绘制纹理。奇怪的是,纹理从未在全屏模式下出现。

我在这里列出我的状态设置以供参考。

BOOL BlendEnable[] = {TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE};
UINT8 RenderTargetWriteMask[] = {0xF, 0xF, 0xF, 0xF, 0xF, 0xF, 0xF, 0xF};

D3D11_BLEND_DESC  bs11 = {0};
bs11.AlphaToCoverageEnable = 0;
bs11.IndependentBlendEnable = false;

for(size_t i = sizeof(BlendEnable) / sizeof(BlendEnable[0]); i--;)
{
     bs11.RenderTarget[i].BlendEnable = BlendEnable[i];
     bs11.RenderTarget[i].RenderTargetWriteMask = RenderTargetWriteMask[i];
}

bs11.RenderTarget[0].BlendOp = D3D10_DDI_BLEND_OP_ADD;
bs11.RenderTarget[0].BlendOpAlpha = D3D10_DDI_BLEND_OP_ADD;
bs11.RenderTarget[0].DestBlend = D3D10_DDI_BLEND_INV_SRC_ALPHA;
bs11.RenderTarget[0].DestBlendAlpha = D3D10_DDI_BLEND_ZERO;
bs11.RenderTarget[0].SrcBlend = D3D10_DDI_BLEND_SRC_ALPHA;
bs11.RenderTarget[0].SrcBlendAlpha = D3D10_DDI_BLEND_ONE;       
bs11.RenderTarget[0].RenderTargetWriteMask = D3D10_DDI_COLOR_WRITE_ENABLE_ALL;

D3D11_DEPTH_STENCIL_DESC depthDesc;
depthDesc.DepthEnable = 0;
depthDesc.DepthWriteMask = D3D10_DEPTH_WRITE_MASK_ZERO;
depthDesc.DepthFunc = D3D10_COMPARISON_NEVER;
depthDesc.BackEnable = 0;
depthDesc.FrontEnable = 0;
depthDesc.StencilEnable = 0;
depthDesc.StencilReadMask = 0;
depthDesc.StencilWriteMask = 0;
depthDesc.FrontFace.StencilDepthFailOp = D3D10_DDI_STENCIL_OP_KEEP;
depthDesc.FrontFace.StencilFailOp = D3D10_DDI_STENCIL_OP_KEEP;
depthDesc.FrontFace.StencilFunc = D3D10_DDI_COMPARISON_ALWAYS;
depthDesc.FrontFace.StencilPassOp = D3D10_DDI_STENCIL_OP_KEEP;
depthDesc.BackFace.StencilDepthFailOp = D3D10_DDI_STENCIL_OP_KEEP;
depthDesc.BackFace.StencilFailOp = D3D10_DDI_STENCIL_OP_KEEP;
depthDesc.BackFace.StencilFunc = D3D10_DDI_COMPARISON_ALWAYS;
depthDesc.BackFace.StencilPassOp = D3D10_DDI_STENCIL_OP_KEEP;

最可能的问题是什么?

谢谢,马歇尔

4

1 回答 1

0

不确定这是否会解决您的问题,但 D3D11_BLEND_DESC/D3D11_DEPTH_STENCIL_DESC 变量被设置为 D3D10_ 标志,据我所知这通常可以编译,但应该是 D3D11_ 等效的。

那么纹理在窗口模式下显示?

于 2011-08-08T13:31:15.523 回答