2017-11-29 21:46:09 +01:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <dxvk_device.h>
|
|
|
|
#include <dxvk_surface.h>
|
|
|
|
#include <dxvk_swapchain.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<DxvkDevice>& device,
|
|
|
|
HWND window,
|
|
|
|
UINT bufferWidth,
|
|
|
|
UINT bufferHeight);
|
|
|
|
|
|
|
|
~DxgiPresenter();
|
|
|
|
|
2017-12-02 11:46:25 +01:00
|
|
|
/**
|
|
|
|
* \brief Initializes back buffer image
|
|
|
|
* \param [in] image Back buffer image
|
|
|
|
*/
|
|
|
|
void initBackBuffer(
|
|
|
|
const Rc<DxvkImage>& image);
|
|
|
|
|
2017-11-29 21:46:09 +01:00
|
|
|
/**
|
|
|
|
* \brief Renders image to the screen
|
|
|
|
* \param [in] view Source image view
|
|
|
|
*/
|
|
|
|
void presentImage(
|
|
|
|
const Rc<DxvkImageView>& view);
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
|
|
|
Rc<DxvkDevice> m_device;
|
2017-12-01 10:08:49 +01:00
|
|
|
Rc<DxvkContext> m_context;
|
2017-11-29 21:46:09 +01:00
|
|
|
|
|
|
|
Rc<DxvkSurface> m_surface;
|
|
|
|
Rc<DxvkSwapchain> m_swapchain;
|
|
|
|
|
|
|
|
Rc<DxvkSemaphore> m_acquireSync;
|
|
|
|
Rc<DxvkSemaphore> m_presentSync;
|
|
|
|
|
|
|
|
Rc<DxvkShader> createVertexShader();
|
|
|
|
Rc<DxvkShader> createFragmentShader();
|
|
|
|
|
2017-12-03 00:40:58 +01:00
|
|
|
Rc<DxvkBindingLayout> createBindingLayout();
|
|
|
|
|
|
|
|
Rc<DxvkGraphicsPipeline> createPipeline();
|
|
|
|
|
2017-11-29 21:46:09 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|