1
0
mirror of https://github.com/doitsujin/dxvk.git synced 2025-01-18 20:52:10 +01:00

[d3d11] Remove state tracking for UAV rendering

This scenario is now properly handled by the DXVK state tracker.
This commit is contained in:
Philip Rebohle 2018-10-29 11:19:35 +01:00
parent fd52022fff
commit 43ed820be9
2 changed files with 7 additions and 11 deletions

View File

@ -2287,7 +2287,7 @@ namespace dxvk {
ID3D11RenderTargetView* const* ppRenderTargetViews,
ID3D11DepthStencilView* pDepthStencilView) {
SetRenderTargets(NumViews, ppRenderTargetViews, pDepthStencilView);
BindFramebuffer(std::exchange(m_state.om.isUavRendering, false));
BindFramebuffer(false);
}
@ -2299,17 +2299,15 @@ namespace dxvk {
UINT NumUAVs,
ID3D11UnorderedAccessView* const* ppUnorderedAccessViews,
const UINT* pUAVInitialCounts) {
bool spillOnBind = m_state.om.isUavRendering;
bool isUavRendering = false;
if (NumRTVs != D3D11_KEEP_RENDER_TARGETS_AND_DEPTH_STENCIL)
SetRenderTargets(NumRTVs, ppRenderTargetViews, pDepthStencilView);
if (NumUAVs != D3D11_KEEP_UNORDERED_ACCESS_VIEWS) {
// Check whether there actually are any UAVs bound
m_state.om.isUavRendering = false;
for (uint32_t i = 0; i < NumUAVs && !m_state.om.isUavRendering; i++)
m_state.om.isUavRendering = ppUnorderedAccessViews[i] != nullptr;
for (uint32_t i = 0; i < NumUAVs && !isUavRendering; i++)
isUavRendering = ppUnorderedAccessViews[i] != nullptr;
// UAVs are made available to all shader stages in
// the graphics pipeline even though this code may
@ -2322,7 +2320,7 @@ namespace dxvk {
pUAVInitialCounts);
}
BindFramebuffer(spillOnBind);
BindFramebuffer(isUavRendering);
}
@ -3173,7 +3171,7 @@ namespace dxvk {
void D3D11DeviceContext::RestoreState() {
BindFramebuffer(m_state.om.isUavRendering);
BindFramebuffer(false);
BindShader(DxbcProgramType::VertexShader, GetCommonShader(m_state.vs.shader.ptr()));
BindShader(DxbcProgramType::HullShader, GetCommonShader(m_state.hs.shader.ptr()));

View File

@ -125,8 +125,6 @@ namespace dxvk {
FLOAT blendFactor[4] = { 1.0f, 1.0f, 1.0f, 1.0f };
UINT sampleMask = 0xFFFFFFFFu;
UINT stencilRef = 0u;
BOOL isUavRendering = FALSE;
};