[Mesa-dev] [PATCH 7/8] i965/vs: Enable SPF when the shader contains no control flow.

Matt Turner mattst88 at gmail.com
Tue May 6 21:28:32 PDT 2014


On Tue, May 6, 2014 at 7:14 PM, Chia-I Wu <olvaffe at gmail.com> wrote:
> On Wed, May 7, 2014 at 9:38 AM, Matt Turner <mattst88 at gmail.com> wrote:
>> ---
>>  src/mesa/drivers/dri/i965/gen6_vs_state.c | 3 ++-
>>  src/mesa/drivers/dri/i965/gen7_vs_state.c | 3 ++-
>>  src/mesa/drivers/dri/i965/gen8_vs_state.c | 3 ++-
>>  3 files changed, 6 insertions(+), 3 deletions(-)
>>
>> diff --git a/src/mesa/drivers/dri/i965/gen6_vs_state.c b/src/mesa/drivers/dri/i965/gen6_vs_state.c
>> index 0af87d1..bdfb9b5 100644
>> --- a/src/mesa/drivers/dri/i965/gen6_vs_state.c
>> +++ b/src/mesa/drivers/dri/i965/gen6_vs_state.c
>> @@ -167,7 +167,8 @@ upload_vs_state(struct brw_context *brw)
>>     OUT_BATCH(floating_point_mode |
>>              ((ALIGN(stage_state->sampler_count, 4)/4) << GEN6_VS_SAMPLER_COUNT_SHIFT) |
>>               ((brw->vs.prog_data->base.base.binding_table.size_bytes / 4) <<
>> -              GEN6_VS_BINDING_TABLE_ENTRY_COUNT_SHIFT));
>> +              GEN6_VS_BINDING_TABLE_ENTRY_COUNT_SHIFT) |
>> +             (!brw->vs.prog_data->base.has_control_flow ? GEN6_VS_SPF_MODE : 0));
> The doc says bit 31 is "Single Vertex Dispatch".  When this bit is
> set, I vaguely remember VS_INVOCATION_COUNT does get doubled for the
> same workload, and the performance is hurt.

Yeah. Chris Forbes mentioned this to me too. I'll drop the last four patches.


More information about the mesa-dev mailing list