[Mesa-dev] [PATCH 5/7] i965/fs: Don't renumber UNIFORM registers.

Kenneth Graunke kenneth at whitecape.org
Wed Mar 12 23:52:29 PDT 2014


On 03/12/2014 05:30 AM, Pohjolainen, Topi wrote:
> On Tue, Mar 11, 2014 at 11:48:54PM -0700, Kenneth Graunke wrote:
[snip]
>> +   stage_prog_data->nr_params = num_push_constants;
>> +
>> +   /* Up until now, the param[] array has been indexed by reg + reg_offset
>> +    * of UNIFORM registers.  Condense it to only contain the uniforms we
>> +    * chose to upload as push constants.
>> +    */
>> +   for (unsigned int i = 0; i < uniforms; i++) {
>> +      int remapped = push_constant_loc[i];
>> +
>> +      if (remapped == -1)
>> +         continue;
>> +
> 
> I suppose it is obvious, but I had to read again the assigning loop above to be
> certain, and hence there is no danger of writing before reading in
> "stage_prog_data->param[]":
> 
>          assert(remapped <= i);

Right...I agree, the assert is definitely nice to have.  (The old code I
moved didn't have one.)  I've added it for v2.

--Ken

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: OpenPGP digital signature
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20140312/1f209188/attachment.pgp>


More information about the mesa-dev mailing list