[Mesa-dev] [PATCH 36/38] i965/fs: Migrate test_fs_cmod_propagation to the IR builder.

Matt Turner mattst88 at gmail.com
Thu Jun 4 16:52:58 PDT 2015


On Thu, Jun 4, 2015 at 9:05 AM, Francisco Jerez <currojerez at riseup.net> wrote:
> ---
>  .../drivers/dri/i965/test_fs_cmod_propagation.cpp  | 75 +++++++++++++---------
>  1 file changed, 45 insertions(+), 30 deletions(-)
>
> diff --git a/src/mesa/drivers/dri/i965/test_fs_cmod_propagation.cpp b/src/mesa/drivers/dri/i965/test_fs_cmod_propagation.cpp
> index 0e48e82..17c519c 100644
> --- a/src/mesa/drivers/dri/i965/test_fs_cmod_propagation.cpp
> +++ b/src/mesa/drivers/dri/i965/test_fs_cmod_propagation.cpp
> @@ -26,6 +26,8 @@
>  #include "brw_cfg.h"
>  #include "program/program.h"
>
> +using namespace brw;
> +
>  class cmod_propagation_test : public ::testing::Test {
>     virtual void SetUp();
>
> @@ -101,12 +103,13 @@ cmod_propagation(fs_visitor *v)
>
>  TEST_F(cmod_propagation_test, basic)
>  {
> +   const fs_builder &bld = v->bld;
>     fs_reg dest = v->vgrf(glsl_type::float_type);
>     fs_reg src0 = v->vgrf(glsl_type::float_type);
>     fs_reg src1 = v->vgrf(glsl_type::float_type);
>     fs_reg zero(0.0f);
> -   v->emit(BRW_OPCODE_ADD, dest, src0, src1);
> -   v->emit(BRW_OPCODE_CMP, v->reg_null_f, dest, zero)
> +   bld.emit(BRW_OPCODE_ADD, dest, src0, src1);
> +   bld.emit(BRW_OPCODE_CMP, bld.null_reg_f(), dest, zero)
>        ->conditional_mod = BRW_CONDITIONAL_GE;

Same thing as before -- use bld.ADD/set_condmod(GE, bld.CMP), etc.


More information about the mesa-dev mailing list