fs_reg(uint32_t u);
fs_reg(struct brw_reg fixed_hw_reg);
fs_reg(enum register_file file, int reg);
- fs_reg(enum register_file file, int reg, enum brw_reg_type type);
+ fs_reg(enum register_file file, int reg, uint32_t type);
fs_reg(class fs_visitor *v, const struct glsl_type *type);
bool equals(const fs_reg &r) const;
/** Register file: GRF, MRF, IMM. */
enum register_file file;
/** Register type. BRW_REGISTER_TYPE_* */
- enum brw_reg_type type;
+ uint8_t type;
/**
* Register number. For MRF, it's the hardware register. For
* GRF, it's a virtual register number until register allocation
fs_reg dst;
fs_reg src[3];
- bool saturate;
- int conditional_mod; /**< BRW_CONDITIONAL_* */
-
- /* Chooses which flag subregister (f0.0 or f0.1) is used for conditional
- * mod and predication.
- */
- uint8_t flag_subreg;
-
- int mlen; /**< SEND message length */
- int regs_written; /**< Number of vgrfs written by a SEND message, or 1 */
- int base_mrf; /**< First MRF in the SEND message, if mlen is nonzero. */
- uint32_t texture_offset; /**< Texture offset bitfield */
- int sampler;
- int target; /**< MRT target. */
- bool eot;
- bool header_present;
- bool shadow_compare;
- bool force_uncompressed;
- bool force_sechalf;
- bool force_writemask_all;
- uint32_t offset; /* spill/unspill offset */
/** @{
* Annotation for the generated IR. One of the two can be set.
const void *ir;
const char *annotation;
/** @} */
+
+ uint32_t texture_offset; /**< Texture offset bitfield */
+ uint32_t offset; /* spill/unspill offset */
+
+ uint8_t conditional_mod; /**< BRW_CONDITIONAL_* */
+
+ /* Chooses which flag subregister (f0.0 or f0.1) is used for conditional
+ * mod and predication.
+ */
+ uint8_t flag_subreg;
+
+ uint8_t mlen; /**< SEND message length */
+ uint8_t regs_written; /**< Number of vgrfs written by a SEND message, or 1 */
+ int8_t base_mrf; /**< First MRF in the SEND message, if mlen is nonzero. */
+ uint8_t sampler;
+ uint8_t target; /**< MRT target. */
+ bool saturate:1;
+ bool eot:1;
+ bool header_present:1;
+ bool shadow_compare:1;
+ bool force_uncompressed:1;
+ bool force_sechalf:1;
+ bool force_writemask_all:1;
};
/**
bool can_do_source_mods(fs_inst *inst);
- fs_inst *emit(fs_inst inst);
fs_inst *emit(fs_inst *inst);
void emit(exec_list list);
int type_size(const struct glsl_type *type);
fs_inst *get_instruction_generating_reg(fs_inst *start,
fs_inst *end,
- fs_reg reg);
+ const fs_reg ®);
- exec_list VARYING_PULL_CONSTANT_LOAD(fs_reg dst, fs_reg surf_index,
- fs_reg varying_offset,
+ exec_list VARYING_PULL_CONSTANT_LOAD(const fs_reg &dst,
+ const fs_reg &surf_index,
+ const fs_reg &varying_offset,
uint32_t const_offset);
bool run();
void split_virtual_grfs();
void compact_virtual_grfs();
void move_uniform_array_access_to_pull_constants();
- void setup_pull_constants();
+ void assign_constant_locations();
+ void demote_pull_constants();
void invalidate_live_intervals();
void calculate_live_intervals();
void calculate_register_pressure();
bool compute_to_mrf();
bool dead_code_eliminate();
bool dead_code_eliminate_local();
- bool remove_dead_constants();
bool remove_duplicate_mrf_writes();
bool virtual_grf_interferes(int a, int b);
void schedule_instructions(instruction_scheduler_mode mode);
fs_reg fix_math_operand(fs_reg src);
fs_inst *emit_math(enum opcode op, fs_reg dst, fs_reg src0);
fs_inst *emit_math(enum opcode op, fs_reg dst, fs_reg src0, fs_reg src1);
- void emit_lrp(fs_reg dst, fs_reg x, fs_reg y, fs_reg a);
- void emit_minmax(uint32_t conditionalmod, fs_reg dst,
- fs_reg src0, fs_reg src1);
+ void emit_lrp(const fs_reg &dst, const fs_reg &x, const fs_reg &y,
+ const fs_reg &a);
+ void emit_minmax(uint32_t conditionalmod, const fs_reg &dst,
+ const fs_reg &src0, const fs_reg &src1);
bool try_emit_saturate(ir_expression *ir);
bool try_emit_mad(ir_expression *ir, int mul_arg);
void try_replace_with_sel();
/** Number of uniform variable components visited. */
unsigned uniforms;
- /* This is the map from UNIFORM hw_reg + reg_offset as generated by
- * the visitor to the packed uniform number after
- * remove_dead_constants() that represents the actual uploaded
- * uniform index.
+ /**
+ * Array mapping UNIFORM register numbers to the pull parameter index,
+ * or -1 if this uniform register isn't being uploaded as a pull constant.
+ */
+ int *pull_constant_loc;
+
+ /**
+ * Array mapping UNIFORM register numbers to the push parameter index,
+ * or -1 if this uniform register isn't being uploaded as a push constant.
*/
- int *params_remap;
- int nr_params_remap;
+ int *push_constant_loc;
struct hash_table *variable_ht;
fs_reg frag_depth;