#pragma once #include "gl_sysfb.h" #include "vk_device.h" #include "vk_objects.h" struct FRenderViewpoint; class VkSamplerManager; class VkBufferManager; class VkTextureManager; class VkShaderManager; class VkCommandBufferManager; class VkDescriptorSetManager; class VkRenderPassManager; class VkRaytrace; class VkRenderState; class VkStreamBuffer; class VkHardwareDataBuffer; class VkHardwareTexture; class VkRenderBuffers; class VkPostprocess; class SWSceneDrawer; class VulkanFrameBuffer : public SystemBaseFrameBuffer { typedef SystemBaseFrameBuffer Super; public: VulkanDevice *device; VkCommandBufferManager* GetCommands() { return mCommands.get(); } VkShaderManager *GetShaderManager() { return mShaderManager.get(); } VkSamplerManager *GetSamplerManager() { return mSamplerManager.get(); } VkBufferManager* GetBufferManager() { return mBufferManager.get(); } VkTextureManager* GetTextureManager() { return mTextureManager.get(); } VkDescriptorSetManager* GetDescriptorSetManager() { return mDescriptorSetManager.get(); } VkRenderPassManager *GetRenderPassManager() { return mRenderPassManager.get(); } VkRaytrace* GetRaytrace() { return mRaytrace.get(); } VkRenderState *GetRenderState() { return mRenderState.get(); } VkPostprocess *GetPostprocess() { return mPostprocess.get(); } VkRenderBuffers *GetBuffers() { return mActiveRenderBuffers; } FRenderState* RenderState() override; unsigned int GetLightBufferBlockSize() const; VulkanFrameBuffer(void *hMonitor, bool fullscreen, VulkanDevice *dev); ~VulkanFrameBuffer(); bool IsVulkan() override { return true; } void Update() override; void InitializeState() override; bool CompileNextShader() override; void PrecacheMaterial(FMaterial *mat, int translation) override; void UpdatePalette() override; const char* DeviceName() const override; int Backend() override { return 1; } void SetTextureFilterMode() override; void StartPrecaching() override; void BeginFrame() override; void InitLightmap(int LMTextureSize, int LMTextureCount, TArray& LMTextureData) override; void BlurScene(float amount) override; void PostProcessScene(bool swscene, int fixedcm, float flash, const std::function &afterBloomDrawEndScene2D) override; void AmbientOccludeScene(float m5) override; void SetSceneRenderTarget(bool useSSAO) override; void SetLevelMesh(hwrenderer::LevelMesh* mesh) override; void UpdateShadowMap() override; void SetSaveBuffers(bool yes) override; void ImageTransitionScene(bool unknown) override; void SetActiveRenderTarget() override; IHardwareTexture *CreateHardwareTexture(int numchannels) override; FMaterial* CreateMaterial(FGameTexture* tex, int scaleflags) override; IVertexBuffer *CreateVertexBuffer() override; IIndexBuffer *CreateIndexBuffer() override; IDataBuffer *CreateDataBuffer(int bindingpoint, bool ssbo, bool needsresize) override; FTexture *WipeStartScreen() override; FTexture *WipeEndScreen() override; TArray GetScreenshotBuffer(int &pitch, ESSType &color_type, float &gamma) override; bool GetVSync() { return mVSync; } void SetVSync(bool vsync) override; void Draw2D() override; void WaitForCommands(bool finish) override; bool RaytracingEnabled(); private: void RenderTextureView(FCanvasTexture* tex, std::function renderFunc) override; void PrintStartupLog(); void CopyScreenToBuffer(int w, int h, uint8_t *data) override; std::unique_ptr mCommands; std::unique_ptr mBufferManager; std::unique_ptr mSamplerManager; std::unique_ptr mTextureManager; std::unique_ptr mShaderManager; std::unique_ptr mScreenBuffers; std::unique_ptr mSaveBuffers; std::unique_ptr mPostprocess; std::unique_ptr mDescriptorSetManager; std::unique_ptr mRenderPassManager; std::unique_ptr mRaytrace; std::unique_ptr mRenderState; VkRenderBuffers *mActiveRenderBuffers = nullptr; bool mVSync = false; };