mirror of
https://github.com/doitsujin/dxvk.git
synced 2025-02-20 10:54:16 +01:00
[d3d11] Added default constant state objects
This commit is contained in:
parent
05ef218326
commit
3cf9582187
@ -21,6 +21,27 @@ namespace dxvk {
|
||||
VK_FRONT_FACE_CLOCKWISE,
|
||||
VK_FALSE, 0.0f, 0.0f, 0.0f, 1.0f);
|
||||
|
||||
VkStencilOpState stencilOp;
|
||||
stencilOp.failOp = VK_STENCIL_OP_KEEP;
|
||||
stencilOp.passOp = VK_STENCIL_OP_KEEP;
|
||||
stencilOp.depthFailOp = VK_STENCIL_OP_KEEP;
|
||||
stencilOp.compareOp = VK_COMPARE_OP_ALWAYS;
|
||||
stencilOp.compareMask = D3D11_DEFAULT_STENCIL_READ_MASK;
|
||||
stencilOp.writeMask = D3D11_DEFAULT_STENCIL_WRITE_MASK;
|
||||
stencilOp.reference = 0;
|
||||
|
||||
m_defaultDsState = new DxvkDepthStencilState(
|
||||
VK_TRUE, VK_TRUE, VK_FALSE, VK_FALSE,
|
||||
VK_COMPARE_OP_LESS, stencilOp, stencilOp,
|
||||
0.0f, 1.0f);
|
||||
|
||||
m_defaultMsState = new DxvkMultisampleState(
|
||||
VK_SAMPLE_COUNT_1_BIT, 0xFFFFFFFFu,
|
||||
VK_FALSE, VK_FALSE, VK_FALSE, 0.0f);
|
||||
|
||||
m_defaultCbState = new DxvkBlendState(
|
||||
VK_FALSE, VK_LOGIC_OP_CLEAR, 0, nullptr);
|
||||
|
||||
this->ClearState();
|
||||
}
|
||||
|
||||
@ -94,8 +115,8 @@ namespace dxvk {
|
||||
// this->CSSetSamplers (0, D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT, nullptr);
|
||||
|
||||
this->OMSetRenderTargets(0, nullptr, nullptr);
|
||||
// this->OMSetBlendState(nullptr, nullptr, D3D11_DEFAULT_SAMPLE_MASK);
|
||||
// this->OMSetDepthStencilState(nullptr, 0);
|
||||
this->OMSetBlendState(nullptr, nullptr, D3D11_DEFAULT_SAMPLE_MASK);
|
||||
this->OMSetDepthStencilState(nullptr, 0);
|
||||
|
||||
this->RSSetState(nullptr);
|
||||
this->RSSetViewports(0, nullptr);
|
||||
@ -1059,6 +1080,8 @@ namespace dxvk {
|
||||
const FLOAT BlendFactor[4],
|
||||
UINT SampleMask) {
|
||||
Logger::err("D3D11DeviceContext::OMSetBlendState: Not implemented");
|
||||
m_context->setBlendState(m_defaultCbState);
|
||||
m_context->setMultisampleState(m_defaultMsState);
|
||||
}
|
||||
|
||||
|
||||
@ -1066,6 +1089,7 @@ namespace dxvk {
|
||||
ID3D11DepthStencilState* pDepthStencilState,
|
||||
UINT StencilRef) {
|
||||
Logger::err("D3D11DeviceContext::OMSetDepthStencilState: Not implemented");
|
||||
m_context->setDepthStencilState(m_defaultDsState);
|
||||
}
|
||||
|
||||
|
||||
|
@ -547,7 +547,10 @@ namespace dxvk {
|
||||
Rc<DxvkDevice> m_device;
|
||||
Rc<DxvkContext> m_context;
|
||||
|
||||
Rc<DxvkRasterizerState> m_defaultRsState;
|
||||
Rc<DxvkRasterizerState> m_defaultRsState;
|
||||
Rc<DxvkDepthStencilState> m_defaultDsState;
|
||||
Rc<DxvkMultisampleState> m_defaultMsState;
|
||||
Rc<DxvkBlendState> m_defaultCbState;
|
||||
|
||||
D3D11ContextState m_state;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user