Ejemplo n.º 1
0
/* clone list of nir_variable: */
static void
clone_var_list(clone_state *state, struct exec_list *dst,
               const struct exec_list *list)
{
    exec_list_make_empty(dst);
    foreach_list_typed(nir_variable, var, node, list) {
        nir_variable *nvar = clone_variable(state, var);
        exec_list_push_tail(dst, &nvar->node);
    }
Ejemplo n.º 2
0
static bool
nir_opt_dce_impl(nir_function_impl *impl)
{
   struct exec_list *worklist = ralloc(NULL, struct exec_list);
   exec_list_make_empty(worklist);

   nir_foreach_block(block, impl) {
      init_block(block, worklist);
   }
Ejemplo n.º 3
0
static void
init_shader_program(struct gl_shader_program *prog)
{
   prog->Type = GL_SHADER_PROGRAM_MESA;
   prog->RefCount = 1;

   prog->AttributeBindings = string_to_uint_map_ctor();
   prog->FragDataBindings = string_to_uint_map_ctor();
   prog->FragDataIndexBindings = string_to_uint_map_ctor();

   prog->Geom.UsesEndPrimitive = false;
   prog->Geom.UsesStreams = false;

   prog->TransformFeedback.BufferMode = GL_INTERLEAVED_ATTRIBS;

   exec_list_make_empty(&prog->EmptyUniformLocations);

   prog->InfoLog = ralloc_strdup(prog, "");
}
Ejemplo n.º 4
0
bool
nir_opt_dce_impl(nir_function_impl *impl)
{
   struct exec_list *worklist = ralloc(NULL, struct exec_list);
   exec_list_make_empty(worklist);

   nir_foreach_block(impl, init_block_cb, worklist);

   while (!exec_list_is_empty(worklist)) {
      nir_instr *instr = worklist_pop(worklist);
      nir_foreach_src(instr, mark_live_cb, worklist);
   }

   ralloc_free(worklist);

   bool progress = false;
   nir_foreach_block(impl, delete_block_cb, &progress);

   if (progress)
      nir_metadata_preserve(impl, nir_metadata_block_index |
                                  nir_metadata_dominance);

   return progress;
}