2017-12-11 13:03:07 +01:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <dxvk_device.h>
|
|
|
|
|
|
|
|
#include "d3d11_device_child.h"
|
|
|
|
#include "d3d11_util.h"
|
|
|
|
|
|
|
|
namespace dxvk {
|
|
|
|
|
|
|
|
class D3D11Device;
|
|
|
|
|
|
|
|
class D3D11BlendState : public D3D11DeviceChild<ID3D11BlendState> {
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
|
|
|
using DescType = D3D11_BLEND_DESC;
|
|
|
|
|
|
|
|
D3D11BlendState(
|
|
|
|
D3D11Device* device,
|
|
|
|
const D3D11_BLEND_DESC& desc);
|
|
|
|
~D3D11BlendState();
|
|
|
|
|
2017-12-12 12:50:52 +01:00
|
|
|
HRESULT STDMETHODCALLTYPE QueryInterface(
|
2017-12-11 13:03:07 +01:00
|
|
|
REFIID riid,
|
|
|
|
void** ppvObject) final;
|
|
|
|
|
2017-12-12 12:50:52 +01:00
|
|
|
void STDMETHODCALLTYPE GetDevice(
|
2017-12-11 13:03:07 +01:00
|
|
|
ID3D11Device **ppDevice) final;
|
|
|
|
|
2017-12-12 12:50:52 +01:00
|
|
|
void STDMETHODCALLTYPE GetDesc(
|
2017-12-11 13:03:07 +01:00
|
|
|
D3D11_BLEND_DESC* pDesc) final;
|
|
|
|
|
|
|
|
void BindToContext(
|
|
|
|
const Rc<DxvkContext>& ctx,
|
2017-12-11 14:11:18 +01:00
|
|
|
UINT sampleMask) const;
|
2017-12-11 13:03:07 +01:00
|
|
|
|
|
|
|
private:
|
|
|
|
|
|
|
|
D3D11Device* const m_device;
|
|
|
|
D3D11_BLEND_DESC m_desc;
|
|
|
|
|
|
|
|
std::array<DxvkBlendMode, 8> m_blendModes;
|
|
|
|
DxvkMultisampleState m_msState;
|
2017-12-11 14:11:18 +01:00
|
|
|
DxvkLogicOpState m_loState;
|
2017-12-11 13:03:07 +01:00
|
|
|
|
|
|
|
static DxvkBlendMode DecodeBlendMode(
|
|
|
|
const D3D11_RENDER_TARGET_BLEND_DESC& blendDesc);
|
|
|
|
|
|
|
|
static VkBlendFactor DecodeBlendFactor(
|
|
|
|
D3D11_BLEND blendFactor,
|
|
|
|
bool isAlpha);
|
|
|
|
|
|
|
|
static VkBlendOp DecodeBlendOp(
|
|
|
|
D3D11_BLEND_OP blendOp);
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|