1
0
mirror of https://github.com/doitsujin/dxvk.git synced 2025-02-08 19:54:15 +01:00
dxvk/src/d3d11/d3d11_depth_stencil.h
ZeroFault 768a078250 [d3d11] Implement state block normalization (#333)
* [d3d11] implement stateblock normalization

* add const to default state description object

* fix code formatting

* Correct the blend state normalization

* add missing error return

* code cleanup and refactoring

* remove unecessary const qualifier and fix code formatting

* [d3d11] Cosmetic changes
2018-04-30 10:41:57 +02:00

70 lines
1.6 KiB
C++

#pragma once
#include <dxvk_device.h>
#include "d3d11_device_child.h"
#include "d3d11_util.h"
namespace dxvk {
class D3D11Device;
class D3D11DepthStencilState : public D3D11DeviceChild<ID3D11DepthStencilState> {
public:
using DescType = D3D11_DEPTH_STENCIL_DESC;
D3D11DepthStencilState(
D3D11Device* device,
const D3D11_DEPTH_STENCIL_DESC& desc);
~D3D11DepthStencilState();
HRESULT STDMETHODCALLTYPE QueryInterface(
REFIID riid,
void** ppvObject) final;
void STDMETHODCALLTYPE GetDevice(
ID3D11Device **ppDevice) final;
void STDMETHODCALLTYPE GetDesc(
D3D11_DEPTH_STENCIL_DESC* pDesc) final;
void BindToContext(
const Rc<DxvkContext>& ctx);
static D3D11_DEPTH_STENCIL_DESC DefaultDesc();
static HRESULT NormalizeDesc(
D3D11_DEPTH_STENCIL_DESC* pDesc);
private:
D3D11Device* const m_device;
D3D11_DEPTH_STENCIL_DESC m_desc;
DxvkDepthStencilState m_state;
VkStencilOpState DecodeStencilOpState(
const D3D11_DEPTH_STENCILOP_DESC& StencilDesc,
const D3D11_DEPTH_STENCIL_DESC& Desc) const;
VkStencilOp DecodeStencilOp(
D3D11_STENCIL_OP Op) const;
static bool ValidateDepthFunc(
D3D11_COMPARISON_FUNC Comparison);
static bool ValidateStencilFunc(
D3D11_COMPARISON_FUNC Comparison);
static bool ValidateStencilOp(
D3D11_STENCIL_OP StencilOp);
static bool ValidateDepthWriteMask(
D3D11_DEPTH_WRITE_MASK Mask);
};
}