panfrost: Avoid minimum stack allocations
[mesa.git] / src / panfrost / util / pan_ir.h
index 5b00edae5f2900a5612302c1f0e7ce5cc8eee754..57d8129e7700cb05ff6f8fafb5e10138e8611239 100644 (file)
@@ -25,7 +25,6 @@
 #define __PAN_IR_H
 
 #include <stdint.h>
-#include "panfrost-job.h"
 #include "compiler/nir/nir.h"
 #include "util/u_dynarray.h"
 #include "util/hash_table.h"
@@ -95,9 +94,6 @@ typedef struct {
         unsigned sysval_count;
         unsigned sysvals[MAX_SYSVAL_COUNT];
 
-        /* Boolean properties of the program */
-        bool writes_point_size;
-
         int first_tag;
 
         struct util_dynarray compiled;
@@ -111,8 +107,8 @@ typedef struct {
          * (register spilling), or zero if no spilling is used */
         unsigned tls_size;
 
-        /* IN: For a fragment shader with a lowered alpha test, the ref value */
-        float alpha_ref;
+        /* IN: Render target formats for output load/store lowering */
+        enum pipe_format rt_formats[8];
 } panfrost_program;
 
 typedef struct pan_block {
@@ -160,6 +156,13 @@ struct pan_instruction {
                 _entry_##v = _mesa_set_next_entry(blk->predecessors, _entry_##v), \
                 v = (struct pan_block *) (_entry_##v ? _entry_##v->key : NULL))
 
+static inline pan_block *
+pan_exit_block(struct list_head *blocks)
+{
+        pan_block *last = list_last_entry(blocks, pan_block, link);
+        assert(!last->successors[0] && !last->successors[1]);
+        return last;
+}
 
 typedef void (*pan_liveness_update)(uint16_t *, void *, unsigned max);
 
@@ -210,4 +213,11 @@ pan_dest_index(nir_dest *dst)
         }
 }
 
+/* IR printing helpers */
+void pan_print_alu_type(nir_alu_type t, FILE *fp);
+
+/* Until it can be upstreamed.. */
+bool pan_has_source_mod(nir_alu_src *src, nir_op op);
+bool pan_has_dest_mod(nir_dest **dest, nir_op op);
+
 #endif