X Tutup
Skip to content

TWP: FREESCAPE: Fix non-compliant GLSL#6602

Merged
chkuendig merged 2 commits intoscummvm:masterfrom
chkuendig:shader-fixes
May 9, 2025
Merged

TWP: FREESCAPE: Fix non-compliant GLSL#6602
chkuendig merged 2 commits intoscummvm:masterfrom
chkuendig:shader-fixes

Conversation

@chkuendig
Copy link
Member

OpenGLES 2.0 GLSL requires:

  • Control flow is limited to forward branching and to loops where the maximum number of iterations can easily be determined at compile time. (Appendix A, 4 Control Flow)
  • In the fragment shader, support for indexing is only mandated for constant-index-expressions. (Appendix A, 5 Indexing of Arrays, Vectors and Matrices)

Generally this doesn't seem to be a limit enforced on most hardware, but for WebGL, this conformity seems to be enforced by the ANGLE Compiler used in all major browsers.

This PR, fixes the following two errors when launching TWP or Freescape games:

I tried to figure out correct upper boundary for the new iteration limits, but would be good if somebody more knowledgeable could double check.

@chkuendig chkuendig changed the title Fix non-compliant GLSL TWP: FREESCAPE: Fix non-compliant GLSL May 8, 2025
@neuromancer
Copy link
Contributor

I just tested freescape using the new shaders and looks good. I think we need @scemino to take a look to the TWP changes and we are ready to go.

@scemino
Copy link
Contributor

scemino commented May 9, 2025

I read your commits, it seems good to me, but I didn't test it.

@chkuendig chkuendig merged commit cee0ecf into scummvm:master May 9, 2025
8 checks passed
@chkuendig chkuendig deleted the shader-fixes branch August 4, 2025 20:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

X Tutup