Commit 1f4ab969 authored by Chad Versace's avatar Chad Versace

hiz: Add tests for depth tests when rendering to a window FB

Add tests for two cases: when the stencil buffer is, and is not, present.
Reviewed-By: default avatarIan Romanick <ian.d.romanick@intel.com>
Signed-off-by: default avatarChad Versace <chad.versace@intel.com>
parent 80e2d30e
......@@ -11,4 +11,22 @@ add_library(hiz-util
hiz-util.c
)
link_libraries (
hiz-util
piglitutil
${OPENGL_gl_LIBRARY}
${OPENGL_glu_LIBRARY}
${OPENGL_egl_LIBRARY}
${GLUT_glut_LIBRARY}
${TIFF_LIBRARY}
)
IF(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
link_libraries(pthread X11)
ENDIF(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
add_executable(hiz-depth-test-window-stencil0 hiz-depth-test-window-stencil0.c)
add_executable(hiz-depth-test-window-stencil1 hiz-depth-test-window-stencil1.c)
# vim: ft=cmake:
/*
* Copyright © 2011 Intel Corporation
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice (including the next
* paragraph) shall be included in all copies or substantial portions of the
* Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
* IN THE SOFTWARE.
*
* Authors:
* Chad Versace <chad.versace@intel.com>
*/
/**
* \file hiz-depth-test-window-stencil0.c
* \author Chad Versace <chad.versace@intel.com>
*
* Checks that depth tests work correctly when rendering to a window
* framebuffer with no stencilbuffer.
*/
#include "piglit-util.h"
#include "hiz/hiz-util.h"
int piglit_width = 400;
int piglit_height = 400;
int piglit_window_mode = GLUT_RGB | GLUT_ALPHA | GLUT_DEPTH;
void
piglit_init(int argc, char **argv)
{
/* empty */
}
enum piglit_result
piglit_display()
{
bool pass;
hiz_draw_rects();
pass = hiz_probe_rects();
if (!piglit_automatic)
glutSwapBuffers();
return pass ? PIGLIT_PASS : PIGLIT_FAIL;
}
/*
* Copyright © 2011 Intel Corporation
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice (including the next
* paragraph) shall be included in all copies or substantial portions of the
* Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
* IN THE SOFTWARE.
*
* Authors:
* Chad Versace <chad.versace@intel.com>
*/
/**
* \file hiz-depth-test-window-stencil1.c
* \author Chad Versace <chad.versace@intel.com>
*
* Checks that depth tests work correctly when rendering to a window
* framebuffer with a stencilbuffer.
*/
#include "piglit-util.h"
#include "hiz/hiz-util.h"
int piglit_width = 400;
int piglit_height = 400;
int piglit_window_mode = GLUT_RGB | GLUT_ALPHA | GLUT_DEPTH | GLUT_STENCIL;
void
piglit_init(int argc, char **argv)
{
/* empty */
}
enum piglit_result
piglit_display()
{
bool pass;
hiz_draw_rects();
pass = hiz_probe_rects();
if (!piglit_automatic)
glutSwapBuffers();
return pass ? PIGLIT_PASS : PIGLIT_FAIL;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment