[Mesa-dev] [PATCH] glsl: avoid calling base_alignment when samplers are involved

Ilia Mirkin imirkin at alum.mit.edu
Tue Mar 24 11:12:01 PDT 2015


On Tue, Mar 24, 2015 at 1:55 PM, Ian Romanick <idr at freedesktop.org> wrote:
> On 03/23/2015 05:00 AM, Ilia Mirkin wrote:
>> diff --git a/src/glsl/link_uniforms.cpp b/src/glsl/link_uniforms.cpp
>> index 799c74b..59adc29 100644
>> --- a/src/glsl/link_uniforms.cpp
>> +++ b/src/glsl/link_uniforms.cpp
>> @@ -547,6 +547,8 @@ private:
>>     virtual void enter_record(const glsl_type *type, const char *name,
>>                               bool row_major) {
>>        assert(type->is_record());
>> +      if (this->ubo_block_index == -1)
>> +         return;
>
> Hmm... would deleting the 'else process(var)' block from
> parcel_out_uniform_storage::set_and_process achieve the same result?

It'd achieve a little too much... that would cause none of the
processing to take place afaik for non-UBO's, which means that we also
wouldn't process samplers and images, which are presumably there for a
reason.

>
>>        this->ubo_byte_offset = glsl_align(
>>              this->ubo_byte_offset, type->std140_base_alignment(row_major));
>>     }
>> @@ -554,6 +556,8 @@ private:
>>     virtual void leave_record(const glsl_type *type, const char *name,
>>                               bool row_major) {
>>        assert(type->is_record());
>> +      if (this->ubo_block_index == -1)
>> +         return;
>>        this->ubo_byte_offset = glsl_align(
>>              this->ubo_byte_offset, type->std140_base_alignment(row_major));
>>     }
>>
>


More information about the mesa-dev mailing list