[Piglit] [PATCH 1/3] built-in-constants: add support for testing compatibility profile built ins
Timothy Arceri
tarceri at itsqueeze.com
Tue May 29 00:52:15 UTC 2018
---
tests/shaders/built-in-constants.c | 18 ++++++++++++------
1 file changed, 12 insertions(+), 6 deletions(-)
diff --git a/tests/shaders/built-in-constants.c b/tests/shaders/built-in-constants.c
index 32cd2638f..e1512a04c 100644
--- a/tests/shaders/built-in-constants.c
+++ b/tests/shaders/built-in-constants.c
@@ -39,6 +39,7 @@ unsigned num_tests = 0;
int required_glsl_version = 0;
char required_glsl_version_string[128];
bool es_shader = false;
+bool compat_shader = false;
GLenum shader_type = 0;
/**
@@ -116,6 +117,8 @@ PIGLIT_GL_TEST_CONFIG_BEGIN
config.supports_gl_es_version = 30;
break;
case 310:
+ config.supports_gl_es_version = 31;
+
/* It seems impossible that a desktop OpenGL implementation
* would support GL_ARB_ES3_1_compatibility and not support at
* least OpenGL 3.2. Realistically, the compute shader
@@ -123,14 +126,15 @@ PIGLIT_GL_TEST_CONFIG_BEGIN
* GL_ARB_ES3_1_compatibility implementations will be OpenGL
* 4.2 or later.
*/
- config.supports_gl_core_version = 32;
- config.supports_gl_es_version = 31;
- break;
+ if (!compat_shader) {
+ config.supports_gl_core_version = 32;
+ break;
+ }
default: {
const unsigned int gl_version
= required_gl_version_from_glsl_version(required_glsl_version);
config.supports_gl_compat_version = gl_version;
- if (gl_version < 31)
+ if (gl_version < 31 || compat_shader)
config.supports_gl_core_version = 0;
else
config.supports_gl_core_version = gl_version;
@@ -208,7 +212,7 @@ parse_file(const char *filename)
/* The format of the test file is:
*
- * version [es|core]
+ * version [es|core|compatibility]
* GL_VERTEX_SHADER|GL_GEOMETRY_SHADER|GL_FRAGMENT_SHADER|GL_COMPUTE_SHADER
* GL_ARB_some_extension
* gl_MaxFoo 8
@@ -232,11 +236,13 @@ parse_file(const char *filename)
required_glsl_version = strtol(line, &endptr, 10);
parse_whitespace(endptr, (const char **)&line);
es_shader = strncmp("es\n", line, 3) == 0;
+ compat_shader = strncmp("compatibility\n", line, 7) == 0;
if (required_glsl_version <= 0 ||
(line != end_of_line &&
strncmp("es\n", line, 3) != 0 &&
- strncmp("core\n", line, 5) != 0)) {
+ strncmp("core\n", line, 5) != 0 &&
+ strncmp("compatibility\n", line, 7) != 0)) {
fprintf(stderr, "Parse error in version line.\n");
piglit_report_result(PIGLIT_FAIL);
}
--
2.17.0
More information about the Piglit
mailing list