Skip to content

Instantly share code, notes, and snippets.

@0x0ade
Last active January 20, 2017 14:29
Show Gist options
  • Save 0x0ade/cd5e95865c4a70248827a82058234d62 to your computer and use it in GitHub Desktop.
Save 0x0ade/cd5e95865c4a70248827a82058234d62 to your computer and use it in GitHub Desktop.
Alternate title: "This could become a fun drinking game.md"

FNADroid graphics bug debugging log:

  • glDrawElements instead of glDrawRangeElements: Nope. Android monitor GL ES profiler behaves differently - glDrawElements calls are blue.
  • Manual texture mode changes: Changes got applied on both PC and Android, but it didn't magically fix any issues.

  • Replacing the effect of the vibrating membrane in the FEZ 32 bit ending with another one used in the game: MESH VISIBLE!
  • Textures and geometry seem fine (except when using HW instancing). Issue seems to be effect related.

  • "Disabling" sin, cos, exp2, log2, fract calls: Adreno Profiler shows updated result; Phone shows no changes.
  • const -> #define: No changes at all - const functional.
  • "Disabling" rcp (1/x): Same as with the other calls - Adreno Profiler reacts, phone doesn't.

  • (18:12:27.951) [FNA] INFORMATION : GL_MAX_FRAGMENT_UNIFORM_COMPONENTS: 896
  • Used uniforms in the vibrating effect: Not that many!

  • Conditionals: None existing, excluded.

  • Everything hints at Adreno driver bug

  • Boolean negation: None found.
  • highp everything: Nope.
  • min, max: Nope.
  • dot complete replacement: Same result. Weirdly, a "non-functional" (f.e. ignores w for vec4) replacement brings different results on phone than in the profiler...

The OpenGL® ES Shading Language (Language Version: 1.00) - Appendix A: Limitations for ES 2.0 (p. 108)

Uniforms (excluding samplers) In the vertex shader, support for all forms of array indexing is mandated. In the fragment shader, support for indexing is only mandated for constant-index-expressions.

No (FEZ) effects affected - after adding the above statement as a fail case for relative array accesses, it turns out only vertex shaders seem to do it anyway.


Varyings Support for indexing with a constant-index-expression is mandated. Support for indexing with other values is not mandated.

varying highp vec4 v_TexCoord[10]; exists, but falls into the former category (indexing with a constant-index-expression).


Counting of Varyings and Uniforms

The target architecture consists of a grid of registers, 8 rows by 4 columns for varying variables and 128 rows by 4 columns for uniform variables. Each register can contain a float value.

The orientation of variables is fixed. Vectors always occupy registers in a single row. Elements of an array must be in different rows. E.g. vec4 will always occupy one row; float[8] will occupy one column. Since it is not permitted to split a variable, large arrays e.g.. for varyings, float[16] will always fail with this algorithm.

  • Changing v_TexCoord[10] to v_TexCoord[6] to take the 2 existing varyings taking two rows away into account doesn't do anything. on my device.

  • There's an uniform array larger than 128 elements in one of the FEZ shaders, but 1. it should've failed; 2. the vibrating mesh shader doesn't, and still fails.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment