Commit 734c6e41 authored by Chad Versace's avatar Chad Versace
Browse files

hiz: Factor out common code from hiz-depth-test-window*.c



... into hiz_run_test_depth_test_window().

The immediate result of this refactoring results in a net increas in code.
But, it will prevent much code duplication on a subsequent commit that
refactors the probe functions.
Signed-off-by: default avatarChad Versace <chad.versace@intel.com>
parent f3c84d12
......@@ -48,10 +48,8 @@ piglit_init(int argc, char **argv)
enum piglit_result
piglit_display()
{
bool pass;
hiz_draw_rects();
pass = hiz_probe_rects();
if (!piglit_automatic)
glutSwapBuffers();
return pass ? PIGLIT_PASS : PIGLIT_FAIL;
if (hiz_run_test_depth_test_window())
return PIGLIT_PASS;
else
return PIGLIT_FAIL;
}
......@@ -48,10 +48,8 @@ piglit_init(int argc, char **argv)
enum piglit_result
piglit_display()
{
bool pass;
hiz_draw_rects();
pass = hiz_probe_rects();
if (!piglit_automatic)
glutSwapBuffers();
return pass ? PIGLIT_PASS : PIGLIT_FAIL;
if (hiz_run_test_depth_test_window())
return PIGLIT_PASS;
else
return PIGLIT_FAIL;
}
......@@ -269,3 +269,13 @@ hiz_check_fbo_depth_test(const struct hiz_fbo_options *fbo_options)
return pass;
}
bool
hiz_run_test_depth_test_window() {
bool pass = true;
hiz_draw_rects();
pass = hiz_probe_rects();
if (!piglit_automatic)
glutSwapBuffers();
return pass;
}
......@@ -91,3 +91,12 @@ void hiz_delete_fbo(GLuint fbo);
* \return True if test passed.
*/
bool hiz_check_fbo_depth_test(const struct hiz_fbo_options *options);
/**
* Check that depth tests work correctly when rendering to the window
* framebuffer.
*
* \param options Perform the test with an FBO with the given formats.
* \return True if test passed.
*/
bool hiz_run_test_depth_test_window();
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