Skip to content

TWP: FREESCAPE: Fix non-compliant GLSL #6602

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
May 9, 2025

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
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