2021-07-15 15:46:28 +04:30
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "Graphics/Framebuffer.h"
|
|
|
|
|
2021-07-29 17:12:13 +04:30
|
|
|
#include "Base/Base.h"
|
|
|
|
|
2021-07-15 15:46:28 +04:30
|
|
|
#include <d3d11.h>
|
|
|
|
#include <wrl.h>
|
|
|
|
|
|
|
|
namespace Light {
|
|
|
|
|
|
|
|
class dxSharedContext;
|
|
|
|
|
|
|
|
class dxFramebuffer : public Framebuffer
|
|
|
|
{
|
|
|
|
private:
|
2021-07-26 11:43:37 +04:30
|
|
|
Ref<dxSharedContext> m_Context;
|
2021-07-15 15:46:28 +04:30
|
|
|
|
|
|
|
FramebufferSpecification m_Specification;
|
|
|
|
|
|
|
|
Microsoft::WRL::ComPtr<ID3D11RenderTargetView> m_RenderTargetView;
|
|
|
|
Microsoft::WRL::ComPtr<ID3D11Texture2D> m_ColorAttachment;
|
|
|
|
Microsoft::WRL::ComPtr<ID3D11Texture2D> m_DepthStencilAttachment;
|
2021-07-29 17:12:13 +04:30
|
|
|
Microsoft::WRL::ComPtr<ID3D11ShaderResourceView> m_ShaderResourceView;
|
2021-07-15 15:46:28 +04:30
|
|
|
Microsoft::WRL::ComPtr<ID3D11DepthStencilView> m_DepthStencilView;
|
|
|
|
|
|
|
|
public:
|
2021-07-26 11:43:37 +04:30
|
|
|
dxFramebuffer(const FramebufferSpecification& specification, Ref<dxSharedContext> sharedContext);
|
2021-07-15 15:46:28 +04:30
|
|
|
|
2021-07-29 17:12:13 +04:30
|
|
|
inline void* GetColorAttachment() override { return (void*)m_ShaderResourceView.Get(); }
|
2021-07-15 15:46:28 +04:30
|
|
|
|
|
|
|
void BindAsTarget() override;
|
|
|
|
void BindAsResource() override;
|
|
|
|
|
2021-07-29 17:12:13 +04:30
|
|
|
void Resize(const glm::uvec2& size) override;
|
2021-07-15 15:46:28 +04:30
|
|
|
};
|
|
|
|
|
|
|
|
}
|