struct acp_entry;
}
-enum register_file {
- BAD_FILE,
- ARF,
- GRF,
- MRF,
- IMM,
- FIXED_HW_REG, /* a struct brw_reg */
- UNIFORM, /* prog_data->params[reg] */
-};
-
class fs_reg {
public:
/* Callers of this ralloc-based new need not call delete. It's
bool equals(const fs_reg &r) const;
bool is_zero() const;
bool is_one() const;
+ bool is_valid_3src() const;
/** Register file: ARF, GRF, MRF, IMM. */
enum register_file file;
fs_reg src0, fs_reg src1,fs_reg src2);
bool equals(fs_inst *inst);
- int regs_written();
bool overwrites_reg(const fs_reg ®);
- bool is_tex();
- bool is_math();
- bool is_control_flow();
bool is_send_from_grf();
+ bool is_partial_write();
fs_reg dst;
fs_reg src[3];
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;
fs_visitor(struct brw_context *brw,
struct brw_wm_compile *c,
- struct gl_shader_program *prog,
+ struct gl_shader_program *shader_prog,
struct gl_fragment_program *fp,
unsigned dispatch_width);
~fs_visitor();
void visit(ir_call *ir);
void visit(ir_function *ir);
void visit(ir_function_signature *ir);
+ void visit(ir_emit_vertex *);
+ void visit(ir_end_primitive *);
void swizzle_result(ir_texture *ir, fs_reg orig_val, int sampler);
uint32_t condition);
fs_inst *LRP(fs_reg dst, fs_reg a, fs_reg y, fs_reg x);
fs_inst *DEP_RESOLVE_MOV(int grf);
+ fs_inst *BFREV(fs_reg dst, fs_reg value);
+ fs_inst *BFE(fs_reg dst, fs_reg bits, fs_reg offset, fs_reg value);
+ fs_inst *BFI1(fs_reg dst, fs_reg bits, fs_reg offset);
+ fs_inst *BFI2(fs_reg dst, fs_reg bfi1_dst, fs_reg insert, fs_reg base);
+ fs_inst *FBH(fs_reg dst, fs_reg value);
+ fs_inst *FBL(fs_reg dst, fs_reg value);
+ fs_inst *CBIT(fs_reg dst, fs_reg value);
int type_size(const struct glsl_type *type);
fs_inst *get_instruction_generating_reg(fs_inst *start,
fs_reg reg);
exec_list VARYING_PULL_CONSTANT_LOAD(fs_reg dst, fs_reg surf_index,
- fs_reg offset);
+ fs_reg varying_offset,
+ uint32_t const_offset);
bool run();
void setup_payload_gen4();
bool register_coalesce_2();
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);
fs_reg src0, 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();
void emit_bool_to_cond_code(ir_rvalue *condition);
void emit_if_gen6(ir_if *ir);
void emit_unspill(fs_inst *inst, fs_reg reg, uint32_t spill_offset);
void setup_builtin_uniform_values(ir_variable *ir);
int implied_mrf_writes(fs_inst *inst);
- void dump_instructions();
- void dump_instruction(fs_inst *inst);
+ void dump_instruction(backend_instruction *inst);
- const struct gl_fragment_program *fp;
+ struct gl_fragment_program *fp;
struct brw_wm_compile *c;
unsigned int sanity_param_count;
int *virtual_grf_sizes;
int virtual_grf_count;
int virtual_grf_array_size;
- int *virtual_grf_def;
- int *virtual_grf_use;
+ int *virtual_grf_start;
+ int *virtual_grf_end;
bool live_intervals_valid;
/* This is the map from UNIFORM hw_reg + reg_offset as generated by
* uniform index.
*/
int *params_remap;
+ int nr_params_remap;
struct hash_table *variable_ht;
fs_reg frag_depth;
int first_non_payload_grf;
/** Either BRW_MAX_GRF or GEN7_MRF_HACK_START */
int max_grf;
- int urb_setup[FRAG_ATTRIB_MAX];
+ int urb_setup[VARYING_SLOT_MAX];
fs_reg *fp_temp_regs;
fs_reg *fp_input_regs;
void generate_math_gen4(fs_inst *inst,
struct brw_reg dst,
struct brw_reg src);
+ void generate_math_g45(fs_inst *inst,
+ struct brw_reg dst,
+ struct brw_reg src);
void generate_ddx(fs_inst *inst, struct brw_reg dst, struct brw_reg src);
void generate_ddy(fs_inst *inst, struct brw_reg dst, struct brw_reg src,
bool negate_value);
struct brw_reg surf_index,
struct brw_reg offset);
void generate_varying_pull_constant_load(fs_inst *inst, struct brw_reg dst,
- struct brw_reg index);
+ struct brw_reg index,
+ struct brw_reg offset);
void generate_varying_pull_constant_load_gen7(fs_inst *inst,
struct brw_reg dst,
struct brw_reg index,
struct brw_reg dst,
struct brw_reg src);
+ void generate_shader_time_add(fs_inst *inst,
+ struct brw_reg payload,
+ struct brw_reg offset,
+ struct brw_reg value);
+
+ void mark_surface_used(unsigned surf_index);
+
void patch_discard_jumps_to_fb_writes();
struct brw_context *brw;
- struct intel_context *intel;
struct gl_context *ctx;
struct brw_compile *p;