~mmach/netext73/mesa_2004

« back to all changes in this revision

Viewing changes to src/compiler/nir/tests/builder_tests.cpp

  • Committer: mmach
  • Date: 2021-03-12 20:48:59 UTC
  • Revision ID: netbit73@gmail.com-20210312204859-i194ujlcu82pq61p
21

Show diffs side-by-side

added added

removed removed

Lines of Context:
67
67
 
68
68
   std::vector<nir_intrinsic_instr *> stores;
69
69
 
70
 
   void *mem_ctx;
71
 
   void *lin_ctx;
72
 
 
73
 
   nir_builder *b;
 
70
   nir_builder *b, _b;
74
71
};
75
72
 
76
73
nir_builder_test::nir_builder_test()
77
74
{
78
75
   glsl_type_singleton_init_or_ref();
79
76
 
80
 
   mem_ctx = ralloc_context(NULL);
81
 
   lin_ctx = linear_alloc_parent(mem_ctx, 0);
82
77
   static const nir_shader_compiler_options options = { };
83
 
   b = rzalloc(mem_ctx, nir_builder);
84
 
   nir_builder_init_simple_shader(b, mem_ctx, MESA_SHADER_COMPUTE, &options);
 
78
   _b = nir_builder_init_simple_shader(MESA_SHADER_COMPUTE, &options, "builder test");
 
79
   b = &_b;
85
80
}
86
81
 
87
82
nir_builder_test::~nir_builder_test()
91
86
      nir_print_shader(b->shader, stdout);
92
87
   }
93
88
 
94
 
   ralloc_free(mem_ctx);
 
89
   ralloc_free(b->shader);
95
90
 
96
91
   glsl_type_singleton_decref();
97
92
}