qzdoom/src/rendering/vulkan/system/vk_framebuffer.h

92 lines
2.6 KiB
C
Raw Normal View History

#pragma once
#include "gl_sysfb.h"
#include "vk_device.h"
#include "vk_objects.h"
class VkSamplerManager;
class VkShaderManager;
class VkRenderPassManager;
class VkRenderState;
class VKDataBuffer;
2019-02-26 14:29:08 +00:00
class VkHardwareTexture;
2019-02-27 14:37:37 +00:00
class SWSceneDrawer;
class VulkanFrameBuffer : public SystemBaseFrameBuffer
{
typedef SystemBaseFrameBuffer Super;
public:
VulkanDevice *device;
VulkanCommandBuffer *GetUploadCommands();
VulkanCommandBuffer *GetDrawCommands();
VkShaderManager *GetShaderManager() { return mShaderManager.get(); }
2019-02-26 14:29:08 +00:00
VkSamplerManager *GetSamplerManager() { return mSamplerManager.get(); }
VkRenderPassManager *GetRenderPassManager() { return mRenderPassManager.get(); }
VkRenderState *GetRenderState() { return mRenderState.get(); }
VKDataBuffer *ViewpointUBO = nullptr;
VKDataBuffer *LightBufferSSO = nullptr;
VKDataBuffer *MatricesUBO = nullptr;
VKDataBuffer *ColorsUBO = nullptr;
VKDataBuffer *GlowingWallsUBO = nullptr;
std::vector<std::unique_ptr<VulkanBuffer>> mFrameDeleteList;
2019-02-27 14:37:37 +00:00
std::unique_ptr<SWSceneDrawer> swdrawer;
VulkanFrameBuffer(void *hMonitor, bool fullscreen, VulkanDevice *dev);
~VulkanFrameBuffer();
void Update();
void InitializeState() override;
void CleanForRestart() override;
void UpdatePalette() override;
uint32_t GetCaps() override;
void WriteSavePic(player_t *player, FileWriter *file, int width, int height) override;
sector_t *RenderView(player_t *player) override;
void UnbindTexUnit(int no) override;
void TextureFilterChanged() override;
void BeginFrame() override;
void BlurScene(float amount) override;
2019-02-26 14:29:08 +00:00
IHardwareTexture *CreateHardwareTexture() override;
FModelRenderer *CreateModelRenderer(int mli) override;
IShaderProgram *CreateShaderProgram() override;
IVertexBuffer *CreateVertexBuffer() override;
IIndexBuffer *CreateIndexBuffer() override;
IDataBuffer *CreateDataBuffer(int bindingpoint, bool ssbo) override;
/*
bool WipeStartScreen(int type);
void WipeEndScreen();
bool WipeDo(int ticks);
void WipeCleanup();
*/
void SetVSync(bool vsync);
void Draw2D() override;
private:
std::unique_ptr<VkShaderManager> mShaderManager;
std::unique_ptr<VkSamplerManager> mSamplerManager;
std::unique_ptr<VkRenderPassManager> mRenderPassManager;
std::unique_ptr<VulkanCommandPool> mGraphicsCommandPool;
std::unique_ptr<VulkanCommandBuffer> mUploadCommands;
2019-02-27 14:37:37 +00:00
std::unique_ptr<VulkanCommandBuffer> mDrawCommands;
2019-02-26 10:58:03 +00:00
std::unique_ptr<VulkanSemaphore> mUploadSemaphore;
std::unique_ptr<VkRenderState> mRenderState;
int camtexcount = 0;
int lastSwapWidth = 0;
int lastSwapHeight = 0;
};
inline VulkanFrameBuffer *GetVulkanFrameBuffer() { return static_cast<VulkanFrameBuffer*>(screen); }