diff options
author | Lionel Landwerlin <llandwerlin@gmail.com> | 2016-09-02 02:45:29 +0100 |
---|---|---|
committer | Lionel Landwerlin <llandwerlin@gmail.com> | 2016-09-02 02:53:04 +0100 |
commit | 651972c8d0f12b8a64a5ed83d1bf27bd938635c3 (patch) | |
tree | 8ec71d8dc58f062f398da022dfede9be92087aa9 | |
parent | cfb757fea955c7f4dc671bde2e8c821d6958ba83 (diff) | |
download | cogl-651972c8d0f12b8a64a5ed83d1bf27bd938635c3.tar.gz |
Add precision for Sampler3D
GLES spec 3.0 - 4.5.4 Default Precision Qualifiers
defines the default precisions as follow for the vertex shaders :
precision highp float;
precision highp int;
precision lowp sampler2D;
precision lowp samplerCube;
and for the fragment shaders :
precision mediump int;
precision lowp sampler2D;
precision lowp samplerCube;
Therefore we need to set the Sampler3D precision in both vertex & fragment
shaders.
This also reverts :
"conform: Disable 3D textures on GLES"
commit ea34b9d7b9ade78b04d4056feb0a13fce6f7c953.
https://bugzilla.gnome.org/show_bug.cgi?id=770723
-rw-r--r-- | cogl/cogl-glsl-shader-boilerplate.h | 4 | ||||
-rw-r--r-- | tests/conform/test-conform-main.c | 4 |
2 files changed, 5 insertions, 3 deletions
diff --git a/cogl/cogl-glsl-shader-boilerplate.h b/cogl/cogl-glsl-shader-boilerplate.h index 6d882dad..48ec31a3 100644 --- a/cogl/cogl-glsl-shader-boilerplate.h +++ b/cogl/cogl-glsl-shader-boilerplate.h @@ -46,6 +46,9 @@ * this will happen for varyings but it doesn't explicitly so for * attributes */ #define _COGL_VERTEX_SHADER_BOILERPLATE \ + "#ifdef GL_ES\n" \ + "precision mediump sampler3D;\n" \ + "#endif\n" \ _COGL_COMMON_SHADER_BOILERPLATE \ "#define cogl_color_out _cogl_color\n" \ "varying vec4 _cogl_color;\n" \ @@ -61,6 +64,7 @@ #define _COGL_FRAGMENT_SHADER_BOILERPLATE \ "#ifdef GL_ES\n" \ "precision highp float;\n" \ + "precision mediump sampler3D;\n" \ "#endif\n" \ _COGL_COMMON_SHADER_BOILERPLATE \ "\n" \ diff --git a/tests/conform/test-conform-main.c b/tests/conform/test-conform-main.c index 162911d1..9b6573d9 100644 --- a/tests/conform/test-conform-main.c +++ b/tests/conform/test-conform-main.c @@ -76,9 +76,7 @@ main (int argc, char **argv) ADD_TEST (test_pixel_buffer_set_data, 0, 0); ADD_TEST (test_pixel_buffer_sub_region, 0, 0); UNPORTED_TEST (test_texture_rectangle); - ADD_TEST (test_texture_3d, - TEST_REQUIREMENT_GL | TEST_REQUIREMENT_TEXTURE_3D, - 0); + ADD_TEST (test_texture_3d, TEST_REQUIREMENT_TEXTURE_3D, 0); ADD_TEST (test_wrap_modes, 0, 0); UNPORTED_TEST (test_texture_pixmap_x11); ADD_TEST (test_texture_get_set_data, 0, 0); |