[Mesa-dev] [PATCH v2 11/31] glsl: fix std140/std430 interfaces for bindless samplers/images

Nicolai Hähnle nhaehnle at gmail.com
Wed Apr 26 07:24:56 UTC 2017


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 <samuel.pitoiset at gmail.com>
>> ---
>>   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 <C> columns and
>>       *     <R> rows, the matrix is stored identically to an array of
>>       *     <C> column vectors with <R> 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 at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev


-- 
Lerne, wie die Welt wirklich ist,
Aber vergiss niemals, wie sie sein sollte.


More information about the mesa-dev mailing list