Skip to content
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

Shader error: 'highp' : precision is not supported in fragment shader #1963

Open
Beuc opened this issue Jul 28, 2019 · 3 comments

Comments

@Beuc
Copy link
Contributor

commented Jul 28, 2019

I just got a report from a RenPyWeb user getting this on a tablet:

  File "glenviron_shader.pyx", line 315, in renpy.gl.glenviron_shader.check_status
Exception: Shader error: ERROR: 0:3: 'highp' : precision is not supported in fragment shader

I requested more info on the hardware, but looking at the code, it sounds like Ren'Py assumes 'highp' is available everywhere.

In the OpenGL wikibooks I wrote a few years back, I used this kind of boilerplate:
https://gitlab.com/wikibooks-opengl/modern-tutorials/blob/master/common-sdl2/shader_utils.cpp#L90

		"#ifdef GL_ES                        \n"
		"#  ifdef GL_FRAGMENT_PRECISION_HIGH \n"
		"     precision highp float;         \n"
		"#  else                             \n"
		"     precision mediump float;       \n"
		"#  endif                            \n"
		"#else                               \n"
		// Ignore unsupported precision specifiers
		"#  define lowp                      \n"
		"#  define mediump                   \n"
		"#  define highp                     \n"
		"#endif                              \n";

Not sure how current this is in 2019.

@Beuc

This comment has been minimized.

Copy link
Contributor Author

commented Jul 29, 2019

The hardware is a Huawei Mediapad 10 Link running Android 4.4.
According to the specs it carries a Vivante GC4000 GPU:
https://www.gsmarena.com/huawei_mediapad_10_link-5507.php
which should fully supported GLES 1-3:
https://bensontao.wordpress.com/2013/12/04/vivante-vega-gpu-geometry-and-tessellation-shader-overview/

The lack of 'highp' is not detected by Ren'Py and RenPyWeb quickly crashes with a JavaScript error ("cannot read property 'createImageData' of null").

I asked the user if they can test with a RAPT version for comparison just to make sure.

@Beuc

This comment has been minimized.

Copy link
Contributor Author

commented Jul 29, 2019

The user (who decided not to comment here, so I'll proxy) couldn't compare with RAPT since RAPT now requires Android 5.0 (since 7.2 or 7.3 AFAICS, I didn't find the info in the Ren'Py changelog).
I unearth my first smartphone but it already supported 'highp' so I cannot test personally (however I could check the funny results that a native 'lowp' can produce ;)).

@Beuc

This comment has been minimized.

Copy link
Contributor Author

commented Jul 30, 2019

I send a build following #1965 to the user to see if this fixes the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
1 participant
You can’t perform that action at this time.