diff options
| author | lucy96chen <47800040+lucy96chen@users.noreply.github.com> | 2022-05-26 10:54:35 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-05-26 10:54:35 -0700 |
| commit | 43e1b7cdc70b2fcac8a3e8ee72f5bc91726f4ec5 (patch) | |
| tree | 1e4701b4ab324a199b81e1f6c671f6660f1050c5 /tools/gfx/vulkan/vk-framebuffer.h | |
| parent | 5ff4f42c636a67724523e4fe60697cfac64908cd (diff) | |
Split render-vk.h/.cpp into a set of smaller files (#2244)
* Some preliminary work on splitting render-vk
* render-vk split, tests currently crash on null reference
* fixed circular include
Diffstat (limited to 'tools/gfx/vulkan/vk-framebuffer.h')
| -rw-r--r-- | tools/gfx/vulkan/vk-framebuffer.h | 56 |
1 files changed, 56 insertions, 0 deletions
diff --git a/tools/gfx/vulkan/vk-framebuffer.h b/tools/gfx/vulkan/vk-framebuffer.h new file mode 100644 index 000000000..7755b870b --- /dev/null +++ b/tools/gfx/vulkan/vk-framebuffer.h @@ -0,0 +1,56 @@ +// vk-framebuffer.h +#pragma once + +#include "vk-base.h" + +namespace gfx +{ + +using namespace Slang; + +namespace vk +{ + +enum +{ + kMaxRenderTargets = 8, + kMaxTargets = kMaxRenderTargets + 1, +}; + +class FramebufferLayoutImpl : public FramebufferLayoutBase +{ +public: + VkRenderPass m_renderPass; + DeviceImpl* m_renderer; + Array<VkAttachmentDescription, kMaxTargets> m_targetDescs; + Array<VkAttachmentReference, kMaxRenderTargets> m_colorReferences; + VkAttachmentReference m_depthReference; + bool m_hasDepthStencilTarget; + uint32_t m_renderTargetCount; + VkSampleCountFlagBits m_sampleCount = VK_SAMPLE_COUNT_1_BIT; + +public: + ~FramebufferLayoutImpl(); + Result init(DeviceImpl* renderer, const IFramebufferLayout::Desc& desc); +}; + +class FramebufferImpl : public FramebufferBase +{ +public: + VkFramebuffer m_handle; + ShortList<ComPtr<IResourceView>> renderTargetViews; + ComPtr<IResourceView> depthStencilView; + uint32_t m_width; + uint32_t m_height; + BreakableReference<DeviceImpl> m_renderer; + VkClearValue m_clearValues[kMaxTargets]; + RefPtr<FramebufferLayoutImpl> m_layout; + +public: + ~FramebufferImpl(); + + Result init(DeviceImpl* renderer, const IFramebuffer::Desc& desc); +}; + +} // namespace vk +} // namespace gfx |
