mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-04 05:28:05 +02:00
intel/compiler: move extern C functions out of namespace brw
brw_compile_gs and brw_compile_tcs are extern C functions, but are defined inside of brw namespace, which somehow works but confuses Eclipse CDT's code analysis. Move these functions out of brw namespace and fix references to objects from brw namespace. Signed-off-by: Marcin Ślusarz <marcin.slusarz@intel.com> Reviewed-by: Jason Ekstrand <jason@jlekstrand.net> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6602>
This commit is contained in:
parent
d4c6e3f196
commit
e5f735a986
2 changed files with 12 additions and 14 deletions
|
|
@ -610,6 +610,8 @@ static const GLuint gl_prim_to_hw_prim[GL_TRIANGLE_STRIP_ADJACENCY+1] = {
|
|||
[GL_TRIANGLE_STRIP_ADJACENCY] = _3DPRIM_TRISTRIP_ADJ,
|
||||
};
|
||||
|
||||
} /* namespace brw */
|
||||
|
||||
extern "C" const unsigned *
|
||||
brw_compile_gs(const struct brw_compiler *compiler, void *log_data,
|
||||
void *mem_ctx,
|
||||
|
|
@ -828,9 +830,9 @@ brw_compile_gs(const struct brw_compiler *compiler, void *log_data,
|
|||
prog_data->base.urb_entry_size = ALIGN(output_size_bytes, 128) / 128;
|
||||
}
|
||||
|
||||
assert(nir->info.gs.output_primitive < ARRAY_SIZE(gl_prim_to_hw_prim));
|
||||
assert(nir->info.gs.output_primitive < ARRAY_SIZE(brw::gl_prim_to_hw_prim));
|
||||
prog_data->output_topology =
|
||||
gl_prim_to_hw_prim[nir->info.gs.output_primitive];
|
||||
brw::gl_prim_to_hw_prim[nir->info.gs.output_primitive];
|
||||
|
||||
prog_data->vertices_in = nir->info.gs.vertices_in;
|
||||
|
||||
|
|
@ -881,7 +883,7 @@ brw_compile_gs(const struct brw_compiler *compiler, void *log_data,
|
|||
likely(!(INTEL_DEBUG & DEBUG_NO_DUAL_OBJECT_GS))) {
|
||||
prog_data->base.dispatch_mode = DISPATCH_MODE_4X2_DUAL_OBJECT;
|
||||
|
||||
vec4_gs_visitor v(compiler, log_data, &c, prog_data, nir,
|
||||
brw::vec4_gs_visitor v(compiler, log_data, &c, prog_data, nir,
|
||||
mem_ctx, true /* no_spills */, shader_time_index);
|
||||
|
||||
/* Backup 'nr_params' and 'param' as they can be modified by the
|
||||
|
|
@ -947,15 +949,15 @@ brw_compile_gs(const struct brw_compiler *compiler, void *log_data,
|
|||
else
|
||||
prog_data->base.dispatch_mode = DISPATCH_MODE_4X2_DUAL_INSTANCE;
|
||||
|
||||
vec4_gs_visitor *gs = NULL;
|
||||
brw::vec4_gs_visitor *gs = NULL;
|
||||
const unsigned *ret = NULL;
|
||||
|
||||
if (compiler->devinfo->gen >= 7)
|
||||
gs = new vec4_gs_visitor(compiler, log_data, &c, prog_data,
|
||||
gs = new brw::vec4_gs_visitor(compiler, log_data, &c, prog_data,
|
||||
nir, mem_ctx, false /* no_spills */,
|
||||
shader_time_index);
|
||||
else
|
||||
gs = new gen6_gs_visitor(compiler, log_data, &c, prog_data, prog,
|
||||
gs = new brw::gen6_gs_visitor(compiler, log_data, &c, prog_data, prog,
|
||||
nir, mem_ctx, false /* no_spills */,
|
||||
shader_time_index);
|
||||
|
||||
|
|
@ -972,6 +974,3 @@ brw_compile_gs(const struct brw_compiler *compiler, void *log_data,
|
|||
delete gs;
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
} /* namespace brw */
|
||||
|
|
|
|||
|
|
@ -352,6 +352,8 @@ get_patch_count_threshold(int input_control_points)
|
|||
return 1;
|
||||
}
|
||||
|
||||
} /* namespace brw */
|
||||
|
||||
extern "C" const unsigned *
|
||||
brw_compile_tcs(const struct brw_compiler *compiler,
|
||||
void *log_data,
|
||||
|
|
@ -390,7 +392,7 @@ brw_compile_tcs(const struct brw_compiler *compiler,
|
|||
bool has_primitive_id =
|
||||
nir->info.system_values_read & (1 << SYSTEM_VALUE_PRIMITIVE_ID);
|
||||
|
||||
prog_data->patch_count_threshold = get_patch_count_threshold(key->input_vertices);
|
||||
prog_data->patch_count_threshold = brw::get_patch_count_threshold(key->input_vertices);
|
||||
|
||||
if (compiler->use_tcs_8_patch &&
|
||||
nir->info.tess.tcs_vertices_out <= (devinfo->gen >= 12 ? 32 : 16) &&
|
||||
|
|
@ -487,7 +489,7 @@ brw_compile_tcs(const struct brw_compiler *compiler,
|
|||
|
||||
assembly = g.get_assembly();
|
||||
} else {
|
||||
vec4_tcs_visitor v(compiler, log_data, key, prog_data,
|
||||
brw::vec4_tcs_visitor v(compiler, log_data, key, prog_data,
|
||||
nir, mem_ctx, shader_time_index, &input_vue_map);
|
||||
if (!v.run()) {
|
||||
if (error_str)
|
||||
|
|
@ -507,6 +509,3 @@ brw_compile_tcs(const struct brw_compiler *compiler,
|
|||
|
||||
return assembly;
|
||||
}
|
||||
|
||||
|
||||
} /* namespace brw */
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue