[Mesa-dev] [PATCH 06/10] i965/fs: Fix dump_instructions() on uniforms.

Eric Anholt eric at anholt.net
Thu Mar 27 16:12:57 PDT 2014


Kenneth Graunke <kenneth at whitecape.org> writes:

> On 03/26/2014 02:23 PM, Eric Anholt wrote:
>> All of a vec4 uniform was being printed as "u0"
>> ---
>>  src/mesa/drivers/dri/i965/brw_fs.cpp | 4 ++--
>>  1 file changed, 2 insertions(+), 2 deletions(-)
>> 
>> diff --git a/src/mesa/drivers/dri/i965/brw_fs.cpp b/src/mesa/drivers/dri/i965/brw_fs.cpp
>> index 713e477..b3f1dfd 100644
>> --- a/src/mesa/drivers/dri/i965/brw_fs.cpp
>> +++ b/src/mesa/drivers/dri/i965/brw_fs.cpp
>> @@ -3035,7 +3035,7 @@ fs_visitor::dump_instruction(backend_instruction *be_inst)
>>        fprintf(stderr, "(null)");
>>        break;
>>     case UNIFORM:
>> -      fprintf(stderr, "***u%d***", inst->dst.reg);
>> +      fprintf(stderr, "***u%d***", inst->dst.reg + inst->dst.reg_offset);
>>        break;
>>     case HW_REG:
>>        if (inst->dst.fixed_hw_reg.file == BRW_ARCHITECTURE_REGISTER_FILE) {
>> @@ -3087,7 +3087,7 @@ fs_visitor::dump_instruction(backend_instruction *be_inst)
>>           fprintf(stderr, "***m%d***", inst->src[i].reg);
>>           break;
>>        case UNIFORM:
>> -         fprintf(stderr, "u%d", inst->src[i].reg);
>> +         fprintf(stderr, "u%d", inst->src[i].reg + inst->src[i].reg_offset);
>>           if (inst->src[i].reladdr) {
>>              fprintf(stderr, "+reladdr");
>>           } else if (virtual_grf_sizes[inst->src[i].reg] != 1 ||
>
> This kind of makes me wonder whether we should be using the reg_offset
> field for UNIFORM files at all.  It seems like we universally add them
> together, and there's a bunch of optimization code that bails when
> reg_offset != 0...

Yeah, I've been thinking about switching uniforms to not use reg_offset,
as a step toward eliminating reg_offset completely.  But until we get
around to that, I figured at least fixing the debug would be nice.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 818 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20140327/6971a8fe/attachment.sig>


More information about the mesa-dev mailing list