[Mesa-dev] [PATCH 03/32] linker: Refactor intra-stage block compatabililty testing

Ian Romanick idr at freedesktop.org
Wed Jan 23 11:44:09 PST 2013


On 01/23/2013 12:35 PM, Carl Worth wrote:
> Ian Romanick <idr at freedesktop.org> writes:
>> +bool
>> +link_uniform_blocks_are_compatible(const gl_uniform_block *a,
>> +				   const gl_uniform_block *b)
>> +{
>> +   assert(strcmp(a->Name, b->Name) == 0);
> ...
>> +      if (strcmp(old_block->Name, new_block->Name) == 0)
>> +	 return link_uniform_blocks_are_compatible(old_block, new_block)
>> +	    ? i : -1;
>
> Moving the strcmp to the body of the function, (it's there
> already---just need to replace the assert with "if(strcmp(a,b)) return
> false;"), would give a less fragile interface here.

But that's functionally different.  I only want to call 
link_uniform_blocks_are_compatible if the from one list is found in the 
other.  If the names match but the blocks are not compatible, it is an 
error.  So, there's three possible states (not found, matching, not 
matching).

> With that:
>
> Reviewed-by: Carl Worth <cworth at cworth.org>
>
> -Carl
>



More information about the mesa-dev mailing list