2018-02-05 22:35:23 +01:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "../dxvk/dxvk_device.h"
|
|
|
|
|
2018-08-11 23:31:45 +02:00
|
|
|
#include "../d3d10/d3d10_view_rtv.h"
|
|
|
|
|
2018-02-05 22:35:23 +01:00
|
|
|
#include "d3d11_device_child.h"
|
|
|
|
|
|
|
|
namespace dxvk {
|
|
|
|
|
|
|
|
class D3D11Device;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* \brief Render target view
|
|
|
|
*/
|
|
|
|
class D3D11RenderTargetView : public D3D11DeviceChild<ID3D11RenderTargetView> {
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
|
|
|
D3D11RenderTargetView(
|
2018-08-05 19:07:53 +02:00
|
|
|
D3D11Device* pDevice,
|
|
|
|
ID3D11Resource* pResource,
|
|
|
|
const D3D11_RENDER_TARGET_VIEW_DESC* pDesc);
|
2018-02-05 22:35:23 +01:00
|
|
|
|
|
|
|
~D3D11RenderTargetView();
|
|
|
|
|
|
|
|
HRESULT STDMETHODCALLTYPE QueryInterface(REFIID riid, void** ppvObject) final;
|
|
|
|
|
|
|
|
void STDMETHODCALLTYPE GetDevice(ID3D11Device** ppDevice) final;
|
|
|
|
|
|
|
|
void STDMETHODCALLTYPE GetResource(ID3D11Resource** ppResource) final;
|
|
|
|
|
|
|
|
void STDMETHODCALLTYPE GetDesc(D3D11_RENDER_TARGET_VIEW_DESC* pDesc) final;
|
|
|
|
|
|
|
|
D3D11_RESOURCE_DIMENSION GetResourceType() const {
|
|
|
|
D3D11_RESOURCE_DIMENSION type;
|
|
|
|
m_resource->GetType(&type);
|
|
|
|
return type;
|
|
|
|
}
|
|
|
|
|
|
|
|
Rc<DxvkImageView> GetImageView() const {
|
|
|
|
return m_view;
|
|
|
|
}
|
|
|
|
|
2018-02-06 17:31:23 +01:00
|
|
|
VkImageLayout GetRenderLayout() const {
|
2018-06-19 11:28:54 +02:00
|
|
|
return m_view->imageInfo().tiling == VK_IMAGE_TILING_OPTIMAL
|
|
|
|
? VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL
|
|
|
|
: VK_IMAGE_LAYOUT_GENERAL;
|
2018-02-06 17:31:23 +01:00
|
|
|
}
|
2018-08-11 23:31:45 +02:00
|
|
|
|
|
|
|
D3D10RenderTargetView* GetD3D10Iface() {
|
|
|
|
return &m_d3d10;
|
|
|
|
}
|
2018-02-06 17:31:23 +01:00
|
|
|
|
2018-03-17 13:42:37 +01:00
|
|
|
static HRESULT GetDescFromResource(
|
|
|
|
ID3D11Resource* pResource,
|
|
|
|
D3D11_RENDER_TARGET_VIEW_DESC* pDesc);
|
|
|
|
|
|
|
|
static HRESULT NormalizeDesc(
|
|
|
|
ID3D11Resource* pResource,
|
|
|
|
D3D11_RENDER_TARGET_VIEW_DESC* pDesc);
|
|
|
|
|
2018-02-05 22:35:23 +01:00
|
|
|
private:
|
|
|
|
|
|
|
|
Com<D3D11Device> m_device;
|
2018-08-05 20:56:04 +02:00
|
|
|
ID3D11Resource* m_resource;
|
2018-02-05 22:35:23 +01:00
|
|
|
D3D11_RENDER_TARGET_VIEW_DESC m_desc;
|
|
|
|
Rc<DxvkImageView> m_view;
|
2018-08-11 23:31:45 +02:00
|
|
|
D3D10RenderTargetView m_d3d10;
|
2018-02-05 22:35:23 +01:00
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|