[Piglit] [PATCH 1/2] shader_runner: Add SSBO buffer initialization command

Chris Forbes chrisf at ijw.co.nz
Tue Sep 29 21:16:42 PDT 2015


Nevermind, you're correct. This is the odd case where the two do interfere.
I've checked the spec and mesa's implementation, and all seems to be
correct.

In that case,

Reviewed-by: Chris Forbes <chrisf at ijw.co.nz>

On Wed, Sep 30, 2015 at 5:11 PM, Jordan Justen <jordan.l.justen at intel.com>
wrote:

> On 2015-09-29 20:30:48, Chris Forbes wrote:
> >    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).
>
> You mean that the BindBufferBase is not sufficient to bind the buffer
> before using BufferData?
>
> If I understand your concern correctly, then the man page seems to
> disagree:
>
> https://www.opengl.org/sdk/docs/man/docbook4/xhtml/glBindBufferBase.xml
>
> "In addition to binding buffer to the indexed buffer binding target,
>  glBindBufferBase also binds buffer to the generic buffer binding
>  point specified by target."
>
> -Jordan
>
> >    - 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/f137e80c/attachment-0001.html>


More information about the Piglit mailing list