nir: Embed the shader_info in the nir_shader again
Commite1af20f18a
changed the shader_info from being embedded into being just a pointer. The idea was that sharing the shader_info between NIR and GLSL would be easier if it were a pointer pointing to the same shader_info struct. This, however, has caused a few problems: 1) There are many things which generate NIR without GLSL. This means we have to support both NIR shaders which come from GLSL and ones that don't and need to have an info elsewhere. 2) The solution to (1) raises all sorts of ownership issues which have to be resolved with ralloc_parent checks. 3) Ever since00620782c9
, we've been using nir_gather_info to fill out the final shader_info. Thanks to cloning and the above ownership issues, the nir_shader::info may not point back to the gl_shader anymore and so we have to do a copy of the shader_info from NIR back to GLSL anyway. All of these issues go away if we just embed the shader_info in the nir_shader. There's a little downside of having to copy it back after calling nir_gather_info but, as explained above, we have to do that anyway. Acked-by: Timothy Arceri <tarceri@itsqueeze.com> Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
This commit is contained in:
@@ -199,8 +199,8 @@ remap_patch_urb_offsets(nir_block *block, nir_builder *b,
|
||||
const struct brw_vue_map *vue_map,
|
||||
GLenum tes_primitive_mode)
|
||||
{
|
||||
const bool is_passthrough_tcs = b->shader->info->name &&
|
||||
strcmp(b->shader->info->name, "passthrough") == 0;
|
||||
const bool is_passthrough_tcs = b->shader->info.name &&
|
||||
strcmp(b->shader->info.name, "passthrough") == 0;
|
||||
|
||||
nir_foreach_instr_safe(instr, block) {
|
||||
if (instr->type != nir_instr_type_intrinsic)
|
||||
@@ -283,7 +283,7 @@ brw_nir_lower_vs_inputs(nir_shader *nir,
|
||||
nir_foreach_function(function, nir) {
|
||||
if (function->impl) {
|
||||
nir_foreach_block(block, function->impl) {
|
||||
remap_vs_attrs(block, nir->info);
|
||||
remap_vs_attrs(block, &nir->info);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -337,7 +337,7 @@ brw_nir_lower_tes_inputs(nir_shader *nir, const struct brw_vue_map *vue_map)
|
||||
nir_builder_init(&b, function->impl);
|
||||
nir_foreach_block(block, function->impl) {
|
||||
remap_patch_urb_offsets(block, &b, vue_map,
|
||||
nir->info->tess.primitive_mode);
|
||||
nir->info.tess.primitive_mode);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user