2017-12-09 20:49:56 +01:00
|
|
|
#pragma once
|
|
|
|
|
2018-08-11 20:42:28 +02:00
|
|
|
#include "../dxvk/dxvk_device.h"
|
|
|
|
|
|
|
|
#include "../d3d10/d3d10_sampler.h"
|
2017-12-09 20:49:56 +01:00
|
|
|
|
|
|
|
#include "d3d11_device_child.h"
|
|
|
|
|
|
|
|
namespace dxvk {
|
|
|
|
|
|
|
|
class D3D11Device;
|
|
|
|
|
|
|
|
class D3D11SamplerState : public D3D11DeviceChild<ID3D11SamplerState> {
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
2018-03-05 02:21:34 +01:00
|
|
|
using DescType = D3D11_SAMPLER_DESC;
|
|
|
|
|
2017-12-09 20:49:56 +01:00
|
|
|
D3D11SamplerState(
|
|
|
|
D3D11Device* device,
|
2018-03-05 02:21:34 +01:00
|
|
|
const D3D11_SAMPLER_DESC& desc);
|
2017-12-09 20:49:56 +01:00
|
|
|
~D3D11SamplerState();
|
|
|
|
|
2017-12-12 12:50:52 +01:00
|
|
|
HRESULT STDMETHODCALLTYPE QueryInterface(
|
2017-12-09 20:49:56 +01:00
|
|
|
REFIID riid,
|
|
|
|
void** ppvObject) final;
|
|
|
|
|
2017-12-12 12:50:52 +01:00
|
|
|
void STDMETHODCALLTYPE GetDevice(
|
2017-12-09 20:49:56 +01:00
|
|
|
ID3D11Device **ppDevice) final;
|
|
|
|
|
2017-12-12 12:50:52 +01:00
|
|
|
void STDMETHODCALLTYPE GetDesc(
|
2017-12-09 20:49:56 +01:00
|
|
|
D3D11_SAMPLER_DESC* pDesc) final;
|
|
|
|
|
|
|
|
Rc<DxvkSampler> GetDXVKSampler() const {
|
|
|
|
return m_sampler;
|
|
|
|
}
|
2018-08-11 20:42:28 +02:00
|
|
|
|
|
|
|
D3D10SamplerState* GetD3D10Iface() {
|
|
|
|
return &m_d3d10;
|
|
|
|
}
|
2017-12-09 20:49:56 +01:00
|
|
|
|
2018-03-18 23:35:40 +01:00
|
|
|
static HRESULT NormalizeDesc(
|
|
|
|
D3D11_SAMPLER_DESC* pDesc);
|
2018-03-05 02:21:34 +01:00
|
|
|
|
2017-12-09 20:49:56 +01:00
|
|
|
private:
|
|
|
|
|
2018-03-18 14:57:14 +01:00
|
|
|
D3D11Device* const m_device;
|
2017-12-09 20:49:56 +01:00
|
|
|
D3D11_SAMPLER_DESC m_desc;
|
|
|
|
Rc<DxvkSampler> m_sampler;
|
2018-08-11 20:42:28 +02:00
|
|
|
D3D10SamplerState m_d3d10;
|
2018-04-30 10:41:57 +02:00
|
|
|
|
|
|
|
static bool ValidateAddressMode(
|
|
|
|
D3D11_TEXTURE_ADDRESS_MODE Mode);
|
|
|
|
|
|
|
|
static bool ValidateComparisonFunc(
|
|
|
|
D3D11_COMPARISON_FUNC Comparison);
|
2017-12-09 20:49:56 +01:00
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|