[Mesa-dev] [PATCH 31/41] i965/fs: Use instruction execution sizes to set compression state

Ilia Mirkin imirkin at alum.mit.edu
Fri Mar 27 21:37:47 PDT 2015


On Tue, Sep 23, 2014 at 2:14 PM, Matt Turner <mattst88 at gmail.com> wrote:
> On Sat, Sep 20, 2014 at 10:23 AM, Jason Ekstrand <jason at jlekstrand.net> wrote:
>> Signed-off-by: Jason Ekstrand <jason.ekstrand at intel.com>
>> ---
>>  src/mesa/drivers/dri/i965/brw_fs_generator.cpp | 23 ++++++++++++++++++-----
>>  1 file changed, 18 insertions(+), 5 deletions(-)
>>
>> diff --git a/src/mesa/drivers/dri/i965/brw_fs_generator.cpp b/src/mesa/drivers/dri/i965/brw_fs_generator.cpp
>> index f20a4a7..00cf3ec 100644
>> --- a/src/mesa/drivers/dri/i965/brw_fs_generator.cpp
>> +++ b/src/mesa/drivers/dri/i965/brw_fs_generator.cpp
>> @@ -1536,12 +1536,25 @@ fs_generator::generate_code(const cfg_t *cfg)
>>        brw_set_default_mask_control(p, inst->force_writemask_all);
>>        brw_set_default_acc_write_control(p, inst->writes_accumulator);
>>
>> -      if (inst->force_uncompressed || dispatch_width == 8) {
>> +      switch (inst->exec_size) {
>> +      case 1:
>> +      case 2:
>> +      case 4:
>> +         assert(inst->force_writemask_all);
>>          brw_set_default_compression_control(p, BRW_COMPRESSION_NONE);
>> -      } else if (inst->force_sechalf) {
>> -        brw_set_default_compression_control(p, BRW_COMPRESSION_2NDHALF);
>> -      } else {
>> -        brw_set_default_compression_control(p, BRW_COMPRESSION_COMPRESSED);
>> +         break;
>> +      case 8:
>> +         if (inst->force_sechalf) {
>> +            brw_set_default_compression_control(p, BRW_COMPRESSION_2NDHALF);
>> +         } else {
>> +           brw_set_default_compression_control(p, BRW_COMPRESSION_NONE);
>
> Indentation is off here, or in the block above.
>
>> +         }
>> +         break;
>> +      case 16:
>> +         brw_set_default_compression_control(p, BRW_COMPRESSION_COMPRESSED);
>> +         break;
>> +      default:
>> +         assert(!"Invalid instruction width");
>
> unreachable.

Jason,

I see that you took this suggestion, however you forgot to flip the
condition. unreachable() just takes a string, not a condition. You
need to remove the ! in there.

  -ilia


More information about the mesa-dev mailing list