#pragma once #include "gl_sysfb.h" #include "vk_device.h" #include "vk_objects.h" class VkSamplerManager; class VkShaderManager; class VkRenderPassManager; class VkRenderState; class VKDataBuffer; class VkHardwareTexture; class VulkanFrameBuffer : public SystemBaseFrameBuffer { typedef SystemBaseFrameBuffer Super; public: VulkanDevice *device; VulkanCommandBuffer *GetUploadCommands(); VulkanCommandBuffer *GetDrawCommands(); VkShaderManager *GetShaderManager() { return mShaderManager.get(); } 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> mFrameDeleteList; 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; 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 mShaderManager; std::unique_ptr mSamplerManager; std::unique_ptr mRenderPassManager; std::unique_ptr mGraphicsCommandPool; std::unique_ptr mUploadCommands; std::unique_ptr mPresentCommands; std::unique_ptr mUploadSemaphore; std::unique_ptr mRenderState; int camtexcount = 0; int lastSwapWidth = 0; int lastSwapHeight = 0; TArray AllTextures; }; inline VulkanFrameBuffer *GetVulkanFrameBuffer() { return static_cast(screen); }