[Piglit] [PATCH 18/23] tex-miplevel-selection: test all variants of textureProjGradOffset
Marek Olšák
maraeo at gmail.com
Fri Jul 4 07:10:05 PDT 2014
From: Marek Olšák <marek.olsak at amd.com>
---
tests/all.py | 8 ++++++++
tests/texturing/tex-miplevel-selection.c | 20 ++++++++++++++++----
2 files changed, 24 insertions(+), 4 deletions(-)
diff --git a/tests/all.py b/tests/all.py
index fab72bb..b023df5 100644
--- a/tests/all.py
+++ b/tests/all.py
@@ -1323,6 +1323,14 @@ add_concurrent_test(spec['glsl-1.30']['execution'], 'tex-miplevel-selection text
add_concurrent_test(spec['glsl-1.30']['execution'], 'tex-miplevel-selection textureProjGrad 1DShadow')
add_concurrent_test(spec['glsl-1.30']['execution'], 'tex-miplevel-selection textureProjGrad 2DShadow')
+add_concurrent_test(spec['glsl-1.30']['execution'], 'tex-miplevel-selection textureProjGradOffset 1D')
+add_concurrent_test(spec['glsl-1.30']['execution'], 'tex-miplevel-selection textureProjGradOffset 1D_ProjVec4')
+add_concurrent_test(spec['glsl-1.30']['execution'], 'tex-miplevel-selection textureProjGradOffset 2D')
+add_concurrent_test(spec['glsl-1.30']['execution'], 'tex-miplevel-selection textureProjGradOffset 2D_ProjVec4')
+add_concurrent_test(spec['glsl-1.30']['execution'], 'tex-miplevel-selection textureProjGradOffset 3D')
+add_concurrent_test(spec['glsl-1.30']['execution'], 'tex-miplevel-selection textureProjGradOffset 1DShadow')
+add_concurrent_test(spec['glsl-1.30']['execution'], 'tex-miplevel-selection textureProjGradOffset 2DShadow')
+
# Group spec/glsl-1.40
spec['glsl-1.40'] = {}
import_glsl_parser_tests(spec['glsl-1.40'],
diff --git a/tests/texturing/tex-miplevel-selection.c b/tests/texturing/tex-miplevel-selection.c
index eb8bca7..8b9e94b 100644
--- a/tests/texturing/tex-miplevel-selection.c
+++ b/tests/texturing/tex-miplevel-selection.c
@@ -132,6 +132,7 @@ enum shader_type {
GL3_TEXTURE_GRAD,
GL3_TEXTURE_GRAD_OFFSET,
GL3_TEXTURE_PROJ_GRAD,
+ GL3_TEXTURE_PROJ_GRAD_OFFSET,
};
#define NEED_ARB_LOD(t) ((t) == ARB_SHADER_TEXTURE_LOD)
@@ -237,6 +238,8 @@ piglit_init(int argc, char **argv)
test = GL3_TEXTURE_GRAD_OFFSET;
else if (strcmp(argv[i], "textureProjGrad") == 0)
test = GL3_TEXTURE_PROJ_GRAD;
+ else if (strcmp(argv[i], "textureProjGradOffset") == 0)
+ test = GL3_TEXTURE_PROJ_GRAD_OFFSET;
else if (strcmp(argv[i], "1D") == 0)
target = TEX_1D;
else if (strcmp(argv[i], "1D_ProjVec4") == 0)
@@ -412,7 +415,8 @@ piglit_init(int argc, char **argv)
test == GL3_TEXTURE_PROJ_OFFSET_BIAS ||
test == GL3_TEXTURE_PROJ_LOD ||
test == GL3_TEXTURE_PROJ_LOD_OFFSET ||
- test == GL3_TEXTURE_PROJ_GRAD) {
+ test == GL3_TEXTURE_PROJ_GRAD ||
+ test == GL3_TEXTURE_PROJ_GRAD_OFFSET) {
if (!strcmp(type_str, "float"))
type_str = "vec2";
else if (!strcmp(type_str, "vec2"))
@@ -490,6 +494,10 @@ piglit_init(int argc, char **argv)
instruction = "textureProjGrad";
other_params = ", DERIV_TYPE(dx), DERIV_TYPE(dy)";
break;
+ case GL3_TEXTURE_PROJ_GRAD_OFFSET:
+ instruction = "textureProjGradOffset";
+ other_params = ", DERIV_TYPE(dx), DERIV_TYPE(dy), OFFSET";
+ break;
default:
assert(0);
}
@@ -544,7 +552,8 @@ piglit_init(int argc, char **argv)
if (test == GL3_TEXTURE_GRAD ||
test == GL3_TEXTURE_GRAD_OFFSET ||
- test == GL3_TEXTURE_PROJ_GRAD) {
+ test == GL3_TEXTURE_PROJ_GRAD ||
+ test == GL3_TEXTURE_PROJ_GRAD_OFFSET) {
loc_dx = glGetUniformLocation(prog, "dx");
loc_dy = glGetUniformLocation(prog, "dy");
}
@@ -555,7 +564,8 @@ piglit_init(int argc, char **argv)
test == GL3_TEXTURE_PROJ_OFFSET_BIAS ||
test == GL3_TEXTURE_LOD_OFFSET ||
test == GL3_TEXTURE_PROJ_LOD_OFFSET ||
- test == GL3_TEXTURE_GRAD_OFFSET) {
+ test == GL3_TEXTURE_GRAD_OFFSET ||
+ test == GL3_TEXTURE_PROJ_GRAD_OFFSET) {
has_offset = GL_TRUE;
no_lod_clamp = GL_TRUE; /* not implemented for now */
}
@@ -791,6 +801,7 @@ draw_quad(int x, int y, int w, int h, int expected_level, int fetch_level,
break;
case GL3_TEXTURE_GRAD_OFFSET:
+ case GL3_TEXTURE_PROJ_GRAD_OFFSET:
fix_normalized_coordinates(expected_level, &s0, &t0, &s1, &t1);
/* fall through */
case GL3_TEXTURE_GRAD:
@@ -867,7 +878,8 @@ draw_quad(int x, int y, int w, int h, int expected_level, int fetch_level,
test == GL3_TEXTURE_PROJ_OFFSET_BIAS ||
test == GL3_TEXTURE_PROJ_LOD ||
test == GL3_TEXTURE_PROJ_LOD_OFFSET ||
- test == GL3_TEXTURE_PROJ_GRAD)
+ test == GL3_TEXTURE_PROJ_GRAD ||
+ test == GL3_TEXTURE_PROJ_GRAD_OFFSET)
p = 7;
switch (target) {
--
1.9.1
More information about the Piglit
mailing list