- force render buffers to be active.
For modern hardware the fallback path really makes no sense and this allows to simplify some things quite a bit.
This commit is contained in:
parent
8ab68264c1
commit
9ff7e5a4ef
12 changed files with 32 additions and 109 deletions
|
|
@ -238,21 +238,13 @@ uint32_t OpenGLFrameBuffer::GetCaps()
|
|||
|
||||
// describe our basic feature set
|
||||
ActorRenderFeatureFlags FlagSet = RFF_FLATSPRITES | RFF_MODELS | RFF_SLOPE3DFLOORS |
|
||||
RFF_TILTPITCH | RFF_ROLLSPRITES | RFF_POLYGONAL;
|
||||
RFF_TILTPITCH | RFF_ROLLSPRITES | RFF_POLYGONAL | RFF_MATSHADER | RFF_POSTSHADER | RFF_BRIGHTMAP;
|
||||
if (r_drawvoxels)
|
||||
FlagSet |= RFF_VOXELS;
|
||||
|
||||
if (!RenderBuffersEnabled())
|
||||
{
|
||||
// truecolor is always available when renderbuffers are unavailable because palette tonemap is not possible
|
||||
FlagSet |= RFF_TRUECOLOR | RFF_MATSHADER | RFF_BRIGHTMAP;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (gl_tonemap != 5) // not running palette tonemap shader
|
||||
FlagSet |= RFF_TRUECOLOR;
|
||||
FlagSet |= RFF_MATSHADER | RFF_POSTSHADER | RFF_BRIGHTMAP;
|
||||
}
|
||||
if (gl_tonemap != 5) // not running palette tonemap shader
|
||||
FlagSet |= RFF_TRUECOLOR;
|
||||
|
||||
return (uint32_t)FlagSet;
|
||||
}
|
||||
|
||||
|
|
@ -393,11 +385,6 @@ void OpenGLFrameBuffer::BlurScene(float amount)
|
|||
GLRenderer->BlurScene(amount);
|
||||
}
|
||||
|
||||
bool OpenGLFrameBuffer::RenderBuffersEnabled()
|
||||
{
|
||||
return FGLRenderBuffers::IsEnabled();
|
||||
}
|
||||
|
||||
void OpenGLFrameBuffer::SetViewportRects(IntRect *bounds)
|
||||
{
|
||||
Super::SetViewportRects(bounds);
|
||||
|
|
|
|||
|
|
@ -41,7 +41,6 @@ public:
|
|||
void TextureFilterChanged() override;
|
||||
void ResetFixedColormap() override;
|
||||
void BeginFrame() override;
|
||||
bool RenderBuffersEnabled() override;
|
||||
void SetViewportRects(IntRect *bounds) override;
|
||||
void BlurScene(float amount) override;
|
||||
IUniformBuffer *CreateUniformBuffer(size_t size, bool staticuse = false) override;
|
||||
|
|
|
|||
|
|
@ -128,19 +128,8 @@ bool OpenGLFrameBuffer::WipeStartScreen(int type)
|
|||
glCopyTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, viewport.left, viewport.top, viewport.width, viewport.height);
|
||||
};
|
||||
|
||||
if (FGLRenderBuffers::IsEnabled())
|
||||
{
|
||||
GLRenderer->mBuffers->BindCurrentFB();
|
||||
copyPixels();
|
||||
}
|
||||
else
|
||||
{
|
||||
GLint readbuffer = 0;
|
||||
glGetIntegerv(GL_READ_BUFFER, &readbuffer);
|
||||
glReadBuffer(GL_FRONT);
|
||||
copyPixels();
|
||||
glReadBuffer(readbuffer);
|
||||
}
|
||||
GLRenderer->mBuffers->BindCurrentFB();
|
||||
copyPixels();
|
||||
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
|
||||
|
|
@ -166,8 +155,7 @@ void OpenGLFrameBuffer::WipeEndScreen()
|
|||
glFinish();
|
||||
wipeendscreen->Bind(0, false, false);
|
||||
|
||||
if (FGLRenderBuffers::IsEnabled())
|
||||
GLRenderer->mBuffers->BindCurrentFB();
|
||||
GLRenderer->mBuffers->BindCurrentFB();
|
||||
|
||||
glCopyTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, viewport.left, viewport.top, viewport.width, viewport.height);
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
|
||||
|
|
@ -199,12 +187,9 @@ bool OpenGLFrameBuffer::WipeDo(int ticks)
|
|||
glDisable(GL_DEPTH_TEST);
|
||||
glDepthMask(false);
|
||||
|
||||
if (FGLRenderBuffers::IsEnabled())
|
||||
{
|
||||
GLRenderer->mBuffers->BindCurrentFB();
|
||||
const auto &bounds = screen->mScreenViewport;
|
||||
glViewport(bounds.left, bounds.top, bounds.width, bounds.height);
|
||||
}
|
||||
GLRenderer->mBuffers->BindCurrentFB();
|
||||
const auto &bounds = screen->mScreenViewport;
|
||||
glViewport(bounds.left, bounds.top, bounds.width, bounds.height);
|
||||
|
||||
done = ScreenWipe->Run(ticks, this);
|
||||
glDepthMask(true);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue