Re: [Mesa-dev] [PATCH v2 11/31] glsl: fix std140/std430 interfaces for bindless samplers/images
On 04/26/2017 12:19 PM, Samuel Pitoiset wrote: On 04/26/2017 04:44 AM, Timothy Arceri wrote: Can we just update is_scalar instead? That should work but only if vector_elements is 1 for samplers. With https://lists.freedesktop.org/archives/mesa-dev/2017-April/153166.html and with is_scalar() returning true for samplers and images, this patch can be removed. On 24/04/17 20:35, Samuel Pitoiset wrote: The ARB_bindless_texture spec says: "Samplers are represented using 64-bit integer handles". Signed-off-by: Samuel Pitoiset --- src/compiler/glsl_types.cpp | 28 1 file changed, 28 insertions(+) diff --git a/src/compiler/glsl_types.cpp b/src/compiler/glsl_types.cpp index df148cfd21..0b5cacd7f3 100644 --- a/src/compiler/glsl_types.cpp +++ b/src/compiler/glsl_types.cpp @@ -1497,6 +1497,13 @@ glsl_type::std140_base_alignment(bool row_major) const } } + /* The ARB_bindless_texture spec says: +* +* "Samplers are represented using 64-bit integer handles". +*/ + if (this->is_sampler() || this->is_image()) + return N; + /* (4) If the member is an array of scalars or vectors, the base alignment * and array stride are set to match the base alignment of a single * array element, according to rules (1), (2), and (3), and rounded up @@ -1607,6 +1614,13 @@ glsl_type::std140_size(bool row_major) const return this->vector_elements * N; } + /* The ARB_bindless_texture spec says: +* +* "Samplers are represented using 64-bit integer handles". +*/ + if (this->is_sampler() || this->is_image()) + return N; + /* (5) If the member is a column-major matrix with columns and * rows, the matrix is stored identically to an array of * column vectors with components each, according to @@ -1752,6 +1766,13 @@ glsl_type::std430_base_alignment(bool row_major) const } } + /* The ARB_bindless_texture spec says: +* +* "Samplers are represented using 64-bit integer handles". +*/ + if (this->is_sampler() || this->is_image()) + return N; + /* OpenGL 4.30 spec, section 7.6.2.2 "Standard Uniform Block Layout": * * "When using the std430 storage layout, shader storage blocks will be @@ -1868,6 +1889,13 @@ glsl_type::std430_size(bool row_major) const if (this->is_scalar() || this->is_vector()) return this->vector_elements * N; + /* The ARB_bindless_texture spec says: +* +* "Samplers are represented using 64-bit integer handles". +*/ + if (this->is_sampler() || this->is_image()) + return N; + if (this->without_array()->is_matrix()) { const struct glsl_type *element_type; const struct glsl_type *vec_type; ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH v2 11/31] glsl: fix std140/std430 interfaces for bindless samplers/images
On 04/26/2017 04:44 AM, Timothy Arceri wrote: Can we just update is_scalar instead? That should work but only if vector_elements is 1 for samplers. On 24/04/17 20:35, Samuel Pitoiset wrote: The ARB_bindless_texture spec says: "Samplers are represented using 64-bit integer handles". Signed-off-by: Samuel Pitoiset --- src/compiler/glsl_types.cpp | 28 1 file changed, 28 insertions(+) diff --git a/src/compiler/glsl_types.cpp b/src/compiler/glsl_types.cpp index df148cfd21..0b5cacd7f3 100644 --- a/src/compiler/glsl_types.cpp +++ b/src/compiler/glsl_types.cpp @@ -1497,6 +1497,13 @@ glsl_type::std140_base_alignment(bool row_major) const } } + /* The ARB_bindless_texture spec says: +* +* "Samplers are represented using 64-bit integer handles". +*/ + if (this->is_sampler() || this->is_image()) + return N; + /* (4) If the member is an array of scalars or vectors, the base alignment * and array stride are set to match the base alignment of a single * array element, according to rules (1), (2), and (3), and rounded up @@ -1607,6 +1614,13 @@ glsl_type::std140_size(bool row_major) const return this->vector_elements * N; } + /* The ARB_bindless_texture spec says: +* +* "Samplers are represented using 64-bit integer handles". +*/ + if (this->is_sampler() || this->is_image()) + return N; + /* (5) If the member is a column-major matrix with columns and * rows, the matrix is stored identically to an array of * column vectors with components each, according to @@ -1752,6 +1766,13 @@ glsl_type::std430_base_alignment(bool row_major) const } } + /* The ARB_bindless_texture spec says: +* +* "Samplers are represented using 64-bit integer handles". +*/ + if (this->is_sampler() || this->is_image()) + return N; + /* OpenGL 4.30 spec, section 7.6.2.2 "Standard Uniform Block Layout": * * "When using the std430 storage layout, shader storage blocks will be @@ -1868,6 +1889,13 @@ glsl_type::std430_size(bool row_major) const if (this->is_scalar() || this->is_vector()) return this->vector_elements * N; + /* The ARB_bindless_texture spec says: +* +* "Samplers are represented using 64-bit integer handles". +*/ + if (this->is_sampler() || this->is_image()) + return N; + if (this->without_array()->is_matrix()) { const struct glsl_type *element_type; const struct glsl_type *vec_type; ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH v2 11/31] glsl: fix std140/std430 interfaces for bindless samplers/images
On 26.04.2017 04:44, Timothy Arceri wrote: Can we just update is_scalar instead? It's probably worth a try. Cheers, Nicolai On 24/04/17 20:35, Samuel Pitoiset wrote: The ARB_bindless_texture spec says: "Samplers are represented using 64-bit integer handles". Signed-off-by: Samuel Pitoiset --- src/compiler/glsl_types.cpp | 28 1 file changed, 28 insertions(+) diff --git a/src/compiler/glsl_types.cpp b/src/compiler/glsl_types.cpp index df148cfd21..0b5cacd7f3 100644 --- a/src/compiler/glsl_types.cpp +++ b/src/compiler/glsl_types.cpp @@ -1497,6 +1497,13 @@ glsl_type::std140_base_alignment(bool row_major) const } } + /* The ARB_bindless_texture spec says: +* +* "Samplers are represented using 64-bit integer handles". +*/ + if (this->is_sampler() || this->is_image()) + return N; + /* (4) If the member is an array of scalars or vectors, the base alignment * and array stride are set to match the base alignment of a single * array element, according to rules (1), (2), and (3), and rounded up @@ -1607,6 +1614,13 @@ glsl_type::std140_size(bool row_major) const return this->vector_elements * N; } + /* The ARB_bindless_texture spec says: +* +* "Samplers are represented using 64-bit integer handles". +*/ + if (this->is_sampler() || this->is_image()) + return N; + /* (5) If the member is a column-major matrix with columns and * rows, the matrix is stored identically to an array of * column vectors with components each, according to @@ -1752,6 +1766,13 @@ glsl_type::std430_base_alignment(bool row_major) const } } + /* The ARB_bindless_texture spec says: +* +* "Samplers are represented using 64-bit integer handles". +*/ + if (this->is_sampler() || this->is_image()) + return N; + /* OpenGL 4.30 spec, section 7.6.2.2 "Standard Uniform Block Layout": * * "When using the std430 storage layout, shader storage blocks will be @@ -1868,6 +1889,13 @@ glsl_type::std430_size(bool row_major) const if (this->is_scalar() || this->is_vector()) return this->vector_elements * N; + /* The ARB_bindless_texture spec says: +* +* "Samplers are represented using 64-bit integer handles". +*/ + if (this->is_sampler() || this->is_image()) + return N; + if (this->without_array()->is_matrix()) { const struct glsl_type *element_type; const struct glsl_type *vec_type; ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev -- Lerne, wie die Welt wirklich ist, Aber vergiss niemals, wie sie sein sollte. ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH v2 11/31] glsl: fix std140/std430 interfaces for bindless samplers/images
Can we just update is_scalar instead? On 24/04/17 20:35, Samuel Pitoiset wrote: The ARB_bindless_texture spec says: "Samplers are represented using 64-bit integer handles". Signed-off-by: Samuel Pitoiset --- src/compiler/glsl_types.cpp | 28 1 file changed, 28 insertions(+) diff --git a/src/compiler/glsl_types.cpp b/src/compiler/glsl_types.cpp index df148cfd21..0b5cacd7f3 100644 --- a/src/compiler/glsl_types.cpp +++ b/src/compiler/glsl_types.cpp @@ -1497,6 +1497,13 @@ glsl_type::std140_base_alignment(bool row_major) const } } + /* The ARB_bindless_texture spec says: +* +* "Samplers are represented using 64-bit integer handles". +*/ + if (this->is_sampler() || this->is_image()) + return N; + /* (4) If the member is an array of scalars or vectors, the base alignment * and array stride are set to match the base alignment of a single * array element, according to rules (1), (2), and (3), and rounded up @@ -1607,6 +1614,13 @@ glsl_type::std140_size(bool row_major) const return this->vector_elements * N; } + /* The ARB_bindless_texture spec says: +* +* "Samplers are represented using 64-bit integer handles". +*/ + if (this->is_sampler() || this->is_image()) + return N; + /* (5) If the member is a column-major matrix with columns and * rows, the matrix is stored identically to an array of * column vectors with components each, according to @@ -1752,6 +1766,13 @@ glsl_type::std430_base_alignment(bool row_major) const } } + /* The ARB_bindless_texture spec says: +* +* "Samplers are represented using 64-bit integer handles". +*/ + if (this->is_sampler() || this->is_image()) + return N; + /* OpenGL 4.30 spec, section 7.6.2.2 "Standard Uniform Block Layout": * * "When using the std430 storage layout, shader storage blocks will be @@ -1868,6 +1889,13 @@ glsl_type::std430_size(bool row_major) const if (this->is_scalar() || this->is_vector()) return this->vector_elements * N; + /* The ARB_bindless_texture spec says: +* +* "Samplers are represented using 64-bit integer handles". +*/ + if (this->is_sampler() || this->is_image()) + return N; + if (this->without_array()->is_matrix()) { const struct glsl_type *element_type; const struct glsl_type *vec_type; ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev