Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
Mesa
piglit
Commits
2b7b52f5
Commit
2b7b52f5
authored
Sep 05, 2011
by
Marek Olšák
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add sampler2DRect GLSL tests
parent
394ad6ee
Changes
16
Hide whitespace changes
Inline
Side-by-side
Showing
16 changed files
with
429 additions
and
0 deletions
+429
-0
tests/all.tests
tests/all.tests
+3
-0
tests/shaders/shader_runner.c
tests/shaders/shader_runner.c
+88
-0
tests/spec/arb_texture_rectangle/glsl-fs-shadow.vert
tests/spec/arb_texture_rectangle/glsl-fs-shadow.vert
+8
-0
tests/spec/arb_texture_rectangle/glsl-fs-shadow2DRect-01.shader_test
...arb_texture_rectangle/glsl-fs-shadow2DRect-01.shader_test
+29
-0
tests/spec/arb_texture_rectangle/glsl-fs-shadow2DRect-02.shader_test
...arb_texture_rectangle/glsl-fs-shadow2DRect-02.shader_test
+29
-0
tests/spec/arb_texture_rectangle/glsl-fs-shadow2DRect-03.shader_test
...arb_texture_rectangle/glsl-fs-shadow2DRect-03.shader_test
+29
-0
tests/spec/arb_texture_rectangle/glsl-fs-shadow2DRect-04.shader_test
...arb_texture_rectangle/glsl-fs-shadow2DRect-04.shader_test
+29
-0
tests/spec/arb_texture_rectangle/glsl-fs-shadow2DRect-05.shader_test
...arb_texture_rectangle/glsl-fs-shadow2DRect-05.shader_test
+29
-0
tests/spec/arb_texture_rectangle/glsl-fs-shadow2DRect-06.shader_test
...arb_texture_rectangle/glsl-fs-shadow2DRect-06.shader_test
+29
-0
tests/spec/arb_texture_rectangle/glsl-fs-shadow2DRect-07.shader_test
...arb_texture_rectangle/glsl-fs-shadow2DRect-07.shader_test
+29
-0
tests/spec/arb_texture_rectangle/glsl-fs-shadow2DRect-08.shader_test
...arb_texture_rectangle/glsl-fs-shadow2DRect-08.shader_test
+29
-0
tests/spec/arb_texture_rectangle/glsl-fs-shadow2DRect-09.shader_test
...arb_texture_rectangle/glsl-fs-shadow2DRect-09.shader_test
+29
-0
tests/spec/arb_texture_rectangle/glsl-fs-shadow2DRect.frag
tests/spec/arb_texture_rectangle/glsl-fs-shadow2DRect.frag
+8
-0
tests/spec/arb_texture_rectangle/glsl-fs-shadow2DRect.shader_test
...ec/arb_texture_rectangle/glsl-fs-shadow2DRect.shader_test
+27
-0
tests/spec/arb_texture_rectangle/glsl-fs-shadow2DRectProj.shader_test
...rb_texture_rectangle/glsl-fs-shadow2DRectProj.shader_test
+33
-0
tests/util/piglit-util-gl.c
tests/util/piglit-util-gl.c
+1
-0
No files found.
tests/all.tests
View file @
2b7b52f5
...
...
@@ -906,6 +906,9 @@ arb_texture_rectangle = Group()
spec
[
'ARB_texture_rectangle'
]
=
arb_texture_rectangle
add_texwrap_test1
(
arb_texture_rectangle
,
'RECT'
)
add_texwrap_test2
(
arb_texture_rectangle
,
'RECT'
,
'proj'
)
add_shader_test_dir
(
arb_texture_rectangle
,
os
.
path
.
dirname
(
__file__
)
+
'/spec/arb_texture_rectangle'
,
recursive
=
True
)
tdfx_texture_compression_fxt1
=
Group
()
spec
[
'3DFX_texture_compression_FXT1'
]
=
tdfx_texture_compression_fxt1
...
...
tests/shaders/shader_runner.c
View file @
2b7b52f5
...
...
@@ -1024,6 +1024,21 @@ piglit_display(void)
GL_INTENSITY
);
glEnable
(
GL_TEXTURE_2D
);
}
else
if
(
sscanf
(
line
,
"texture shadowRect %d ( %d , %d )"
,
&
tex
,
&
w
,
&
h
)
==
3
)
{
glActiveTexture
(
GL_TEXTURE0
+
tex
);
piglit_depth_texture
(
GL_TEXTURE_RECTANGLE
,
GL_DEPTH_COMPONENT
,
w
,
h
,
1
,
GL_FALSE
);
glTexParameteri
(
GL_TEXTURE_RECTANGLE
,
GL_TEXTURE_COMPARE_MODE_ARB
,
GL_COMPARE_R_TO_TEXTURE_ARB
);
glTexParameteri
(
GL_TEXTURE_RECTANGLE
,
GL_TEXTURE_COMPARE_FUNC_ARB
,
GL_GREATER
);
glTexParameteri
(
GL_TEXTURE_RECTANGLE
,
GL_DEPTH_TEXTURE_MODE_ARB
,
GL_INTENSITY
);
}
else
if
(
sscanf
(
line
,
"texture shadow1D %d ( %d )"
,
&
tex
,
&
w
)
==
2
)
{
...
...
@@ -1142,6 +1157,79 @@ piglit_display(void)
glTexParameteri
(
GL_TEXTURE_2D
,
GL_DEPTH_TEXTURE_MODE_ARB
,
GL_ALPHA
);
}
else
if
(
!
strncmp
(
line
,
"texparameterRect compare_func greater
\n
"
,
38
))
{
glTexParameteri
(
GL_TEXTURE_RECTANGLE
,
GL_TEXTURE_COMPARE_FUNC_ARB
,
GL_GREATER
);
}
else
if
(
!
strncmp
(
line
,
"texparameterRect compare_func gequal
\n
"
,
37
))
{
glTexParameteri
(
GL_TEXTURE_RECTANGLE
,
GL_TEXTURE_COMPARE_FUNC_ARB
,
GL_GEQUAL
);
}
else
if
(
!
strncmp
(
line
,
"texparameterRect compare_func less
\n
"
,
35
))
{
glTexParameteri
(
GL_TEXTURE_RECTANGLE
,
GL_TEXTURE_COMPARE_FUNC_ARB
,
GL_LESS
);
}
else
if
(
!
strncmp
(
line
,
"texparameterRect compare_func lequal
\n
"
,
37
))
{
glTexParameteri
(
GL_TEXTURE_RECTANGLE
,
GL_TEXTURE_COMPARE_FUNC_ARB
,
GL_LEQUAL
);
}
else
if
(
!
strncmp
(
line
,
"texparameterRect compare_func equal
\n
"
,
36
))
{
glTexParameteri
(
GL_TEXTURE_RECTANGLE
,
GL_TEXTURE_COMPARE_FUNC_ARB
,
GL_EQUAL
);
}
else
if
(
!
strncmp
(
line
,
"texparameterRect compare_func notequal
\n
"
,
39
))
{
glTexParameteri
(
GL_TEXTURE_RECTANGLE
,
GL_TEXTURE_COMPARE_FUNC_ARB
,
GL_NOTEQUAL
);
}
else
if
(
!
strncmp
(
line
,
"texparameterRect compare_func always
\n
"
,
37
))
{
glTexParameteri
(
GL_TEXTURE_RECTANGLE
,
GL_TEXTURE_COMPARE_FUNC_ARB
,
GL_ALWAYS
);
}
else
if
(
!
strncmp
(
line
,
"texparameterRect compare_func never
\n
"
,
36
))
{
glTexParameteri
(
GL_TEXTURE_RECTANGLE
,
GL_TEXTURE_COMPARE_FUNC_ARB
,
GL_NEVER
);
}
else
if
(
!
strncmp
(
line
,
"texparameterRect depth_mode red
\n
"
,
32
))
{
/* Requires GL 3.0 or GL_ARB_texture_rg */
glTexParameteri
(
GL_TEXTURE_RECTANGLE
,
GL_DEPTH_TEXTURE_MODE_ARB
,
GL_RED
);
}
else
if
(
!
strncmp
(
line
,
"texparameterRect depth_mode luminance
\n
"
,
38
))
{
glTexParameteri
(
GL_TEXTURE_RECTANGLE
,
GL_DEPTH_TEXTURE_MODE_ARB
,
GL_LUMINANCE
);
}
else
if
(
!
strncmp
(
line
,
"texparameterRect depth_mode intensity
\n
"
,
38
))
{
glTexParameteri
(
GL_TEXTURE_RECTANGLE
,
GL_DEPTH_TEXTURE_MODE_ARB
,
GL_INTENSITY
);
}
else
if
(
!
strncmp
(
line
,
"texparameterRect depth_mode alpha
\n
"
,
33
))
{
glTexParameteri
(
GL_TEXTURE_RECTANGLE
,
GL_DEPTH_TEXTURE_MODE_ARB
,
GL_ALPHA
);
}
else
if
(
!
strncmp
(
line
,
"texparameter1D compare_func greater
\n
"
,
36
))
{
...
...
tests/spec/arb_texture_rectangle/glsl-fs-shadow.vert
0 → 100644
View file @
2b7b52f5
#version 110
varying
vec4
texcoords
;
void
main
()
{
gl_Position
=
gl_Vertex
;
texcoords
=
(
gl_Vertex
+
1
.
0
)
/
2
.
0
;
}
tests/spec/arb_texture_rectangle/glsl-fs-shadow2DRect-01.shader_test
0 → 100644
View file @
2b7b52f5
# [description]
# Test shadow2DRect(sampler2DRectShadow, vec3) with
# - depth texture mode = luminance
# - texture compare func = greater
[require]
GLSL >= 1.10
GL_ARB_texture_rectangle
[vertex shader file]
glsl-fs-shadow.vert
[fragment shader file]
glsl-fs-shadow2DRect.frag
[test]
uniform int tex 0
texture shadowRect 0 (32, 32)
texparameterRect depth_mode luminance
texparameterRect compare_func greater
draw rect -1 -1 2 2
# depth comparison pass
relative probe rgba (0.0, 0.1) (1.0, 1.0, 1.0, 1.0)
relative probe rgba (0.9, 1.0) (1.0, 1.0, 1.0, 1.0)
# depth comparison fail
relative probe rgba (0.1, 0.0) (0.0, 0.0, 0.0, 1.0)
relative probe rgba (1.0, 0.9) (0.0, 0.0, 0.0, 1.0)
tests/spec/arb_texture_rectangle/glsl-fs-shadow2DRect-02.shader_test
0 → 100644
View file @
2b7b52f5
# [description]
# Test shadow2DRect(sampler2DRectShadow, vec3) with
# - depth texture mode = luminance
# - texture compare func = always
[require]
GLSL >= 1.10
GL_ARB_texture_rectangle
[vertex shader file]
glsl-fs-shadow.vert
[fragment shader file]
glsl-fs-shadow2DRect.frag
[test]
uniform int tex 0
texture shadowRect 0 (32, 32)
texparameterRect depth_mode luminance
texparameterRect compare_func always
draw rect -1 -1 2 2
# depth comparison pass
relative probe rgba (0.0, 0.1) (1.0, 1.0, 1.0, 1.0)
relative probe rgba (0.9, 1.0) (1.0, 1.0, 1.0, 1.0)
# depth comparison fail
relative probe rgba (0.1, 0.0) (1.0, 1.0, 1.0, 1.0)
relative probe rgba (1.0, 0.9) (1.0, 1.0, 1.0, 1.0)
tests/spec/arb_texture_rectangle/glsl-fs-shadow2DRect-03.shader_test
0 → 100644
View file @
2b7b52f5
# [description]
# Test shadow2DRect(sampler2DRectShadow, vec3) with
# - depth texture mode = luminance
# - texture compare func = never
[require]
GLSL >= 1.10
GL_ARB_texture_rectangle
[vertex shader file]
glsl-fs-shadow.vert
[fragment shader file]
glsl-fs-shadow2DRect.frag
[test]
uniform int tex 0
texture shadowRect 0 (32, 32)
texparameterRect depth_mode luminance
texparameterRect compare_func never
draw rect -1 -1 2 2
# depth comparison pass
relative probe rgba (0.0, 0.1) (0.0, 0.0, 0.0, 1.0)
relative probe rgba (0.9, 1.0) (0.0, 0.0, 0.0, 1.0)
# depth comparison fail
relative probe rgba (0.1, 0.0) (0.0, 0.0, 0.0, 1.0)
relative probe rgba (1.0, 0.9) (0.0, 0.0, 0.0, 1.0)
tests/spec/arb_texture_rectangle/glsl-fs-shadow2DRect-04.shader_test
0 → 100644
View file @
2b7b52f5
# [description]
# Test shadow2DRect(sampler2DRectShadow, vec3) with
# - depth texture mode = intensity
# - texture compare func = greater
[require]
GLSL >= 1.10
GL_ARB_texture_rectangle
[vertex shader file]
glsl-fs-shadow.vert
[fragment shader file]
glsl-fs-shadow2DRect.frag
[test]
uniform int tex 0
texture shadowRect 0 (32, 32)
texparameterRect depth_mode intensity
texparameterRect compare_func greater
draw rect -1 -1 2 2
# depth comparison pass
relative probe rgba (0.0, 0.1) (1.0, 1.0, 1.0, 1.0)
relative probe rgba (0.9, 1.0) (1.0, 1.0, 1.0, 1.0)
# depth comparison fail
relative probe rgba (0.1, 0.0) (0.0, 0.0, 0.0, 0.0)
relative probe rgba (1.0, 0.9) (0.0, 0.0, 0.0, 0.0)
tests/spec/arb_texture_rectangle/glsl-fs-shadow2DRect-05.shader_test
0 → 100644
View file @
2b7b52f5
# [description]
# Test shadow2DRect(sampler2DRectShadow, vec3) with
# - depth texture mode = intensity
# - texture compare func = always
[require]
GLSL >= 1.10
GL_ARB_texture_rectangle
[vertex shader file]
glsl-fs-shadow.vert
[fragment shader file]
glsl-fs-shadow2DRect.frag
[test]
uniform int tex 0
texture shadowRect 0 (32, 32)
texparameterRect depth_mode intensity
texparameterRect compare_func always
draw rect -1 -1 2 2
# depth comparison pass
relative probe rgba (0.0, 0.1) (1.0, 1.0, 1.0, 1.0)
relative probe rgba (0.9, 1.0) (1.0, 1.0, 1.0, 1.0)
# depth comparison fail
relative probe rgba (0.1, 0.0) (1.0, 1.0, 1.0, 1.0)
relative probe rgba (1.0, 0.9) (1.0, 1.0, 1.0, 1.0)
tests/spec/arb_texture_rectangle/glsl-fs-shadow2DRect-06.shader_test
0 → 100644
View file @
2b7b52f5
# [description]
# Test shadow2DRect(sampler2DRectShadow, vec3) with
# - depth texture mode = intensity
# - texture compare func = never
[require]
GLSL >= 1.10
GL_ARB_texture_rectangle
[vertex shader file]
glsl-fs-shadow.vert
[fragment shader file]
glsl-fs-shadow2DRect.frag
[test]
uniform int tex 0
texture shadowRect 0 (32, 32)
texparameterRect depth_mode intensity
texparameterRect compare_func never
draw rect -1 -1 2 2
# depth comparison pass
relative probe rgba (0.0, 0.1) (0.0, 0.0, 0.0, 0.0)
relative probe rgba (0.9, 1.0) (0.0, 0.0, 0.0, 0.0)
# depth comparison fail
relative probe rgba (0.1, 0.0) (0.0, 0.0, 0.0, 0.0)
relative probe rgba (1.0, 0.9) (0.0, 0.0, 0.0, 0.0)
tests/spec/arb_texture_rectangle/glsl-fs-shadow2DRect-07.shader_test
0 → 100644
View file @
2b7b52f5
# [description]
# Test shadow2DRect(sampler2DRectShadow, vec3) with
# - depth texture mode = alpha
# - texture compare func = greater
[require]
GLSL >= 1.10
GL_ARB_texture_rectangle
[vertex shader file]
glsl-fs-shadow.vert
[fragment shader file]
glsl-fs-shadow2DRect.frag
[test]
uniform int tex 0
texture shadowRect 0 (32, 32)
texparameterRect depth_mode alpha
texparameterRect compare_func greater
draw rect -1 -1 2 2
# depth comparison pass
relative probe rgba (0.0, 0.1) (0.0, 0.0, 0.0, 1.0)
relative probe rgba (0.9, 1.0) (0.0, 0.0, 0.0, 1.0)
# depth comparison fail
relative probe rgba (0.1, 0.0) (0.0, 0.0, 0.0, 0.0)
relative probe rgba (1.0, 0.9) (0.0, 0.0, 0.0, 0.0)
tests/spec/arb_texture_rectangle/glsl-fs-shadow2DRect-08.shader_test
0 → 100644
View file @
2b7b52f5
# [description]
# Test shadow2DRect(sampler2DRectShadow, vec3) with
# - depth texture mode = alpha
# - texture compare func = always
[require]
GLSL >= 1.10
GL_ARB_texture_rectangle
[vertex shader file]
glsl-fs-shadow.vert
[fragment shader file]
glsl-fs-shadow2DRect.frag
[test]
uniform int tex 0
texture shadowRect 0 (32, 32)
texparameterRect depth_mode alpha
texparameterRect compare_func always
draw rect -1 -1 2 2
# depth comparison pass
relative probe rgba (0.0, 0.1) (0.0, 0.0, 0.0, 1.0)
relative probe rgba (0.9, 1.0) (0.0, 0.0, 0.0, 1.0)
# depth comparison fail
relative probe rgba (0.1, 0.0) (0.0, 0.0, 0.0, 1.0)
relative probe rgba (1.0, 0.9) (0.0, 0.0, 0.0, 1.0)
tests/spec/arb_texture_rectangle/glsl-fs-shadow2DRect-09.shader_test
0 → 100644
View file @
2b7b52f5
# [description]
# Test shadow2DRect(sampler2DRectShadow, vec3) with
# - depth texture mode = alpha
# - texture compare func = never
[require]
GLSL >= 1.10
GL_ARB_texture_rectangle
[vertex shader file]
glsl-fs-shadow.vert
[fragment shader file]
glsl-fs-shadow2DRect.frag
[test]
uniform int tex 0
texture shadowRect 0 (32, 32)
texparameterRect depth_mode alpha
texparameterRect compare_func never
draw rect -1 -1 2 2
# depth comparison pass
relative probe rgba (0.0, 0.1) (0.0, 0.0, 0.0, 0.0)
relative probe rgba (0.9, 1.0) (0.0, 0.0, 0.0, 0.0)
# depth comparison fail
relative probe rgba (0.1, 0.0) (0.0, 0.0, 0.0, 0.0)
relative probe rgba (1.0, 0.9) (0.0, 0.0, 0.0, 0.0)
tests/spec/arb_texture_rectangle/glsl-fs-shadow2DRect.frag
0 → 100644
View file @
2b7b52f5
#version 110
uniform
sampler2DRectShadow
tex
;
varying
vec4
texcoords
;
void
main
()
{
gl_FragColor
=
shadow2DRect
(
tex
,
texcoords
.
xyy
*
vec3
(
31
.
0
,
31
.
0
,
1
.
0
));
}
tests/spec/arb_texture_rectangle/glsl-fs-shadow2DRect.shader_test
0 → 100644
View file @
2b7b52f5
[require]
GLSL >= 1.10
GL_ARB_texture_rectangle
[vertex shader file]
glsl-fs-shadow.vert
[fragment shader]
varying vec4 texcoords;
uniform sampler2DRectShadow tex;
void main()
{
gl_FragColor = shadow2DRect(tex, texcoords.xyy * vec3(31.0, 31.0, 1.0));
}
[test]
uniform int tex 0
texture shadowRect 0 (32, 32)
draw rect -1 -1 2 2
relative probe rgba (0.0, 0.1) (1.0, 1.0, 1.0, 1.0)
relative probe rgba (0.0, 1.0) (1.0, 1.0, 1.0, 1.0)
relative probe rgba (0.9, 1.0) (1.0, 1.0, 1.0, 1.0)
relative probe rgba (0.1, 0.0) (0.0, 0.0, 0.0, 0.0)
relative probe rgba (1.0, 0.0) (0.0, 0.0, 0.0, 0.0)
relative probe rgba (1.0, 0.9) (0.0, 0.0, 0.0, 0.0)
tests/spec/arb_texture_rectangle/glsl-fs-shadow2DRectProj.shader_test
0 → 100644
View file @
2b7b52f5
[require]
GLSL >= 1.10
GL_ARB_texture_rectangle
[vertex shader]
varying vec4 texcoords;
void main()
{
gl_Position = gl_Vertex;
texcoords = gl_Vertex + 1.0;
}
[fragment shader]
varying vec4 texcoords;
uniform sampler2DRectShadow tex;
void main()
{
gl_FragColor = shadow2DRectProj(tex, vec4(texcoords.xyy * vec3(31.0, 31.0, 1.0), 2.0));
}
[test]
uniform int tex 0
texture shadowRect 0 (32, 32)
draw rect -1 -1 2 2
relative probe rgba (0.0, 0.1) (1.0, 1.0, 1.0, 1.0)
relative probe rgba (0.0, 1.0) (1.0, 1.0, 1.0, 1.0)
relative probe rgba (0.9, 1.0) (1.0, 1.0, 1.0, 1.0)
relative probe rgba (0.1, 0.0) (0.0, 0.0, 0.0, 0.0)
relative probe rgba (1.0, 0.0) (0.0, 0.0, 0.0, 0.0)
relative probe rgba (1.0, 0.9) (0.0, 0.0, 0.0, 0.0)
tests/util/piglit-util-gl.c
View file @
2b7b52f5
...
...
@@ -1040,6 +1040,7 @@ piglit_depth_texture(GLenum target, GLenum internalformat, int w, int h, int d,
case
GL_TEXTURE_1D_ARRAY
:
case
GL_TEXTURE_2D
:
case
GL_TEXTURE_RECTANGLE
:
glTexImage2D
(
target
,
level
,
internalformat
,
w
,
h
,
0
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment