- added a RenderState virtual to the FrameBuffer class.

This commit is contained in:
Christoph Oelckers 2020-04-24 16:15:18 +02:00
parent 70d30feb4c
commit 90585c4931
7 changed files with 22 additions and 1 deletions

View file

@ -514,6 +514,11 @@ void OpenGLFrameBuffer::UpdatePalette()
GLRenderer->ClearTonemapPalette();
}
FRenderState* OpenGLFrameBuffer::RenderState()
{
return &gl_RenderState;
}
//===========================================================================
//

View file

@ -27,6 +27,7 @@ public:
void InitializeState() override;
void Update() override;
FRenderState* RenderState() override;
void CleanForRestart() override;
void UpdatePalette() override;
uint32_t GetCaps() override;

View file

@ -530,6 +530,12 @@ void PolyFrameBuffer::CleanForRestart()
swdrawer.reset();
}
FRenderState* PolyFrameBuffer::RenderState()
{
return mRenderState.get();
}
void PolyFrameBuffer::PrecacheMaterial(FMaterial *mat, int translation)
{
if (mat->Source()->GetUseType() == ETextureType::SWCanvas) return;

View file

@ -35,6 +35,7 @@ public:
void InitializeState() override;
FRenderState* RenderState() override;
void CleanForRestart() override;
void PrecacheMaterial(FMaterial *mat, int translation) override;
void UpdatePalette() override;

View file

@ -67,6 +67,7 @@ class FLightBuffer;
struct HWDrawInfo;
class FMaterial;
class FGameTexture;
class FRenderState;
enum EHWCaps
{
@ -270,6 +271,7 @@ public:
virtual void BeginFrame() {}
virtual void SetWindowSize(int w, int h) {}
virtual void StartPrecaching() {}
virtual FRenderState* RenderState() { return nullptr; }
virtual int GetClientWidth() = 0;
virtual int GetClientHeight() = 0;

View file

@ -584,7 +584,7 @@ void VulkanFrameBuffer::DrawScene(HWDrawInfo *di, int drawmode)
}
GetRenderState()->SetDepthMask(true);
if (!gl_no_skyclear) screen->mPortalState->RenderFirstSkyPortal(recursion, di, *GetRenderState());
if (!gl_no_skyclear) mPortalState->RenderFirstSkyPortal(recursion, di, *GetRenderState());
di->RenderScene(*GetRenderState());
@ -995,3 +995,8 @@ void VulkanFrameBuffer::UpdateShadowMap()
{
mPostprocess->UpdateShadowMap();
}
FRenderState* VulkanFrameBuffer::RenderState()
{
return mRenderState.get();
}

View file

@ -35,6 +35,7 @@ public:
VkRenderState *GetRenderState() { return mRenderState.get(); }
VkPostprocess *GetPostprocess() { return mPostprocess.get(); }
VkRenderBuffers *GetBuffers() { return mActiveRenderBuffers; }
FRenderState* RenderState() override;
void FlushCommands(bool finish, bool lastsubmit = false);