bool include_primitive_id;
+ int invocations;
+
/**
* True if the thread should be dispatched in DUAL_INSTANCE mode, false if
* it should be dispatched in DUAL_OBJECT mode.
# define GEN7_GS_CONTROL_DATA_FORMAT_GSCTL_CUT 0
# define GEN7_GS_CONTROL_DATA_FORMAT_GSCTL_SID 1
# define GEN7_GS_CONTROL_DATA_HEADER_SIZE_SHIFT 20
+# define GEN7_GS_INSTANCE_CONTROL_SHIFT 15
# define GEN7_GS_DISPATCH_MODE_SINGLE (0 << 11)
# define GEN7_GS_DISPATCH_MODE_DUAL_INSTANCE (1 << 11)
# define GEN7_GS_DISPATCH_MODE_DUAL_OBJECT (2 << 11)
c.prog_data.include_primitive_id =
(gp->program.Base.InputsRead & VARYING_BIT_PRIMITIVE_ID) != 0;
+ c.prog_data.invocations = gp->program.Invocations;
+
/* Allocate the references to the uniforms that will end up in the
* prog_data associated with the compiled program, and which will be freed
* by the state cache.
}
/* Compile the geometry shader in DUAL_OBJECT dispatch mode, if we can do
- * so without spilling.
+ * so without spilling. If the GS invocations count > 1, then we can't use
+ * dual object mode.
*/
- if (likely(!(INTEL_DEBUG & DEBUG_NO_DUAL_OBJECT_GS))) {
+ if (c->prog_data.invocations <= 1 &&
+ likely(!(INTEL_DEBUG & DEBUG_NO_DUAL_OBJECT_GS))) {
c->prog_data.dual_instanced_dispatch = false;
vec4_gs_visitor v(brw, c, prog, shader, mem_ctx, true /* no_spills */);
((brw->max_gs_threads - 1) << max_threads_shift) |
(brw->gs.prog_data->control_data_header_size_hwords <<
GEN7_GS_CONTROL_DATA_HEADER_SIZE_SHIFT) |
+ ((brw->gs.prog_data->invocations - 1) <<
+ GEN7_GS_INSTANCE_CONTROL_SHIFT) |
(brw->gs.prog_data->dual_instanced_dispatch ?
GEN7_GS_DISPATCH_MODE_DUAL_INSTANCE :
GEN7_GS_DISPATCH_MODE_DUAL_OBJECT) |