[Mesa-dev] [PATCH 14/16] i965/vec4: Turn some _mesa_problem calls into asserts

Chris Forbes chrisf at ijw.co.nz
Mon Jun 22 20:21:58 PDT 2015


Recent convention has been to use unreachable("str") rather than assert(!"str")

On Tue, Jun 23, 2015 at 1:07 PM, Jason Ekstrand <jason at jlekstrand.net> wrote:
> ---
>  src/mesa/drivers/dri/i965/brw_vec4_vp.cpp | 9 +++------
>  1 file changed, 3 insertions(+), 6 deletions(-)
>
> diff --git a/src/mesa/drivers/dri/i965/brw_vec4_vp.cpp b/src/mesa/drivers/dri/i965/brw_vec4_vp.cpp
> index 92d1085..dcbd240 100644
> --- a/src/mesa/drivers/dri/i965/brw_vec4_vp.cpp
> +++ b/src/mesa/drivers/dri/i965/brw_vec4_vp.cpp
> @@ -381,8 +381,7 @@ vec4_vs_visitor::emit_program_code()
>           break;
>
>        default:
> -         _mesa_problem(ctx, "Unsupported opcode %s in vertex program\n",
> -                       _mesa_opcode_string(vpi->Opcode));
> +         assert(!"Unsupported opcode in vertex program");
>        }
>
>        /* Copy the temporary back into the actual destination register. */
> @@ -574,15 +573,13 @@ vec4_vs_visitor::get_vp_src_reg(const prog_src_register &src)
>           break;
>
>        default:
> -         _mesa_problem(ctx, "bad uniform src register file: %s\n",
> -                       _mesa_register_file_name((gl_register_file)src.File));
> +         assert(!"Bad uniform in src register file");
>           return src_reg(this, glsl_type::vec4_type);
>        }
>        break;
>
>     default:
> -      _mesa_problem(ctx, "bad src register file: %s\n",
> -                    _mesa_register_file_name((gl_register_file)src.File));
> +      assert(!"Bad src register file");
>        return src_reg(this, glsl_type::vec4_type);
>     }
>
> --
> 2.4.3
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/mesa-dev


More information about the mesa-dev mailing list