feat: enable custom material and postprocess shaders on GLES backend - #47
Open
emawind84 wants to merge 6 commits into
Open
feat: enable custom material and postprocess shaders on GLES backend#47emawind84 wants to merge 6 commits into
emawind84 wants to merge 6 commits into
Conversation
emawind84
force-pushed
the
questzdoom-r15-gles-shaders-impl
branch
from
August 6, 2026 05:18
b29d5b1 to
7802789
Compare
…oid crashes on some devices Also set shader version to '300 es' by default when running on GLES device, it can be overridden by +gles_force_glsl_v100 1 command line parameter, which will force shader version to '100' and disable all shaders for backend 2.
- Ensures GLES uses the current pipeline framebuffer when appropriate instead of always binding `mSceneFB`
emawind84
force-pushed
the
questzdoom-r15-gles-shaders-impl
branch
from
August 11, 2026 05:27
e2f8f05 to
c00cf82
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Wires up the GLES backend (backend 2) to support user/mod-supplied
hardware material shaders and postprocess shaders (gl_customshader,
gl_custompost), previously only working on the GL backend (backend 0).
Postprocess ping-pong buffers (gles_renderbuffers.*): scene now renders
directly into pipeline texture 0 (matching GL's non-multisampled,
non-G-buffer path), which doubles as the first postprocess texture -
no separate scene texture or blit needed. Added the second ping-pong
texture/FBO pair, GLPPRenderState (PPRenderState implementation
mirroring GLPPRenderState in gl_renderbuffers.cpp), and the
BindSceneColorTexture/BlitSceneToTexture/BindNextFB/NextTexture
plumbing hw_postprocess.cpp needs to drive Pass1/Pass2.
FGLRenderer::PostProcessScene (gles_postprocess.cpp) now actually
calls hw_postprocess.Pass1/Pass2 instead of no-op'ing; added
BlurScene/ClearTonemapPalette (gles_framebuffer.*, gles_renderer.h)
so menu blur and palette flash, previously silently hitting
DFrameBuffer's empty stub, actually run.
Enabled usershaders compilation in gles_shader.cpp (was #if 0'd out,
with gl_customshader hardcoded false in gles_system.cpp); added
mUserShaderPath to FShader so a mod-supplied custom shader's literal
path isn't rewritten into the shaders_gles/ tree the way built-in
shader paths are.
Fixed two GLDataBuffer bugs (gles_buffers.*) that left postprocess
shader uniforms reading zeroed/garbage data even after the above was
wired up: the constructor was passing buffer target 0 (now
GL_UNIFORM_BUFFER/GL_SHADER_STORAGE_BUFFER per is_ssbo), and BindBase()
was an empty stub. Root cause went one level deeper than the target
fix alone: GLBuffer's constructor only ever calls glGenBuffers() for
GL_ARRAY_BUFFER/GL_ELEMENT_ARRAY_BUFFER, so GLDataBuffer never actually
had a backing GL buffer object regardless of target - added a separate
hasGLBuffer flag (independent of isData, which still governs the CPU
shadow copy that viewpoint/lights/bones read via a raw pointer and
must keep working unmodified) so Bind()/SetData()/SetSubData() do the
real glBufferData/glBufferSubData upload for uniform/storage buffers
too. This is what let VanRes.fp (Vanilla Essence mod) actually read
its uniforms instead of texelFetch-ing a near-constant coordinate and
covering the 3D view in a single color.