summaryrefslogtreecommitdiff
path: root/tests/general
diff options
context:
space:
mode:
authorLuca Barbieri <luca@luca-barbieri.com>2010-08-16 14:46:08 +0200
committerMarek Olšák <maraeo@gmail.com>2010-08-16 22:18:28 +0200
commit1edd9dda8a61f94be8db95aa7b142032074f62e8 (patch)
tree15994ad5dd24cc2a6d18aa80ee34e7961e925f4f /tests/general
parent7a7d6062ed31c2bd63129976b4576dcf7ddb2587 (diff)
stencil-twoside: use ATI syntax for StencilOpSeparate too
If OpenGL 2 is not supported, GLEW doesn't set the pointer for the GL2 syntax function, leading to a segfault.
Diffstat (limited to 'tests/general')
-rw-r--r--tests/general/stencil-twoside.c30
1 files changed, 20 insertions, 10 deletions
diff --git a/tests/general/stencil-twoside.c b/tests/general/stencil-twoside.c
index a85f3388..d32dde0d 100644
--- a/tests/general/stencil-twoside.c
+++ b/tests/general/stencil-twoside.c
@@ -80,12 +80,14 @@ piglit_display(void)
if (use20syntax) {
glStencilFuncSeparate(GL_FRONT, GL_ALWAYS, 0, ~0);
glStencilFuncSeparate(GL_BACK, GL_ALWAYS, 0, ~0);
+ glStencilOpSeparate(GL_FRONT, GL_KEEP, GL_KEEP, GL_INCR);
+ glStencilOpSeparate(GL_BACK, GL_KEEP, GL_KEEP, GL_DECR);
}
else {
glStencilFuncSeparateATI(GL_ALWAYS, GL_ALWAYS, 0, ~0);
+ glStencilOpSeparateATI(GL_FRONT, GL_KEEP, GL_KEEP, GL_INCR);
+ glStencilOpSeparateATI(GL_BACK, GL_KEEP, GL_KEEP, GL_DECR);
}
- glStencilOpSeparate(GL_FRONT, GL_KEEP, GL_KEEP, GL_INCR);
- glStencilOpSeparate(GL_BACK, GL_KEEP, GL_KEEP, GL_DECR);
glColor3f(0.9, 0.9, 0.9);
for (i = 0 ; i < (max_stencil + 5) ; i++) {
@@ -102,12 +104,14 @@ piglit_display(void)
if (use20syntax) {
glStencilFuncSeparate(GL_FRONT, GL_ALWAYS, 0, ~0);
glStencilFuncSeparate(GL_BACK, GL_ALWAYS, 0, ~0);
+ glStencilOpSeparate(GL_FRONT, GL_KEEP, GL_KEEP, GL_DECR);
+ glStencilOpSeparate(GL_BACK, GL_KEEP, GL_KEEP, GL_INCR);
}
else {
glStencilFuncSeparateATI(GL_ALWAYS, GL_ALWAYS, 0, ~0);
+ glStencilOpSeparateATI(GL_FRONT, GL_KEEP, GL_KEEP, GL_DECR);
+ glStencilOpSeparateATI(GL_BACK, GL_KEEP, GL_KEEP, GL_INCR);
}
- glStencilOpSeparate(GL_FRONT, GL_KEEP, GL_KEEP, GL_DECR);
- glStencilOpSeparate(GL_BACK, GL_KEEP, GL_KEEP, GL_INCR);
glColor3f(0.9, 0.9, 0.9);
for (i = 0 ; i < (max_stencil + 5) ; i++) {
@@ -124,12 +128,14 @@ piglit_display(void)
if (use20syntax) {
glStencilFuncSeparate(GL_FRONT, GL_NEVER, 0, ~0);
glStencilFuncSeparate(GL_BACK, GL_ALWAYS, 0, ~0);
+ glStencilOpSeparate(GL_FRONT, GL_KEEP, GL_KEEP, GL_DECR);
+ glStencilOpSeparate(GL_BACK, GL_KEEP, GL_KEEP, GL_INCR);
}
else {
glStencilFuncSeparateATI(GL_NEVER, GL_ALWAYS, 0, ~0);
+ glStencilOpSeparateATI(GL_FRONT, GL_KEEP, GL_KEEP, GL_DECR);
+ glStencilOpSeparateATI(GL_BACK, GL_KEEP, GL_KEEP, GL_INCR);
}
- glStencilOpSeparate(GL_FRONT, GL_KEEP, GL_KEEP, GL_DECR);
- glStencilOpSeparate(GL_BACK, GL_KEEP, GL_KEEP, GL_INCR);
glColor3f(0.9, 0.9, 0.9);
for (i = 0 ; i < (max_stencil + 5) ; i++) {
@@ -148,12 +154,14 @@ piglit_display(void)
if (use20syntax) {
glStencilFuncSeparate(GL_FRONT, GL_ALWAYS, 0, ~0);
glStencilFuncSeparate(GL_BACK, GL_ALWAYS, 0, ~0);
+ glStencilOpSeparate(GL_FRONT, GL_KEEP, GL_KEEP, GL_INCR);
+ glStencilOpSeparate(GL_BACK, GL_KEEP, GL_KEEP, GL_DECR);
}
else {
glStencilFuncSeparateATI(GL_ALWAYS, GL_ALWAYS, 0, ~0);
+ glStencilOpSeparateATI(GL_FRONT, GL_KEEP, GL_KEEP, GL_INCR);
+ glStencilOpSeparateATI(GL_BACK, GL_KEEP, GL_KEEP, GL_DECR);
}
- glStencilOpSeparate(GL_FRONT, GL_KEEP, GL_KEEP, GL_INCR);
- glStencilOpSeparate(GL_BACK, GL_KEEP, GL_KEEP, GL_DECR);
glColor3f(0.9, 0.9, 0.9);
for (i = 0 ; i < (max_stencil + 5) ; i++) {
@@ -172,12 +180,14 @@ piglit_display(void)
if (use20syntax) {
glStencilFuncSeparate(GL_FRONT, GL_ALWAYS, 0, ~0);
glStencilFuncSeparate(GL_BACK, GL_ALWAYS, 0, ~0);
+ glStencilOpSeparate(GL_FRONT, GL_KEEP, GL_KEEP, GL_KEEP);
+ glStencilOpSeparate(GL_BACK, GL_KEEP, GL_KEEP, GL_INCR_WRAP);
}
else {
glStencilFuncSeparateATI(GL_ALWAYS, GL_ALWAYS, 0, ~0);
+ glStencilOpSeparateATI(GL_FRONT, GL_KEEP, GL_KEEP, GL_KEEP);
+ glStencilOpSeparateATI(GL_BACK, GL_KEEP, GL_KEEP, GL_INCR_WRAP);
}
- glStencilOpSeparate(GL_FRONT, GL_KEEP, GL_KEEP, GL_KEEP);
- glStencilOpSeparate(GL_BACK, GL_KEEP, GL_KEEP, GL_INCR_WRAP);
glColor3f(0.9, 0.9, 0.9);
for (i = 0 ; i < (max_stencil + 5) ; i++) {