only apply palrender postprocess shader once

This commit is contained in:
Alug committed 2024-11-27 22:40:20 +01:00
1 parent ea0babc5c0
commit d996bc7793
4 files changed
+21 -15

No files matched your search

+2 -2
View File
@@ -5718,9 +5718,9 @@ void HWR_MakeScreenFinalTexture(void)
GL_MakeScreenTexture(HWD_SCREENTEXTURE_GENERIC2);
}
void HWR_DrawScreenFinalTexture(INT32 width, INT32 height)
void HWR_DrawScreenFinalTexture(INT32 width, INT32 height, boolean useshader)
{
GL_DrawScreenFinalTexture(HWD_SCREENTEXTURE_GENERIC2, width, height);
GL_DrawScreenFinalTexture(HWD_SCREENTEXTURE_GENERIC2, width, height, useshader);
}
#endif // HWRENDER
+1 -1
View File
@@ -131,7 +131,7 @@ void HWR_DrawIntermissionBG(void);
void HWR_DoWipe(UINT8 wipenum, UINT8 scrnnum);
void HWR_RenderVhsEffect(fixed_t upbary, fixed_t downbary, UINT8 updistort, UINT8 downdistort, UINT8 barsize);
void HWR_MakeScreenFinalTexture(void);
void HWR_DrawScreenFinalTexture(INT32 width, INT32 height);
void HWR_DrawScreenFinalTexture(INT32 width, INT32 height, boolean useshader);
// hw_main.c: Segs
void HWR_ProcessSeg(void); // Sort of like GLWall::Process in GZDoom
+16 -10
View File
@@ -3463,7 +3463,7 @@ void GL_MakeScreenTexture(int tex)
tex_downloaded = screenTextures[tex];
}
void GL_DrawScreenFinalTexture(int tex, INT32 width, INT32 height)
void GL_DrawScreenFinalTexture(int tex, INT32 width, INT32 height, boolean useshader)
{
float xfix, yfix;
float origaspect, newaspect;
@@ -3530,12 +3530,15 @@ void GL_DrawScreenFinalTexture(int tex, INT32 width, INT32 height)
pglBindTexture(GL_TEXTURE_2D, screenTextures[tex]);
// godawful but you can only ever run ONE shader per renderpass and since i dont want to draw an extra screen texture when you downsample from higher resolution (essentially killing performance)
// so i combined the palette postprocess with this crap
if (HWR_ShouldUsePaletteRendering() && (!(HWR_UseShader() && fbo_shader && !WipeInAction)))
pglUseProgram(gl_shaders[SHADER_PALETTE_POSTPROCESS].program); // palette postprocess shader
else if (HWR_UseShader() && fbo_shader && !WipeInAction) // this looks awful with wipes
pglUseProgram(gl_shaders[SHADER_DOWNSAMPLE].program);
if (useshader)
{
// godawful but you can only ever run ONE shader per renderpass and since i dont want to draw an extra screen texture when you downsample from higher resolution (essentially killing performance)
// so i combined the palette postprocess with this crap
if (HWR_ShouldUsePaletteRendering() && (!(HWR_UseShader() && fbo_shader && !WipeInAction)))
pglUseProgram(gl_shaders[SHADER_PALETTE_POSTPROCESS].program); // palette postprocess shader
else if (HWR_UseShader() && fbo_shader && !WipeInAction) // this looks awful with wipes
pglUseProgram(gl_shaders[SHADER_DOWNSAMPLE].program);
}
pglColor4ubv(white);
@@ -3543,9 +3546,12 @@ void GL_DrawScreenFinalTexture(int tex, INT32 width, INT32 height)
pglVertexPointer(3, GL_FLOAT, 0, off);
pglDrawArrays(GL_TRIANGLE_FAN, 0, 4);
if (HWR_ShouldUsePaletteRendering() || (HWR_UseShader() && fbo_shader && !WipeInAction))
pglUseProgram(0);
if (useshader)
{
if (HWR_ShouldUsePaletteRendering() || (HWR_UseShader() && fbo_shader && !WipeInAction))
pglUseProgram(0);
}
tex_downloaded = screenTextures[tex];
}
+2 -2
View File
@@ -284,7 +284,7 @@ void OglSdlFinishUpdate(boolean waitvbl)
#endif
//HWR_DrawScreenFinalTexture(sdlw, sdlh);
GL_DrawScreenFinalTexture(HWD_SCREENTEXTURE_GENERIC2, sdlw, sdlh);
GL_DrawScreenFinalTexture(HWD_SCREENTEXTURE_GENERIC2, sdlw, sdlh, true);
#ifdef USE_FBO_OGL
if (UseScreenFBO())
@@ -305,7 +305,7 @@ void OglSdlFinishUpdate(boolean waitvbl)
&& (!UseScreenFBO())
#endif
)
HWR_DrawScreenFinalTexture(realwidth, realheight);
HWR_DrawScreenFinalTexture(realwidth, realheight, false);
//HWR_DrawScreenFinalTexture(realwidth, realheight);
//GL_DrawScreenFinalTexture(HWD_SCREENTEXTURE_GENERIC2, realwidth, realheight);