Skip to content

Commit

Permalink
Fix GLSL ES bug (removed precision)
Browse files Browse the repository at this point in the history
  • Loading branch information
mortennobel committed Mar 24, 2018
1 parent 2617e79 commit 6104e54
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 14 deletions.
2 changes: 2 additions & 0 deletions em-build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ emcc -Iinclude src/imgui/imgui.cpp \
src/sre/SpriteAtlas.cpp \
src/sre/Inspector.cpp \
src/sre/Log.cpp \
src/sre/impl/UniformSet.cpp \
test/$FILENAME.cpp \
-O2 -std=c++14 -s USE_WEBGL2=1 -s FORCE_FILESYSTEM=1 -s TOTAL_MEMORY=67108864 -s USE_SDL_IMAGE=2 -s SDL2_IMAGE_FORMATS='["png"]' --preload-file test_data -s USE_SDL=2 -o html/$FILENAME.html
done
Expand Down Expand Up @@ -62,6 +63,7 @@ emcc -Iinclude src/imgui/imgui.cpp \
src/sre/SpriteAtlas.cpp \
src/sre/Inspector.cpp \
src/sre/Log.cpp \
src/sre/impl/UniformSet.cpp \
examples/$FILENAME.cpp \
-O2 -std=c++14 -s USE_WEBGL2=1 -s FORCE_FILESYSTEM=1 -s TOTAL_MEMORY=33554432 -s USE_SDL_IMAGE=2 -s SDL2_IMAGE_FORMATS='["png"]' --preload-file examples_data -s USE_SDL=2 -o html/$FILENAME.html
done
14 changes: 7 additions & 7 deletions include/sre/impl/ShaderSource.inl
Original file line number Diff line number Diff line change
Expand Up @@ -803,13 +803,13 @@ std::make_pair<std::string,std::string>("global_uniforms_incl.glsl",R"(#if __VER
layout(std140) uniform g_global_uniforms {
#endif
#ifdef GL_ES
uniform precision highp mat4 g_view;
uniform precision highp mat4 g_projection;
uniform precision highp vec4 g_viewport;
uniform precision highp vec4 g_cameraPos;
uniform precision highp vec4 g_ambientLight;
uniform precision highp vec4 g_lightColorRange[SI_LIGHTS];
uniform precision highp vec4 g_lightPosType[SI_LIGHTS];
uniform highp mat4 g_view;
uniform highp mat4 g_projection;
uniform highp vec4 g_viewport;
uniform highp vec4 g_cameraPos;
uniform highp vec4 g_ambientLight;
uniform highp vec4 g_lightColorRange[SI_LIGHTS];
uniform highp vec4 g_lightPosType[SI_LIGHTS];
#else
uniform mat4 g_view;
uniform mat4 g_projection;
Expand Down
14 changes: 7 additions & 7 deletions src/embedded_deps/global_uniforms_incl.glsl
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@
layout(std140) uniform g_global_uniforms {
#endif
#ifdef GL_ES
uniform precision highp mat4 g_view;
uniform precision highp mat4 g_projection;
uniform precision highp vec4 g_viewport;
uniform precision highp vec4 g_cameraPos;
uniform precision highp vec4 g_ambientLight;
uniform precision highp vec4 g_lightColorRange[SI_LIGHTS];
uniform precision highp vec4 g_lightPosType[SI_LIGHTS];
uniform highp mat4 g_view;
uniform highp mat4 g_projection;
uniform highp vec4 g_viewport;
uniform highp vec4 g_cameraPos;
uniform highp vec4 g_ambientLight;
uniform highp vec4 g_lightColorRange[SI_LIGHTS];
uniform highp vec4 g_lightPosType[SI_LIGHTS];
#else
uniform mat4 g_view;
uniform mat4 g_projection;
Expand Down

0 comments on commit 6104e54

Please sign in to comment.