<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Oct 18, 2016 at 2:18 PM, Jason Ekstrand <span dir="ltr"><<a href="mailto:jason@jlekstrand.net" target="_blank">jason@jlekstrand.net</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote"><div><div class="h5">On Tue, Oct 18, 2016 at 2:06 PM, Timothy Arceri <span dir="ltr"><<a href="mailto:timothy.arceri@collabora.com" target="_blank">timothy.arceri@collabora.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="m_-6989745745178297322HOEnZb"><div class="m_-6989745745178297322h5">On Tue, 2016-10-18 at 08:47 -0700, Jason Ekstrand wrote:<br>
> On Mon, Oct 17, 2016 at 11:12 PM, Timothy Arceri <timothy.arceri@coll<br>
> <a href="http://abora.com" rel="noreferrer" target="_blank">abora.com</a>> wrote:<br>
> > And pass in a pointer to the shader info in gl_program for ARB<br>
> > programs.<br>
> > ---<br>
> > src/amd/vulkan/radv_meta_blit<wbr>.c | 12 ++++++++----<br>
> > src/amd/vulkan/radv_meta_blit<wbr>2d.c | 12 ++++++++----<br>
> > src/amd/vulkan/radv_meta_buff<wbr>er.c | 6 ++++--<br>
> > src/amd/vulkan/radv_meta_bufi<wbr>mage.c | 3 ++-<br>
> > src/amd/vulkan/radv_meta_clea<wbr>r.c | 12 ++++++++----<br>
> > src/amd/vulkan/radv_meta_deco<wbr>mpress.c | 6 ++++--<br>
> > src/amd/vulkan/radv_meta_fast<wbr>_clear.c | 6 ++++--<br>
> > src/amd/vulkan/radv_meta_reso<wbr>lve.c | 6 ++++--<br>
> > src/amd/vulkan/radv_meta_reso<wbr>lve_cs.c | 2 +-<br>
> > src/amd/vulkan/radv_pipeline.<wbr>c | 2 +-<br>
> > src/compiler/nir/nir_builder.<wbr>h | 5 +++--<br>
> > src/compiler/nir/tests/contro<wbr>l_flow_tests.cpp | 3 ++-<br>
> > src/gallium/auxiliary/nir/tgs<wbr>i_to_nir.c | 2 +-<br>
> > src/intel/blorp/blorp_blit.c | 2 +-<br>
> > src/intel/blorp/blorp_clear.c<wbr> | 2 +-<br>
> > src/mesa/drivers/dri/i965/brw<wbr>_program.c | 2 +-<br>
> > src/mesa/drivers/dri/i965/brw<wbr>_program.h | 2 +-<br>
> > src/mesa/drivers/dri/i965/brw<wbr>_tcs.c | 3 ++-<br>
> > src/mesa/program/prog_to_nir.<wbr>c | 5 +++--<br>
> > src/mesa/program/prog_to_nir.<wbr>h | 2 +-<br>
> > 20 files changed, 60 insertions(+), 35 deletions(-)<br>
> ><br>
> > diff --git a/src/amd/vulkan/radv_meta_bli<wbr>t.c<br>
> > b/src/amd/vulkan/radv_meta_bli<wbr>t.c<br>
> > index bfbf880..3eda43e 100644<br>
> > --- a/src/amd/vulkan/radv_meta_bli<wbr>t.c<br>
> > +++ b/src/amd/vulkan/radv_meta_bli<wbr>t.c<br>
> > @@ -37,7 +37,8 @@ build_nir_vertex_shader(void)<br>
> > const struct glsl_type *vec4 = glsl_vec4_type();<br>
> > nir_builder b;<br>
> ><br>
> > - nir_builder_init_simple_shade<wbr>r(&b, NULL,<br>
> > MESA_SHADER_VERTEX, NULL);<br>
> > + nir_builder_init_simple_shade<wbr>r(&b, NULL,<br>
> > MESA_SHADER_VERTEX, NULL,<br>
> > + NULL);<br>
> > b.shader->info->name = ralloc_strdup(b.shader,<br>
> > "meta_blit_vs");<br>
> ><br>
> > nir_variable *pos_in = nir_variable_create(b.shader,<br>
> > nir_var_shader_in,<br>
> > @@ -67,7 +68,8 @@ build_nir_copy_fragment_shader<wbr>(enum<br>
> > glsl_sampler_dim tex_dim)<br>
> > const struct glsl_type *vec4 = glsl_vec4_type();<br>
> > nir_builder b;<br>
> ><br>
> > - nir_builder_init_simple_shade<wbr>r(&b, NULL,<br>
> > MESA_SHADER_FRAGMENT, NULL);<br>
> > + nir_builder_init_simple_shade<wbr>r(&b, NULL,<br>
> > MESA_SHADER_FRAGMENT, NULL,<br>
> > + NULL);<br>
> ><br>
> > sprintf(shader_name, "meta_blit_fs.%d", tex_dim);<br>
> > b.shader->info->name = ralloc_strdup(b.shader,<br>
> > shader_name);<br>
> > @@ -121,7 +123,8 @@ build_nir_copy_fragment_shader<wbr>_depth(enum<br>
> > glsl_sampler_dim tex_dim)<br>
> > const struct glsl_type *vec4 = glsl_vec4_type();<br>
> > nir_builder b;<br>
> ><br>
> > - nir_builder_init_simple_shade<wbr>r(&b, NULL,<br>
> > MESA_SHADER_FRAGMENT, NULL);<br>
> > + nir_builder_init_simple_shade<wbr>r(&b, NULL,<br>
> > MESA_SHADER_FRAGMENT, NULL,<br>
> > + NULL);<br>
> ><br>
> > sprintf(shader_name, "meta_blit_depth_fs.%d", tex_dim);<br>
> > b.shader->info->name = ralloc_strdup(b.shader,<br>
> > shader_name);<br>
> > @@ -175,7 +178,8 @@ build_nir_copy_fragment_shader<wbr>_stencil(enum<br>
> > glsl_sampler_dim tex_dim)<br>
> > const struct glsl_type *vec4 = glsl_vec4_type();<br>
> > nir_builder b;<br>
> ><br>
> > - nir_builder_init_simple_shade<wbr>r(&b, NULL,<br>
> > MESA_SHADER_FRAGMENT, NULL);<br>
> > + nir_builder_init_simple_shade<wbr>r(&b, NULL,<br>
> > MESA_SHADER_FRAGMENT, NULL,<br>
> > + NULL);<br>
> ><br>
> > sprintf(shader_name, "meta_blit_stencil_fs.%d", tex_dim);<br>
> > b.shader->info->name = ralloc_strdup(b.shader,<br>
> > shader_name);<br>
> > diff --git a/src/amd/vulkan/radv_meta_bli<wbr>t2d.c<br>
> > b/src/amd/vulkan/radv_meta_bli<wbr>t2d.c<br>
> > index 6e92f80..bed03a3 100644<br>
> > --- a/src/amd/vulkan/radv_meta_bli<wbr>t2d.c<br>
> > +++ b/src/amd/vulkan/radv_meta_bli<wbr>t2d.c<br>
> > @@ -438,7 +438,8 @@ build_nir_vertex_shader(void)<br>
> > const struct glsl_type *vec2 =<br>
> > glsl_vector_type(GLSL_TYPE_FLO<wbr>AT, 2);<br>
> > nir_builder b;<br>
> ><br>
> > - nir_builder_init_simple_shade<wbr>r(&b, NULL,<br>
> > MESA_SHADER_VERTEX, NULL);<br>
> > + nir_builder_init_simple_shade<wbr>r(&b, NULL,<br>
> > MESA_SHADER_VERTEX, NULL,<br>
> > + NULL);<br>
> > b.shader->info->name = ralloc_strdup(b.shader,<br>
> > "meta_blit_vs");<br>
> ><br>
> > nir_variable *pos_in = nir_variable_create(b.shader,<br>
> > nir_var_shader_in,<br>
> > @@ -573,7 +574,8 @@ build_nir_copy_fragment_shader<wbr>(struct<br>
> > radv_device *device,<br>
> > const struct glsl_type *vec2 =<br>
> > glsl_vector_type(GLSL_TYPE_FLO<wbr>AT, 2);<br>
> > nir_builder b;<br>
> ><br>
> > - nir_builder_init_simple_shade<wbr>r(&b, NULL,<br>
> > MESA_SHADER_FRAGMENT, NULL);<br>
> > + nir_builder_init_simple_shade<wbr>r(&b, NULL,<br>
> > MESA_SHADER_FRAGMENT, NULL,<br>
> > + NULL);<br>
> > b.shader->info->name = ralloc_strdup(b.shader, name);<br>
> ><br>
> > nir_variable *tex_pos_in = nir_variable_create(b.shader,<br>
> > nir_var_shader_in,<br>
> > @@ -602,7 +604,8 @@ build_nir_copy_fragment_shader<wbr>_depth(struct<br>
> > radv_device *device,<br>
> > const struct glsl_type *vec2 =<br>
> > glsl_vector_type(GLSL_TYPE_FLO<wbr>AT, 2);<br>
> > nir_builder b;<br>
> ><br>
> > - nir_builder_init_simple_shade<wbr>r(&b, NULL,<br>
> > MESA_SHADER_FRAGMENT, NULL);<br>
> > + nir_builder_init_simple_shade<wbr>r(&b, NULL,<br>
> > MESA_SHADER_FRAGMENT, NULL,<br>
> > + NULL);<br>
> > b.shader->info->name = ralloc_strdup(b.shader, name);<br>
> ><br>
> > nir_variable *tex_pos_in = nir_variable_create(b.shader,<br>
> > nir_var_shader_in,<br>
> > @@ -631,7 +634,8 @@ build_nir_copy_fragment_shader<wbr>_stencil(struct<br>
> > radv_device *device,<br>
> > const struct glsl_type *vec2 =<br>
> > glsl_vector_type(GLSL_TYPE_FLO<wbr>AT, 2);<br>
> > nir_builder b;<br>
> ><br>
> > - nir_builder_init_simple_shade<wbr>r(&b, NULL,<br>
> > MESA_SHADER_FRAGMENT, NULL);<br>
> > + nir_builder_init_simple_shade<wbr>r(&b, NULL,<br>
> > MESA_SHADER_FRAGMENT, NULL,<br>
> > + NULL);<br>
> > b.shader->info->name = ralloc_strdup(b.shader, name);<br>
> ><br>
> > nir_variable *tex_pos_in = nir_variable_create(b.shader,<br>
> > nir_var_shader_in,<br>
> > diff --git a/src/amd/vulkan/radv_meta_buf<wbr>fer.c<br>
> > b/src/amd/vulkan/radv_meta_buf<wbr>fer.c<br>
> > index 05c4971..6294975 100644<br>
> > --- a/src/amd/vulkan/radv_meta_buf<wbr>fer.c<br>
> > +++ b/src/amd/vulkan/radv_meta_buf<wbr>fer.c<br>
> > @@ -9,7 +9,8 @@ build_buffer_fill_shader(struc<wbr>t radv_device *dev)<br>
> > {<br>
> > nir_builder b;<br>
> ><br>
> > - nir_builder_init_simple_shade<wbr>r(&b, NULL,<br>
> > MESA_SHADER_COMPUTE, NULL);<br>
> > + nir_builder_init_simple_shade<wbr>r(&b, NULL,<br>
> > MESA_SHADER_COMPUTE, NULL,<br>
> > + NULL);<br>
> > b.shader->info->name = ralloc_strdup(b.shader,<br>
> > "meta_buffer_fill");<br>
> > b.shader->info->cs.local_size[<wbr>0] = 64;<br>
> > b.shader->info->cs.local_size[<wbr>1] = 1;<br>
> > @@ -59,7 +60,8 @@ build_buffer_copy_shader(struc<wbr>t radv_device *dev)<br>
> > {<br>
> > nir_builder b;<br>
> ><br>
> > - nir_builder_init_simple_shade<wbr>r(&b, NULL,<br>
> > MESA_SHADER_COMPUTE, NULL);<br>
> > + nir_builder_init_simple_shade<wbr>r(&b, NULL,<br>
> > MESA_SHADER_COMPUTE, NULL,<br>
> > + NULL);<br>
> > b.shader->info->name = ralloc_strdup(b.shader,<br>
> > "meta_buffer_copy");<br>
> > b.shader->info->cs.local_size[<wbr>0] = 64;<br>
> > b.shader->info->cs.local_size[<wbr>1] = 1;<br>
> > diff --git a/src/amd/vulkan/radv_meta_buf<wbr>image.c<br>
> > b/src/amd/vulkan/radv_meta_buf<wbr>image.c<br>
> > index c9dd072..005b52c 100644<br>
> > --- a/src/amd/vulkan/radv_meta_buf<wbr>image.c<br>
> > +++ b/src/amd/vulkan/radv_meta_buf<wbr>image.c<br>
> > @@ -13,7 +13,8 @@ build_nir_itob_compute_shader(<wbr>struct radv_device<br>
> > *dev)<br>
> > false,<br>
> > false,<br>
> > <br>
> > GLSL_TYPE_FLOAT);<br>
> > - nir_builder_init_simple_shade<wbr>r(&b, NULL,<br>
> > MESA_SHADER_COMPUTE, NULL);<br>
> > + nir_builder_init_simple_shade<wbr>r(&b, NULL,<br>
> > MESA_SHADER_COMPUTE, NULL,<br>
> > + NULL);<br>
> > b.shader->info->name = ralloc_strdup(b.shader,<br>
> > "meta_itob_cs");<br>
> > b.shader->info->cs.local_size[<wbr>0] = 16;<br>
> > b.shader->info->cs.local_size[<wbr>1] = 16;<br>
> > diff --git a/src/amd/vulkan/radv_meta_cle<wbr>ar.c<br>
> > b/src/amd/vulkan/radv_meta_cle<wbr>ar.c<br>
> > index 34b318a..276fc65 100644<br>
> > --- a/src/amd/vulkan/radv_meta_cle<wbr>ar.c<br>
> > +++ b/src/amd/vulkan/radv_meta_cle<wbr>ar.c<br>
> > @@ -53,8 +53,10 @@ build_color_shaders(struct nir_shader **out_vs,<br>
> > nir_builder vs_b;<br>
> > nir_builder fs_b;<br>
> ><br>
> > - nir_builder_init_simple_shade<wbr>r(&vs_b, NULL,<br>
> > MESA_SHADER_VERTEX, NULL);<br>
> > - nir_builder_init_simple_shade<wbr>r(&fs_b, NULL,<br>
> > MESA_SHADER_FRAGMENT, NULL);<br>
> > + nir_builder_init_simple_shade<wbr>r(&vs_b, NULL,<br>
> > MESA_SHADER_VERTEX, NULL,<br>
> > + NULL);<br>
> > + nir_builder_init_simple_shade<wbr>r(&fs_b, NULL,<br>
> > MESA_SHADER_FRAGMENT, NULL,<br>
> > + NULL);<br>
> ><br>
> > vs_b.shader->info->name = ralloc_strdup(vs_b.shader,<br>
> > "meta_clear_color_vs");<br>
> > fs_b.shader->info->name = ralloc_strdup(fs_b.shader,<br>
> > "meta_clear_color_fs");<br>
> > @@ -455,8 +457,10 @@ build_depthstencil_shader(stru<wbr>ct nir_shader<br>
> > **out_vs, struct nir_shader **out_fs<br>
> > {<br>
> > nir_builder vs_b, fs_b;<br>
> ><br>
> > - nir_builder_init_simple_shade<wbr>r(&vs_b, NULL,<br>
> > MESA_SHADER_VERTEX, NULL);<br>
> > - nir_builder_init_simple_shade<wbr>r(&fs_b, NULL,<br>
> > MESA_SHADER_FRAGMENT, NULL);<br>
> > + nir_builder_init_simple_shade<wbr>r(&vs_b, NULL,<br>
> > MESA_SHADER_VERTEX, NULL,<br>
> > + NULL);<br>
> > + nir_builder_init_simple_shade<wbr>r(&fs_b, NULL,<br>
> > MESA_SHADER_FRAGMENT, NULL,<br>
> > + NULL);<br>
> ><br>
> > vs_b.shader->info->name = ralloc_strdup(vs_b.shader,<br>
> > "meta_clear_depthstencil_vs");<br>
> > fs_b.shader->info->name = ralloc_strdup(fs_b.shader,<br>
> > "meta_clear_depthstencil_fs");<br>
> > diff --git a/src/amd/vulkan/radv_meta_dec<wbr>ompress.c<br>
> > b/src/amd/vulkan/radv_meta_dec<wbr>ompress.c<br>
> > index 47ef64d..ff91abd 100644<br>
> > --- a/src/amd/vulkan/radv_meta_dec<wbr>ompress.c<br>
> > +++ b/src/amd/vulkan/radv_meta_dec<wbr>ompress.c<br>
> > @@ -45,7 +45,8 @@ build_nir_vs(void)<br>
> > nir_variable *a_position;<br>
> > nir_variable *v_position;<br>
> ><br>
> > - nir_builder_init_simple_shade<wbr>r(&b, NULL,<br>
> > MESA_SHADER_VERTEX, NULL);<br>
> > + nir_builder_init_simple_shade<wbr>r(&b, NULL,<br>
> > MESA_SHADER_VERTEX, NULL,<br>
> > + NULL);<br>
> > b.shader->info->name = ralloc_strdup(b.shader,<br>
> > "meta_depth_decomp_vs");<br>
> ><br>
> > a_position = nir_variable_create(b.shader,<br>
> > nir_var_shader_in, vec4,<br>
> > @@ -67,7 +68,8 @@ build_nir_fs(void)<br>
> > {<br>
> > nir_builder b;<br>
> ><br>
> > - nir_builder_init_simple_shade<wbr>r(&b, NULL,<br>
> > MESA_SHADER_FRAGMENT, NULL);<br>
> > + nir_builder_init_simple_shade<wbr>r(&b, NULL,<br>
> > MESA_SHADER_FRAGMENT, NULL,<br>
> > + NULL);<br>
> > b.shader->info->name = ralloc_asprintf(b.shader,<br>
> > <br>
> > "meta_depth_decomp_noop_fs");<br>
> ><br>
> > diff --git a/src/amd/vulkan/radv_meta_fas<wbr>t_clear.c<br>
> > b/src/amd/vulkan/radv_meta_fas<wbr>t_clear.c<br>
> > index d3ebf41..89a56d3 100644<br>
> > --- a/src/amd/vulkan/radv_meta_fas<wbr>t_clear.c<br>
> > +++ b/src/amd/vulkan/radv_meta_fas<wbr>t_clear.c<br>
> > @@ -48,7 +48,8 @@ build_nir_vs(void)<br>
> > nir_variable *a_tex_position;<br>
> > nir_variable *v_tex_position;<br>
> ><br>
> > - nir_builder_init_simple_shade<wbr>r(&b, NULL,<br>
> > MESA_SHADER_VERTEX, NULL);<br>
> > + nir_builder_init_simple_shade<wbr>r(&b, NULL,<br>
> > MESA_SHADER_VERTEX, NULL,<br>
> > + NULL);<br>
> > b.shader->info->name = ralloc_strdup(b.shader,<br>
> > "meta_fast_clear_vs");<br>
> ><br>
> > a_position = nir_variable_create(b.shader,<br>
> > nir_var_shader_in, vec4,<br>
> > @@ -82,7 +83,8 @@ build_nir_fs(void)<br>
> > nir_variable *v_tex_position; /* vec4, varying texture<br>
> > coordinate */<br>
> > nir_variable *f_color; /* vec4, fragment output color */<br>
> ><br>
> > - nir_builder_init_simple_shade<wbr>r(&b, NULL,<br>
> > MESA_SHADER_FRAGMENT, NULL);<br>
> > + nir_builder_init_simple_shade<wbr>r(&b, NULL,<br>
> > MESA_SHADER_FRAGMENT, NULL,<br>
> > + NULL);<br>
> > b.shader->info->name = ralloc_asprintf(b.shader,<br>
> > <br>
> > "meta_fast_clear_fs");<br>
> ><br>
> > diff --git a/src/amd/vulkan/radv_meta_res<wbr>olve.c<br>
> > b/src/amd/vulkan/radv_meta_res<wbr>olve.c<br>
> > index 8e2a353..a937dea 100644<br>
> > --- a/src/amd/vulkan/radv_meta_res<wbr>olve.c<br>
> > +++ b/src/amd/vulkan/radv_meta_res<wbr>olve.c<br>
> > @@ -48,7 +48,8 @@ build_nir_vs(void)<br>
> > nir_variable *a_tex_position;<br>
> > nir_variable *v_tex_position;<br>
> ><br>
> > - nir_builder_init_simple_shade<wbr>r(&b, NULL,<br>
> > MESA_SHADER_VERTEX, NULL);<br>
> > + nir_builder_init_simple_shade<wbr>r(&b, NULL,<br>
> > MESA_SHADER_VERTEX, NULL,<br>
> > + NULL);<br>
> > b.shader->info->name = ralloc_strdup(b.shader,<br>
> > "meta_resolve_vs");<br>
> ><br>
> > a_position = nir_variable_create(b.shader,<br>
> > nir_var_shader_in, vec4,<br>
> > @@ -82,7 +83,8 @@ build_nir_fs(void)<br>
> > nir_variable *v_tex_position; /* vec4, varying texture<br>
> > coordinate */<br>
> > nir_variable *f_color; /* vec4, fragment output color */<br>
> ><br>
> > - nir_builder_init_simple_shade<wbr>r(&b, NULL,<br>
> > MESA_SHADER_FRAGMENT, NULL);<br>
> > + nir_builder_init_simple_shade<wbr>r(&b, NULL,<br>
> > MESA_SHADER_FRAGMENT, NULL,<br>
> > + NULL);<br>
> > b.shader->info->name = ralloc_asprintf(b.shader,<br>
> > "meta_resolve_fs");<br>
> ><br>
> > diff --git a/src/amd/vulkan/radv_meta_res<wbr>olve_cs.c<br>
> > b/src/amd/vulkan/radv_meta_res<wbr>olve_cs.c<br>
> > index 126823b..8d62ef9 100644<br>
> > --- a/src/amd/vulkan/radv_meta_res<wbr>olve_cs.c<br>
> > +++ b/src/amd/vulkan/radv_meta_res<wbr>olve_cs.c<br>
> > @@ -46,7 +46,7 @@ build_resolve_compute_shader(s<wbr>truct radv_device<br>
> > *dev, bool is_integer, int sampl<br>
> > false,<br>
> > <br>
> > GLSL_TYPE_FLOAT);<br>
> > snprintf(name, 64, "meta_resolve_cs-%d-%s", samples,<br>
> > is_integer ? "int" : "float");<br>
> > - nir_builder_init_simple_shade<wbr>r(&b, NULL,<br>
> > MESA_SHADER_COMPUTE, NULL);<br>
> > + nir_builder_init_simple_shade<wbr>r(&b, NULL,<br>
> > MESA_SHADER_COMPUTE, NULL, NULL);<br>
> > b.shader->info->name = ralloc_strdup(b.shader, name);<br>
> > b.shader->info->cs.local_size[<wbr>0] = 16;<br>
> > b.shader->info->cs.local_size[<wbr>1] = 16;<br>
> > diff --git a/src/amd/vulkan/radv_pipeline<wbr>.c<br>
> > b/src/amd/vulkan/radv_pipeline<wbr>.c<br>
> > index edc0674e..921b602 100644<br>
> > --- a/src/amd/vulkan/radv_pipeline<wbr>.c<br>
> > +++ b/src/amd/vulkan/radv_pipeline<wbr>.c<br>
> > @@ -1215,7 +1215,7 @@ radv_pipeline_init(struct radv_pipeline<br>
> > *pipeline,<br>
> ><br>
> > if (!modules[MESA_SHADER_FRAGMENT<wbr>]) {<br>
> > nir_builder fs_b;<br>
> > - nir_builder_init_simple_shade<wbr>r(&fs_b, NULL,<br>
> > MESA_SHADER_FRAGMENT, NULL);<br>
> > + nir_builder_init_simple_shade<wbr>r(&fs_b, NULL,<br>
> > MESA_SHADER_FRAGMENT, NULL, NULL);<br>
> > fs_b.shader->info->name =<br>
> > ralloc_strdup(fs_b.shader, "noop_fs");<br>
> > fs_m.nir = fs_b.shader;<br>
> > modules[MESA_SHADER_FRAGMENT] = &fs_m;<br>
> > diff --git a/src/compiler/nir/nir_builder<wbr>.h<br>
> > b/src/compiler/nir/nir_builder<wbr>.h<br>
> > index 0ee7d1a..5ff84e2 100644<br>
> > --- a/src/compiler/nir/nir_builder<wbr>.h<br>
> > +++ b/src/compiler/nir/nir_builder<wbr>.h<br>
> > @@ -50,9 +50,10 @@ nir_builder_init(nir_builder *build,<br>
> > nir_function_impl *impl)<br>
> > static inline void<br>
> > nir_builder_init_simple_shade<wbr>r(nir_builder *build, void *mem_ctx,<br>
> > gl_shader_stage stage,<br>
> > - const nir_shader_compiler_options<br>
> > *options)<br>
> > + const nir_shader_compiler_options<br>
> > *options,<br>
> > + shader_info *si)<br>
><br>
> Do we really need to add this just for prog_to_nir? It seems like<br>
> prog_to_nir could just replace the pointer in the nir_shader.<br>
<br>
</div></div>We could but we would then have another shader_info in memory that<br>
never gets used (created by nir_shader_create()).<span><br></span></blockquote></div></div></div></div></div></blockquote><div><br></div><div>Yes and no. It will get freed the first time we do a nir_sweep.<br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div><div class="h5"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span>
> Or we could create the shader directly since prog_to_nir really<br>
> isn't the "simple" case.<br>
<br>
</span>I thought about that but then decided to just make the builder more<br>
flexible. At this point I don't really care. Please let me know what<br>
you want here or I'll just leave it as is.<br></blockquote><div><br></div></div></div><div>I don't care what we do in prog_to_nir, I just don't like having it in init_simple_shader. The init_simple_shader helper was created expressly for things building NIR shaders directly and they all use nir_gather_info. The one exception is prog_to_nir so I'd rather it be an exception.<br></div><div><div class="h5"><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="m_-6989745745178297322HOEnZb"><div class="m_-6989745745178297322h5">
> <br>
> > {<br>
> > - build->shader = nir_shader_create(mem_ctx, stage, options,<br>
> > NULL);<br>
> > + build->shader = nir_shader_create(mem_ctx, stage, options, si);<br>
> > nir_function *func = nir_function_create(build->sha<wbr>der,<br>
> > "main");<br>
> > build->exact = false;<br>
> > build->impl = nir_function_impl_create(func)<wbr>;<br>
> > diff --git a/src/compiler/nir/tests/contr<wbr>ol_flow_tests.cpp<br>
> > b/src/compiler/nir/tests/contr<wbr>ol_flow_tests.cpp<br>
> > index ae0954f..0b70f57 100644<br>
> > --- a/src/compiler/nir/tests/contr<wbr>ol_flow_tests.cpp<br>
> > +++ b/src/compiler/nir/tests/contr<wbr>ol_flow_tests.cpp<br>
> > @@ -35,7 +35,8 @@ protected:<br>
> > nir_cf_test::nir_cf_test()<br>
> > {<br>
> > static const nir_shader_compiler_options options = { };<br>
> > - nir_builder_init_simple_shade<wbr>r(&b, NULL, MESA_SHADER_VERTEX,<br>
> > &options);<br>
> > + nir_builder_init_simple_shade<wbr>r(&b, NULL, MESA_SHADER_VERTEX,<br>
> > &options,<br>
> > + NULL);<br>
> > }<br>
> ><br>
> > nir_cf_test::~nir_cf_test()<br>
> > diff --git a/src/gallium/auxiliary/nir/tg<wbr>si_to_nir.c<br>
> > b/src/gallium/auxiliary/nir/tg<wbr>si_to_nir.c<br>
> > index 3f05acd..adeea60 100644<br>
> > --- a/src/gallium/auxiliary/nir/tg<wbr>si_to_nir.c<br>
> > +++ b/src/gallium/auxiliary/nir/tg<wbr>si_to_nir.c<br>
> > @@ -1999,7 +1999,7 @@ tgsi_to_nir(const void *tgsi_tokens,<br>
> ><br>
> > nir_builder_init_simple_shader<wbr>(&c->build, NULL,<br>
> > <br>
> > tgsi_processor_to_shader_stag<wbr>e(scan.processor),<br>
> > - options);<br>
> > + options, NULL);<br>
> > s = c->build.shader;<br>
> ><br>
> > s->num_inputs = scan.file_max[TGSI_FILE_INPUT] + 1;<br>
> > diff --git a/src/intel/blorp/blorp_blit.c<br>
> > b/src/intel/blorp/blorp_blit.c<br>
> > index 0c3ee72..d7a7763 100644<br>
> > --- a/src/intel/blorp/blorp_blit.c<br>
> > +++ b/src/intel/blorp/blorp_blit.c<br>
> > @@ -1044,7 +1044,7 @@ brw_blorp_build_nir_shader(str<wbr>uct<br>
> > blorp_context *blorp,<br>
> > (key->dst_samples <= 1));<br>
> ><br>
> > nir_builder b;<br>
> > - nir_builder_init_simple_shade<wbr>r(&b, NULL, MESA_SHADER_FRAGMENT,<br>
> > NULL);<br>
> > + nir_builder_init_simple_shade<wbr>r(&b, NULL, MESA_SHADER_FRAGMENT,<br>
> > NULL, NULL);<br>
> ><br>
> > struct brw_blorp_blit_vars v;<br>
> > brw_blorp_blit_vars_init(&b, &v, key);<br>
> > diff --git a/src/intel/blorp/blorp_clear.<wbr>c<br>
> > b/src/intel/blorp/blorp_clear.<wbr>c<br>
> > index f932789..8285e0e 100644<br>
> > --- a/src/intel/blorp/blorp_clear.<wbr>c<br>
> > +++ b/src/intel/blorp/blorp_clear.<wbr>c<br>
> > @@ -55,7 +55,7 @@ blorp_params_get_clear_kernel(<wbr>struct<br>
> > blorp_context *blorp,<br>
> > void *mem_ctx = ralloc_context(NULL);<br>
> ><br>
> > nir_builder b;<br>
> > - nir_builder_init_simple_shade<wbr>r(&b, NULL, MESA_SHADER_FRAGMENT,<br>
> > NULL);<br>
> > + nir_builder_init_simple_shade<wbr>r(&b, NULL, MESA_SHADER_FRAGMENT,<br>
> > NULL, NULL);<br>
> > b.shader->info->name = ralloc_strdup(b.shader, "BLORP-clear");<br>
> ><br>
> > nir_variable *v_color = nir_variable_create(b.shader,<br>
> > nir_var_shader_in,<br>
> > diff --git a/src/mesa/drivers/dri/i965/br<wbr>w_program.c<br>
> > b/src/mesa/drivers/dri/i965/br<wbr>w_program.c<br>
> > index 7151558..8c0c936 100644<br>
> > --- a/src/mesa/drivers/dri/i965/br<wbr>w_program.c<br>
> > +++ b/src/mesa/drivers/dri/i965/br<wbr>w_program.c<br>
> > @@ -64,7 +64,7 @@ brw_nir_lower_uniforms(nir_sha<wbr>der *nir, bool<br>
> > is_scalar)<br>
> > nir_shader *<br>
> > brw_create_nir(struct brw_context *brw,<br>
> > const struct gl_shader_program *shader_prog,<br>
> > - const struct gl_program *prog,<br>
> > + struct gl_program *prog,<br>
> > gl_shader_stage stage,<br>
> > bool is_scalar)<br>
> > {<br>
> > diff --git a/src/mesa/drivers/dri/i965/br<wbr>w_program.h<br>
> > b/src/mesa/drivers/dri/i965/br<wbr>w_program.h<br>
> > index eed07a2..7b24dbb 100644<br>
> > --- a/src/mesa/drivers/dri/i965/br<wbr>w_program.h<br>
> > +++ b/src/mesa/drivers/dri/i965/br<wbr>w_program.h<br>
> > @@ -34,7 +34,7 @@ struct brw_context;<br>
> ><br>
> > struct nir_shader *brw_create_nir(struct brw_context *brw,<br>
> > const struct gl_shader_program<br>
> > *shader_prog,<br>
> > - const struct gl_program *prog,<br>
> > + struct gl_program *prog,<br>
> > gl_shader_stage stage,<br>
> > bool is_scalar);<br>
> ><br>
> > diff --git a/src/mesa/drivers/dri/i965/br<wbr>w_tcs.c<br>
> > b/src/mesa/drivers/dri/i965/br<wbr>w_tcs.c<br>
> > index 7511507..0910d24 100644<br>
> > --- a/src/mesa/drivers/dri/i965/br<wbr>w_tcs.c<br>
> > +++ b/src/mesa/drivers/dri/i965/br<wbr>w_tcs.c<br>
> > @@ -41,7 +41,8 @@ create_passthrough_tcs(const struct brw_compiler<br>
> > *compiler,<br>
> > const struct brw_tcs_prog_key *key)<br>
> > {<br>
> > nir_builder b;<br>
> > - nir_builder_init_simple_shade<wbr>r(&b, NULL, MESA_SHADER_TESS_CTRL,<br>
> > options);<br>
> > + nir_builder_init_simple_shade<wbr>r(&b, NULL, MESA_SHADER_TESS_CTRL,<br>
> > options,<br>
> > + NULL);<br>
> > nir_shader *nir = b.shader;<br>
> > nir_variable *var;<br>
> > nir_intrinsic_instr *load;<br>
> > diff --git a/src/mesa/program/prog_to_nir<wbr>.c<br>
> > b/src/mesa/program/prog_to_nir<wbr>.c<br>
> > index a65d4bf..a675bc6 100644<br>
> > --- a/src/mesa/program/prog_to_nir<wbr>.c<br>
> > +++ b/src/mesa/program/prog_to_nir<wbr>.c<br>
> > @@ -1006,7 +1006,7 @@ setup_registers_and_variables(<wbr>struct<br>
> > ptn_compile *c)<br>
> > }<br>
> ><br>
> > struct nir_shader *<br>
> > -prog_to_nir(const struct gl_program *prog,<br>
> > +prog_to_nir(struct gl_program *prog,<br>
> > const nir_shader_compiler_options *options)<br>
> > {<br>
> > struct ptn_compile *c;<br>
> > @@ -1018,7 +1018,8 @@ prog_to_nir(const struct gl_program *prog,<br>
> > return NULL;<br>
> > c->prog = prog;<br>
> ><br>
> > - nir_builder_init_simple_shade<wbr>r(&c->build, NULL, stage,<br>
> > options);<br>
> > + nir_builder_init_simple_shade<wbr>r(&c->build, NULL, stage, options,<br>
> > + &prog->info);<br>
> > s = c->build.shader;<br>
> ><br>
> > if (prog->Parameters->NumParamete<wbr>rs > 0) {<br>
> > diff --git a/src/mesa/program/prog_to_nir<wbr>.h<br>
> > b/src/mesa/program/prog_to_nir<wbr>.h<br>
> > index 09425b5..b1e0ec7 100644<br>
> > --- a/src/mesa/program/prog_to_nir<wbr>.h<br>
> > +++ b/src/mesa/program/prog_to_nir<wbr>.h<br>
> > @@ -31,7 +31,7 @@<br>
> > extern "C" {<br>
> > #endif<br>
> ><br>
> > -struct nir_shader *prog_to_nir(const struct gl_program *prog,<br>
> > +struct nir_shader *prog_to_nir(struct gl_program *prog,<br>
> > const nir_shader_compiler_options<br>
> > *options);<br>
> ><br>
> > #ifdef __cplusplus<br>
> > --<br>
> > 2.7.4<br>
> ><br>
> > ______________________________<wbr>_________________<br>
> > mesa-dev mailing list<br>
> > <a href="mailto:mesa-dev@lists.freedesktop.org" target="_blank">mesa-dev@lists.freedesktop.org</a><br>
> > <a href="https://lists.freedesktop.org/mailman/listinfo/mesa-dev" rel="noreferrer" target="_blank">https://lists.freedesktop.org/<wbr>mailman/listinfo/mesa-dev</a><br>
> ><br>
><br>
</div></div></blockquote></div></div></div><br></div></div>
</blockquote></div><br></div></div>