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
cc500f69
Commit
cc500f69
authored
Sep 04, 2011
by
Marek Olšák
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
util: add 1D and texture array support to piglit_depth_texture
parent
b535a162
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
46 additions
and
18 deletions
+46
-18
tests/fbo/fbo-generatemipmap-formats.c
tests/fbo/fbo-generatemipmap-formats.c
+2
-2
tests/shaders/shader_runner.c
tests/shaders/shader_runner.c
+2
-2
tests/util/piglit-util-gl.c
tests/util/piglit-util-gl.c
+41
-13
tests/util/piglit-util.h
tests/util/piglit-util.h
+1
-1
No files found.
tests/fbo/fbo-generatemipmap-formats.c
View file @
cc500f69
...
...
@@ -71,8 +71,8 @@ create_tex(GLenum internalformat, GLenum baseformat, GLenum basetype)
GLenum
type
,
format
;
if
((
baseformat
==
GL_DEPTH_COMPONENT
)
||
(
baseformat
==
GL_DEPTH_STENCIL
))
{
tex
=
piglit_depth_texture
(
internalformat
,
tex_width
,
tex_height
,
GL_FALSE
);
tex
=
piglit_depth_texture
(
GL_TEXTURE_2D
,
internalformat
,
tex_width
,
tex_height
,
1
,
GL_FALSE
);
assert
(
glGetError
()
==
0
);
if
(
baseformat
==
GL_DEPTH_STENCIL
)
{
format
=
GL_DEPTH_STENCIL
;
...
...
tests/shaders/shader_runner.c
View file @
cc500f69
...
...
@@ -1011,8 +1011,8 @@ piglit_display(void)
"texture shadow2D %d ( %d , %d )"
,
&
tex
,
&
w
,
&
h
)
==
3
)
{
glActiveTexture
(
GL_TEXTURE0
+
tex
);
piglit_depth_texture
(
GL_DEPTH_COMPONENT
,
w
,
h
,
GL_FALSE
);
piglit_depth_texture
(
GL_TEXTURE_2D
,
GL_DEPTH_COMPONENT
,
w
,
h
,
1
,
GL_FALSE
);
glTexParameteri
(
GL_TEXTURE_2D
,
GL_TEXTURE_COMPARE_MODE_ARB
,
GL_COMPARE_R_TO_TEXTURE_ARB
);
...
...
tests/util/piglit-util-gl.c
View file @
cc500f69
...
...
@@ -976,28 +976,28 @@ piglit_rgbw_texture(GLenum format, int w, int h, GLboolean mip,
}
GLuint
piglit_depth_texture
(
GLenum
internalformat
,
int
w
,
int
h
,
GLboolean
mip
)
piglit_depth_texture
(
GLenum
target
,
GLenum
internalformat
,
int
w
,
int
h
,
int
d
,
GLboolean
mip
)
{
void
*
data
;
float
*
f
=
NULL
,
*
f2
=
NULL
;
unsigned
int
*
i
=
NULL
;
int
size
,
x
,
y
,
level
;
int
size
,
x
,
y
,
level
,
layer
;
GLuint
tex
;
GLenum
type
,
format
;
glGenTextures
(
1
,
&
tex
);
glBindTexture
(
GL_TEXTURE_2D
,
tex
);
glTexParameteri
(
GL_TEXTURE_2D
,
GL_TEXTURE_WRAP_S
,
GL_CLAMP_TO_EDGE
);
glTexParameteri
(
GL_TEXTURE_2D
,
GL_TEXTURE_WRAP_T
,
GL_CLAMP_TO_EDGE
);
glBindTexture
(
target
,
tex
);
glTexParameteri
(
target
,
GL_TEXTURE_WRAP_S
,
GL_CLAMP_TO_EDGE
);
glTexParameteri
(
target
,
GL_TEXTURE_WRAP_T
,
GL_CLAMP_TO_EDGE
);
if
(
mip
)
{
glTexParameteri
(
GL_TEXTURE_2D
,
GL_TEXTURE_MAG_FILTER
,
glTexParameteri
(
target
,
GL_TEXTURE_MAG_FILTER
,
GL_LINEAR
);
glTexParameteri
(
GL_TEXTURE_2D
,
GL_TEXTURE_MIN_FILTER
,
glTexParameteri
(
target
,
GL_TEXTURE_MIN_FILTER
,
GL_LINEAR_MIPMAP_NEAREST
);
}
else
{
glTexParameteri
(
GL_TEXTURE_2D
,
GL_TEXTURE_MAG_FILTER
,
glTexParameteri
(
target
,
GL_TEXTURE_MAG_FILTER
,
GL_NEAREST
);
glTexParameteri
(
GL_TEXTURE_2D
,
GL_TEXTURE_MIN_FILTER
,
glTexParameteri
(
target
,
GL_TEXTURE_MIN_FILTER
,
GL_NEAREST
);
}
data
=
malloc
(
w
*
h
*
4
*
sizeof
(
GLfloat
));
...
...
@@ -1029,10 +1029,38 @@ piglit_depth_texture(GLenum internalformat, int w, int h, GLboolean mip)
i
[
y
*
w
+
x
]
=
0xffffff00
*
val
;
}
}
glTexImage2D
(
GL_TEXTURE_2D
,
level
,
internalformat
,
w
,
h
,
0
,
format
,
type
,
data
);
switch
(
target
)
{
case
GL_TEXTURE_1D
:
glTexImage1D
(
target
,
level
,
internalformat
,
w
,
0
,
format
,
type
,
data
);
break
;
case
GL_TEXTURE_1D_ARRAY
:
case
GL_TEXTURE_2D
:
glTexImage2D
(
target
,
level
,
internalformat
,
w
,
h
,
0
,
format
,
type
,
data
);
break
;
case
GL_TEXTURE_2D_ARRAY
:
glTexImage3D
(
target
,
level
,
internalformat
,
w
,
h
,
d
,
0
,
format
,
type
,
NULL
);
for
(
layer
=
0
;
layer
<
d
;
layer
++
)
{
glTexSubImage3D
(
target
,
level
,
0
,
0
,
layer
,
w
,
h
,
1
,
format
,
type
,
data
);
}
break
;
default:
assert
(
0
);
}
if
(
!
mip
)
break
;
...
...
tests/util/piglit-util.h
View file @
cc500f69
...
...
@@ -191,7 +191,7 @@ GLuint piglit_checkerboard_texture(GLuint tex, unsigned level,
const
float
*
black
,
const
float
*
white
);
GLuint
piglit_rgbw_texture
(
GLenum
format
,
int
w
,
int
h
,
GLboolean
mip
,
GLboolean
alpha
,
GLenum
basetype
);
GLuint
piglit_depth_texture
(
GLenum
format
,
int
w
,
int
h
,
GLboolean
mip
);
GLuint
piglit_depth_texture
(
GLenum
target
,
GLenum
format
,
int
w
,
int
h
,
int
d
,
GLboolean
mip
);
extern
float
piglit_tolerance
[
4
];
void
piglit_set_tolerance_for_bits
(
int
rbits
,
int
gbits
,
int
bbits
,
int
abits
);
...
...
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