[cogl/cogl-1.22] Add precision for Sampler3D



commit 651972c8d0f12b8a64a5ed83d1bf27bd938635c3
Author: Lionel Landwerlin <llandwerlin gmail com>
Date:   Fri Sep 2 02:45:29 2016 +0100

    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

 cogl/cogl-glsl-shader-boilerplate.h |    4 ++++
 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 6d882da..48ec31a 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 162911d..9b6573d 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);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]