mirror of
https://github.com/ZDoom/qzdoom.git
synced 2024-11-11 15:22:16 +00:00
- don't route calls to FMaterial::FlushAll through the framebuffer interface.
This commit is contained in:
parent
eb277cc101
commit
b106f72741
10 changed files with 12 additions and 31 deletions
|
@ -236,17 +236,6 @@ void FGLRenderer::SetupLevel()
|
||||||
//
|
//
|
||||||
//===========================================================================
|
//===========================================================================
|
||||||
|
|
||||||
void FGLRenderer::FlushTextures()
|
|
||||||
{
|
|
||||||
FMaterial::FlushAll();
|
|
||||||
}
|
|
||||||
|
|
||||||
//===========================================================================
|
|
||||||
//
|
|
||||||
//
|
|
||||||
//
|
|
||||||
//===========================================================================
|
|
||||||
|
|
||||||
bool FGLRenderer::StartOffscreen()
|
bool FGLRenderer::StartOffscreen()
|
||||||
{
|
{
|
||||||
bool firstBind = (mFBID == 0);
|
bool firstBind = (mFBID == 0);
|
||||||
|
@ -372,7 +361,7 @@ void FGLRenderer::WriteSavePic (player_t *player, FileWriter *file, int width, i
|
||||||
bounds.width = width;
|
bounds.width = width;
|
||||||
bounds.height = height;
|
bounds.height = height;
|
||||||
|
|
||||||
// if GLRenderer->mVBO is persistently mapped we must be sure the GPU finished reading from it before we fill it with new data.
|
// if mVBO is persistently mapped we must be sure the GPU finished reading from it before we fill it with new data.
|
||||||
glFinish();
|
glFinish();
|
||||||
|
|
||||||
// Switch to render buffers dimensioned for the savepic
|
// Switch to render buffers dimensioned for the savepic
|
||||||
|
@ -411,9 +400,9 @@ void FGLRenderer::WriteSavePic (player_t *player, FileWriter *file, int width, i
|
||||||
|
|
||||||
void FGLRenderer::BeginFrame()
|
void FGLRenderer::BeginFrame()
|
||||||
{
|
{
|
||||||
buffersActive = GLRenderer->mScreenBuffers->Setup(screen->mScreenViewport.width, screen->mScreenViewport.height, screen->mSceneViewport.width, screen->mSceneViewport.height);
|
buffersActive = mScreenBuffers->Setup(screen->mScreenViewport.width, screen->mScreenViewport.height, screen->mSceneViewport.width, screen->mSceneViewport.height);
|
||||||
if (buffersActive)
|
if (buffersActive)
|
||||||
buffersActive = GLRenderer->mSaveBuffers->Setup(SAVEPICWIDTH, SAVEPICHEIGHT, SAVEPICWIDTH, SAVEPICHEIGHT);
|
buffersActive = mSaveBuffers->Setup(SAVEPICWIDTH, SAVEPICHEIGHT, SAVEPICWIDTH, SAVEPICHEIGHT);
|
||||||
}
|
}
|
||||||
|
|
||||||
//===========================================================================
|
//===========================================================================
|
||||||
|
@ -606,7 +595,7 @@ void FGLRenderer::Draw2D(F2DDrawer *drawer)
|
||||||
}
|
}
|
||||||
glDisable(GL_SCISSOR_TEST);
|
glDisable(GL_SCISSOR_TEST);
|
||||||
|
|
||||||
gl_RenderState.SetVertexBuffer(GLRenderer->mVBO);
|
gl_RenderState.SetVertexBuffer(mVBO);
|
||||||
gl_RenderState.EnableTexture(true);
|
gl_RenderState.EnableTexture(true);
|
||||||
gl_RenderState.EnableBrightmap(true);
|
gl_RenderState.EnableBrightmap(true);
|
||||||
gl_RenderState.SetTextureMode(TM_MODULATE);
|
gl_RenderState.SetTextureMode(TM_MODULATE);
|
||||||
|
|
|
@ -123,7 +123,6 @@ public:
|
||||||
|
|
||||||
void ClearBorders();
|
void ClearBorders();
|
||||||
|
|
||||||
void FlushTextures();
|
|
||||||
void SetupLevel();
|
void SetupLevel();
|
||||||
void ResetSWScene();
|
void ResetSWScene();
|
||||||
|
|
||||||
|
|
|
@ -361,11 +361,6 @@ void OpenGLFrameBuffer::UnbindTexUnit(int no)
|
||||||
FHardwareTexture::Unbind(no);
|
FHardwareTexture::Unbind(no);
|
||||||
}
|
}
|
||||||
|
|
||||||
void OpenGLFrameBuffer::FlushTextures()
|
|
||||||
{
|
|
||||||
if (GLRenderer) GLRenderer->FlushTextures();
|
|
||||||
}
|
|
||||||
|
|
||||||
void OpenGLFrameBuffer::TextureFilterChanged()
|
void OpenGLFrameBuffer::TextureFilterChanged()
|
||||||
{
|
{
|
||||||
if (GLRenderer != NULL && GLRenderer->mSamplerManager != NULL) GLRenderer->mSamplerManager->SetTextureFilterMode();
|
if (GLRenderer != NULL && GLRenderer->mSamplerManager != NULL) GLRenderer->mSamplerManager->SetTextureFilterMode();
|
||||||
|
|
|
@ -37,7 +37,6 @@ public:
|
||||||
IHardwareTexture *CreateHardwareTexture(FTexture *tex) override;
|
IHardwareTexture *CreateHardwareTexture(FTexture *tex) override;
|
||||||
FModelRenderer *CreateModelRenderer(int mli) override;
|
FModelRenderer *CreateModelRenderer(int mli) override;
|
||||||
void UnbindTexUnit(int no) override;
|
void UnbindTexUnit(int no) override;
|
||||||
void FlushTextures() override;
|
|
||||||
void TextureFilterChanged() override;
|
void TextureFilterChanged() override;
|
||||||
void BeginFrame() override;
|
void BeginFrame() override;
|
||||||
void SetViewportRects(IntRect *bounds) override;
|
void SetViewportRects(IntRect *bounds) override;
|
||||||
|
|
|
@ -25,6 +25,7 @@
|
||||||
#include "c_dispatch.h"
|
#include "c_dispatch.h"
|
||||||
#include "v_video.h"
|
#include "v_video.h"
|
||||||
#include "hw_cvars.h"
|
#include "hw_cvars.h"
|
||||||
|
#include "hwrenderer/textures/hw_material.h"
|
||||||
#include "menu/menu.h"
|
#include "menu/menu.h"
|
||||||
|
|
||||||
|
|
||||||
|
@ -91,7 +92,7 @@ CUSTOM_CVAR(Float,gl_texture_filter_anisotropic,8.0f,CVAR_ARCHIVE|CVAR_GLOBALCON
|
||||||
|
|
||||||
CCMD(gl_flush)
|
CCMD(gl_flush)
|
||||||
{
|
{
|
||||||
screen->FlushTextures();
|
FMaterial::FlushAll();
|
||||||
}
|
}
|
||||||
|
|
||||||
CUSTOM_CVAR(Int, gl_texture_filter, 4, CVAR_ARCHIVE|CVAR_GLOBALCONFIG|CVAR_NOINITCALL)
|
CUSTOM_CVAR(Int, gl_texture_filter, 4, CVAR_ARCHIVE|CVAR_GLOBALCONFIG|CVAR_NOINITCALL)
|
||||||
|
@ -102,7 +103,7 @@ CUSTOM_CVAR(Int, gl_texture_filter, 4, CVAR_ARCHIVE|CVAR_GLOBALCONFIG|CVAR_NOINI
|
||||||
|
|
||||||
CUSTOM_CVAR(Bool, gl_texture_usehires, true, CVAR_ARCHIVE|CVAR_NOINITCALL)
|
CUSTOM_CVAR(Bool, gl_texture_usehires, true, CVAR_ARCHIVE|CVAR_NOINITCALL)
|
||||||
{
|
{
|
||||||
screen->FlushTextures();
|
FMaterial::FlushAll();
|
||||||
}
|
}
|
||||||
|
|
||||||
CVAR(Bool, gl_precache, false, CVAR_ARCHIVE)
|
CVAR(Bool, gl_precache, false, CVAR_ARCHIVE)
|
||||||
|
|
|
@ -111,7 +111,6 @@ SDLGLVideo::SDLGLVideo (int parm)
|
||||||
|
|
||||||
SDLGLVideo::~SDLGLVideo ()
|
SDLGLVideo::~SDLGLVideo ()
|
||||||
{
|
{
|
||||||
if (GLRenderer != NULL) GLRenderer->FlushTextures();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
DFrameBuffer *SDLGLVideo::CreateFrameBuffer ()
|
DFrameBuffer *SDLGLVideo::CreateFrameBuffer ()
|
||||||
|
|
|
@ -1030,7 +1030,7 @@ void R_SetupFrame (FRenderViewpoint &viewpoint, FViewWindow &viewwindow, AActor
|
||||||
double angx = cos(radPitch);
|
double angx = cos(radPitch);
|
||||||
double angy = sin(radPitch) * level.info->pixelstretch;
|
double angy = sin(radPitch) * level.info->pixelstretch;
|
||||||
double alen = sqrt(angx*angx + angy*angy);
|
double alen = sqrt(angx*angx + angy*angy);
|
||||||
viewpoint.HWAngles.Pitch = (float)RAD2DEG(asin(angy / alen));
|
viewpoint.HWAngles.Pitch = RAD2DEG((float)asin(angy / alen));
|
||||||
|
|
||||||
viewpoint.HWAngles.Roll.Degrees = viewpoint.Angles.Roll.Degrees; // copied for convenience.
|
viewpoint.HWAngles.Roll.Degrees = viewpoint.Angles.Roll.Degrees; // copied for convenience.
|
||||||
|
|
||||||
|
|
|
@ -43,6 +43,7 @@
|
||||||
#include "xbr/xbrz.h"
|
#include "xbr/xbrz.h"
|
||||||
#include "xbr/xbrz_old.h"
|
#include "xbr/xbrz_old.h"
|
||||||
#include "parallel_for.h"
|
#include "parallel_for.h"
|
||||||
|
#include "hwrenderer/textures/hw_material.h"
|
||||||
|
|
||||||
CUSTOM_CVAR(Int, gl_texture_hqresize, 0, CVAR_ARCHIVE | CVAR_GLOBALCONFIG | CVAR_NOINITCALL)
|
CUSTOM_CVAR(Int, gl_texture_hqresize, 0, CVAR_ARCHIVE | CVAR_GLOBALCONFIG | CVAR_NOINITCALL)
|
||||||
{
|
{
|
||||||
|
@ -56,18 +57,18 @@ CUSTOM_CVAR(Int, gl_texture_hqresize, 0, CVAR_ARCHIVE | CVAR_GLOBALCONFIG | CVAR
|
||||||
if (self == 8) self = 10;
|
if (self == 8) self = 10;
|
||||||
if (self == 9) self = 6;
|
if (self == 9) self = 6;
|
||||||
#endif
|
#endif
|
||||||
screen->FlushTextures();
|
FMaterial::FlushAll();
|
||||||
}
|
}
|
||||||
|
|
||||||
CUSTOM_CVAR(Int, gl_texture_hqresize_maxinputsize, 512, CVAR_ARCHIVE | CVAR_GLOBALCONFIG | CVAR_NOINITCALL)
|
CUSTOM_CVAR(Int, gl_texture_hqresize_maxinputsize, 512, CVAR_ARCHIVE | CVAR_GLOBALCONFIG | CVAR_NOINITCALL)
|
||||||
{
|
{
|
||||||
if (self > 1024) self = 1024;
|
if (self > 1024) self = 1024;
|
||||||
screen->FlushTextures();
|
FMaterial::FlushAll();
|
||||||
}
|
}
|
||||||
|
|
||||||
CUSTOM_CVAR(Int, gl_texture_hqresize_targets, 7, CVAR_ARCHIVE | CVAR_GLOBALCONFIG | CVAR_NOINITCALL)
|
CUSTOM_CVAR(Int, gl_texture_hqresize_targets, 7, CVAR_ARCHIVE | CVAR_GLOBALCONFIG | CVAR_NOINITCALL)
|
||||||
{
|
{
|
||||||
screen->FlushTextures();
|
FMaterial::FlushAll();
|
||||||
}
|
}
|
||||||
|
|
||||||
CVAR (Flag, gl_texture_hqresize_textures, gl_texture_hqresize_targets, 1);
|
CVAR (Flag, gl_texture_hqresize_textures, gl_texture_hqresize_targets, 1);
|
||||||
|
|
|
@ -419,7 +419,6 @@ public:
|
||||||
virtual IHardwareTexture *CreateHardwareTexture(FTexture *tex) { return nullptr; }
|
virtual IHardwareTexture *CreateHardwareTexture(FTexture *tex) { return nullptr; }
|
||||||
virtual FModelRenderer *CreateModelRenderer(int mli) { return nullptr; }
|
virtual FModelRenderer *CreateModelRenderer(int mli) { return nullptr; }
|
||||||
virtual void UnbindTexUnit(int no) {}
|
virtual void UnbindTexUnit(int no) {}
|
||||||
virtual void FlushTextures() {}
|
|
||||||
virtual void TextureFilterChanged() {}
|
virtual void TextureFilterChanged() {}
|
||||||
virtual void BeginFrame() {}
|
virtual void BeginFrame() {}
|
||||||
|
|
||||||
|
|
|
@ -155,7 +155,6 @@ Win32GLVideo::Win32GLVideo(int parm)
|
||||||
|
|
||||||
Win32GLVideo::~Win32GLVideo()
|
Win32GLVideo::~Win32GLVideo()
|
||||||
{
|
{
|
||||||
if (GLRenderer != NULL) GLRenderer->FlushTextures();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//==========================================================================
|
//==========================================================================
|
||||||
|
|
Loading…
Reference in a new issue