Upcoming NIR->vec4 pass can benefit from this method, so lets move it up.
Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com>
}
}
-static brw_reg_type
-brw_type_for_nir_type(nir_alu_type type)
-{
- switch (type) {
- case nir_type_unsigned:
- return BRW_REGISTER_TYPE_UD;
- case nir_type_bool:
- case nir_type_int:
- return BRW_REGISTER_TYPE_D;
- case nir_type_float:
- return BRW_REGISTER_TYPE_F;
- default:
- unreachable("unknown type");
- }
-
- return BRW_REGISTER_TYPE_F;
-}
-
bool
fs_visitor::optimize_frontfacing_ternary(nir_alu_instr *instr,
const fs_reg &result)
return nir;
}
+
+enum brw_reg_type
+brw_type_for_nir_type(nir_alu_type type)
+{
+ switch (type) {
+ case nir_type_unsigned:
+ return BRW_REGISTER_TYPE_UD;
+ case nir_type_bool:
+ case nir_type_int:
+ return BRW_REGISTER_TYPE_D;
+ case nir_type_float:
+ return BRW_REGISTER_TYPE_F;
+ default:
+ unreachable("unknown type");
+ }
+
+ return BRW_REGISTER_TYPE_F;
+}
#pragma once
#include "brw_context.h"
+#include "brw_reg.h"
#include "glsl/nir/nir.h"
#ifdef __cplusplus
gl_shader_stage stage,
bool is_scalar);
+enum brw_reg_type brw_type_for_nir_type(nir_alu_type type);
+
#ifdef __cplusplus
}
#endif