2018-01-11 12:23:55 +01:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "../dxvk/dxvk_device.h"
|
|
|
|
|
|
|
|
#include "d3d11_device_child.h"
|
|
|
|
|
|
|
|
namespace dxvk {
|
|
|
|
|
|
|
|
class D3D11Device;
|
|
|
|
|
|
|
|
/**
|
2018-02-05 22:35:23 +01:00
|
|
|
* \brief Shader resource view
|
2018-01-11 12:23:55 +01:00
|
|
|
*/
|
2018-02-05 22:35:23 +01:00
|
|
|
class D3D11ShaderResourceView : public D3D11DeviceChild<ID3D11ShaderResourceView> {
|
2018-01-11 12:23:55 +01:00
|
|
|
|
|
|
|
public:
|
|
|
|
|
2018-02-05 22:35:23 +01:00
|
|
|
D3D11ShaderResourceView(
|
2018-01-11 12:23:55 +01:00
|
|
|
D3D11Device* device,
|
|
|
|
ID3D11Resource* resource,
|
2018-02-05 22:35:23 +01:00
|
|
|
const D3D11_SHADER_RESOURCE_VIEW_DESC& desc,
|
|
|
|
const Rc<DxvkBufferView>& bufferView);
|
2018-01-11 12:23:55 +01:00
|
|
|
|
2018-02-05 22:35:23 +01:00
|
|
|
D3D11ShaderResourceView(
|
2018-01-11 12:23:55 +01:00
|
|
|
D3D11Device* device,
|
|
|
|
ID3D11Resource* resource,
|
2018-02-05 22:35:23 +01:00
|
|
|
const D3D11_SHADER_RESOURCE_VIEW_DESC& desc,
|
|
|
|
const Rc<DxvkImageView>& imageView);
|
2018-01-11 12:23:55 +01:00
|
|
|
|
2018-02-05 22:35:23 +01:00
|
|
|
~D3D11ShaderResourceView();
|
2018-01-11 12:23:55 +01:00
|
|
|
|
|
|
|
HRESULT STDMETHODCALLTYPE QueryInterface(REFIID riid, void** ppvObject) final;
|
|
|
|
|
|
|
|
void STDMETHODCALLTYPE GetDevice(ID3D11Device** ppDevice) final;
|
|
|
|
|
|
|
|
void STDMETHODCALLTYPE GetResource(ID3D11Resource** ppResource) final;
|
|
|
|
|
2018-02-05 22:35:23 +01:00
|
|
|
void STDMETHODCALLTYPE GetDesc(D3D11_SHADER_RESOURCE_VIEW_DESC* pDesc) final;
|
2018-01-11 12:23:55 +01:00
|
|
|
|
|
|
|
D3D11_RESOURCE_DIMENSION GetResourceType() const {
|
|
|
|
D3D11_RESOURCE_DIMENSION type;
|
|
|
|
m_resource->GetType(&type);
|
|
|
|
return type;
|
|
|
|
}
|
|
|
|
|
|
|
|
Rc<DxvkBufferView> GetBufferView() const {
|
|
|
|
return m_bufferView;
|
|
|
|
}
|
|
|
|
|
|
|
|
Rc<DxvkImageView> GetImageView() const {
|
|
|
|
return m_imageView;
|
|
|
|
}
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
|
|
|
Com<D3D11Device> m_device;
|
|
|
|
Com<ID3D11Resource> m_resource;
|
2018-02-05 22:35:23 +01:00
|
|
|
D3D11_SHADER_RESOURCE_VIEW_DESC m_desc;
|
2018-01-11 12:23:55 +01:00
|
|
|
Rc<DxvkBufferView> m_bufferView;
|
|
|
|
Rc<DxvkImageView> m_imageView;
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|