nir: Add a label to nir_shader_info

Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
This commit is contained in:
Jason Ekstrand 2015-10-05 16:54:36 -07:00
parent e00314bc57
commit 5d4bc5ec13
3 changed files with 7 additions and 0 deletions

View file

@ -151,6 +151,8 @@ glsl_to_nir(const struct gl_shader_program *shader_prog,
num_textures = i;
shader->info.name = ralloc_asprintf(shader, "GLSL%d", shader_prog->Name);
if (shader_prog->Label)
shader->info.label = ralloc_strdup(shader, shader_prog->Label);
shader->info.num_textures = num_textures;
shader->info.num_ubos = sh->NumUniformBlocks;
shader->info.num_abos = shader_prog->NumAtomicBuffers;

View file

@ -1460,6 +1460,9 @@ typedef struct nir_shader_compiler_options {
typedef struct nir_shader_info {
const char *name;
/* Descriptive name provided by the client; may be NULL */
const char *label;
/* Number of textures used by this shader */
unsigned num_textures;
/* Number of uniform buffers used by this shader */

View file

@ -155,6 +155,8 @@ nir_sweep(nir_shader *nir)
ralloc_adopt(rubbish, nir);
ralloc_steal(nir, (char *)nir->info.name);
if (nir->info.label)
ralloc_steal(nir, (char *)nir->info.label);
/* Variables and registers are not dead. Steal them back. */
steal_list(nir, nir_variable, &nir->uniforms);