Merge "Fix negative EGL tests expecting EGL_BAD_ATTRIBUTE."
diff --git a/Android.mk b/Android.mk
index e1235d4..99fd19f 100644
--- a/Android.mk
+++ b/Android.mk
@@ -79,6 +79,7 @@
framework/delibs/debase/deRandom.c \
framework/delibs/debase/deString.c \
framework/delibs/decpp/deArrayBuffer.cpp \
+ framework/delibs/decpp/deArrayUtil.cpp \
framework/delibs/decpp/deBlockBuffer.cpp \
framework/delibs/decpp/deCommandLine.cpp \
framework/delibs/decpp/deDefs.cpp \
diff --git a/MODULE_LICENSE_APACHE2 b/MODULE_LICENSE_APACHE2
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/MODULE_LICENSE_APACHE2
diff --git a/NOTICE b/NOTICE
new file mode 100644
index 0000000..0a93ef7
--- /dev/null
+++ b/NOTICE
@@ -0,0 +1,202 @@
+
+ Apache License
+ Version 2.0, January 2004
+ http://www.apache.org/licenses/
+
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+ 1. Definitions.
+
+ "License" shall mean the terms and conditions for use, reproduction,
+ and distribution as defined by Sections 1 through 9 of this document.
+
+ "Licensor" shall mean the copyright owner or entity authorized by
+ the copyright owner that is granting the License.
+
+ "Legal Entity" shall mean the union of the acting entity and all
+ other entities that control, are controlled by, or are under common
+ control with that entity. For the purposes of this definition,
+ "control" means (i) the power, direct or indirect, to cause the
+ direction or management of such entity, whether by contract or
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
+ outstanding shares, or (iii) beneficial ownership of such entity.
+
+ "You" (or "Your") shall mean an individual or Legal Entity
+ exercising permissions granted by this License.
+
+ "Source" form shall mean the preferred form for making modifications,
+ including but not limited to software source code, documentation
+ source, and configuration files.
+
+ "Object" form shall mean any form resulting from mechanical
+ transformation or translation of a Source form, including but
+ not limited to compiled object code, generated documentation,
+ and conversions to other media types.
+
+ "Work" shall mean the work of authorship, whether in Source or
+ Object form, made available under the License, as indicated by a
+ copyright notice that is included in or attached to the work
+ (an example is provided in the Appendix below).
+
+ "Derivative Works" shall mean any work, whether in Source or Object
+ form, that is based on (or derived from) the Work and for which the
+ editorial revisions, annotations, elaborations, or other modifications
+ represent, as a whole, an original work of authorship. For the purposes
+ of this License, Derivative Works shall not include works that remain
+ separable from, or merely link (or bind by name) to the interfaces of,
+ the Work and Derivative Works thereof.
+
+ "Contribution" shall mean any work of authorship, including
+ the original version of the Work and any modifications or additions
+ to that Work or Derivative Works thereof, that is intentionally
+ submitted to Licensor for inclusion in the Work by the copyright owner
+ or by an individual or Legal Entity authorized to submit on behalf of
+ the copyright owner. For the purposes of this definition, "submitted"
+ means any form of electronic, verbal, or written communication sent
+ to the Licensor or its representatives, including but not limited to
+ communication on electronic mailing lists, source code control systems,
+ and issue tracking systems that are managed by, or on behalf of, the
+ Licensor for the purpose of discussing and improving the Work, but
+ excluding communication that is conspicuously marked or otherwise
+ designated in writing by the copyright owner as "Not a Contribution."
+
+ "Contributor" shall mean Licensor and any individual or Legal Entity
+ on behalf of whom a Contribution has been received by Licensor and
+ subsequently incorporated within the Work.
+
+ 2. Grant of Copyright License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ copyright license to reproduce, prepare Derivative Works of,
+ publicly display, publicly perform, sublicense, and distribute the
+ Work and such Derivative Works in Source or Object form.
+
+ 3. Grant of Patent License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ (except as stated in this section) patent license to make, have made,
+ use, offer to sell, sell, import, and otherwise transfer the Work,
+ where such license applies only to those patent claims licensable
+ by such Contributor that are necessarily infringed by their
+ Contribution(s) alone or by combination of their Contribution(s)
+ with the Work to which such Contribution(s) was submitted. If You
+ institute patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
+ or a Contribution incorporated within the Work constitutes direct
+ or contributory patent infringement, then any patent licenses
+ granted to You under this License for that Work shall terminate
+ as of the date such litigation is filed.
+
+ 4. Redistribution. You may reproduce and distribute copies of the
+ Work or Derivative Works thereof in any medium, with or without
+ modifications, and in Source or Object form, provided that You
+ meet the following conditions:
+
+ (a) You must give any other recipients of the Work or
+ Derivative Works a copy of this License; and
+
+ (b) You must cause any modified files to carry prominent notices
+ stating that You changed the files; and
+
+ (c) You must retain, in the Source form of any Derivative Works
+ that You distribute, all copyright, patent, trademark, and
+ attribution notices from the Source form of the Work,
+ excluding those notices that do not pertain to any part of
+ the Derivative Works; and
+
+ (d) If the Work includes a "NOTICE" text file as part of its
+ distribution, then any Derivative Works that You distribute must
+ include a readable copy of the attribution notices contained
+ within such NOTICE file, excluding those notices that do not
+ pertain to any part of the Derivative Works, in at least one
+ of the following places: within a NOTICE text file distributed
+ as part of the Derivative Works; within the Source form or
+ documentation, if provided along with the Derivative Works; or,
+ within a display generated by the Derivative Works, if and
+ wherever such third-party notices normally appear. The contents
+ of the NOTICE file are for informational purposes only and
+ do not modify the License. You may add Your own attribution
+ notices within Derivative Works that You distribute, alongside
+ or as an addendum to the NOTICE text from the Work, provided
+ that such additional attribution notices cannot be construed
+ as modifying the License.
+
+ You may add Your own copyright statement to Your modifications and
+ may provide additional or different license terms and conditions
+ for use, reproduction, or distribution of Your modifications, or
+ for any such Derivative Works as a whole, provided Your use,
+ reproduction, and distribution of the Work otherwise complies with
+ the conditions stated in this License.
+
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
+ any Contribution intentionally submitted for inclusion in the Work
+ by You to the Licensor shall be under the terms and conditions of
+ this License, without any additional terms or conditions.
+ Notwithstanding the above, nothing herein shall supersede or modify
+ the terms of any separate license agreement you may have executed
+ with Licensor regarding such Contributions.
+
+ 6. Trademarks. This License does not grant permission to use the trade
+ names, trademarks, service marks, or product names of the Licensor,
+ except as required for reasonable and customary use in describing the
+ origin of the Work and reproducing the content of the NOTICE file.
+
+ 7. Disclaimer of Warranty. Unless required by applicable law or
+ agreed to in writing, Licensor provides the Work (and each
+ Contributor provides its Contributions) on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied, including, without limitation, any warranties or conditions
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+ PARTICULAR PURPOSE. You are solely responsible for determining the
+ appropriateness of using or redistributing the Work and assume any
+ risks associated with Your exercise of permissions under this License.
+
+ 8. Limitation of Liability. In no event and under no legal theory,
+ whether in tort (including negligence), contract, or otherwise,
+ unless required by applicable law (such as deliberate and grossly
+ negligent acts) or agreed to in writing, shall any Contributor be
+ liable to You for damages, including any direct, indirect, special,
+ incidental, or consequential damages of any character arising as a
+ result of this License or out of the use or inability to use the
+ Work (including but not limited to damages for loss of goodwill,
+ work stoppage, computer failure or malfunction, or any and all
+ other commercial damages or losses), even if such Contributor
+ has been advised of the possibility of such damages.
+
+ 9. Accepting Warranty or Additional Liability. While redistributing
+ the Work or Derivative Works thereof, You may choose to offer,
+ and charge a fee for, acceptance of support, warranty, indemnity,
+ or other liability obligations and/or rights consistent with this
+ License. However, in accepting such obligations, You may act only
+ on Your own behalf and on Your sole responsibility, not on behalf
+ of any other Contributor, and only if You agree to indemnify,
+ defend, and hold each Contributor harmless for any liability
+ incurred by, or claims asserted against, such Contributor by reason
+ of your accepting any such warranty or additional liability.
+
+ END OF TERMS AND CONDITIONS
+
+ APPENDIX: How to apply the Apache License to your work.
+
+ To apply the Apache License to your work, attach the following
+ boilerplate notice, with the fields enclosed by brackets "[]"
+ replaced with your own identifying information. (Don't include
+ the brackets!) The text should be enclosed in the appropriate
+ comment syntax for the file format. We also recommend that a
+ file or class name and description of purpose be included on the
+ same "printed page" as the copyright notice for easier
+ identification within third-party archives.
+
+ Copyright 2014 The Android Open Source Project
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
diff --git a/android/cts/com.drawelements.deqp.gles3.xml b/android/cts/com.drawelements.deqp.gles3.xml
index a622fe5..ce88674 100644
--- a/android/cts/com.drawelements.deqp.gles3.xml
+++ b/android/cts/com.drawelements.deqp.gles3.xml
@@ -35734,7 +35734,6 @@
<TestCase name="random">
<Test name="1" />
<Test name="2" />
-<Test name="3" />
<Test name="4" />
<Test name="5" />
<Test name="6" />
@@ -35759,7 +35758,6 @@
<Test name="25" />
<Test name="26" />
<Test name="27" />
-<Test name="28" />
<Test name="30" />
<Test name="31" />
<Test name="32" />
@@ -35778,7 +35776,6 @@
<Test name="45" />
<Test name="46" />
<Test name="47" />
-<Test name="48" />
<Test name="49" />
<Test name="51" />
<Test name="52" />
@@ -35799,9 +35796,7 @@
<Test name="68" />
<Test name="69" />
<Test name="70" />
-<Test name="71" />
<Test name="72" />
-<Test name="73" />
<Test name="74" />
<Test name="76" />
<Test name="77" />
diff --git a/android/cts/es30-lmp-mr1.txt b/android/cts/es30-lmp-mr1.txt
index f4ba082..b19ae39 100644
--- a/android/cts/es30-lmp-mr1.txt
+++ b/android/cts/es30-lmp-mr1.txt
@@ -33281,7 +33281,6 @@
dEQP-GLES3.functional.fragment_out.array.uint.r8ui_highp_uvec4
dEQP-GLES3.functional.fragment_out.random.1
dEQP-GLES3.functional.fragment_out.random.2
-dEQP-GLES3.functional.fragment_out.random.3
dEQP-GLES3.functional.fragment_out.random.4
dEQP-GLES3.functional.fragment_out.random.5
dEQP-GLES3.functional.fragment_out.random.6
@@ -33306,7 +33305,6 @@
dEQP-GLES3.functional.fragment_out.random.25
dEQP-GLES3.functional.fragment_out.random.26
dEQP-GLES3.functional.fragment_out.random.27
-dEQP-GLES3.functional.fragment_out.random.28
dEQP-GLES3.functional.fragment_out.random.30
dEQP-GLES3.functional.fragment_out.random.31
dEQP-GLES3.functional.fragment_out.random.32
@@ -33325,7 +33323,6 @@
dEQP-GLES3.functional.fragment_out.random.45
dEQP-GLES3.functional.fragment_out.random.46
dEQP-GLES3.functional.fragment_out.random.47
-dEQP-GLES3.functional.fragment_out.random.48
dEQP-GLES3.functional.fragment_out.random.49
dEQP-GLES3.functional.fragment_out.random.51
dEQP-GLES3.functional.fragment_out.random.52
@@ -33346,9 +33343,7 @@
dEQP-GLES3.functional.fragment_out.random.68
dEQP-GLES3.functional.fragment_out.random.69
dEQP-GLES3.functional.fragment_out.random.70
-dEQP-GLES3.functional.fragment_out.random.71
dEQP-GLES3.functional.fragment_out.random.72
-dEQP-GLES3.functional.fragment_out.random.73
dEQP-GLES3.functional.fragment_out.random.74
dEQP-GLES3.functional.fragment_out.random.76
dEQP-GLES3.functional.fragment_out.random.77
diff --git a/android/cts/es30-lmp.txt b/android/cts/es30-lmp.txt
index c707c4b..9e05804 100644
--- a/android/cts/es30-lmp.txt
+++ b/android/cts/es30-lmp.txt
@@ -33203,7 +33203,6 @@
dEQP-GLES3.functional.fragment_out.array.uint.r8ui_highp_uvec4
dEQP-GLES3.functional.fragment_out.random.1
dEQP-GLES3.functional.fragment_out.random.2
-dEQP-GLES3.functional.fragment_out.random.3
dEQP-GLES3.functional.fragment_out.random.4
dEQP-GLES3.functional.fragment_out.random.5
dEQP-GLES3.functional.fragment_out.random.6
@@ -33228,7 +33227,6 @@
dEQP-GLES3.functional.fragment_out.random.25
dEQP-GLES3.functional.fragment_out.random.26
dEQP-GLES3.functional.fragment_out.random.27
-dEQP-GLES3.functional.fragment_out.random.28
dEQP-GLES3.functional.fragment_out.random.30
dEQP-GLES3.functional.fragment_out.random.31
dEQP-GLES3.functional.fragment_out.random.32
@@ -33247,7 +33245,6 @@
dEQP-GLES3.functional.fragment_out.random.45
dEQP-GLES3.functional.fragment_out.random.46
dEQP-GLES3.functional.fragment_out.random.47
-dEQP-GLES3.functional.fragment_out.random.48
dEQP-GLES3.functional.fragment_out.random.49
dEQP-GLES3.functional.fragment_out.random.51
dEQP-GLES3.functional.fragment_out.random.52
@@ -33268,9 +33265,7 @@
dEQP-GLES3.functional.fragment_out.random.68
dEQP-GLES3.functional.fragment_out.random.69
dEQP-GLES3.functional.fragment_out.random.70
-dEQP-GLES3.functional.fragment_out.random.71
dEQP-GLES3.functional.fragment_out.random.72
-dEQP-GLES3.functional.fragment_out.random.73
dEQP-GLES3.functional.fragment_out.random.74
dEQP-GLES3.functional.fragment_out.random.76
dEQP-GLES3.functional.fragment_out.random.77
diff --git a/android/package/src/com/drawelements/deqp/execserver/ExecServerActivity.java b/android/package/src/com/drawelements/deqp/execserver/ExecServerActivity.java
index 981ba81..b16e4be 100644
--- a/android/package/src/com/drawelements/deqp/execserver/ExecServerActivity.java
+++ b/android/package/src/com/drawelements/deqp/execserver/ExecServerActivity.java
@@ -27,14 +27,11 @@
package com.drawelements.deqp.execserver;
import android.app.Activity;
-import android.content.Context;
import android.content.Intent;
-import android.content.pm.ActivityInfo;
import android.widget.TextView;
import android.os.Bundle;
import com.drawelements.deqp.testercore.Log;
-import com.drawelements.deqp.execserver.ExecService;
import com.drawelements.deqp.R;
public class ExecServerActivity extends Activity {
diff --git a/android/package/src/com/drawelements/deqp/execserver/ExecService.java b/android/package/src/com/drawelements/deqp/execserver/ExecService.java
index 6976fa8..d091bad 100644
--- a/android/package/src/com/drawelements/deqp/execserver/ExecService.java
+++ b/android/package/src/com/drawelements/deqp/execserver/ExecService.java
@@ -27,11 +27,8 @@
import android.app.Notification;
import android.app.PendingIntent;
import android.content.Intent;
-import android.content.Context;
-import android.content.ComponentName;
import android.os.Binder;
import android.os.IBinder;
-import android.os.Build;
import com.drawelements.deqp.execserver.ExecServerActivity;
import com.drawelements.deqp.R;
diff --git a/android/package/src/com/drawelements/deqp/execserver/ServiceStarter.java b/android/package/src/com/drawelements/deqp/execserver/ServiceStarter.java
index 817f435..8bcefd8 100644
--- a/android/package/src/com/drawelements/deqp/execserver/ServiceStarter.java
+++ b/android/package/src/com/drawelements/deqp/execserver/ServiceStarter.java
@@ -27,7 +27,6 @@
import android.os.Bundle;
import com.drawelements.deqp.testercore.Log;
import android.content.Intent;
-import com.drawelements.deqp.execserver.ExecService;
public class ServiceStarter extends Activity
{
diff --git a/android/package/src/com/drawelements/deqp/testercore/DeqpInstrumentation.java b/android/package/src/com/drawelements/deqp/testercore/DeqpInstrumentation.java
index c12d7f6..466c6fd 100644
--- a/android/package/src/com/drawelements/deqp/testercore/DeqpInstrumentation.java
+++ b/android/package/src/com/drawelements/deqp/testercore/DeqpInstrumentation.java
@@ -23,23 +23,11 @@
package com.drawelements.deqp.testercore;
-import android.app.ActivityManager;
import android.app.Instrumentation;
-import android.app.Activity;
-import android.app.NativeActivity;
-
-import android.content.Context;
-import android.content.Intent;
-import android.content.ComponentName;
-
import android.os.Bundle;
-import java.util.List;
import java.lang.Thread;
import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileNotFoundException;
-import java.io.IOException;
public class DeqpInstrumentation extends Instrumentation
{
diff --git a/android/package/src/com/drawelements/deqp/testercore/Log.java b/android/package/src/com/drawelements/deqp/testercore/Log.java
index b130153..dbed170 100644
--- a/android/package/src/com/drawelements/deqp/testercore/Log.java
+++ b/android/package/src/com/drawelements/deqp/testercore/Log.java
@@ -23,11 +23,8 @@
package com.drawelements.deqp.testercore;
-import javax.microedition.khronos.egl.*;
-
public class Log {
- private static final boolean LOG_VERBOSE = android.util.Log.isLoggable("dEQP", android.util.Log.VERBOSE);
private static final boolean LOG_DEBUG = android.util.Log.isLoggable("dEQP", android.util.Log.DEBUG);
private static final boolean LOG_INFO = true;
private static final boolean LOG_WARNING = true;
diff --git a/android/package/src/com/drawelements/deqp/testercore/RemoteAPI.java b/android/package/src/com/drawelements/deqp/testercore/RemoteAPI.java
index 10b85cc..3c7fd7a 100644
--- a/android/package/src/com/drawelements/deqp/testercore/RemoteAPI.java
+++ b/android/package/src/com/drawelements/deqp/testercore/RemoteAPI.java
@@ -27,11 +27,7 @@
import android.content.Context;
import android.content.ComponentName;
import android.content.Intent;
-import android.content.pm.PackageManager;
import android.os.Process;
-import android.os.Build;
-import android.text.TextUtils;
-import java.lang.System;
import java.util.List;
diff --git a/android/package/src/com/drawelements/deqp/testercore/TestLogParser.java b/android/package/src/com/drawelements/deqp/testercore/TestLogParser.java
index 05ee665..842ad00 100644
--- a/android/package/src/com/drawelements/deqp/testercore/TestLogParser.java
+++ b/android/package/src/com/drawelements/deqp/testercore/TestLogParser.java
@@ -23,8 +23,6 @@
package com.drawelements.deqp.testercore;
-import android.os.Build;
-
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
diff --git a/android/scripts/build.py b/android/scripts/build.py
index 93f33f5..c7342f2 100644
--- a/android/scripts/build.py
+++ b/android/scripts/build.py
@@ -189,9 +189,11 @@
print " "
if __name__ == "__main__":
+ nativeBuildTypes = ['Release', 'Debug', 'MinSizeRel', 'RelWithAsserts', 'RelWithDebInfo']
+
parser = argparse.ArgumentParser()
parser.add_argument('--is-release', dest='isRelease', type=bool, default=False, help="Build android project in release mode.")
- parser.add_argument('--native-build-type', dest='nativeBuildType', default="Release", help="Build type passed cmake when building native code.")
+ parser.add_argument('--native-build-type', dest='nativeBuildType', default="RelWithAsserts", choices=nativeBuildTypes, help="Build type passed cmake when building native code.")
parser.add_argument('--build-root', dest='buildRoot', default=common.ANDROID_DIR, help="Root directory for storing build results.")
parser.add_argument('--dump-config', dest='dumpConfig', action='store_true', help="Print out all configurations variables")
parser.add_argument('--java-api', dest='javaApi', default=common.ANDROID_JAVA_API, help="Set the API signature for the java build.")
diff --git a/android/scripts/common.py b/android/scripts/common.py
index cc66dce..241cecf 100644
--- a/android/scripts/common.py
+++ b/android/scripts/common.py
@@ -110,10 +110,20 @@
if retcode != 0:
raise Exception("Failed to execute '%s', got %d" % (str(args), retcode))
-def execArgsInDirectory (args, cwd):
- # Make sure previous stdout prints have been written out.
- sys.stdout.flush()
- process = subprocess.Popen(args, cwd=cwd)
+def execArgsInDirectory (args, cwd, linePrefix=""):
+
+ def readApplyPrefixAndPrint (source, prefix, sink):
+ while True:
+ line = source.readline()
+ if len(line) == 0: # EOF
+ break;
+ sink.write(prefix + line)
+
+ process = subprocess.Popen(args, cwd=cwd, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
+ stdoutJob = threading.Thread(target=readApplyPrefixAndPrint, args=(process.stdout, linePrefix, sys.stdout))
+ stderrJob = threading.Thread(target=readApplyPrefixAndPrint, args=(process.stdout, linePrefix, sys.stderr))
+ stdoutJob.start()
+ stderrJob.start()
retcode = process.wait()
if retcode != 0:
raise Exception("Failed to execute '%s', got %d" % (str(args), retcode))
diff --git a/android/scripts/install.py b/android/scripts/install.py
index 89e60f5..1bf63fd 100644
--- a/android/scripts/install.py
+++ b/android/scripts/install.py
@@ -32,7 +32,7 @@
common.execArgsInDirectory([common.ADB_BIN] + extraArgs + [
'uninstall',
'com.drawelements.deqp'
- ], common.ANDROID_DIR)
+ ], common.ANDROID_DIR, printPrefix)
print printPrefix + "Remove complete\n",
print printPrefix + "Installing dEQP Package...\n",
@@ -40,11 +40,15 @@
'install',
'-r',
'package/bin/dEQP-debug.apk'
- ], common.ANDROID_DIR)
+ ], common.ANDROID_DIR, printPrefix)
print printPrefix + "Install complete\n",
def installToDevice (device, printPrefix=""):
- print printPrefix + "Installing to %s (%s)...\n" % (device.serial, device.model),
+ if len(printPrefix) == 0:
+ print "Installing to %s (%s)...\n" % (device.serial, device.model),
+ else:
+ print printPrefix + "Installing to %s\n" % device.serial,
+
install(['-s', device.serial], printPrefix)
def installToAllDevices (doParallel):
diff --git a/data/gles2/shaders/functions.test b/data/gles2/shaders/functions.test
index 3f03112..6469b98 100644
--- a/data/gles2/shaders/functions.test
+++ b/data/gles2/shaders/functions.test
@@ -2355,6 +2355,8 @@
end
case return_after_loop_sequence
+ require full_glsl_es_100_support
+
values
{
input float in0 = [ -0.5 | 1.5 ];
diff --git a/data/gles2/shaders/scoping.test b/data/gles2/shaders/scoping.test
index 5408704..23e274b 100644
--- a/data/gles2/shaders/scoping.test
+++ b/data/gles2/shaders/scoping.test
@@ -106,6 +106,7 @@
case while_condition_variable_hides_local_variable
version 100 es
+ require full_glsl_es_100_support
values
{
input int in0 = [ 1 | 2 | 3 ];
@@ -160,6 +161,7 @@
case while_condition_variable_hides_global_variable
version 100 es
+ require full_glsl_es_100_support
values
{
input int in0 = [ 1 | 2 | 3 ];
diff --git a/framework/common/tcuTexture.cpp b/framework/common/tcuTexture.cpp
index ed11674..d6a2913 100644
--- a/framework/common/tcuTexture.cpp
+++ b/framework/common/tcuTexture.cpp
@@ -31,6 +31,7 @@
#include "tcuFloat.hpp"
#include "tcuTextureUtil.hpp"
#include "deStringUtil.hpp"
+#include "deArrayUtil.hpp"
#include <limits>
@@ -84,6 +85,32 @@
ptr[2] = floatToU8(val[2]);
}
+inline void writeUint24 (deUint8* dst, deUint32 val)
+{
+#if (DE_ENDIANNESS == DE_LITTLE_ENDIAN)
+ dst[0] = (deUint8)((val & 0x0000FFu) >> 0u);
+ dst[1] = (deUint8)((val & 0x00FF00u) >> 8u);
+ dst[2] = (deUint8)((val & 0xFF0000u) >> 16u);
+#else
+ dst[0] = (deUint8)((val & 0xFF0000u) >> 16u);
+ dst[1] = (deUint8)((val & 0x00FF00u) >> 8u);
+ dst[2] = (deUint8)((val & 0x0000FFu) >> 0u);
+#endif
+}
+
+inline deUint32 readUint24 (const deUint8* src)
+{
+#if (DE_ENDIANNESS == DE_LITTLE_ENDIAN)
+ return (((deUint32)src[0]) << 0u) |
+ (((deUint32)src[1]) << 8u) |
+ (((deUint32)src[2]) << 16u);
+#else
+ return (((deUint32)src[0]) << 16u) |
+ (((deUint32)src[1]) << 8u) |
+ (((deUint32)src[2]) << 0u);
+#endif
+}
+
// \todo [2011-09-21 pyry] Move to tcutil?
template <typename T>
inline T convertSatRte (float f)
@@ -113,8 +140,18 @@
return (T)intVal;
}
+inline deUint32 convertSatRteUint24 (float f)
+{
+ const deUint32 rounded = convertSatRte<deUint32>(f);
+ const deUint32 maxUint24 = 0xFFFFFFu;
+ return de::min(rounded, maxUint24);
+}
+
int getChannelSize (TextureFormat::ChannelType type)
{
+ // make sure this table is updated if format table is updated
+ DE_STATIC_ASSERT(TextureFormat::CHANNELTYPE_LAST == 26);
+
switch (type)
{
case TextureFormat::SNORM_INT8: return 1;
@@ -122,6 +159,7 @@
case TextureFormat::SNORM_INT32: return 4;
case TextureFormat::UNORM_INT8: return 1;
case TextureFormat::UNORM_INT16: return 2;
+ case TextureFormat::UNORM_INT24: return 3;
case TextureFormat::UNORM_INT32: return 4;
case TextureFormat::SIGNED_INT8: return 1;
case TextureFormat::SIGNED_INT16: return 2;
@@ -139,6 +177,9 @@
int getNumUsedChannels (TextureFormat::ChannelOrder order)
{
+ // make sure this table is updated if type table is updated
+ DE_STATIC_ASSERT(TextureFormat::CHANNELORDER_LAST == 16);
+
switch (order)
{
case TextureFormat::R: return 1;
@@ -165,6 +206,9 @@
inline float channelToFloat (const deUint8* value, TextureFormat::ChannelType type)
{
+ // make sure this table is updated if format table is updated
+ DE_STATIC_ASSERT(TextureFormat::CHANNELTYPE_LAST == 26);
+
switch (type)
{
case TextureFormat::SNORM_INT8: return de::max(-1.0f, (float)*((const deInt8*)value) / 127.0f);
@@ -172,6 +216,7 @@
case TextureFormat::SNORM_INT32: return de::max(-1.0f, (float)*((const deInt32*)value) / 2147483647.0f);
case TextureFormat::UNORM_INT8: return (float)*((const deUint8*)value) / 255.0f;
case TextureFormat::UNORM_INT16: return (float)*((const deUint16*)value) / 65535.0f;
+ case TextureFormat::UNORM_INT24: return (float)readUint24(value) / 16777215.0f;
case TextureFormat::UNORM_INT32: return (float)*((const deUint32*)value) / 4294967295.0f;
case TextureFormat::SIGNED_INT8: return (float)*((const deInt8*)value);
case TextureFormat::SIGNED_INT16: return (float)*((const deInt16*)value);
@@ -189,6 +234,9 @@
inline int channelToInt (const deUint8* value, TextureFormat::ChannelType type)
{
+ // make sure this table is updated if format table is updated
+ DE_STATIC_ASSERT(TextureFormat::CHANNELTYPE_LAST == 26);
+
switch (type)
{
case TextureFormat::SNORM_INT8: return (int)*((const deInt8*)value);
@@ -196,6 +244,7 @@
case TextureFormat::SNORM_INT32: return (int)*((const deInt32*)value);
case TextureFormat::UNORM_INT8: return (int)*((const deUint8*)value);
case TextureFormat::UNORM_INT16: return (int)*((const deUint16*)value);
+ case TextureFormat::UNORM_INT24: return (int)readUint24(value);
case TextureFormat::UNORM_INT32: return (int)*((const deUint32*)value);
case TextureFormat::SIGNED_INT8: return (int)*((const deInt8*)value);
case TextureFormat::SIGNED_INT16: return (int)*((const deInt16*)value);
@@ -213,6 +262,9 @@
void floatToChannel (deUint8* dst, float src, TextureFormat::ChannelType type)
{
+ // make sure this table is updated if format table is updated
+ DE_STATIC_ASSERT(TextureFormat::CHANNELTYPE_LAST == 26);
+
switch (type)
{
case TextureFormat::SNORM_INT8: *((deInt8*)dst) = convertSatRte<deInt8> (src * 127.0f); break;
@@ -220,6 +272,7 @@
case TextureFormat::SNORM_INT32: *((deInt32*)dst) = convertSatRte<deInt32> (src * 2147483647.0f); break;
case TextureFormat::UNORM_INT8: *((deUint8*)dst) = convertSatRte<deUint8> (src * 255.0f); break;
case TextureFormat::UNORM_INT16: *((deUint16*)dst) = convertSatRte<deUint16> (src * 65535.0f); break;
+ case TextureFormat::UNORM_INT24: writeUint24(dst, convertSatRteUint24(src * 16777215.0f)); break;
case TextureFormat::UNORM_INT32: *((deUint32*)dst) = convertSatRte<deUint32> (src * 4294967295.0f); break;
case TextureFormat::SIGNED_INT8: *((deInt8*)dst) = convertSatRte<deInt8> (src); break;
case TextureFormat::SIGNED_INT16: *((deInt16*)dst) = convertSatRte<deInt16> (src); break;
@@ -248,14 +301,32 @@
return (T)src;
}
+template <typename S>
+static inline deUint32 convertSatUint24 (S src)
+{
+ S min = (S)0u;
+ S max = (S)0xFFFFFFu;
+
+ if (src < min)
+ return (deUint32)min;
+ else if (src > max)
+ return (deUint32)max;
+ else
+ return (deUint32)src;
+}
+
void intToChannel (deUint8* dst, int src, TextureFormat::ChannelType type)
{
+ // make sure this table is updated if format table is updated
+ DE_STATIC_ASSERT(TextureFormat::CHANNELTYPE_LAST == 26);
+
switch (type)
{
case TextureFormat::SNORM_INT8: *((deInt8*)dst) = convertSat<deInt8> (src); break;
case TextureFormat::SNORM_INT16: *((deInt16*)dst) = convertSat<deInt16> (src); break;
case TextureFormat::UNORM_INT8: *((deUint8*)dst) = convertSat<deUint8> (src); break;
case TextureFormat::UNORM_INT16: *((deUint16*)dst) = convertSat<deUint16> (src); break;
+ case TextureFormat::UNORM_INT24: writeUint24(dst, convertSatUint24(src)); break;
case TextureFormat::SIGNED_INT8: *((deInt8*)dst) = convertSat<deInt8> (src); break;
case TextureFormat::SIGNED_INT16: *((deInt16*)dst) = convertSat<deInt16> (src); break;
case TextureFormat::SIGNED_INT32: *((deInt32*)dst) = convertSat<deInt32> (src); break;
@@ -447,52 +518,7 @@
return 8;
}
else
- {
- int numChannels = 0;
- int channelSize = 0;
-
- switch (order)
- {
- case R: numChannels = 1; break;
- case A: numChannels = 1; break;
- case I: numChannels = 1; break;
- case L: numChannels = 1; break;
- case LA: numChannels = 2; break;
- case RG: numChannels = 2; break;
- case RA: numChannels = 2; break;
- case RGB: numChannels = 3; break;
- case RGBA: numChannels = 4; break;
- case ARGB: numChannels = 4; break;
- case BGRA: numChannels = 4; break;
- case sRGB: numChannels = 3; break;
- case sRGBA: numChannels = 4; break;
- case D: numChannels = 1; break;
- case S: numChannels = 1; break;
- case DS: numChannels = 2; break;
- default: DE_ASSERT(DE_FALSE);
- }
-
- switch (type)
- {
- case SNORM_INT8: channelSize = 1; break;
- case SNORM_INT16: channelSize = 2; break;
- case SNORM_INT32: channelSize = 4; break;
- case UNORM_INT8: channelSize = 1; break;
- case UNORM_INT16: channelSize = 2; break;
- case UNORM_INT32: channelSize = 4; break;
- case SIGNED_INT8: channelSize = 1; break;
- case SIGNED_INT16: channelSize = 2; break;
- case SIGNED_INT32: channelSize = 4; break;
- case UNSIGNED_INT8: channelSize = 1; break;
- case UNSIGNED_INT16: channelSize = 2; break;
- case UNSIGNED_INT32: channelSize = 4; break;
- case HALF_FLOAT: channelSize = 2; break;
- case FLOAT: channelSize = 4; break;
- default: DE_ASSERT(DE_FALSE);
- }
-
- return numChannels*channelSize;
- }
+ return getNumUsedChannels(order) * getChannelSize(type);
}
ConstPixelBufferAccess::ConstPixelBufferAccess (void)
@@ -677,8 +703,8 @@
DE_ASSERT(de::inBounds(y, 0, m_size.y()));
DE_ASSERT(de::inBounds(z, 0, m_size.z()));
- const deUint8* pixelPtr = (const deUint8*)getDataPtr() + z*m_pitch.z() + y*m_pitch.y() + x*m_pitch.x();
- IVec4 result;
+ const deUint8* const pixelPtr = (const deUint8*)getDataPtr() + z*m_pitch.z() + y*m_pitch.y() + x*m_pitch.x();
+ IVec4 result;
// Optimized fomats.
if (m_format.type == TextureFormat::UNORM_INT8)
@@ -781,7 +807,7 @@
DE_ASSERT(de::inBounds(y, 0, getHeight()));
DE_ASSERT(de::inBounds(z, 0, getDepth()));
- deUint8* pixelPtr = (deUint8*)getDataPtr() + z*m_pitch.z() + y*m_pitch.y() + x*m_pitch.x();
+ const deUint8* const pixelPtr = (const deUint8*)getDataPtr() + z*m_pitch.z() + y*m_pitch.y() + x*m_pitch.x();
#define UB32(OFFS, COUNT) ((*((const deUint32*)pixelPtr) >> (OFFS)) & ((1<<(COUNT))-1))
#define NB32(OFFS, COUNT) channelToNormFloat(UB32(OFFS, COUNT), (COUNT))
@@ -820,7 +846,7 @@
DE_ASSERT(de::inBounds(y, 0, getHeight()));
DE_ASSERT(de::inBounds(z, 0, getDepth()));
- deUint8* pixelPtr = (deUint8*)getDataPtr() + z*m_pitch.z() + y*m_pitch.y() + x*m_pitch.x();
+ const deUint8* const pixelPtr = (const deUint8*)getDataPtr() + z*m_pitch.z() + y*m_pitch.y() + x*m_pitch.x();
switch (m_format.type)
{
@@ -954,7 +980,7 @@
DE_ASSERT(de::inBounds(y, 0, getHeight()));
DE_ASSERT(de::inBounds(z, 0, getDepth()));
- deUint8* pixelPtr = (deUint8*)getDataPtr() + z*m_pitch.z() + y*m_pitch.y() + x*m_pitch.x();
+ deUint8* const pixelPtr = (deUint8*)getDataPtr() + z*m_pitch.z() + y*m_pitch.y() + x*m_pitch.x();
// Optimized fomats.
if (m_format.type == TextureFormat::UNORM_INT8)
@@ -1017,7 +1043,7 @@
DE_ASSERT(de::inBounds(y, 0, getHeight()));
DE_ASSERT(de::inBounds(z, 0, getDepth()));
- deUint8* pixelPtr = (deUint8*)getDataPtr() + z*m_pitch.z() + y*m_pitch.y() + x*m_pitch.x();
+ deUint8* const pixelPtr = (deUint8*)getDataPtr() + z*m_pitch.z() + y*m_pitch.y() + x*m_pitch.x();
#define PN(VAL, OFFS, BITS) (normFloatToChannel((VAL), (BITS)) << (OFFS))
@@ -1053,7 +1079,7 @@
DE_ASSERT(de::inBounds(y, 0, getHeight()));
DE_ASSERT(de::inBounds(z, 0, getDepth()));
- deUint8* pixelPtr = (deUint8*)getDataPtr() + z*m_pitch.z() + y*m_pitch.y() + x*m_pitch.x();
+ deUint8* const pixelPtr = (deUint8*)getDataPtr() + z*m_pitch.z() + y*m_pitch.y() + x*m_pitch.x();
#define PU(VAL, OFFS, BITS) (uintToChannel((deUint32)(VAL), (BITS)) << (OFFS))
@@ -3409,6 +3435,7 @@
"SNORM_INT32",
"UNORM_INT8",
"UNORM_INT16",
+ "UNORM_INT24",
"UNORM_INT32",
"UNORM_SHORT_565",
"UNORM_SHORT_555",
diff --git a/framework/common/tcuTexture.hpp b/framework/common/tcuTexture.hpp
index a0e2bb7..27db3ed 100644
--- a/framework/common/tcuTexture.hpp
+++ b/framework/common/tcuTexture.hpp
@@ -70,6 +70,7 @@
SNORM_INT32,
UNORM_INT8,
UNORM_INT16,
+ UNORM_INT24,
UNORM_INT32,
UNORM_SHORT_565,
UNORM_SHORT_555,
diff --git a/framework/common/tcuTextureUtil.cpp b/framework/common/tcuTextureUtil.cpp
index abc4deb..73ebc0f 100644
--- a/framework/common/tcuTextureUtil.cpp
+++ b/framework/common/tcuTextureUtil.cpp
@@ -78,12 +78,18 @@
//! Get texture channel class for format
TextureChannelClass getTextureChannelClass (TextureFormat::ChannelType channelType)
{
+ // make sure this table is updated if format table is updated
+ DE_STATIC_ASSERT(TextureFormat::CHANNELTYPE_LAST == 26);
+
switch (channelType)
{
case TextureFormat::SNORM_INT8: return TEXTURECHANNELCLASS_SIGNED_FIXED_POINT;
case TextureFormat::SNORM_INT16: return TEXTURECHANNELCLASS_SIGNED_FIXED_POINT;
+ case TextureFormat::SNORM_INT32: return TEXTURECHANNELCLASS_SIGNED_FIXED_POINT;
case TextureFormat::UNORM_INT8: return TEXTURECHANNELCLASS_UNSIGNED_FIXED_POINT;
case TextureFormat::UNORM_INT16: return TEXTURECHANNELCLASS_UNSIGNED_FIXED_POINT;
+ case TextureFormat::UNORM_INT24: return TEXTURECHANNELCLASS_UNSIGNED_FIXED_POINT;
+ case TextureFormat::UNORM_INT32: return TEXTURECHANNELCLASS_UNSIGNED_FIXED_POINT;
case TextureFormat::UNORM_SHORT_565: return TEXTURECHANNELCLASS_UNSIGNED_FIXED_POINT;
case TextureFormat::UNORM_SHORT_555: return TEXTURECHANNELCLASS_UNSIGNED_FIXED_POINT;
case TextureFormat::UNORM_SHORT_4444: return TEXTURECHANNELCLASS_UNSIGNED_FIXED_POINT;
@@ -93,6 +99,7 @@
case TextureFormat::UNSIGNED_INT_1010102_REV: return TEXTURECHANNELCLASS_UNSIGNED_INTEGER;
case TextureFormat::UNSIGNED_INT_11F_11F_10F_REV: return TEXTURECHANNELCLASS_FLOATING_POINT;
case TextureFormat::UNSIGNED_INT_999_E5_REV: return TEXTURECHANNELCLASS_FLOATING_POINT;
+ case TextureFormat::UNSIGNED_INT_24_8: return TEXTURECHANNELCLASS_LAST; //!< packed unorm24-uint8
case TextureFormat::SIGNED_INT8: return TEXTURECHANNELCLASS_SIGNED_INTEGER;
case TextureFormat::SIGNED_INT16: return TEXTURECHANNELCLASS_SIGNED_INTEGER;
case TextureFormat::SIGNED_INT32: return TEXTURECHANNELCLASS_SIGNED_INTEGER;
@@ -101,6 +108,7 @@
case TextureFormat::UNSIGNED_INT32: return TEXTURECHANNELCLASS_UNSIGNED_INTEGER;
case TextureFormat::HALF_FLOAT: return TEXTURECHANNELCLASS_FLOATING_POINT;
case TextureFormat::FLOAT: return TEXTURECHANNELCLASS_FLOATING_POINT;
+ case TextureFormat::FLOAT_UNSIGNED_INT_24_8_REV: return TEXTURECHANNELCLASS_LAST; //!< packed float32-pad24-uint8
default: return TEXTURECHANNELCLASS_LAST;
}
}
@@ -215,6 +223,9 @@
static Vec2 getChannelValueRange (TextureFormat::ChannelType channelType)
{
+ // make sure this table is updated if format table is updated
+ DE_STATIC_ASSERT(TextureFormat::CHANNELTYPE_LAST == 26);
+
float cMin = 0.0f;
float cMax = 0.0f;
@@ -222,11 +233,14 @@
{
// Signed normalized formats.
case TextureFormat::SNORM_INT8:
- case TextureFormat::SNORM_INT16: cMin = -1.0f; cMax = 1.0f; break;
+ case TextureFormat::SNORM_INT16:
+ case TextureFormat::SNORM_INT32: cMin = -1.0f; cMax = 1.0f; break;
// Unsigned normalized formats.
case TextureFormat::UNORM_INT8:
case TextureFormat::UNORM_INT16:
+ case TextureFormat::UNORM_INT24:
+ case TextureFormat::UNORM_INT32:
case TextureFormat::UNORM_SHORT_565:
case TextureFormat::UNORM_SHORT_4444:
case TextureFormat::UNORM_INT_101010:
@@ -295,6 +309,9 @@
static IVec4 getChannelBitDepth (TextureFormat::ChannelType channelType)
{
+ // make sure this table is updated if format table is updated
+ DE_STATIC_ASSERT(TextureFormat::CHANNELTYPE_LAST == 26);
+
switch (channelType)
{
case TextureFormat::SNORM_INT8: return IVec4(8);
@@ -302,6 +319,7 @@
case TextureFormat::SNORM_INT32: return IVec4(32);
case TextureFormat::UNORM_INT8: return IVec4(8);
case TextureFormat::UNORM_INT16: return IVec4(16);
+ case TextureFormat::UNORM_INT24: return IVec4(24);
case TextureFormat::UNORM_INT32: return IVec4(32);
case TextureFormat::UNORM_SHORT_565: return IVec4(5,6,5,0);
case TextureFormat::UNORM_SHORT_4444: return IVec4(4);
@@ -346,6 +364,9 @@
static IVec4 getChannelMantissaBitDepth (TextureFormat::ChannelType channelType)
{
+ // make sure this table is updated if format table is updated
+ DE_STATIC_ASSERT(TextureFormat::CHANNELTYPE_LAST == 26);
+
switch (channelType)
{
case TextureFormat::SNORM_INT8:
@@ -353,6 +374,7 @@
case TextureFormat::SNORM_INT32:
case TextureFormat::UNORM_INT8:
case TextureFormat::UNORM_INT16:
+ case TextureFormat::UNORM_INT24:
case TextureFormat::UNORM_INT32:
case TextureFormat::UNORM_SHORT_565:
case TextureFormat::UNORM_SHORT_4444:
diff --git a/framework/delibs/cmake/Defs.cmake b/framework/delibs/cmake/Defs.cmake
index f34bba5..d40bd73 100644
--- a/framework/delibs/cmake/Defs.cmake
+++ b/framework/delibs/cmake/Defs.cmake
@@ -39,6 +39,12 @@
endif ()
endmacro ()
+# Add build type RelWithAsserts
+set(CMAKE_CXX_FLAGS_RELWITHASSERTS ${CMAKE_CXX_FLAGS_RELEASE})
+set(CMAKE_C_FLAGS_RELWITHASSERTS ${CMAKE_C_FLAGS_RELEASE})
+set(CMAKE_EXE_LINKER_FLAGS_RELWITHASSERTS ${CMAKE_EXE_LINKER_FLAGS_RELEASE})
+set(CMAKE_SHARED_LINKER_FLAGS_RELWITHASSERTS ${CMAKE_SHARED_LINKER_FLAGS_RELEASE})
+
# Os detection
if (NOT DEFINED DE_OS)
if (WIN32)
@@ -133,7 +139,7 @@
# Debug definitions
if (NOT DEFINED DE_DEBUG)
- if (CMAKE_BUILD_TYPE STREQUAL "Debug")
+ if (CMAKE_BUILD_TYPE STREQUAL "Debug" OR CMAKE_BUILD_TYPE STREQUAL "RelWithAsserts")
set(DE_DEBUG 1)
else ()
set(DE_DEBUG 0)
diff --git a/framework/delibs/decpp/CMakeLists.txt b/framework/delibs/decpp/CMakeLists.txt
index efc729c..a585e50 100644
--- a/framework/delibs/decpp/CMakeLists.txt
+++ b/framework/delibs/decpp/CMakeLists.txt
@@ -5,6 +5,10 @@
endif ()
set(DECPP_SRCS
+ deArrayBuffer.cpp
+ deArrayBuffer.hpp
+ deArrayUtil.cpp
+ deArrayUtil.hpp
deBlockBuffer.cpp
deBlockBuffer.hpp
deCommandLine.cpp
@@ -49,8 +53,6 @@
deThreadSafeRingBuffer.hpp
deUniquePtr.cpp
deUniquePtr.hpp
- deArrayBuffer.cpp
- deArrayBuffer.hpp
)
add_library(decpp STATIC ${DECPP_SRCS})
diff --git a/framework/delibs/decpp/deArrayUtil.cpp b/framework/delibs/decpp/deArrayUtil.cpp
new file mode 100644
index 0000000..fc5f0e7
--- /dev/null
+++ b/framework/delibs/decpp/deArrayUtil.cpp
@@ -0,0 +1,26 @@
+/*-------------------------------------------------------------------------
+ * drawElements C++ Base Library
+ * -----------------------------
+ *
+ * Copyright 2015 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ *//*!
+ * \file
+ * \brief Array utils
+ *//*--------------------------------------------------------------------*/
+
+#include "deArrayUtil.hpp"
+
+DE_EMPTY_CPP_FILE
diff --git a/framework/delibs/decpp/deArrayUtil.hpp b/framework/delibs/decpp/deArrayUtil.hpp
new file mode 100644
index 0000000..0a7311e
--- /dev/null
+++ b/framework/delibs/decpp/deArrayUtil.hpp
@@ -0,0 +1,49 @@
+#ifndef _DEARRAYUTIL_HPP
+#define _DEARRAYUTIL_HPP
+/*-------------------------------------------------------------------------
+ * drawElements C++ Base Library
+ * -----------------------------
+ *
+ * Copyright 2015 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ *//*!
+ * \file
+ * \brief Array utils
+ *//*--------------------------------------------------------------------*/
+
+#include "deDefs.hpp"
+
+namespace de
+{
+
+//! Get an element of an array with a specified size.
+template <int LastElementIndex, int Size, typename Elem>
+const Elem& getSizedArrayElement (const Elem (&array)[Size], typename de::EnableIf<int, LastElementIndex==Size>::Type offset)
+{
+ DE_ASSERT(inBounds(offset, 0, Size));
+ return array[offset];
+}
+
+//! Get an element of an array with a compile-time constant size.
+template <int Size, typename Elem>
+const Elem& getArrayElement (const Elem (&array)[Size], int offset)
+{
+ DE_ASSERT(inBounds(offset, 0, Size));
+ return array[offset];
+}
+
+} // de
+
+#endif // _DEARRAYUTIL_HPP
diff --git a/framework/delibs/decpp/deDefs.hpp b/framework/delibs/decpp/deDefs.hpp
index 6daa835..fe9b38b 100644
--- a/framework/delibs/decpp/deDefs.hpp
+++ b/framework/delibs/decpp/deDefs.hpp
@@ -76,29 +76,12 @@
{
};
-
template <typename T>
struct EnableIf<T, true>
{
typedef T Type;
};
-//! Get an element of an array with a specified size.
-template <int LastElementIndex, int Size, typename Elem>
-const Elem& getSizedArrayElement (const Elem (&array)[Size], typename de::EnableIf<int, LastElementIndex==Size>::Type offset)
-{
- DE_ASSERT(inBounds(offset, 0, Size));
- return array[offset];
-}
-
-//! Get an element of an array with a compile-time constant size.
-template <int Size, typename Elem>
-const Elem& getArrayElement (const Elem (&array)[Size], int offset)
-{
- DE_ASSERT(inBounds(offset, 0, Size));
- return array[offset];
-}
-
} // de
/*--------------------------------------------------------------------*//*!
diff --git a/framework/opengl/gluObjectWrapper.cpp b/framework/opengl/gluObjectWrapper.cpp
index 45444d9..70fee4e 100644
--- a/framework/opengl/gluObjectWrapper.cpp
+++ b/framework/opengl/gluObjectWrapper.cpp
@@ -26,6 +26,7 @@
#include "gluStrUtil.hpp"
#include "glwFunctions.hpp"
#include "glwEnums.hpp"
+#include "deArrayUtil.hpp"
#include <sstream>
diff --git a/framework/opengl/gluShaderUtil.cpp b/framework/opengl/gluShaderUtil.cpp
index 99dd112..ef9233c 100644
--- a/framework/opengl/gluShaderUtil.cpp
+++ b/framework/opengl/gluShaderUtil.cpp
@@ -23,6 +23,7 @@
#include "gluShaderUtil.hpp"
#include "glwEnums.hpp"
+#include "deArrayUtil.hpp"
namespace glu
{
diff --git a/framework/opengl/gluStrUtil.hpp b/framework/opengl/gluStrUtil.hpp
index e7381de..cc402f9 100644
--- a/framework/opengl/gluStrUtil.hpp
+++ b/framework/opengl/gluStrUtil.hpp
@@ -94,6 +94,17 @@
std::ostream& operator<< (std::ostream& str, ApiType apiType);
std::ostream& operator<< (std::ostream& str, ContextType contextType);
+// prevent implicit conversions from bool to int.
+//
+// While it is well-defined that (int)true == GL_TRUE and (int)false == GL_FALSE,
+// using these functions to convert non-GL-types suggests a that the calling code is
+// mixing and matching GLboolean and bool types which may not be safe.
+//
+// \note return value is void to prevent compilation. Otherwise this would only break linking.
+void getBooleanPointerStr (const bool* value, deInt32 size); // delete
+void getBooleanStr (bool); // delete
+void getBooleanName (bool); // delete
+
#include "gluStrUtilPrototypes.inl"
} // glu
diff --git a/framework/opengl/gluTexture.hpp b/framework/opengl/gluTexture.hpp
index de77b72..45de10c 100644
--- a/framework/opengl/gluTexture.hpp
+++ b/framework/opengl/gluTexture.hpp
@@ -29,6 +29,7 @@
#include "tcuResource.hpp"
#include "gluRenderContext.hpp"
#include "gluContextInfo.hpp"
+#include "deArrayBuffer.hpp"
#include <vector>
#include <string>
diff --git a/framework/opengl/gluVarType.cpp b/framework/opengl/gluVarType.cpp
index 25a27c2..9e516a9 100644
--- a/framework/opengl/gluVarType.cpp
+++ b/framework/opengl/gluVarType.cpp
@@ -23,6 +23,7 @@
#include "gluVarType.hpp"
#include "deStringUtil.hpp"
+#include "deArrayUtil.hpp"
namespace glu
{
diff --git a/framework/opengl/simplereference/sglrReferenceContext.cpp b/framework/opengl/simplereference/sglrReferenceContext.cpp
index 57a10c7..c923e6f 100644
--- a/framework/opengl/simplereference/sglrReferenceContext.cpp
+++ b/framework/opengl/simplereference/sglrReferenceContext.cpp
@@ -4679,7 +4679,6 @@
TextureLevelArray::TextureLevelArray (void)
{
- deMemset(&m_data[0], 0, sizeof(m_data));
}
TextureLevelArray::~TextureLevelArray (void)
@@ -4693,34 +4692,30 @@
for (int ndx = 0; ndx < DE_LENGTH_OF_ARRAY(m_data); ndx++)
{
- delete[] m_data[ndx];
-
- m_data[ndx] = DE_NULL;
- m_access[ndx] = PixelBufferAccess();
+ m_data[ndx].clear();
+ m_access[ndx] = PixelBufferAccess();
}
}
void TextureLevelArray::allocLevel (int level, const tcu::TextureFormat& format, int width, int height, int depth)
{
- const int dataSize = format.getPixelSize()*width*height*depth;
+ const int dataSize = format.getPixelSize()*width*height*depth;
- DE_ASSERT(level < DE_LENGTH_OF_ARRAY(m_data));
+ DE_ASSERT(deInBounds32(level, 0, DE_LENGTH_OF_ARRAY(m_data)));
if (hasLevel(level))
clearLevel(level);
- m_data[level] = new deUint8[dataSize];
- m_access[level] = PixelBufferAccess(format, width, height, depth, m_data[level]);
+ m_data[level].setStorage(dataSize);
+ m_access[level] = PixelBufferAccess(format, width, height, depth, m_data[level].getPtr());
}
void TextureLevelArray::clearLevel (int level)
{
- DE_ASSERT(level < DE_LENGTH_OF_ARRAY(m_data));
+ DE_ASSERT(deInBounds32(level, 0, DE_LENGTH_OF_ARRAY(m_data)));
- delete[] m_data[level];
-
- m_data[level] = DE_NULL;
- m_access[level] = PixelBufferAccess();
+ m_data[level].clear();
+ m_access[level] = PixelBufferAccess();
}
Texture::Texture (deUint32 name, Type type)
diff --git a/framework/opengl/simplereference/sglrReferenceContext.hpp b/framework/opengl/simplereference/sglrReferenceContext.hpp
index 76de272..a0ce306 100644
--- a/framework/opengl/simplereference/sglrReferenceContext.hpp
+++ b/framework/opengl/simplereference/sglrReferenceContext.hpp
@@ -29,12 +29,13 @@
#include "tcuSurface.hpp"
#include "tcuTexture.hpp"
#include "tcuVector.hpp"
-#include "gluRenderContext.hpp"
#include "rrFragmentOperations.hpp"
#include "rrRenderState.hpp"
#include "rrRenderer.hpp"
#include "rrMultisamplePixelBufferAccess.hpp"
+#include "gluRenderContext.hpp"
#include "gluShaderUtil.hpp"
+#include "deArrayBuffer.hpp"
#include <map>
#include <vector>
@@ -117,11 +118,11 @@
TextureLevelArray (void);
~TextureLevelArray (void);
- bool hasLevel (int level) const { return level < DE_LENGTH_OF_ARRAY(m_data) && m_data[level]; }
- const tcu::PixelBufferAccess& getLevel (int level) { DE_ASSERT(hasLevel(level)); return m_access[level]; }
- const tcu::ConstPixelBufferAccess& getLevel (int level) const { DE_ASSERT(hasLevel(level)); return m_access[level]; }
+ bool hasLevel (int level) const { return deInBounds32(level, 0, DE_LENGTH_OF_ARRAY(m_data)) && !m_data[level].empty(); }
+ const tcu::PixelBufferAccess& getLevel (int level) { DE_ASSERT(hasLevel(level)); return m_access[level]; }
+ const tcu::ConstPixelBufferAccess& getLevel (int level) const { DE_ASSERT(hasLevel(level)); return m_access[level]; }
- const tcu::ConstPixelBufferAccess* getLevels (void) const { return &m_access[0]; }
+ const tcu::ConstPixelBufferAccess* getLevels (void) const { return &m_access[0]; }
void allocLevel (int level, const tcu::TextureFormat& format, int width, int height, int depth);
void clearLevel (int level);
@@ -129,7 +130,7 @@
void clear (void);
private:
- deUint8* m_data[MAX_TEXTURE_SIZE_LOG2];
+ de::ArrayBuffer<deUint8> m_data[MAX_TEXTURE_SIZE_LOG2];
tcu::PixelBufferAccess m_access[MAX_TEXTURE_SIZE_LOG2];
};
diff --git a/modules/egl/teglNegativeApiTests.cpp b/modules/egl/teglNegativeApiTests.cpp
index fa8b1f8..78fcbef 100755
--- a/modules/egl/teglNegativeApiTests.cpp
+++ b/modules/egl/teglNegativeApiTests.cpp
@@ -650,9 +650,6 @@
{
expectNoSurface(eglCreatePixmapSurface(display, pixmapConfig, DE_NULL, s_emptyAttribList));
expectError(EGL_BAD_NATIVE_PIXMAP);
-
- expectNoSurface(eglCreatePixmapSurface(display, pixmapConfig, (EGLNativePixmapType)-1, s_emptyAttribList));
- expectError(EGL_BAD_NATIVE_PIXMAP);
}
log << TestLog::EndSection;
@@ -688,9 +685,6 @@
{
expectNoSurface(eglCreateWindowSurface(display, windowConfig, DE_NULL, s_emptyAttribList));
expectError(EGL_BAD_NATIVE_WINDOW);
-
- expectNoSurface(eglCreateWindowSurface(display, windowConfig, (EGLNativeWindowType)-1, s_emptyAttribList));
- expectError(EGL_BAD_NATIVE_WINDOW);
}
log << TestLog::EndSection;
diff --git a/modules/gles3/functional/es3fFragmentOutputTests.cpp b/modules/gles3/functional/es3fFragmentOutputTests.cpp
index 71f8422..1dc1415 100644
--- a/modules/gles3/functional/es3fFragmentOutputTests.cpp
+++ b/modules/gles3/functional/es3fFragmentOutputTests.cpp
@@ -181,26 +181,27 @@
const FragmentOutput& output = outputs[outNdx];
bool isArray = output.arrayLength > 0;
const char* typeName = glu::getDataTypeName(output.type);
- const char* precName = glu::getPrecisionName(output.precision);
+ const char* outputPrec = glu::getPrecisionName(output.precision);
bool isFloat = glu::isDataTypeFloatOrVec(output.type);
const char* interp = isFloat ? "smooth" : "flat";
+ const char* interpPrec = isFloat ? "highp" : outputPrec;
if (isArray)
{
for (int elemNdx = 0; elemNdx < output.arrayLength; elemNdx++)
{
- vtx << "in " << precName << " " << typeName << " in" << outNdx << "_" << elemNdx << ";\n"
- << interp << " out " << precName << " " << typeName << " var" << outNdx << "_" << elemNdx << ";\n";
- frag << interp << " in " << precName << " " << typeName << " var" << outNdx << "_" << elemNdx << ";\n";
+ vtx << "in " << interpPrec << " " << typeName << " in" << outNdx << "_" << elemNdx << ";\n"
+ << interp << " out " << interpPrec << " " << typeName << " var" << outNdx << "_" << elemNdx << ";\n";
+ frag << interp << " in " << interpPrec << " " << typeName << " var" << outNdx << "_" << elemNdx << ";\n";
}
- frag << "layout(location = " << output.location << ") out " << precName << " " << typeName << " out" << outNdx << "[" << output.arrayLength << "];\n";
+ frag << "layout(location = " << output.location << ") out " << outputPrec << " " << typeName << " out" << outNdx << "[" << output.arrayLength << "];\n";
}
else
{
- vtx << "in " << precName << " " << typeName << " in" << outNdx << ";\n"
- << interp << " out " << precName << " " << typeName << " var" << outNdx << ";\n";
- frag << interp << " in " << precName << " " << typeName << " var" << outNdx << ";\n"
- << "layout(location = " << output.location << ") out " << precName << " " << typeName << " out" << outNdx << ";\n";
+ vtx << "in " << interpPrec << " " << typeName << " in" << outNdx << ";\n"
+ << interp << " out " << interpPrec << " " << typeName << " var" << outNdx << ";\n";
+ frag << interp << " in " << interpPrec << " " << typeName << " var" << outNdx << ";\n"
+ << "layout(location = " << output.location << ") out " << outputPrec << " " << typeName << " out" << outNdx << ";\n";
}
}
@@ -891,9 +892,10 @@
{
case tcu::TEXTURECHANNELCLASS_FLOATING_POINT:
{
- UVec4 formatThreshold; //!< Threshold computed based on format.
- deUint32 precThreshold = 0; //!< Threshold computed based on output type precision
- UVec4 finalThreshold;
+ const deUint32 interpThreshold = 4; //!< 4 ULP interpolation threshold (interpolation always in highp)
+ deUint32 outTypeThreshold = 0; //!< Threshold based on output type
+ UVec4 formatThreshold; //!< Threshold computed based on format.
+ UVec4 finalThreshold;
// 1 ULP rounding error is allowed for smaller floating-point formats
switch (format.type)
@@ -906,17 +908,17 @@
break;
}
- // 4 ULP interpolation
+ // 1 ULP rounding error for highp -> output precision cast
switch (outPrecision)
{
- case glu::PRECISION_LOWP: precThreshold = (4<<(23-8)); break;
- case glu::PRECISION_MEDIUMP: precThreshold = (4<<(23-10)); break;
- case glu::PRECISION_HIGHP: precThreshold = 4; break;
+ case glu::PRECISION_LOWP: outTypeThreshold = (1<<(23-8)); break;
+ case glu::PRECISION_MEDIUMP: outTypeThreshold = (1<<(23-10)); break;
+ case glu::PRECISION_HIGHP: outTypeThreshold = 0; break;
default:
DE_ASSERT(false);
}
- finalThreshold = select(max(formatThreshold, UVec4(precThreshold)), UVec4(~0u), cmpMask);
+ finalThreshold = select(max(formatThreshold, UVec4(deMax32(interpThreshold, outTypeThreshold))), UVec4(~0u), cmpMask);
isOk = tcu::floatUlpThresholdCompare(log, name.c_str(), desc.c_str(), reference, rendered, finalThreshold, tcu::COMPARE_LOG_RESULT);
break;
diff --git a/modules/gles31/functional/es31fCopyImageTests.cpp b/modules/gles31/functional/es31fCopyImageTests.cpp
index cc23bf1..55df903 100644
--- a/modules/gles31/functional/es31fCopyImageTests.cpp
+++ b/modules/gles31/functional/es31fCopyImageTests.cpp
@@ -53,6 +53,7 @@
#include "deRandom.hpp"
#include "deStringUtil.hpp"
#include "deUniquePtr.hpp"
+#include "deArrayUtil.hpp"
#include <map>
#include <string>
diff --git a/modules/gles31/functional/es31fDrawBuffersIndexedTests.cpp b/modules/gles31/functional/es31fDrawBuffersIndexedTests.cpp
index aecbe46..55942e8 100644
--- a/modules/gles31/functional/es31fDrawBuffersIndexedTests.cpp
+++ b/modules/gles31/functional/es31fDrawBuffersIndexedTests.cpp
@@ -50,6 +50,7 @@
#include "tcuVectorUtil.hpp"
#include "deRandom.hpp"
+#include "deArrayUtil.hpp"
#include "deStringUtil.hpp"
#include "deUniquePtr.hpp"
diff --git a/modules/gles31/functional/es31fProgramInterfaceQueryTests.cpp b/modules/gles31/functional/es31fProgramInterfaceQueryTests.cpp
index 83fa13c..0bc1efc 100644
--- a/modules/gles31/functional/es31fProgramInterfaceQueryTests.cpp
+++ b/modules/gles31/functional/es31fProgramInterfaceQueryTests.cpp
@@ -38,6 +38,7 @@
#include "deSharedPtr.hpp"
#include "deUniquePtr.hpp"
#include "deSTLUtil.hpp"
+#include "deArrayUtil.hpp"
#include <set>
#include <map>
diff --git a/modules/gles31/functional/es31fShaderCommonFunctionTests.cpp b/modules/gles31/functional/es31fShaderCommonFunctionTests.cpp
index 00ad997..22f3b57 100644
--- a/modules/gles31/functional/es31fShaderCommonFunctionTests.cpp
+++ b/modules/gles31/functional/es31fShaderCommonFunctionTests.cpp
@@ -32,6 +32,7 @@
#include "deRandom.hpp"
#include "deMath.h"
#include "deString.h"
+#include "deArrayUtil.hpp"
namespace deqp
{
diff --git a/modules/gles31/functional/es31fShaderSharedVarTests.cpp b/modules/gles31/functional/es31fShaderSharedVarTests.cpp
index d8f79ce..d8e6cc3 100644
--- a/modules/gles31/functional/es31fShaderSharedVarTests.cpp
+++ b/modules/gles31/functional/es31fShaderSharedVarTests.cpp
@@ -33,6 +33,7 @@
#include "tcuVectorUtil.hpp"
#include "tcuFormatUtil.hpp"
#include "deRandom.hpp"
+#include "deArrayUtil.hpp"
#include "glwFunctions.hpp"
#include "glwEnums.hpp"
diff --git a/modules/glshared/glsBufferTestUtil.cpp b/modules/glshared/glsBufferTestUtil.cpp
index 5ea1bd2..b00ff84 100644
--- a/modules/glshared/glsBufferTestUtil.cpp
+++ b/modules/glshared/glsBufferTestUtil.cpp
@@ -36,6 +36,7 @@
#include "gluShaderProgram.hpp"
#include "deMemory.h"
#include "deStringUtil.hpp"
+#include "deArrayUtil.hpp"
#include <algorithm>
diff --git a/modules/glshared/glsBuiltinPrecisionTests.cpp b/modules/glshared/glsBuiltinPrecisionTests.cpp
index eeef119..c7f103b 100644
--- a/modules/glshared/glsBuiltinPrecisionTests.cpp
+++ b/modules/glshared/glsBuiltinPrecisionTests.cpp
@@ -32,6 +32,7 @@
#include "deStringUtil.hpp"
#include "deUniquePtr.hpp"
#include "deSharedPtr.hpp"
+#include "deArrayUtil.hpp"
#include "tcuCommandLine.hpp"
#include "tcuFloatFormat.hpp"
diff --git a/modules/glshared/glsDrawTest.cpp b/modules/glshared/glsDrawTest.cpp
index 05689db..e5f3fbc 100644
--- a/modules/glshared/glsDrawTest.cpp
+++ b/modules/glshared/glsDrawTest.cpp
@@ -29,6 +29,7 @@
#include "deStringUtil.hpp"
#include "deFloat16.h"
#include "deUniquePtr.hpp"
+#include "deArrayUtil.hpp"
#include "tcuTestLog.hpp"
#include "tcuPixelFormat.hpp"
diff --git a/modules/glshared/glsShaderLibrary.cpp b/modules/glshared/glsShaderLibrary.cpp
index a263a44..a97823c 100644
--- a/modules/glshared/glsShaderLibrary.cpp
+++ b/modules/glshared/glsShaderLibrary.cpp
@@ -997,6 +997,12 @@
valueBlock = ShaderCase::CaseRequirement::createLimitRequirement(limitEnum, limitValue);
}
+ else if (m_curTokenStr == "full_glsl_es_100_support")
+ {
+ advanceToken();
+
+ valueBlock = ShaderCase::CaseRequirement::createFullGLSLES100SpecificationRequirement();
+ }
else
parseError(string("invalid requirement value: " + m_curTokenStr));
}
diff --git a/modules/glshared/glsShaderLibraryCase.cpp b/modules/glshared/glsShaderLibraryCase.cpp
index af30141..089d7a6 100644
--- a/modules/glshared/glsShaderLibraryCase.cpp
+++ b/modules/glshared/glsShaderLibraryCase.cpp
@@ -121,6 +121,15 @@
return retVal;
}
+ShaderCase::CaseRequirement ShaderCase::CaseRequirement::createFullGLSLES100SpecificationRequirement (void)
+{
+ CaseRequirement retVal;
+
+ retVal.m_type = REQUIREMENTTYPE_FULL_GLSL_ES_100_SPEC;
+
+ return retVal;
+}
+
void ShaderCase::CaseRequirement::checkRequirements (glu::RenderContext& renderCtx, const glu::ContextInfo& contextInfo)
{
DE_UNREF(renderCtx);
@@ -176,6 +185,12 @@
return;
}
+ case REQUIREMENTTYPE_FULL_GLSL_ES_100_SPEC:
+ {
+ // cannot be queried
+ return;
+ }
+
default:
DE_ASSERT(false);
}
@@ -495,6 +510,19 @@
DE_ASSERT(false);
break;
}
+
+ // sanity of arguments
+
+ if (anyProgramRequiresFullGLSLES100Specification())
+ {
+ // makes only sense in tests where shader compiles
+ DE_ASSERT(m_expectResult == EXPECT_PASS ||
+ m_expectResult == EXPECT_VALIDATION_FAIL ||
+ m_expectResult == EXPECT_BUILD_SUCCESSFUL);
+
+ // only makes sense for ES 100 programs
+ DE_ASSERT(m_targetVersion == glu::GLSL_VERSION_100_ES);
+ }
}
static void setUniformValue (const glw::Functions& gl, const std::vector<deUint32>& pipelinePrograms, const std::string& name, const ShaderCase::Value& val, int arrayNdx, tcu::TestLog& log)
@@ -576,6 +604,17 @@
!m_programs[0].programSources.sources[glu::SHADERTYPE_TESSELLATION_EVALUATION].empty();
}
+bool ShaderCase::anyProgramRequiresFullGLSLES100Specification (void) const
+{
+ for (int programNdx = 0; programNdx < (int)m_programs.size(); ++programNdx)
+ for (int requirementNdx = 0; requirementNdx < (int)m_programs[programNdx].spec.requirements.size(); ++requirementNdx)
+ {
+ if (m_programs[programNdx].spec.requirements[requirementNdx].getType() == CaseRequirement::REQUIREMENTTYPE_FULL_GLSL_ES_100_SPEC)
+ return true;
+ }
+ return false;
+}
+
bool ShaderCase::checkPixels (Surface& surface, int minX, int maxX, int minY, int maxY)
{
TestLog& log = m_testCtx.getLog();
@@ -615,8 +654,8 @@
bool ShaderCase::execute (void)
{
- const float quadSize = 1.0f;
- static const float s_positions[4*4] =
+ const float quadSize = 1.0f;
+ static const float s_positions[4*4] =
{
-quadSize, -quadSize, 0.0f, 1.0f,
-quadSize, +quadSize, 0.0f, 1.0f,
@@ -624,30 +663,31 @@
+quadSize, +quadSize, 0.0f, 1.0f
};
- static const deUint16 s_indices[2*3] =
+ static const deUint16 s_indices[2*3] =
{
0, 1, 2,
1, 3, 2
};
- TestLog& log = m_testCtx.getLog();
- const glw::Functions& gl = m_renderCtx.getFunctions();
+ TestLog& log = m_testCtx.getLog();
+ const glw::Functions& gl = m_renderCtx.getFunctions();
// Compute viewport.
- const tcu::RenderTarget& renderTarget = m_renderCtx.getRenderTarget();
- de::Random rnd (deStringHash(getName()));
- const int width = deMin32(renderTarget.getWidth(), VIEWPORT_WIDTH);
- const int height = deMin32(renderTarget.getHeight(), VIEWPORT_HEIGHT);
- const int viewportX = rnd.getInt(0, renderTarget.getWidth() - width);
- const int viewportY = rnd.getInt(0, renderTarget.getHeight() - height);
- const int numVerticesPerDraw = 4;
- const bool tessellationPresent = isTessellationPresent();
+ const tcu::RenderTarget& renderTarget = m_renderCtx.getRenderTarget();
+ de::Random rnd (deStringHash(getName()));
+ const int width = deMin32(renderTarget.getWidth(), VIEWPORT_WIDTH);
+ const int height = deMin32(renderTarget.getHeight(), VIEWPORT_HEIGHT);
+ const int viewportX = rnd.getInt(0, renderTarget.getWidth() - width);
+ const int viewportY = rnd.getInt(0, renderTarget.getHeight() - height);
+ const int numVerticesPerDraw = 4;
+ const bool tessellationPresent = isTessellationPresent();
+ const bool requiresFullGLSLES100 = anyProgramRequiresFullGLSLES100Specification();
- bool allCompilesOk = true;
- bool allLinksOk = true;
- const char* failReason = DE_NULL;
+ bool allCompilesOk = true;
+ bool allLinksOk = true;
+ const char* failReason = DE_NULL;
- deUint32 vertexProgramID = -1;
+ deUint32 vertexProgramID = -1;
std::vector<deUint32> pipelineProgramIDs;
std::vector<de::SharedPtr<glu::ShaderProgram> > programs;
de::SharedPtr<glu::ProgramPipeline> programPipeline;
@@ -761,9 +801,26 @@
// \todo [2010-06-07 petri] These should be handled in the test case?
log << TestLog::Message << "ERROR: " << failReason << TestLog::EndMessage;
- // If implementation parses shader at link time, report it as quality warning.
- if (m_expectResult == EXPECT_COMPILE_FAIL && allCompilesOk && !allLinksOk)
+ if (requiresFullGLSLES100)
+ {
+ log << TestLog::Message
+ << "Assuming build failure is caused by implementation not supporting full GLSL ES 100 specification, which is not required."
+ << TestLog::EndMessage;
+
+ if (allCompilesOk && !allLinksOk)
+ {
+ // Used features are detectable at compile time. If implementation parses shader
+ // at link time, report it as quality warning.
+ m_testCtx.setTestResult(QP_TEST_RESULT_QUALITY_WARNING, failReason);
+ }
+ else
+ m_testCtx.setTestResult(QP_TEST_RESULT_NOT_SUPPORTED, "Full GLSL ES 100 is not supported");
+ }
+ else if (m_expectResult == EXPECT_COMPILE_FAIL && allCompilesOk && !allLinksOk)
+ {
+ // If implementation parses shader at link time, report it as quality warning.
m_testCtx.setTestResult(QP_TEST_RESULT_QUALITY_WARNING, failReason);
+ }
else
m_testCtx.setTestResult(QP_TEST_RESULT_FAIL, failReason);
return false;
@@ -774,7 +831,7 @@
m_expectResult == EXPECT_COMPILE_LINK_FAIL ||
m_expectResult == EXPECT_LINK_FAIL ||
m_expectResult == EXPECT_BUILD_SUCCESSFUL)
- return (failReason == DE_NULL);
+ return true;
// Setup viewport.
gl.viewport(viewportX, viewportY, width, height);
diff --git a/modules/glshared/glsShaderLibraryCase.hpp b/modules/glshared/glsShaderLibraryCase.hpp
index 8934c98..162ea0f 100644
--- a/modules/glshared/glsShaderLibraryCase.hpp
+++ b/modules/glshared/glsShaderLibraryCase.hpp
@@ -107,19 +107,21 @@
{
REQUIREMENTTYPE_EXTENSION = 0,
REQUIREMENTTYPE_IMPLEMENTATION_LIMIT,
+ REQUIREMENTTYPE_FULL_GLSL_ES_100_SPEC, //!< Full support (as opposed to limited as specified for GLES 2.0 (See GLSL Appendix A)) cannot be queried
REQUIREMENTTYPE_LAST
};
- CaseRequirement (void);
+ CaseRequirement (void);
- static CaseRequirement createAnyExtensionRequirement (const std::vector<std::string>& requirements, deUint32 effectiveShaderStageFlags);
- static CaseRequirement createLimitRequirement (deUint32 enumName, int ref);
- void checkRequirements (glu::RenderContext& renderCtx, const glu::ContextInfo& contextInfo);
+ static CaseRequirement createAnyExtensionRequirement (const std::vector<std::string>& requirements, deUint32 effectiveShaderStageFlags);
+ static CaseRequirement createLimitRequirement (deUint32 enumName, int ref);
+ static CaseRequirement createFullGLSLES100SpecificationRequirement (void);
+ void checkRequirements (glu::RenderContext& renderCtx, const glu::ContextInfo& contextInfo);
- RequirementType getType (void) const { return m_type; };
- std::string getSupportedExtension (void) const { DE_ASSERT(m_type == REQUIREMENTTYPE_EXTENSION); DE_ASSERT(m_supportedExtensionNdx >= 0); return m_extensions[m_supportedExtensionNdx]; }
- deUint32 getAffectedExtensionStageFlags (void) const { DE_ASSERT(m_type == REQUIREMENTTYPE_EXTENSION); return m_effectiveShaderStageFlags; }
+ RequirementType getType (void) const { return m_type; };
+ std::string getSupportedExtension (void) const { DE_ASSERT(m_type == REQUIREMENTTYPE_EXTENSION); DE_ASSERT(m_supportedExtensionNdx >= 0); return m_extensions[m_supportedExtensionNdx]; }
+ deUint32 getAffectedExtensionStageFlags (void) const { DE_ASSERT(m_type == REQUIREMENTTYPE_EXTENSION); return m_effectiveShaderStageFlags; }
private:
RequirementType m_type;
@@ -174,42 +176,43 @@
};
// Methods.
- ShaderCase (tcu::TestContext& testCtx,
- glu::RenderContext& renderCtx,
- const glu::ContextInfo& contextInfo,
- const char* caseName,
- const char* description,
- const ShaderCaseSpecification& specification);
- ShaderCase (tcu::TestContext& testCtx,
- glu::RenderContext& renderCtx,
- const glu::ContextInfo& contextInfo,
- const char* caseName,
- const char* description,
- const PipelineCaseSpecification& specification);
- virtual ~ShaderCase (void);
+ ShaderCase (tcu::TestContext& testCtx,
+ glu::RenderContext& renderCtx,
+ const glu::ContextInfo& contextInfo,
+ const char* caseName,
+ const char* description,
+ const ShaderCaseSpecification& specification);
+ ShaderCase (tcu::TestContext& testCtx,
+ glu::RenderContext& renderCtx,
+ const glu::ContextInfo& contextInfo,
+ const char* caseName,
+ const char* description,
+ const PipelineCaseSpecification& specification);
+ virtual ~ShaderCase (void);
private:
- void init (void);
- bool execute (void);
- IterateResult iterate (void);
+ void init (void);
+ bool execute (void);
+ IterateResult iterate (void);
- ShaderCase (const ShaderCase&); // not allowed!
- ShaderCase& operator= (const ShaderCase&); // not allowed!
+ ShaderCase (const ShaderCase&); // not allowed!
+ ShaderCase& operator= (const ShaderCase&); // not allowed!
- std::string genVertexShader (const ValueBlock& valueBlock) const;
- std::string genFragmentShader (const ValueBlock& valueBlock) const;
- std::string specializeVertexShader (const char* src, const ValueBlock& valueBlock) const;
- std::string specializeFragmentShader (const char* src, const ValueBlock& valueBlock) const;
- void specializeVertexShaders (glu::ProgramSources& dst, const std::vector<std::string>& sources, const ValueBlock& valueBlock, const std::vector<ShaderCase::CaseRequirement>& requirements) const;
- void specializeFragmentShaders (glu::ProgramSources& dst, const std::vector<std::string>& sources, const ValueBlock& valueBlock, const std::vector<ShaderCase::CaseRequirement>& requirements) const;
- void specializeGeometryShaders (glu::ProgramSources& dst, const std::vector<std::string>& sources, const ValueBlock& valueBlock, const std::vector<ShaderCase::CaseRequirement>& requirements) const;
- void specializeTessControlShaders (glu::ProgramSources& dst, const std::vector<std::string>& sources, const ValueBlock& valueBlock, const std::vector<ShaderCase::CaseRequirement>& requirements) const;
- void specializeTessEvalShaders (glu::ProgramSources& dst, const std::vector<std::string>& sources, const ValueBlock& valueBlock, const std::vector<ShaderCase::CaseRequirement>& requirements) const;
- bool isTessellationPresent (void) const;
+ std::string genVertexShader (const ValueBlock& valueBlock) const;
+ std::string genFragmentShader (const ValueBlock& valueBlock) const;
+ std::string specializeVertexShader (const char* src, const ValueBlock& valueBlock) const;
+ std::string specializeFragmentShader (const char* src, const ValueBlock& valueBlock) const;
+ void specializeVertexShaders (glu::ProgramSources& dst, const std::vector<std::string>& sources, const ValueBlock& valueBlock, const std::vector<ShaderCase::CaseRequirement>& requirements) const;
+ void specializeFragmentShaders (glu::ProgramSources& dst, const std::vector<std::string>& sources, const ValueBlock& valueBlock, const std::vector<ShaderCase::CaseRequirement>& requirements) const;
+ void specializeGeometryShaders (glu::ProgramSources& dst, const std::vector<std::string>& sources, const ValueBlock& valueBlock, const std::vector<ShaderCase::CaseRequirement>& requirements) const;
+ void specializeTessControlShaders (glu::ProgramSources& dst, const std::vector<std::string>& sources, const ValueBlock& valueBlock, const std::vector<ShaderCase::CaseRequirement>& requirements) const;
+ void specializeTessEvalShaders (glu::ProgramSources& dst, const std::vector<std::string>& sources, const ValueBlock& valueBlock, const std::vector<ShaderCase::CaseRequirement>& requirements) const;
+ bool isTessellationPresent (void) const;
+ bool anyProgramRequiresFullGLSLES100Specification (void) const;
- void dumpValues (const ValueBlock& valueBlock, int arrayNdx);
+ void dumpValues (const ValueBlock& valueBlock, int arrayNdx);
- bool checkPixels (tcu::Surface& surface, int minX, int maxX, int minY, int maxY);
+ bool checkPixels (tcu::Surface& surface, int minX, int maxX, int minY, int maxY);
struct ProgramObject
{
diff --git a/modules/glshared/glsVertexArrayTests.cpp b/modules/glshared/glsVertexArrayTests.cpp
index 8b6fcff..e5ec808 100644
--- a/modules/glshared/glsVertexArrayTests.cpp
+++ b/modules/glshared/glsVertexArrayTests.cpp
@@ -44,6 +44,7 @@
#include "deMath.h"
#include "deStringUtil.hpp"
+#include "deArrayUtil.hpp"
#include <cstring>
#include <cmath>
diff --git a/modules/internal/ditFrameworkTests.cpp b/modules/internal/ditFrameworkTests.cpp
index d9f17d6..fdf23dc 100644
--- a/modules/internal/ditFrameworkTests.cpp
+++ b/modules/internal/ditFrameworkTests.cpp
@@ -30,9 +30,11 @@
#include "rrRenderer.hpp"
#include "tcuTextureUtil.hpp"
#include "tcuVectorUtil.hpp"
-#include "deRandom.hpp"
#include "tcuFloat.hpp"
+#include "deRandom.hpp"
+#include "deArrayUtil.hpp"
+
namespace dit
{