mirror of
https://github.com/EduApps-CDG/OpenDX
synced 2024-12-30 09:45:37 +01:00
[d3d11] Fix immediate context initialization
The old initialization code did not take either CSMT or Deferred Contexts into account and could lead to illegal calls to beginRecording. Fixes a hang encountered in Dishonored 2.
This commit is contained in:
parent
7f6c8dff95
commit
b3aff7cd2e
@ -31,26 +31,6 @@ namespace dxvk {
|
|||||||
m_defaultBlendState = static_cast<D3D11BlendState*> (defaultBlendState.ptr());
|
m_defaultBlendState = static_cast<D3D11BlendState*> (defaultBlendState.ptr());
|
||||||
m_defaultDepthStencilState = static_cast<D3D11DepthStencilState*>(defaultDepthStencilState.ptr());
|
m_defaultDepthStencilState = static_cast<D3D11DepthStencilState*>(defaultDepthStencilState.ptr());
|
||||||
m_defaultRasterizerState = static_cast<D3D11RasterizerState*> (defaultRasterizerState.ptr());
|
m_defaultRasterizerState = static_cast<D3D11RasterizerState*> (defaultRasterizerState.ptr());
|
||||||
|
|
||||||
EmitCs([
|
|
||||||
dev = m_device,
|
|
||||||
bsState = m_defaultBlendState,
|
|
||||||
dsState = m_defaultDepthStencilState,
|
|
||||||
rsState = m_defaultRasterizerState,
|
|
||||||
blendConst = DxvkBlendConstants {
|
|
||||||
m_state.om.blendFactor[0], m_state.om.blendFactor[1],
|
|
||||||
m_state.om.blendFactor[2], m_state.om.blendFactor[3] },
|
|
||||||
stencilRef = m_state.om.stencilRef
|
|
||||||
] (DxvkContext* ctx) {
|
|
||||||
ctx->beginRecording(dev->createCommandList());
|
|
||||||
|
|
||||||
bsState->BindToContext(ctx, 0xFFFFFFFF);
|
|
||||||
dsState->BindToContext(ctx);
|
|
||||||
rsState->BindToContext(ctx);
|
|
||||||
|
|
||||||
ctx->setBlendConstants (blendConst);
|
|
||||||
ctx->setStencilReference(stencilRef);
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -10,7 +10,11 @@ namespace dxvk {
|
|||||||
Rc<DxvkDevice> Device)
|
Rc<DxvkDevice> Device)
|
||||||
: D3D11DeviceContext(pParent, Device),
|
: D3D11DeviceContext(pParent, Device),
|
||||||
m_csThread(Device->createContext()) {
|
m_csThread(Device->createContext()) {
|
||||||
|
EmitCs([cDevice = m_device] (DxvkContext* ctx) {
|
||||||
|
ctx->beginRecording(cDevice->createCommandList());
|
||||||
|
});
|
||||||
|
|
||||||
|
ClearState();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user