2017-12-09 20:49:56 +01:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <dxvk_device.h>
|
|
|
|
|
|
|
|
#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-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-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
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|