[Mesa-dev] [PATCH 08/24] glsl: Add new atomic_uint built-in GLSL type.

Paul Berry stereotype441 at gmail.com
Tue Sep 17 13:25:38 PDT 2013


On 17 September 2013 12:18, Paul Berry <stereotype441 at gmail.com> wrote:

> On 15 September 2013 00:10, Francisco Jerez <currojerez at riseup.net> wrote:
>
>>
>>     /**
>> +    * Return the amount of atomic counter storage required for a type.
>> +    */
>> +   unsigned atomic_size() const
>> +   {
>> +      if (base_type == GLSL_TYPE_ATOMIC_UINT)
>> +         return ATOMIC_COUNTER_SIZE;
>> +      else if (is_array())
>> +         return length * element_type()->atomic_size();
>> +      else
>> +         return 0;
>> +   }
>>
>
> Can atomic counters appear inside structs?  If so, we probably need an
> is_record() case here.  If not, it would be nice to have a comment
> explaining why it's unnecessary.
>

I also notice that most of your uses of atomic_size() in this patch series
are merely to see whether the type contains any atomics.  You might
consider adding a contains_atomic() function (like we've already done with
contains_sampler() and contains_integer()) just for code clarity.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20130917/58de82c6/attachment.html>


More information about the mesa-dev mailing list