Re: [Mesa-dev] [PATCH] glsl: set matrix_stride for non matrices with atomic counter buffers
On 11/13/2015 05:57 PM, Ilia Mirkin wrote: On Fri, Nov 13, 2015 at 10:53 AM, Tapani Pälli wrote: On 11/12/2015 05:47 PM, Ilia Mirkin wrote: On Mon, Nov 2, 2015 at 6:36 AM, Tapani Pälli wrote: Patch sets matrix_stride as 0 for non matrix uniforms that are in a atomic counter buffer. Matrix stride calculation for actual matrix uniforms is done during link_assign_uniform_locations. From ARB_program_interface_query specification: GL_MATRIX_STRIDE: "For active variables not declared as a matrix or array of matrices, zero is written to . For active variables not backed by a buffer object, -1 is written to , regardless of the variable type." Signed-off-by: Tapani Pälli --- src/glsl/link_atomics.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/glsl/link_atomics.cpp b/src/glsl/link_atomics.cpp index cdcc06d..3aa52db 100644 --- a/src/glsl/link_atomics.cpp +++ b/src/glsl/link_atomics.cpp @@ -240,6 +240,8 @@ link_assign_atomic_counter_resources(struct gl_context *ctx, storage->offset = var->data.atomic.offset; storage->array_stride = (var->type->is_array() ? var->type->without_array()->atomic_size() : 0); + if (!var->type->is_matrix()) +storage->matrix_stride = 0; Can atomics ever be in matrices? Nope, but one can query matrix stride property of a uniform that is 'backed by' atomic counter buffer. Right, I get that... but why the if (!var->type->is_matrix())? Yes that's right, we should be able to just initialize matrix_stride as 0 without check. I'll test this and then check can be removed. // Tapani ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH] glsl: set matrix_stride for non matrices with atomic counter buffers
On Fri, Nov 13, 2015 at 10:53 AM, Tapani Pälli wrote: > On 11/12/2015 05:47 PM, Ilia Mirkin wrote: >> >> On Mon, Nov 2, 2015 at 6:36 AM, Tapani Pälli >> wrote: >>> >>> Patch sets matrix_stride as 0 for non matrix uniforms that are in a >>> atomic counter buffer. Matrix stride calculation for actual matrix >>> uniforms is done during link_assign_uniform_locations. >>> >>> From ARB_program_interface_query specification: >>> >>> GL_MATRIX_STRIDE: >>> >>> "For active variables not declared as a matrix or array of matrices, >>> zero is written to . For active variables not backed by a >>> buffer object, -1 is written to , regardless of the variable >>> type." >>> >>> Signed-off-by: Tapani Pälli >>> --- >>> src/glsl/link_atomics.cpp | 2 ++ >>> 1 file changed, 2 insertions(+) >>> >>> diff --git a/src/glsl/link_atomics.cpp b/src/glsl/link_atomics.cpp >>> index cdcc06d..3aa52db 100644 >>> --- a/src/glsl/link_atomics.cpp >>> +++ b/src/glsl/link_atomics.cpp >>> @@ -240,6 +240,8 @@ link_assign_atomic_counter_resources(struct >>> gl_context *ctx, >>>storage->offset = var->data.atomic.offset; >>>storage->array_stride = (var->type->is_array() ? >>> >>> var->type->without_array()->atomic_size() : 0); >>> + if (!var->type->is_matrix()) >>> +storage->matrix_stride = 0; >> >> Can atomics ever be in matrices? > > > Nope, but one can query matrix stride property of a uniform that is 'backed > by' atomic counter buffer. Right, I get that... but why the if (!var->type->is_matrix())? ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH] glsl: set matrix_stride for non matrices with atomic counter buffers
On 11/12/2015 05:47 PM, Ilia Mirkin wrote: On Mon, Nov 2, 2015 at 6:36 AM, Tapani Pälli wrote: Patch sets matrix_stride as 0 for non matrix uniforms that are in a atomic counter buffer. Matrix stride calculation for actual matrix uniforms is done during link_assign_uniform_locations. From ARB_program_interface_query specification: GL_MATRIX_STRIDE: "For active variables not declared as a matrix or array of matrices, zero is written to . For active variables not backed by a buffer object, -1 is written to , regardless of the variable type." Signed-off-by: Tapani Pälli --- src/glsl/link_atomics.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/glsl/link_atomics.cpp b/src/glsl/link_atomics.cpp index cdcc06d..3aa52db 100644 --- a/src/glsl/link_atomics.cpp +++ b/src/glsl/link_atomics.cpp @@ -240,6 +240,8 @@ link_assign_atomic_counter_resources(struct gl_context *ctx, storage->offset = var->data.atomic.offset; storage->array_stride = (var->type->is_array() ? var->type->without_array()->atomic_size() : 0); + if (!var->type->is_matrix()) +storage->matrix_stride = 0; Can atomics ever be in matrices? Nope, but one can query matrix stride property of a uniform that is 'backed by' atomic counter buffer. -ilia // Tapani ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH] glsl: set matrix_stride for non matrices with atomic counter buffers
On Mon, Nov 2, 2015 at 6:36 AM, Tapani Pälli wrote: > Patch sets matrix_stride as 0 for non matrix uniforms that are in a > atomic counter buffer. Matrix stride calculation for actual matrix > uniforms is done during link_assign_uniform_locations. > > From ARB_program_interface_query specification: > > GL_MATRIX_STRIDE: > >"For active variables not declared as a matrix or array of matrices, >zero is written to . For active variables not backed by a >buffer object, -1 is written to , regardless of the variable >type." > > Signed-off-by: Tapani Pälli > --- > src/glsl/link_atomics.cpp | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/src/glsl/link_atomics.cpp b/src/glsl/link_atomics.cpp > index cdcc06d..3aa52db 100644 > --- a/src/glsl/link_atomics.cpp > +++ b/src/glsl/link_atomics.cpp > @@ -240,6 +240,8 @@ link_assign_atomic_counter_resources(struct gl_context > *ctx, > storage->offset = var->data.atomic.offset; > storage->array_stride = (var->type->is_array() ? >var->type->without_array()->atomic_size() > : 0); > + if (!var->type->is_matrix()) > +storage->matrix_stride = 0; Can atomics ever be in matrices? -ilia ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH] glsl: set matrix_stride for non matrices with atomic counter buffers
Reviewed-by: Marta Lofstedt > -Original Message- > From: mesa-dev [mailto:mesa-dev-boun...@lists.freedesktop.org] On > Behalf Of Tapani Pälli > Sent: Monday, November 2, 2015 12:36 PM > To: mesa-dev@lists.freedesktop.org > Subject: [Mesa-dev] [PATCH] glsl: set matrix_stride for non matrices with > atomic counter buffers > > Patch sets matrix_stride as 0 for non matrix uniforms that are in a atomic > counter buffer. Matrix stride calculation for actual matrix uniforms is done > during link_assign_uniform_locations. > > From ARB_program_interface_query specification: > > GL_MATRIX_STRIDE: > >"For active variables not declared as a matrix or array of matrices, >zero is written to . For active variables not backed by a >buffer object, -1 is written to , regardless of the variable >type." > > Signed-off-by: Tapani Pälli > --- > src/glsl/link_atomics.cpp | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/src/glsl/link_atomics.cpp b/src/glsl/link_atomics.cpp index > cdcc06d..3aa52db 100644 > --- a/src/glsl/link_atomics.cpp > +++ b/src/glsl/link_atomics.cpp > @@ -240,6 +240,8 @@ link_assign_atomic_counter_resources(struct > gl_context *ctx, > storage->offset = var->data.atomic.offset; > storage->array_stride = (var->type->is_array() ? >var->type->without_array()->atomic_size() > : 0); > + if (!var->type->is_matrix()) > +storage->matrix_stride = 0; >} > >/* Assign stage-specific fields. */ > -- > 2.4.3 > > ___ > mesa-dev mailing list > mesa-dev@lists.freedesktop.org > http://lists.freedesktop.org/mailman/listinfo/mesa-dev ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [PATCH] glsl: set matrix_stride for non matrices with atomic counter buffers
Patch sets matrix_stride as 0 for non matrix uniforms that are in a atomic counter buffer. Matrix stride calculation for actual matrix uniforms is done during link_assign_uniform_locations. From ARB_program_interface_query specification: GL_MATRIX_STRIDE: "For active variables not declared as a matrix or array of matrices, zero is written to . For active variables not backed by a buffer object, -1 is written to , regardless of the variable type." Signed-off-by: Tapani Pälli --- src/glsl/link_atomics.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/glsl/link_atomics.cpp b/src/glsl/link_atomics.cpp index cdcc06d..3aa52db 100644 --- a/src/glsl/link_atomics.cpp +++ b/src/glsl/link_atomics.cpp @@ -240,6 +240,8 @@ link_assign_atomic_counter_resources(struct gl_context *ctx, storage->offset = var->data.atomic.offset; storage->array_stride = (var->type->is_array() ? var->type->without_array()->atomic_size() : 0); + if (!var->type->is_matrix()) +storage->matrix_stride = 0; } /* Assign stage-specific fields. */ -- 2.4.3 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev