mirror of
https://github.com/doitsujin/dxvk.git
synced 2024-12-14 18:23:52 +01:00
3359b89166
Emulates Windows behaviour more closely. Fixes refcount-related error messages in Unreal Engine 4 (see #302), as well as a crash in Yakuza 0 (see #533).
66 lines
1.7 KiB
C++
66 lines
1.7 KiB
C++
#pragma once
|
|
|
|
#include "../dxvk/dxvk_device.h"
|
|
|
|
#include "d3d11_device_child.h"
|
|
|
|
namespace dxvk {
|
|
|
|
class D3D11Device;
|
|
|
|
/**
|
|
* \brief Shader resource view
|
|
*/
|
|
class D3D11ShaderResourceView : public D3D11DeviceChild<ID3D11ShaderResourceView> {
|
|
|
|
public:
|
|
|
|
D3D11ShaderResourceView(
|
|
D3D11Device* pDevice,
|
|
ID3D11Resource* pResource,
|
|
const D3D11_SHADER_RESOURCE_VIEW_DESC* pDesc);
|
|
|
|
~D3D11ShaderResourceView();
|
|
|
|
HRESULT STDMETHODCALLTYPE QueryInterface(REFIID riid, void** ppvObject) final;
|
|
|
|
void STDMETHODCALLTYPE GetDevice(ID3D11Device** ppDevice) final;
|
|
|
|
void STDMETHODCALLTYPE GetResource(ID3D11Resource** ppResource) final;
|
|
|
|
void STDMETHODCALLTYPE GetDesc(D3D11_SHADER_RESOURCE_VIEW_DESC* pDesc) final;
|
|
|
|
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;
|
|
}
|
|
|
|
static HRESULT GetDescFromResource(
|
|
ID3D11Resource* pResource,
|
|
D3D11_SHADER_RESOURCE_VIEW_DESC* pDesc);
|
|
|
|
static HRESULT NormalizeDesc(
|
|
ID3D11Resource* pResource,
|
|
D3D11_SHADER_RESOURCE_VIEW_DESC* pDesc);
|
|
|
|
private:
|
|
|
|
Com<D3D11Device> m_device;
|
|
ID3D11Resource* m_resource;
|
|
D3D11_SHADER_RESOURCE_VIEW_DESC m_desc;
|
|
Rc<DxvkBufferView> m_bufferView;
|
|
Rc<DxvkImageView> m_imageView;
|
|
|
|
};
|
|
|
|
}
|