From: Vadym Shovkoplias
This test checks max possible blit buffers sizes
v2: copyright updated
v3: test scope extended: different bounds of blitting
are tested now.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=108088
CC: Lionel G Landwerlin
CC: Jason Ekstrand
Signed-off-by: Vadym Shovkoplias
Signed-off-by: Sergii Romantsov
---
tests/fbo/CMakeLists.gl.txt | 1 +
tests/fbo/fbo-blit-check-limits.c | 309 ++
tests/opengl.py | 1 +
3 files changed, 311 insertions(+)
create mode 100644 tests/fbo/fbo-blit-check-limits.c
diff --git a/tests/fbo/CMakeLists.gl.txt b/tests/fbo/CMakeLists.gl.txt
index 1a1a607..e2c7b3a 100644
--- a/tests/fbo/CMakeLists.gl.txt
+++ b/tests/fbo/CMakeLists.gl.txt
@@ -91,6 +91,7 @@ piglit_add_executable (fbo-storage-formats
fbo-storage-formats.c)
piglit_add_executable (fbo-storage-completeness fbo-storage-completeness.c)
piglit_add_executable (fbo-sys-blit fbo-sys-blit.c)
piglit_add_executable (fbo-sys-sub-blit fbo-sys-sub-blit.c)
+piglit_add_executable (fbo-blit-check-limits fbo-blit-check-limits.c)
piglit_add_executable (fbo-tex-rgbx fbo-tex-rgbx.c)
piglit_add_executable (fbo-pbo-readpixels-small fbo-pbo-readpixels-small.c)
piglit_add_executable (fbo-copyteximage fbo-copyteximage.c)
diff --git a/tests/fbo/fbo-blit-check-limits.c
b/tests/fbo/fbo-blit-check-limits.c
new file mode 100644
index 000..b58c168
--- /dev/null
+++ b/tests/fbo/fbo-blit-check-limits.c
@@ -0,0 +1,309 @@
+/*
+ * Copyright (C) 2018 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.
+ *
+ */
+
+/** @file fbo-blit-check-limits.c
+ *
+ * Test FBO blits with MAX possible buffer sizes
+ * Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=108088
+ *
+ * \author Vadym Shovkoplias
+ * \author Sergii Romantsov
+ */
+
+#include "piglit-util-gl.h"
+
+#define FB_SIZE 160
+
+PIGLIT_GL_TEST_CONFIG_BEGIN
+
+ config.supports_gl_compat_version = 10;
+
+ config.window_visual = PIGLIT_GL_VISUAL_DOUBLE | PIGLIT_GL_VISUAL_RGB;
+ config.requires_displayed_window = true;
+ config.khr_no_error_support = PIGLIT_NO_ERRORS;
+ config.window_width = FB_SIZE;
+ config.window_height = FB_SIZE;
+
+PIGLIT_GL_TEST_CONFIG_END
+
+
+typedef struct _rgba {
+ float r;
+ float g;
+ float b;
+ float a;
+} rgba;
+
+// Yellow - back buffer left side color
+#define BACK1_R 1.0f
+#define BACK1_G 1.0f
+#define BACK1_B 0.0f
+static const rgba BACK1 = { BACK1_R, BACK1_G, BACK1_B, 1.0f };
+
+// Green - back buffer right side color
+#define BACK2_R 0.0f
+#define BACK2_G 1.0f
+#define BACK2_B 0.0f
+static const rgba BACK2 = { BACK2_R, BACK2_G, BACK2_B, 1.0f };
+
+// Red - front buffer color
+#define FRONT_R 1.0f
+#define FRONT_G 0.0f
+#define FRONT_B 0.0f
+static const rgba FRONT = { FRONT_R, FRONT_G, FRONT_B, 1.0f };
+
+// Black - blit from invalid region
+#define BLACK_R 0.0f
+#define BLACK_G 0.0f
+#define BLACK_B 0.0f
+
+typedef struct _fb_data {
+ int read;
+ int write;
+ rgba color_lb;
+ rgba color_lt;
+ rgba color_right;
+} fb_data;
+
+
+const fb_data fb_params[] = {
+ { .read = 0, .write = 0,
+ .color_lb = { FRONT_R, FRONT_G, FRONT_B, 1.0f },
+ .color_lt = { FRONT_R, FRONT_G, FRONT_B, 1.0f },
+ .color_right = { FRONT_R, FRONT_G, FRONT_B, 1.0f },
+ },
+ { .read = 0, .write = FB_SIZE,
+ .color_lb = { FRONT_R, FRONT_G, FRONT_B, 1.0f },
+ .color_lt = { FRONT_R, FRONT_G, FRONT_B, 1.0f },
+ .color_right = { FRONT_R, FRONT_G, FRONT_B, 1.0f },
+ },
+ { .read = 0, .write = FB_SIZE << 1,
+ .color_lb = { FRONT_R, FRONT_G, FRONT_B, 1.0f },
+ .color_lt = { FRONT_R, FRONT_G, FRONT_B, 1.0f },
+ .color_right = { FRONT_R, FRONT_G, FRONT_B, 1.0f },
+