mesa: pass ctx to add_uniform_to_shader constructor
authorTimothy Arceri <tarceri@itsqueeze.com>
Tue, 22 Aug 2017 10:31:57 +0000 (20:31 +1000)
committerTimothy Arceri <tarceri@itsqueeze.com>
Tue, 22 Aug 2017 11:25:55 +0000 (21:25 +1000)
Fixes: 4c2422067b5c ("glsl: pass UseSTD430AsDefaultPacking to where it will be used")
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
src/mesa/program/ir_to_mesa.cpp
src/mesa/program/ir_to_mesa.h
src/mesa/state_tracker/st_glsl_to_nir.cpp
src/mesa/state_tracker/st_glsl_to_tgsi.cpp

index c168162b5726403c4de490ee09bdc2cfa3185398..78f244987839b4cdc2e48d4735bc601d1d7a635d 100644 (file)
@@ -2416,7 +2416,8 @@ namespace {
 
 class add_uniform_to_shader : public program_resource_visitor {
 public:
-   add_uniform_to_shader(struct gl_shader_program *shader_program,
+   add_uniform_to_shader(struct gl_context *ctx,
+                         struct gl_shader_program *shader_program,
                         struct gl_program_parameter_list *params)
       : ctx(ctx), params(params), idx(-1)
    {
@@ -2482,13 +2483,14 @@ add_uniform_to_shader::visit_field(const glsl_type *type, const char *name,
  * \param params         Parameter list to be filled in.
  */
 void
-_mesa_generate_parameters_list_for_uniforms(struct gl_shader_program
+_mesa_generate_parameters_list_for_uniforms(struct gl_context *ctx,
+                                            struct gl_shader_program
                                            *shader_program,
                                            struct gl_linked_shader *sh,
                                            struct gl_program_parameter_list
                                            *params)
 {
-   add_uniform_to_shader add(shader_program, params);
+   add_uniform_to_shader add(ctx, shader_program, params);
 
    foreach_in_list(ir_instruction, node, sh->ir) {
       ir_variable *var = node->as_variable();
@@ -2850,7 +2852,7 @@ get_mesa_program(struct gl_context *ctx,
    v.shader_program = shader_program;
    v.options = options;
 
-   _mesa_generate_parameters_list_for_uniforms(shader_program, shader,
+   _mesa_generate_parameters_list_for_uniforms(ctx, shader_program, shader,
                                               prog->Parameters);
 
    /* Emit Mesa IR for main(). */
index e3d364455cfb7947ab95167ea8d60d16640ebde2..9714f50443aa164209d4e83a958c0cc0b3355f8c 100644 (file)
@@ -38,7 +38,8 @@ void _mesa_glsl_link_shader(struct gl_context *ctx, struct gl_shader_program *pr
 GLboolean _mesa_ir_link_shader(struct gl_context *ctx, struct gl_shader_program *prog);
 
 void
-_mesa_generate_parameters_list_for_uniforms(struct gl_shader_program
+_mesa_generate_parameters_list_for_uniforms(struct gl_context *ctx,
+                                            struct gl_shader_program
                                            *shader_program,
                                            struct gl_linked_shader *sh,
                                            struct gl_program_parameter_list
index a2522070b1c8b5dbdced107abe315133a9bd66c0..38d6c7068c2435fa955a59ec1bf0ed44c700c68c 100644 (file)
@@ -400,7 +400,7 @@ st_nir_get_mesa_program(struct gl_context *ctx,
    do_set_program_inouts(shader->ir, prog, shader->Stage);
 
    _mesa_copy_linked_program_data(shader_program, shader);
-   _mesa_generate_parameters_list_for_uniforms(shader_program, shader,
+   _mesa_generate_parameters_list_for_uniforms(ctx, shader_program, shader,
                                                prog->Parameters);
 
    /* Make a pass over the IR to add state references for any built-in
index 9688400ed4fb87179f78aea2eedbe95e43ddf048..6489371db3204a4bacf87c7165c4a84dc1e7c62e 100644 (file)
@@ -6843,7 +6843,7 @@ get_mesa_program_tgsi(struct gl_context *ctx,
       pscreen->get_shader_param(pscreen, ptarget,
                                 PIPE_SHADER_CAP_TGSI_SKIP_MERGE_REGISTERS);
 
-   _mesa_generate_parameters_list_for_uniforms(shader_program, shader,
+   _mesa_generate_parameters_list_for_uniforms(ctx, shader_program, shader,
                                                prog->Parameters);
 
    /* Remove reads from output registers. */