Skip to content

Commit

Permalink
feat: enable hardware clip planes and cull distances for mobile if th…
Browse files Browse the repository at this point in the history
…e extension is present

Also add the NO_CLIPDISTANCE_SUPPORT definition if RFL_NO_CLIP_PLANES is present
  • Loading branch information
emawind84 committed Mar 19, 2024
1 parent 2b07bf2 commit 5694fee
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/common/rendering/gl/gl_shader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -408,6 +408,8 @@ bool FShader::Load(const char * name, const char * vert_prog_lump, const char *
vp_comb << "#version 330 core\n";
#endif
vp_comb << "#define SUPPORTS_SHADOWMAPS\n";
if (gl.flags & RFL_NO_CLIP_PLANES)
vp_comb << "#define NO_CLIPDISTANCE_SUPPORT\n";

bool lightbuffertype = screen->mLights->GetBufferType();
if (!lightbuffertype)
Expand Down
2 changes: 1 addition & 1 deletion src/common/rendering/gl_load/gl_interface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -140,9 +140,9 @@ void gl_LoadExtensions()

#ifdef __MOBILE__
gl_version = 3.31;
gl.flags |= RFL_NO_CLIP_PLANES;
gl.flags |= RFL_INVALIDATE_BUFFER;
gl.flags |= RFL_SHADER_STORAGE_BUFFER;
if (!CheckExtension("GL_EXT_clip_cull_distance")) gl.flags |= RFL_NO_CLIP_PLANES;
#endif
// Don't even start if it's lower than 2.0 or no framebuffers are available (The framebuffer extension is needed for glGenerateMipmapsEXT!)
if (gl_version < 3.3f)
Expand Down

0 comments on commit 5694fee

Please sign in to comment.