mirror of
https://github.com/EduApps-CDG/OpenDX
synced 2024-12-30 09:45:37 +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) {
|
if (m_state.rs.state != rasterizerState) {
|
||||||
m_state.rs.state = rasterizerState;
|
m_state.rs.state = rasterizerState;
|
||||||
|
|
||||||
if (rasterizerState != nullptr) {
|
if (rasterizerState != nullptr)
|
||||||
m_context->setRasterizerState(
|
rasterizerState->BindToContext(m_context);
|
||||||
rasterizerState->GetDXVKRasterizerState());
|
else
|
||||||
} else {
|
|
||||||
// Restore the initial state
|
|
||||||
this->SetDefaultRasterizerState();
|
this->SetDefaultRasterizerState();
|
||||||
}
|
|
||||||
|
|
||||||
// In D3D11, the rasterizer state defines
|
// In D3D11, the rasterizer state defines
|
||||||
// whether the scissor test is enabled, so
|
// 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(
|
VkStencilOpState D3D11DepthStencilState::DecodeStencilOpState(
|
||||||
const D3D11_DEPTH_STENCILOP_DESC& stencilDesc,
|
const D3D11_DEPTH_STENCILOP_DESC& stencilDesc,
|
||||||
const D3D11_DEPTH_STENCIL_DESC& desc) const {
|
const D3D11_DEPTH_STENCIL_DESC& desc) const {
|
||||||
|
@ -30,9 +30,8 @@ namespace dxvk {
|
|||||||
void GetDesc(
|
void GetDesc(
|
||||||
D3D11_DEPTH_STENCIL_DESC* pDesc) final;
|
D3D11_DEPTH_STENCIL_DESC* pDesc) final;
|
||||||
|
|
||||||
const DxvkDepthStencilState& GetDXVKDepthStencilState() const {
|
void BindToContext(
|
||||||
return m_state;
|
const Rc<DxvkContext>& ctx);
|
||||||
}
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
|
@ -86,4 +86,9 @@ namespace dxvk {
|
|||||||
*pDesc = m_desc;
|
*pDesc = m_desc;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void D3D11RasterizerState::BindToContext(const Rc<DxvkContext>& ctx) {
|
||||||
|
ctx->setRasterizerState(m_state);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
@ -29,9 +29,8 @@ namespace dxvk {
|
|||||||
void GetDesc(
|
void GetDesc(
|
||||||
D3D11_RASTERIZER_DESC* pDesc) final;
|
D3D11_RASTERIZER_DESC* pDesc) final;
|
||||||
|
|
||||||
const DxvkRasterizerState& GetDXVKRasterizerState() const {
|
void BindToContext(
|
||||||
return m_state;
|
const Rc<DxvkContext>& ctx);
|
||||||
}
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user