mirror of
https://github.com/doitsujin/dxvk.git
synced 2025-01-19 05:52:11 +01:00
[d3d11] Refactored state object binding
This commit is contained in:
parent
4144e3229a
commit
352b46fe80
@ -1262,13 +1262,10 @@ namespace dxvk {
|
||||
if (m_state.rs.state != rasterizerState) {
|
||||
m_state.rs.state = rasterizerState;
|
||||
|
||||
if (rasterizerState != nullptr) {
|
||||
m_context->setRasterizerState(
|
||||
rasterizerState->GetDXVKRasterizerState());
|
||||
} else {
|
||||
// Restore the initial state
|
||||
if (rasterizerState != nullptr)
|
||||
rasterizerState->BindToContext(m_context);
|
||||
else
|
||||
this->SetDefaultRasterizerState();
|
||||
}
|
||||
|
||||
// In D3D11, the rasterizer state defines
|
||||
// whether the scissor test is enabled, so
|
||||
|
@ -47,6 +47,12 @@ namespace dxvk {
|
||||
}
|
||||
|
||||
|
||||
void D3D11DepthStencilState::BindToContext(
|
||||
const Rc<DxvkContext>& ctx) {
|
||||
ctx->setDepthStencilState(m_state);
|
||||
}
|
||||
|
||||
|
||||
VkStencilOpState D3D11DepthStencilState::DecodeStencilOpState(
|
||||
const D3D11_DEPTH_STENCILOP_DESC& stencilDesc,
|
||||
const D3D11_DEPTH_STENCIL_DESC& desc) const {
|
||||
|
@ -30,9 +30,8 @@ namespace dxvk {
|
||||
void GetDesc(
|
||||
D3D11_DEPTH_STENCIL_DESC* pDesc) final;
|
||||
|
||||
const DxvkDepthStencilState& GetDXVKDepthStencilState() const {
|
||||
return m_state;
|
||||
}
|
||||
void BindToContext(
|
||||
const Rc<DxvkContext>& ctx);
|
||||
|
||||
private:
|
||||
|
||||
|
@ -86,4 +86,9 @@ namespace dxvk {
|
||||
*pDesc = m_desc;
|
||||
}
|
||||
|
||||
|
||||
void D3D11RasterizerState::BindToContext(const Rc<DxvkContext>& ctx) {
|
||||
ctx->setRasterizerState(m_state);
|
||||
}
|
||||
|
||||
}
|
@ -29,9 +29,8 @@ namespace dxvk {
|
||||
void GetDesc(
|
||||
D3D11_RASTERIZER_DESC* pDesc) final;
|
||||
|
||||
const DxvkRasterizerState& GetDXVKRasterizerState() const {
|
||||
return m_state;
|
||||
}
|
||||
void BindToContext(
|
||||
const Rc<DxvkContext>& ctx);
|
||||
|
||||
private:
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user