[Piglit] [PATCH 01/13] shader_runner: Allow initializing integer fields of an SSBO

Ian Romanick idr at freedesktop.org
Fri Jun 1 22:43:06 UTC 2018


From: Ian Romanick <ian.d.romanick at intel.com>

v2: Use %i for the "data" parameter so that hex values can be specified.

Signed-off-by: Ian Romanick <ian.d.romanick at intel.com>
---
 tests/shaders/shader_runner.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/tests/shaders/shader_runner.c b/tests/shaders/shader_runner.c
index 794524e8f..5cf151799 100644
--- a/tests/shaders/shader_runner.c
+++ b/tests/shaders/shader_runner.c
@@ -3556,6 +3556,9 @@ piglit_display(void)
 		} else if (sscanf(line, "ssbo %d subdata float %d %f", &x, &y, &c[0]) == 3) {
 			glBindBuffer(GL_SHADER_STORAGE_BUFFER, ssbo[x]);
 			glBufferSubData(GL_SHADER_STORAGE_BUFFER, y, 4, &c[0]);
+		} else if (sscanf(line, "ssbo %d subdata int %d %i", &x, &y, &z) == 3) {
+			glBindBuffer(GL_SHADER_STORAGE_BUFFER, ssbo[x]);
+			glBufferSubData(GL_SHADER_STORAGE_BUFFER, y, 4, &z);
 		} else if (sscanf(line, "texture rgbw %d ( %d", &tex, &w) == 2) {
 			GLenum int_fmt = GL_RGBA;
 			int num_scanned =
-- 
2.14.4



More information about the Piglit mailing list