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

Matt Turner mattst88 at gmail.com
Tue May 6 18:38:37 PDT 2014


---
 src/mesa/drivers/dri/i965/gen7_gs_state.c | 4 +++-
 src/mesa/drivers/dri/i965/gen8_gs_state.c | 3 ++-
 2 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/src/mesa/drivers/dri/i965/gen7_gs_state.c b/src/mesa/drivers/dri/i965/gen7_gs_state.c
index d18ae15..d7ba4a0 100644
--- a/src/mesa/drivers/dri/i965/gen7_gs_state.c
+++ b/src/mesa/drivers/dri/i965/gen7_gs_state.c
@@ -96,7 +96,9 @@ upload_gs_state(struct brw_context *brw)
       OUT_BATCH(((ALIGN(stage_state->sampler_count, 4)/4) <<
                  GEN6_GS_SAMPLER_COUNT_SHIFT) |
                 ((brw->gs.prog_data->base.base.binding_table.size_bytes / 4) <<
-                 GEN6_GS_BINDING_TABLE_ENTRY_COUNT_SHIFT));
+                 GEN6_GS_BINDING_TABLE_ENTRY_COUNT_SHIFT) |
+                (!brw->gs.prog_data->base.has_control_flow ? GEN6_GS_SPF_MODE : 0));
+
 
       if (brw->gs.prog_data->base.total_scratch) {
          OUT_RELOC(stage_state->scratch_bo,
diff --git a/src/mesa/drivers/dri/i965/gen8_gs_state.c b/src/mesa/drivers/dri/i965/gen8_gs_state.c
index 97fbf84..e5260db 100644
--- a/src/mesa/drivers/dri/i965/gen8_gs_state.c
+++ b/src/mesa/drivers/dri/i965/gen8_gs_state.c
@@ -61,7 +61,8 @@ gen8_upload_gs_state(struct brw_context *brw)
                 ((ALIGN(stage_state->sampler_count, 4)/4) <<
                  GEN6_GS_SAMPLER_COUNT_SHIFT) |
                 ((prog_data->base.binding_table.size_bytes / 4) <<
-                 GEN6_GS_BINDING_TABLE_ENTRY_COUNT_SHIFT));
+                 GEN6_GS_BINDING_TABLE_ENTRY_COUNT_SHIFT) |
+                (!brw->gs.prog_data->base.has_control_flow ? GEN6_GS_SPF_MODE : 0));
 
       if (brw->gs.prog_data->base.total_scratch) {
          OUT_RELOC64(stage_state->scratch_bo,
-- 
1.8.3.2



More information about the mesa-dev mailing list