summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorLaura Ekstrand <laura@jlekstrand.net>2014-10-09 15:59:40 -0700
committerLaura Ekstrand <laura@jlekstrand.net>2014-10-09 15:59:40 -0700
commit39477219925bfc14a38ae8ea23a27ab5a4695450 (patch)
tree8b57b07437441d6025f1710c7ab01a7b2eb06644 /tests
parent5132b15c7be9594dc86e1515389545681983d057 (diff)
Fixed gl_fragDepth bug, but cannot find texture2D with bias bug.
Diffstat (limited to 'tests')
-rw-r--r--tests/glean/tglsl1.cpp34
-rw-r--r--tests/spec/laura_glsl1/glsl1.c53
2 files changed, 74 insertions, 13 deletions
diff --git a/tests/glean/tglsl1.cpp b/tests/glean/tglsl1.cpp
index 549f9fa8a..bbd07af87 100644
--- a/tests/glean/tglsl1.cpp
+++ b/tests/glean/tglsl1.cpp
@@ -2114,6 +2114,40 @@ GLSLTest::runOne(MultiTestResult &r, Window &w)
r.pass = false;
return;
}
+ GLint setting;
+ glGetTexParameteriv(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, &setting);
+ printf("%i\t", setting);
+ glGetTexParameteriv(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, &setting);
+ printf("%i\t", setting);
+ glGetTexParameteriv(GL_TEXTURE_2D, GL_TEXTURE_MIN_LOD, &setting);
+ printf("%i\t", setting);
+ glGetTexParameteriv(GL_TEXTURE_2D, GL_TEXTURE_MAX_LOD, &setting);
+ printf("%i\t", setting);
+ glGetTexParameteriv(GL_TEXTURE_2D, GL_TEXTURE_BASE_LEVEL, &setting);
+ printf("%i\t", setting);
+ glGetTexParameteriv(GL_TEXTURE_2D, GL_TEXTURE_MAX_LEVEL, &setting);
+ printf("%i\t", setting);
+ glGetTexParameteriv(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, &setting);
+ printf("%i\t", setting);
+ glGetTexParameteriv(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, &setting);
+ printf("%i\t", setting);
+ glGetTexParameteriv(GL_TEXTURE_2D, GL_TEXTURE_WRAP_R, &setting);
+ printf("%i\t", setting);
+ glGetTexParameteriv(GL_TEXTURE_2D, GL_TEXTURE_BORDER_COLOR, &setting);
+ printf("%i\t", setting);
+ glGetTexParameteriv(GL_TEXTURE_2D, GL_TEXTURE_PRIORITY, &setting);
+ printf("%i\t", setting);
+ glGetTexParameteriv(GL_TEXTURE_2D, GL_TEXTURE_RESIDENT, &setting);
+ printf("%i\t", setting);
+ glGetTexParameteriv(GL_TEXTURE_2D, GL_TEXTURE_COMPARE_MODE, &setting);
+ printf("%i\t", setting);
+ glGetTexParameteriv(GL_TEXTURE_2D, GL_TEXTURE_COMPARE_FUNC, &setting);
+ printf("%i\t", setting);
+ glGetTexParameteriv(GL_TEXTURE_2D, GL_DEPTH_TEXTURE_MODE, &setting);
+ printf("%i\t", setting);
+ glGetTexParameteriv(GL_TEXTURE_2D, GL_GENERATE_MIPMAP, &setting);
+ printf("%i\n", setting);
+
// If you just want to run a single sub-test, assign the name to singleTest.
const char *singleTest = getenv("PIGLIT_TEST");
diff --git a/tests/spec/laura_glsl1/glsl1.c b/tests/spec/laura_glsl1/glsl1.c
index 20fbcd275..0e9f22ef1 100644
--- a/tests/spec/laura_glsl1/glsl1.c
+++ b/tests/spec/laura_glsl1/glsl1.c
@@ -118,7 +118,8 @@ PIGLIT_GL_TEST_CONFIG_BEGIN
config.supports_gl_compat_version = 10;
- config.window_visual = PIGLIT_GL_VISUAL_RGBA | PIGLIT_GL_VISUAL_DOUBLE;
+ config.window_visual = PIGLIT_GL_VISUAL_RGBA |
+ PIGLIT_GL_VISUAL_DOUBLE | PIGLIT_GL_VISUAL_DEPTH;
PIGLIT_GL_TEST_CONFIG_END
@@ -2016,7 +2017,7 @@ testProgram(const struct ShaderProgram* p)
else
{
glEnable(GL_DEPTH_TEST);
- printf(" Depth buffer enabled.\n");
+ printf("================ Depth buffer enabled.\n");
}
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
@@ -2025,11 +2026,14 @@ testProgram(const struct ShaderProgram* p)
printf("Shader test: %s\n", p->name);
+ /* Check the lower-left hand square in the textured quad to make sure it is the
+ * right color. */
if (!piglit_probe_pixel_rgba(piglit_width / 2 - 2, piglit_height / 2 - 2, p->expectedColor)) {
retVal = false;
goto cleanup;
}
+ /* Check the depth at the center of the textured quad. */
if (p->expectedZ != DONT_CARE_Z) {
if (!piglit_probe_pixel_depth(piglit_width / 2, piglit_height / 2, p->expectedZ)) {
retVal = false;
@@ -2037,17 +2041,6 @@ testProgram(const struct ShaderProgram* p)
}
}
- //if (p->expectedZ != DONT_CARE_Z) {
- // GLfloat z;
- // // read z at center of quad
- // glReadPixels(piglit_width / 2, piglit_height / 2, 1, 1,
- // GL_DEPTH_COMPONENT, GL_FLOAT, &z);
- // if (!(fabsf(z - p->expectedZ) > 1.0f)) {
- // retVal = false;
- // goto cleanup;
- // }
- //}
-
/* passed! */
retVal = true;
@@ -2070,10 +2063,44 @@ piglit_display(void)
bool pass = true;
int i;
const char *singleTest;
+ GLint setting;
if (!setup())
return PIGLIT_FAIL;
+ glGetTexParameteriv(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, &setting);
+ printf("%i\t", setting);
+ glGetTexParameteriv(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, &setting);
+ printf("%i\t", setting);
+ glGetTexParameteriv(GL_TEXTURE_2D, GL_TEXTURE_MIN_LOD, &setting);
+ printf("%i\t", setting);
+ glGetTexParameteriv(GL_TEXTURE_2D, GL_TEXTURE_MAX_LOD, &setting);
+ printf("%i\t", setting);
+ glGetTexParameteriv(GL_TEXTURE_2D, GL_TEXTURE_BASE_LEVEL, &setting);
+ printf("%i\t", setting);
+ glGetTexParameteriv(GL_TEXTURE_2D, GL_TEXTURE_MAX_LEVEL, &setting);
+ printf("%i\t", setting);
+ glGetTexParameteriv(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, &setting);
+ printf("%i\t", setting);
+ glGetTexParameteriv(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, &setting);
+ printf("%i\t", setting);
+ glGetTexParameteriv(GL_TEXTURE_2D, GL_TEXTURE_WRAP_R, &setting);
+ printf("%i\t", setting);
+ glGetTexParameteriv(GL_TEXTURE_2D, GL_TEXTURE_BORDER_COLOR, &setting);
+ printf("%i\t", setting);
+ glGetTexParameteriv(GL_TEXTURE_2D, GL_TEXTURE_PRIORITY, &setting);
+ printf("%i\t", setting);
+ glGetTexParameteriv(GL_TEXTURE_2D, GL_TEXTURE_RESIDENT, &setting);
+ printf("%i\t", setting);
+ glGetTexParameteriv(GL_TEXTURE_2D, GL_TEXTURE_COMPARE_MODE, &setting);
+ printf("%i\t", setting);
+ glGetTexParameteriv(GL_TEXTURE_2D, GL_TEXTURE_COMPARE_FUNC, &setting);
+ printf("%i\t", setting);
+ glGetTexParameteriv(GL_TEXTURE_2D, GL_DEPTH_TEXTURE_MODE, &setting);
+ printf("%i\t", setting);
+ glGetTexParameteriv(GL_TEXTURE_2D, GL_GENERATE_MIPMAP, &setting);
+ printf("%i\n", setting);
+
/* If you just want to run a single sub-test, assign the name to singleTest. */
/* for loops run until Programs[i].name because the last name in the array is NULL */
singleTest = getenv("PIGLIT_TEST");