#pragma once #include #include #include #include "dxgi_include.h" #include "../spirv/spirv_module.h" namespace dxvk { /** * \brief DXGI presenter * * Renders the back buffer from the * \ref DxgiSwapChain to the Vulkan * swap chain. */ class DxgiPresenter : public RcObject { public: DxgiPresenter( const Rc& device, HWND window, uint32_t bufferWidth, uint32_t bufferHeight, DXGI_FORMAT bufferFormat); ~DxgiPresenter(); /** * \brief Initializes back buffer image * \param [in] image Back buffer image */ void initBackBuffer( const Rc& image); /** * \brief Renders image to the screen * \param [in] view Source image view */ void presentImage( const Rc& view); /** * \brief Renders image to the screen * \param [in] view Source image view */ void recreateSwapchain( uint32_t bufferWidth, uint32_t bufferHeight, DXGI_FORMAT bufferFormat); private: enum BindingIds : uint32_t { Sampler = 0, Texture = 1, }; Rc m_device; Rc m_context; Rc m_surface; Rc m_swapchain; Rc m_acquireSync; Rc m_presentSync; Rc m_sampler; VkSurfaceFormatKHR pickFormat(DXGI_FORMAT fmt) const; Rc createVertexShader(); Rc createFragmentShader(); }; }