From 1ea33cd42fa8ab1db1dc5e2975e85c93ae6c291f Mon Sep 17 00:00:00 2001 From: Alug Date: Mon, 9 Nov 2026 00:26:28 +0100 Subject: [PATCH] delet this dont needed anymore cause i dumbass lul --- src/hardware/hw_defs.h | 1 - src/hardware/hw_shaders.c | 4 --- src/hardware/hw_shaders.h | 48 -------------------------------- src/hardware/r_opengl/r_opengl.c | 15 ---------- src/i_video.h | 3 -- src/sdl/i_video.c | 18 ++++-------- src/sdl/ogl_sdl.c | 18 +----------- 7 files changed, 7 insertions(+), 100 deletions(-) diff --git a/src/hardware/hw_defs.h b/src/hardware/hw_defs.h index e336a72f1..63fea1fbb 100644 --- a/src/hardware/hw_defs.h +++ b/src/hardware/hw_defs.h @@ -196,7 +196,6 @@ enum SHADER_SKY, SHADER_PALETTE_POSTPROCESS, SHADER_UI_COLORMAP_FADE, - SHADER_DOWNSAMPLE, NUMSHADERTARGETS }; diff --git a/src/hardware/hw_shaders.c b/src/hardware/hw_shaders.c index 9d981f559..a6dd6a04d 100644 --- a/src/hardware/hw_shaders.c +++ b/src/hardware/hw_shaders.c @@ -56,9 +56,6 @@ static struct { // UI colormap fade shader {GLSL_DEFAULT_VERTEX_SHADER, GLSL_UI_COLORMAP_FADE_FRAGMENT_SHADER}, - // downsampling - {GLSL_DEFAULT_VERTEX_SHADER, GLSL_DOWNSAMPLE_FRAGMENT_SHADER}, - {NULL, NULL}, }; @@ -450,7 +447,6 @@ customshaderxlat_t shaderxlat[] = {"Sky", SHADER_SKY}, {"PalettePostprocess", SHADER_PALETTE_POSTPROCESS}, {"UIColormapFade", SHADER_UI_COLORMAP_FADE}, - {"Downsampling", SHADER_DOWNSAMPLE}, {NULL, 0}, }; diff --git a/src/hardware/hw_shaders.h b/src/hardware/hw_shaders.h index 545c92d87..4cef701a9 100644 --- a/src/hardware/hw_shaders.h +++ b/src/hardware/hw_shaders.h @@ -71,34 +71,6 @@ "gl_FragColor = texture2D(tex, gl_TexCoord[0].st) * poly_color;\n" \ "}\0" -#define GLSL_DOWNSAMPLE_FRAGMENT_SHADER \ - "#version 130\n" \ - "uniform sampler2D tex;\n" \ - "uniform vec2 inv_supersamplefactor;\n" \ - "#ifdef SRB2_PALETTE_RENDERING\n" \ - "uniform sampler3D palette_lookup_tex;\n" \ - "uniform sampler1D palette_tex;\n" \ - "#endif\n" \ - "void main(void) {\n" \ - "vec2 uv = gl_TexCoord[0].st;\n" \ - "vec2 texel_size = 1.0 / textureSize(tex, 0);\n" \ - "float blur = min(inv_supersamplefactor.x, inv_supersamplefactor.y) * 0.005;\n" \ - "vec2 offset = texel_size * blur;\n" \ - "vec4 color1 = texture2D(tex, uv + vec2(offset.x, offset.y));\n" \ - "vec4 color2 = texture2D(tex, uv + vec2(-offset.x, offset.y));\n" \ - "vec4 color3 = texture2D(tex, uv + vec2(offset.x, -offset.y));\n" \ - "vec4 color4 = texture2D(tex, uv + vec2(-offset.x, -offset.y));\n" \ - "vec4 blurred_color = (color1 + color2 + color3 + color4) * 0.25;\n" \ - "#ifdef SRB2_PALETTE_RENDERING\n" \ - "float tex_pal_idx = texture3D(palette_lookup_tex, vec3((blurred_color.rgb * 63.0 + 0.5) / 64.0))[0] * 255.0;\n" \ - "float palette_coord = (tex_pal_idx + 0.5) / 256.0;\n" \ - "vec4 final_color = texture1D(palette_tex, palette_coord);\n" \ - "#else\n" \ - "vec4 final_color = blurred_color;\n" \ - "#endif\n" \ - "gl_FragColor = final_color;\n" \ - "}\0" - // // Software fragment shader // @@ -221,26 +193,6 @@ "}\n" \ "#endif\0" -#define GLSL_SOFTWARE_FRAGMENT_SHADER_NOPAL \ - "uniform sampler2D tex;\n" \ - "uniform vec4 poly_color;\n" \ - "uniform vec4 tint_color;\n" \ - "uniform vec4 fade_color;\n" \ - "uniform float lighting;\n" \ - "uniform float fade_start;\n" \ - "uniform float fade_end;\n" \ - GLSL_DOOM_COLORMAP \ - GLSL_DOOM_LIGHT_EQUATION \ - "void main(void) {\n" \ - "vec4 texel = texture2D(tex, gl_TexCoord[0].st);\n" \ - "vec4 base_color = texel * poly_color;\n" \ - "vec4 final_color = base_color;\n" \ - GLSL_SOFTWARE_TINT_EQUATION \ - GLSL_SOFTWARE_FADE_EQUATION \ - "final_color.a = texel.a * poly_color.a;\n" \ - "gl_FragColor = final_color;\n" \ - "}\n" \ - // hand tuned adjustments for light level calculation #define GLSL_FLOOR_FUDGES \ "#define STARTMAP_FUDGE 1.06\n" \ diff --git a/src/hardware/r_opengl/r_opengl.c b/src/hardware/r_opengl/r_opengl.c index c27793901..8508eedea 100644 --- a/src/hardware/r_opengl/r_opengl.c +++ b/src/hardware/r_opengl/r_opengl.c @@ -740,9 +740,6 @@ typedef enum gluniform_scr_resolution, - // supersampling crap - gluniform_inv_supersamplefactor, - gluniform_max, } gluniform_t; @@ -2271,11 +2268,6 @@ static void GL_Shader_SetUniforms(FSurfaceInfo *Surface, GLRGBAFloat *poly, GLRG UNIFORM_2(shader->uniforms[gluniform_scr_resolution], (GLfloat)vid.width, (GLfloat)vid.height, pglUniform2f); -#ifdef USE_FBO_OGL - // supersampling crap - UNIFORM_2(shader->uniforms[gluniform_inv_supersamplefactor], InvSupersampleFactorX, InvSupersampleFactorY, pglUniform2f); -#endif - #undef UNIFORM_1 #undef UNIFORM_2 #undef UNIFORM_3 @@ -2405,9 +2397,6 @@ static boolean GL_Shader_CompileProgram(gl_shader_t *shader, GLint i) shader->uniforms[gluniform_scr_resolution] = GETUNI("scr_resolution"); - // supersampling crap - shader->uniforms[gluniform_inv_supersamplefactor] = GETUNI("inv_supersamplefactor"); - // misc. shader->uniforms[gluniform_leveltime] = GETUNI("leveltime"); @@ -2433,10 +2422,6 @@ static boolean GL_Shader_CompileProgram(gl_shader_t *shader, GLint i) UNIFORM_1(shader->uniforms[gluniform_scene_tex], 4, pglUniform1i); UNIFORM_1(shader->uniforms[gluniform_scene_depth_tex], 5, pglUniform1i); -#ifdef USE_FBO_OGL - // supersampling crap - UNIFORM_2(shader->uniforms[gluniform_inv_supersamplefactor], InvSupersampleFactorX, InvSupersampleFactorY, pglUniform2f); -#endif // restore gl shader state pglUseProgram(gl_shaderstate.program); diff --git a/src/i_video.h b/src/i_video.h index c4ea14e08..c2ae54d78 100644 --- a/src/i_video.h +++ b/src/i_video.h @@ -128,9 +128,6 @@ boolean I_CheckNativeRes(void); void I_SetBorderlessWindow(void); #ifdef USE_FBO_OGL -extern float InvSupersampleFactorX; -extern float InvSupersampleFactorY; - void RefreshOGLSDLSurface(void); void I_DownSample(void); boolean UseScreenFBO(void); diff --git a/src/sdl/i_video.c b/src/sdl/i_video.c index 23372babc..2817dd677 100644 --- a/src/sdl/i_video.c +++ b/src/sdl/i_video.c @@ -123,9 +123,7 @@ static void Impl_SetVsync(void); static INT32 desktopwidth = 0, desktopheight = 0; static void I_CheckDesktopRes(void); -#ifdef USE_FBO_OGL -static void I_ResetFBOSurface(void); -#endif + // synchronize page flipping with screen refresh consvar_t cv_vidwait = {"vid_wait", "Off", CV_SAVE|CV_CALL|CV_NOINIT, CV_OnOff, Impl_SetVsync, 0, NULL, NULL, 0, 0, NULL}; static consvar_t cv_stretch = {"stretch", "Off", CV_SAVE|CV_NOSHOWHELP, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL}; @@ -171,8 +169,6 @@ static void Impl_SetWindowIcon(void); #ifdef USE_FBO_OGL boolean downsample = false; -float InvSupersampleFactorX = 0.0; -float InvSupersampleFactorY = 0.0; #endif static INT32 Impl_SDL_Scancode_To_Keycode(SDL_Scancode code) @@ -1286,6 +1282,11 @@ void RefreshOGLSDLSurface(void) OglSdlSurface(vid.width, vid.height); } +static void I_ResetFBOSurface(void) +{ + RefreshOGLSDLSurface(); +} + void I_DownSample(void) { boolean needrefresh = false; @@ -1320,13 +1321,6 @@ void I_DownSample(void) needrefresh = false; } } - -static void I_ResetFBOSurface(void) -{ - InvSupersampleFactorX = (float)(desktopwidth) / vid.width; - InvSupersampleFactorY = (float)(desktopheight) / vid.height; - RefreshOGLSDLSurface(); -} #endif static void SDLSetMode(INT32 width, INT32 height, SDL_bool fullscreen) diff --git a/src/sdl/ogl_sdl.c b/src/sdl/ogl_sdl.c index 1893fbf86..be87e0146 100644 --- a/src/sdl/ogl_sdl.c +++ b/src/sdl/ogl_sdl.c @@ -206,11 +206,6 @@ boolean OglSdlSurface(INT32 w, INT32 h) GL_Framebuffer_Enable(); else GL_Framebuffer_Disable(); - - if (UseScreenFBO() && HWR_UseShader()) - { - HWR_CompileShaders(); - } #endif if (!first_init) @@ -233,7 +228,6 @@ void OglSdlFinishUpdate(SDL_Window *window) #ifdef USE_FBO_OGL const boolean usefbo = UseScreenFBO(); - boolean fboshader = (usefbo && !WipeInAction && HWR_UseShader()); #endif SDL_GetWindowSize(window, &sdlw, &sdlh); @@ -246,21 +240,11 @@ void OglSdlFinishUpdate(SDL_Window *window) } #endif -#ifdef USE_FBO_OGL - if (HWR_ShouldUsePaletteRendering() || fboshader) -#else if (HWR_ShouldUsePaletteRendering()) -#endif { // 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 // so i combined the palette postprocess with this crap -#ifdef USE_FBO_OGL - if (fboshader) // this looks awful with wipes - GL_SetShader(HWR_GetShaderFromTarget(SHADER_DOWNSAMPLE)); - else -#endif - GL_SetShader(HWR_GetShaderFromTarget(SHADER_PALETTE_POSTPROCESS)); // Final postprocess step of palette rendering, after everything else has been drawn. - + GL_SetShader(HWR_GetShaderFromTarget(SHADER_PALETTE_POSTPROCESS)); // Final postprocess step of palette rendering, after everything else has been drawn. GL_EnableShader(); HWR_DrawScreenFinalTexture(sdlw, sdlh); GL_UnSetShader();