summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTopi Pohjolainen <topi.pohjolainen@intel.com>2016-02-09 15:24:03 +0200
committerTopi Pohjolainen <topi.pohjolainen@intel.com>2016-06-23 10:29:02 +0300
commitcb1741702bf48f6671a074524cd8e75cc38cfa82 (patch)
treeeac848c69dcf4bebca634765bb61214ac896a7b8
parent233c1c2e5b325bd7c8bd6aee56488b2c9e21ce41 (diff)
fcc: Combine fast clear with mipmap generation
This test demonstrates a bug in the Intel mesa driver meta operation state restore logic. Originally it was found when developing lossless compression support. Current piglit tests just didn't exercise the resolve code path that would interfere with any ongoing meta operation. Signed-off-by: Topi Pohjolainen <topi.pohjolainen@intel.com> CC: Ben Widawsky <benjamin.widawsky@intel.com> CC: Chad Versace <chad.versace@intel.com>
-rw-r--r--tests/fast_color_clear/read-after-clear.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/fast_color_clear/read-after-clear.c b/tests/fast_color_clear/read-after-clear.c
index 98c716969..bbd638e0f 100644
--- a/tests/fast_color_clear/read-after-clear.c
+++ b/tests/fast_color_clear/read-after-clear.c
@@ -243,6 +243,25 @@ piglit_display(void)
glUniform1i(glGetUniformLocation(prog_sample, "samp"), 0);
glActiveTexture(GL_TEXTURE0);
glBindTexture(GL_TEXTURE_2D, tex1);
+
+ /* Initial buffer for texture is not large enough to hold
+ * subsequent mipmap levels. As a side effect mipmap
+ * generation will trigger Intel driver to allocate new buffer
+ * and to copy the original level zero to the newly allocated.
+ * Moreover, this will happen inside a meta operation that aims
+ * to generate level one using level zero as source. The copy
+ * from original level zero to the new buffer falls to blitter
+ * engine. This in turn requires the fast cleared content in
+ * the original buffer to be resolved resulting into another
+ * nested meta operation.
+ * This will exercise a bug in Intel driver, the nested meta
+ * operation will interfere with vertex buffer state of the
+ * outer meta operation causing the generated level one to
+ * hold wrong pixel values.
+ */
+ glGenerateMipmap(GL_TEXTURE_2D);
+ glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_BASE_LEVEL, 1);
+
piglit_draw_rect_tex(-1, -1, 2, 2, 0, 0, 1, 1);
glBindFramebuffer(GL_READ_FRAMEBUFFER, piglit_winsys_fbo);
pass = piglit_probe_rect_rgba(0, 0, piglit_width,