ir3: Rewrite UBO push analysis to support bindless
[mesa.git] / src / freedreno / ir3 / ir3_shader.h
index f9fdaa89c4e2876de547c3291c473720843c3829..63bec0d25dc9d554f23880ae023684aa93804c95 100644 (file)
@@ -70,7 +70,7 @@ enum ir3_driver_param {
 #define IR3_MAX_SO_BUFFERS        4
 #define IR3_MAX_SO_STREAMS        4
 #define IR3_MAX_SO_OUTPUTS       64
-#define IR3_MAX_CONSTANT_BUFFERS 32
+#define IR3_MAX_UBO_PUSH_RANGES  32
 
 
 /**
@@ -619,13 +619,16 @@ ir3_shader_stage(struct ir3_shader_variant *v)
 }
 
 struct ir3_ubo_range {
-       uint32_t offset; /* start offset of this block in const register file */
+       uint32_t offset; /* start offset to push in the const register file */
+       uint32_t block; /* Which constant block */
        uint32_t start, end; /* range of block that's actually used */
+       uint16_t bindless_base; /* For bindless, which base register is used */
+       bool bindless;
 };
 
 struct ir3_ubo_analysis_state {
-       struct ir3_ubo_range range[IR3_MAX_CONSTANT_BUFFERS];
-       uint32_t enabled;
+       struct ir3_ubo_range range[IR3_MAX_UBO_PUSH_RANGES];
+       uint32_t num_enabled;
        uint32_t size;
        uint32_t lower_count;
        uint32_t cmdstream_size; /* for per-gen backend to stash required cmdstream size */