diff options
author | Eric Anholt <[email protected]> | 2011-05-26 10:01:10 -0700 |
---|---|---|
committer | Eric Anholt <[email protected]> | 2011-05-27 08:51:30 -0700 |
commit | b7b700aeb0eab2cae26a01d9db42feea969333c7 (patch) | |
tree | 94447525fe501e0be5415e83b2788e1e1da1b961 /src/mesa/drivers/dri/i965/brw_fs.cpp | |
parent | 14b86f3c9131c1b26b01e07679cc899df0885b23 (diff) |
i965: Move a couple of GLSL IR -> BRW helper functions to brw_shader.cpp.
These will be used by the VS backend as well.
Reviewed-by: Kenneth Graunke <[email protected]>
Diffstat (limited to 'src/mesa/drivers/dri/i965/brw_fs.cpp')
-rw-r--r-- | src/mesa/drivers/dri/i965/brw_fs.cpp | 50 |
1 files changed, 1 insertions, 49 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_fs.cpp b/src/mesa/drivers/dri/i965/brw_fs.cpp index 89803cd9f24..cac5f48cc0c 100644 --- a/src/mesa/drivers/dri/i965/brw_fs.cpp +++ b/src/mesa/drivers/dri/i965/brw_fs.cpp @@ -41,6 +41,7 @@ extern "C" { #include "brw_eu.h" #include "brw_wm.h" } +#include "brw_shader.h" #include "brw_fs.h" #include "../glsl/glsl_types.h" #include "../glsl/ir_print_visitor.h" @@ -198,31 +199,6 @@ fs_reg::fs_reg(enum register_file file, int hw_reg, uint32_t type) this->type = type; } -int -brw_type_for_base_type(const struct glsl_type *type) -{ - switch (type->base_type) { - case GLSL_TYPE_FLOAT: - return BRW_REGISTER_TYPE_F; - case GLSL_TYPE_INT: - case GLSL_TYPE_BOOL: - return BRW_REGISTER_TYPE_D; - case GLSL_TYPE_UINT: - return BRW_REGISTER_TYPE_UD; - case GLSL_TYPE_ARRAY: - case GLSL_TYPE_STRUCT: - case GLSL_TYPE_SAMPLER: - /* These should be overridden with the type of the member when - * dereferenced into. BRW_REGISTER_TYPE_UD seems like a likely - * way to trip up if we don't. - */ - return BRW_REGISTER_TYPE_UD; - default: - assert(!"not reached"); - return BRW_REGISTER_TYPE_F; - } -} - /** Automatic reg constructor. */ fs_reg::fs_reg(class fs_visitor *v, const struct glsl_type *type) { @@ -730,30 +706,6 @@ fs_visitor::try_emit_saturate(ir_expression *ir) return true; } -static uint32_t -brw_conditional_for_comparison(unsigned int op) -{ - switch (op) { - case ir_binop_less: - return BRW_CONDITIONAL_L; - case ir_binop_greater: - return BRW_CONDITIONAL_G; - case ir_binop_lequal: - return BRW_CONDITIONAL_LE; - case ir_binop_gequal: - return BRW_CONDITIONAL_GE; - case ir_binop_equal: - case ir_binop_all_equal: /* same as equal for scalars */ - return BRW_CONDITIONAL_Z; - case ir_binop_nequal: - case ir_binop_any_nequal: /* same as nequal for scalars */ - return BRW_CONDITIONAL_NZ; - default: - assert(!"not reached: bad operation for comparison"); - return BRW_CONDITIONAL_NZ; - } -} - void fs_visitor::visit(ir_expression *ir) { |