From 868933d668e4ad4b6dac0bb50b3683fb05a96936 Mon Sep 17 00:00:00 2001 From: John Kessenich Date: Mon, 28 Jan 2013 17:40:21 +0000 Subject: [PATCH] Add precision.frag test. git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@20333 e7fa87d3-cd2b-0410-9028-fcbf551c1848 --- Test/precision.frag | 51 +++++++++++++++++++++++++++++++++++++++++++++ Test/testlist | 1 + 2 files changed, 52 insertions(+) create mode 100644 Test/precision.frag diff --git a/Test/precision.frag b/Test/precision.frag new file mode 100644 index 00000000..f0ea6598 --- /dev/null +++ b/Test/precision.frag @@ -0,0 +1,51 @@ +#version 100 + +varying vec3 color; + +lowp vec2 foo(mediump vec3 mv3) +{ + highp vec4 hv4; + return hv4.xy; +} + +int global_medium; + +precision highp int; + +int global_high; + +void main() +{ + lowp int sum = global_medium + global_high; + + gl_FragColor = vec4(color, 1.0f); + + int level1_high; + sum += level1_high; + + precision lowp int; + int level1_low; + sum += level1_low; + + { + int level2_low; + sum += level2_low; + + precision highp int; + int level2_high; + sum += level2_high; + do { + if (1) { + precision mediump int; + int level4_medium; + sum += level4_medium; + } + int level3_high; + sum += level3_high; + } while (1); + int level2_high2; + sum += level2_high2; + } + int level1_low3; + sum += level1_low3; +} diff --git a/Test/testlist b/Test/testlist index e55cdd83..c9a1513a 100644 --- a/Test/testlist +++ b/Test/testlist @@ -9,3 +9,4 @@ versionsErrors.vert 120.frag 130.frag 140.frag +precision.frag