From 27534089bedbd7963362f5e74adf84df6f152773 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Marek=20Ol=C5=A1=C3=A1k?= Date: Mon, 28 Jun 2021 11:09:02 -0400 Subject: [PATCH] drawoverhead: fix shader image tests Image slots 1..7 were always unbound, resulting in theoretically impossible results. Part-of: --- tests/perf/drawoverhead.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/tests/perf/drawoverhead.c b/tests/perf/drawoverhead.c index 72cbe06df..abbae2672 100644 --- a/tests/perf/drawoverhead.c +++ b/tests/perf/drawoverhead.c @@ -313,6 +313,11 @@ setup_shaders_and_resources(unsigned prog_index) /* Save the last TBOs for testing UBO changes. */ tbo[i % 8] = tb; } + for (i = 0; i < num_images; i++) + glBindImageTexture(i, tex[i % 8], 0, false, 0, GL_READ_ONLY, GL_RGBA8); + for (i = 0; i < num_imgbos; i++) + glBindImageTexture(i, tbo[i % 8], 0, false, 0, GL_READ_ONLY, GL_RGBA8); + glActiveTexture(GL_TEXTURE0); } @@ -474,14 +479,14 @@ draw_many_img_change(unsigned count) if (indexed) { for (i = 0; i < count; i++) { for (j = 0; j < 8; j++) - glBindImageTexture(0, tex[(i + j) % 8], 0, false, + glBindImageTexture(j, tex[(i + j) % 8], 0, false, 0, GL_READ_ONLY, GL_RGBA8); glDrawElements(GL_TRIANGLES, 3, GL_UNSIGNED_INT, NULL); } } else { for (i = 0; i < count; i++) { for (j = 0; j < 8; j++) - glBindImageTexture(0, tex[(i + j) % 8], 0, false, + glBindImageTexture(j, tex[(i + j) % 8], 0, false, 0, GL_READ_ONLY, GL_RGBA8); glActiveTexture(GL_TEXTURE0); glDrawArrays(GL_TRIANGLES, 0, 3); @@ -515,7 +520,7 @@ draw_many_imgbo_change(unsigned count) if (indexed) { for (i = 0; i < count; i++) { for (j = 0; j < 8; j++) - glBindImageTexture(0, tbo[(i + j) % 8], 0, false, + glBindImageTexture(j, tbo[(i + j) % 8], 0, false, 0, GL_READ_ONLY, GL_RGBA8); glActiveTexture(GL_TEXTURE0); glDrawElements(GL_TRIANGLES, 3, GL_UNSIGNED_INT, NULL); @@ -523,7 +528,7 @@ draw_many_imgbo_change(unsigned count) } else { for (i = 0; i < count; i++) { for (j = 0; j < 8; j++) - glBindImageTexture(0, tbo[(i + j) % 8], 0, false, + glBindImageTexture(j, tbo[(i + j) % 8], 0, false, 0, GL_READ_ONLY, GL_RGBA8); glActiveTexture(GL_TEXTURE0); glDrawArrays(GL_TRIANGLES, 0, 3); -- 2.11.4.GIT