diff options
author | Jordan Justen <jordan.l.justen@intel.com> | 2015-09-29 15:58:07 -0700 |
---|---|---|
committer | Jordan Justen <jordan.l.justen@intel.com> | 2015-09-30 11:33:00 -0700 |
commit | c2bdb58b230e959c4df5617bbfd111d33604e94f (patch) | |
tree | 6401bc0ac22e534fb85cdde105663f246275ad68 /tests | |
parent | 3426d305ee6addb3ce7608203b90361166bebafb (diff) |
shader_runner: Add SSBO buffer initialization command
The command is:
ssbo <size>
where <size> is the size in bytes to allocate for the SSBO buffer.
This command only sets of a buffer for SSBO index 0.
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/shaders/shader_runner.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/shaders/shader_runner.c b/tests/shaders/shader_runner.c index e8c3aaabb..32ac7bd4f 100644 --- a/tests/shaders/shader_runner.c +++ b/tests/shaders/shader_runner.c @@ -113,6 +113,7 @@ GLenum geometry_layout_input_type = GL_TRIANGLES; GLenum geometry_layout_output_type = GL_TRIANGLE_STRIP; GLint geometry_layout_vertices_out = 0; GLuint atomics_bo = 0; +GLuint ssbo = 0; #define SHADER_TYPES 6 static GLuint *subuniform_locations[SHADER_TYPES]; @@ -2898,6 +2899,13 @@ piglit_display(void) glShadeModel(GL_SMOOTH); } else if (string_match("shade model flat", line)) { glShadeModel(GL_FLAT); + } else if (sscanf(line, "ssbo %d", &x) == 1) { + GLuint *ssbo_init = calloc(x, 1); + glGenBuffers(1, &ssbo); + glBindBufferBase(GL_SHADER_STORAGE_BUFFER, 0, ssbo); + glBufferData(GL_SHADER_STORAGE_BUFFER, x, + ssbo_init, GL_DYNAMIC_DRAW); + free(ssbo_init); } else if (sscanf(line, "texture rgbw %d ( %d", &tex, &w) == 2) { GLenum int_fmt = GL_RGBA; int num_scanned = |