}
static bool
-analyze_boolean_resolves_block(nir_block *block, void *void_state)
+analyze_boolean_resolves_block(nir_block *block)
{
- nir_foreach_instr(block, instr) {
+ nir_foreach_instr(instr, block) {
switch (instr->type) {
case nir_instr_type_alu: {
/* For ALU instructions, the resolve status is handled in a
}
default:
- if (nir_op_infos[alu->op].output_type == nir_type_bool) {
+ if (nir_alu_type_get_base_type(nir_op_infos[alu->op].output_type) == nir_type_bool) {
/* This instructions will turn into a CMP when we actually emit
* them so the result will have to be resolved before it can be
* used.
* have to worry about resolving them.
*/
instr->pass_flags &= ~BRW_NIR_BOOLEAN_MASK;
- if (load->value.u[0] == NIR_TRUE || load->value.u[0] == NIR_FALSE) {
+ if (load->value.u32[0] == NIR_TRUE || load->value.u32[0] == NIR_FALSE) {
instr->pass_flags |= BRW_NIR_BOOLEAN_NO_RESOLVE;
} else {
instr->pass_flags |= BRW_NIR_NON_BOOLEAN;
static void
analyze_boolean_resolves_impl(nir_function_impl *impl)
{
- nir_foreach_block(impl, analyze_boolean_resolves_block, NULL);
+ nir_foreach_block(block, impl) {
+ analyze_boolean_resolves_block(block);
+ }
}
void
brw_nir_analyze_boolean_resolves(nir_shader *shader)
{
- nir_foreach_overload(shader, overload)
- if (overload->impl)
- analyze_boolean_resolves_impl(overload->impl);
+ nir_foreach_function(function, shader) {
+ if (function->impl)
+ analyze_boolean_resolves_impl(function->impl);
+ }
}