intel/fs/gen12: Fix hangs with per-sample SIMD32 fragment shader dispatch.
[mesa.git] / src / intel / compiler / brw_compiler.h
index 2e34b16dd44e2e2ad12facce2ddabb176c89bc9b..ab39af226840e14a236d1a0de1aafdc536ba55a5 100644 (file)
@@ -657,6 +657,19 @@ struct brw_stage_prog_data {
    GLuint nr_params;       /**< number of float params/constants */
    GLuint nr_pull_params;
 
+   /* zero_push_reg is a bitfield which indicates what push registers (if any)
+    * should be zeroed by SW at the start of the shader.  The corresponding
+    * push_reg_mask_param specifies the param index (in 32-bit units) where
+    * the actual runtime 64-bit mask will be pushed.  The shader will zero
+    * push reg i if
+    *
+    *    reg_used & zero_push_reg & ~*push_reg_mask_param & (1ull << i)
+    *
+    * If this field is set, brw_compiler::compact_params must be false.
+    */
+   uint64_t zero_push_reg;
+   unsigned push_reg_mask_param;
+
    unsigned curb_read_length;
    unsigned total_scratch;
    unsigned total_shared;
@@ -906,7 +919,6 @@ struct brw_cs_prog_data {
    unsigned local_size[3];
    unsigned max_variable_local_size;
    unsigned simd_size;
-   unsigned threads;
    unsigned slm_size;
    bool uses_barrier;
    bool uses_num_work_groups;
@@ -1255,11 +1267,16 @@ union brw_any_prog_data {
    struct brw_cs_prog_data cs;
 };
 
-#define DEFINE_PROG_DATA_DOWNCAST(stage)                       \
-static inline struct brw_##stage##_prog_data *                 \
-brw_##stage##_prog_data(struct brw_stage_prog_data *prog_data) \
-{                                                              \
-   return (struct brw_##stage##_prog_data *) prog_data;        \
+#define DEFINE_PROG_DATA_DOWNCAST(stage)                                   \
+static inline struct brw_##stage##_prog_data *                             \
+brw_##stage##_prog_data(struct brw_stage_prog_data *prog_data)             \
+{                                                                          \
+   return (struct brw_##stage##_prog_data *) prog_data;                    \
+}                                                                          \
+static inline const struct brw_##stage##_prog_data *                       \
+brw_##stage##_prog_data_const(const struct brw_stage_prog_data *prog_data) \
+{                                                                          \
+   return (const struct brw_##stage##_prog_data *) prog_data;              \
 }
 DEFINE_PROG_DATA_DOWNCAST(vue)
 DEFINE_PROG_DATA_DOWNCAST(vs)
@@ -1276,6 +1293,7 @@ DEFINE_PROG_DATA_DOWNCAST(sf)
 struct brw_compile_stats {
    uint32_t dispatch_width; /**< 0 for vec4 */
    uint32_t instructions;
+   uint32_t sends;
    uint32_t loops;
    uint32_t cycles;
    uint32_t spills;