raze/source/common/rendering/vulkan/system/vk_framebuffer.h

115 lines
4 KiB
C
Raw Normal View History

#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<uint16_t>& LMTextureData) override;
void BlurScene(float amount) override;
2020-06-07 13:02:54 +00:00
void PostProcessScene(bool swscene, int fixedcm, float flash, const std::function<void()> &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;
2020-05-31 19:25:52 +00:00
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<uint8_t> 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<void(IntRect &)> renderFunc) override;
void PrintStartupLog();
void CopyScreenToBuffer(int w, int h, uint8_t *data) override;
std::unique_ptr<VkCommandBufferManager> mCommands;
std::unique_ptr<VkBufferManager> mBufferManager;
std::unique_ptr<VkSamplerManager> mSamplerManager;
std::unique_ptr<VkTextureManager> mTextureManager;
std::unique_ptr<VkShaderManager> mShaderManager;
std::unique_ptr<VkRenderBuffers> mScreenBuffers;
std::unique_ptr<VkRenderBuffers> mSaveBuffers;
std::unique_ptr<VkPostprocess> mPostprocess;
std::unique_ptr<VkDescriptorSetManager> mDescriptorSetManager;
std::unique_ptr<VkRenderPassManager> mRenderPassManager;
std::unique_ptr<VkRaytrace> mRaytrace;
std::unique_ptr<VkRenderState> mRenderState;
VkRenderBuffers *mActiveRenderBuffers = nullptr;
bool mVSync = false;
};