i965/gs: Add a case to brwNewProgram() for geometry shaders.
[mesa.git] / src / mesa / drivers / dri / i965 / brw_fs.h
index 115a878d99ac16dceda78cb8223cd80c0f112960..9d240b588ef14b146b0130a08e66c9c34dc35f77 100644 (file)
@@ -55,16 +55,6 @@ namespace {
    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
@@ -93,6 +83,7 @@ public:
    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;
@@ -175,10 +166,8 @@ public:
 
    bool equals(fs_inst *inst);
    bool overwrites_reg(const fs_reg &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];
@@ -249,6 +238,8 @@ public:
    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);
 
@@ -287,6 +278,13 @@ public:
                 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,
@@ -328,6 +326,7 @@ public:
    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);
@@ -370,6 +369,7 @@ public:
                     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);
@@ -422,8 +422,7 @@ public:
    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);
 
    struct gl_fragment_program *fp;
    struct brw_wm_compile *c;
@@ -434,8 +433,8 @@ public:
    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
@@ -444,6 +443,7 @@ public:
     * uniform index.
     */
    int *params_remap;
+   int nr_params_remap;
 
    struct hash_table *variable_ht;
    fs_reg frag_depth;
@@ -528,6 +528,9 @@ private:
    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);
@@ -566,10 +569,11 @@ private:
                                  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;