[Piglit] [PATCH 1/2] shader_runner: Add SSBO buffer initialization command
Chris Forbes
chrisf at ijw.co.nz
Tue Sep 29 20:30:48 PDT 2015
I don't think this is correct. The non-indexed binding point (which
BindBuffer, BufferData uses) is distinct from the 0'th indexed binding
point (which BindBuffer{Base,Range} use).
- Chris
On Wed, Sep 30, 2015 at 1:10 PM, Jordan Justen <jordan.l.justen at intel.com>
wrote:
> 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 at intel.com>
> ---
> tests/shaders/shader_runner.c | 8 ++++++++
> 1 file changed, 8 insertions(+)
>
> diff --git a/tests/shaders/shader_runner.c b/tests/shaders/shader_runner.c
> index e8c3aaa..32ac7bd 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 =
> --
> 2.5.1
>
> _______________________________________________
> Piglit mailing list
> Piglit at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/piglit
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/piglit/attachments/20150930/152b7cd2/attachment.html>
More information about the Piglit
mailing list