[Mesa-dev] [PATCH 1.9/2] i965: Add brw_imm_uv().

Matt Turner mattst88 at gmail.com
Thu Nov 19 09:53:32 PST 2015


On Thu, Nov 19, 2015 at 8:00 AM, Jason Ekstrand <jason at jlekstrand.net> wrote:
> On Wed, Nov 18, 2015 at 2:25 PM, Matt Turner <mattst88 at gmail.com> wrote:
>> ---
>>  src/mesa/drivers/dri/i965/brw_fs_generator.cpp | 3 +++
>>  src/mesa/drivers/dri/i965/brw_reg.h            | 9 +++++++++
>>  2 files changed, 12 insertions(+)
>>
>> diff --git a/src/mesa/drivers/dri/i965/brw_fs_generator.cpp b/src/mesa/drivers/dri/i965/brw_fs_generator.cpp
>> index e5a286a..78c10e9 100644
>> --- a/src/mesa/drivers/dri/i965/brw_fs_generator.cpp
>> +++ b/src/mesa/drivers/dri/i965/brw_fs_generator.cpp
>> @@ -116,6 +116,9 @@ brw_reg_from_fs_reg(fs_inst *inst, fs_reg *reg, unsigned gen)
>>        case BRW_REGISTER_TYPE_V:
>>           brw_reg = brw_imm_v(reg->ud);
>>           break;
>> +      case BRW_REGISTER_TYPE_UV:
>> +         brw_reg = brw_imm_uv(reg->ud);
>> +         break;
>>        default:
>>          unreachable("not reached");
>>        }
>> diff --git a/src/mesa/drivers/dri/i965/brw_reg.h b/src/mesa/drivers/dri/i965/brw_reg.h
>> index 759bd93..b77cdeb 100644
>> --- a/src/mesa/drivers/dri/i965/brw_reg.h
>> +++ b/src/mesa/drivers/dri/i965/brw_reg.h
>> @@ -623,6 +623,15 @@ brw_imm_v(unsigned v)
>>     return imm;
>>  }
>>
>> +/** Construct vector of eight unsigned half-byte values */
>> +static inline struct brw_reg
>> +brw_imm_uv(unsigned uv)
>> +{
>
> Please add a GEN assertion either here or in the generator.  This only
> becomes available on Haswell or Broadwell if I remember correctly.  I
> do know it's not universally available.

Good idea. (It's Sandybridge+)


More information about the mesa-dev mailing list