dxvk/src/d3d11/d3d11_sampler.h

59 lines
1.2 KiB
C
Raw Normal View History

2017-12-09 19:49:56 +00:00
#pragma once
2018-08-11 19:42:28 +01:00
#include "../dxvk/dxvk_device.h"
#include "../d3d10/d3d10_sampler.h"
2017-12-09 19:49:56 +00:00
#include "d3d11_device_child.h"
namespace dxvk {
class D3D11Device;
2021-01-07 20:08:55 +00:00
class D3D11SamplerState : public D3D11StateObject<ID3D11SamplerState> {
2017-12-09 19:49:56 +00:00
public:
using DescType = D3D11_SAMPLER_DESC;
2017-12-09 19:49:56 +00:00
D3D11SamplerState(
D3D11Device* device,
const D3D11_SAMPLER_DESC& desc);
2017-12-09 19:49:56 +00:00
~D3D11SamplerState();
2017-12-12 11:50:52 +00:00
HRESULT STDMETHODCALLTYPE QueryInterface(
2017-12-09 19:49:56 +00:00
REFIID riid,
void** ppvObject) final;
2017-12-12 11:50:52 +00:00
void STDMETHODCALLTYPE GetDesc(
2017-12-09 19:49:56 +00:00
D3D11_SAMPLER_DESC* pDesc) final;
Rc<DxvkSampler> GetDXVKSampler() const {
return m_sampler;
}
2018-08-11 19:42:28 +01:00
D3D10SamplerState* GetD3D10Iface() {
return &m_d3d10;
}
2017-12-09 19:49:56 +00:00
static HRESULT NormalizeDesc(
D3D11_SAMPLER_DESC* pDesc);
2017-12-09 19:49:56 +00:00
private:
D3D11_SAMPLER_DESC m_desc;
Rc<DxvkSampler> m_sampler;
2018-08-11 19:42:28 +01:00
D3D10SamplerState m_d3d10;
std::atomic<uint32_t> m_refCount = { 0u };
static bool ValidateAddressMode(
D3D11_TEXTURE_ADDRESS_MODE Mode);
static bool ValidateComparisonFunc(
D3D11_COMPARISON_FUNC Comparison);
2017-12-09 19:49:56 +00:00
};
}