[Mesa-dev] [PATCH 03/11] glsl: pass UseSTD430AsDefaultPacking to where it will be used
Nicolai Hähnle
nhaehnle at gmail.com
Tue Aug 22 08:36:40 UTC 2017
On 17.08.2017 13:03, Timothy Arceri wrote:
> diff --git a/src/mesa/program/ir_to_mesa.cpp b/src/mesa/program/ir_to_mesa.cpp
> index 0e6a95ce99..d04ea67b07 100644
> --- a/src/mesa/program/ir_to_mesa.cpp
> +++ b/src/mesa/program/ir_to_mesa.cpp
> @@ -2411,39 +2411,41 @@ print_program(struct prog_instruction *mesa_instructions,
> PROG_PRINT_DEBUG, NULL);
> }
> }
>
> namespace {
>
> class add_uniform_to_shader : public program_resource_visitor {
> public:
> add_uniform_to_shader(struct gl_shader_program *shader_program,
> struct gl_program_parameter_list *params)
> - : shader_program(shader_program), params(params), idx(-1)
> + : ctx(ctx), shader_program(shader_program), params(params), idx(-1)
Looks like you pushed a version of this with a problem:
../../../mesa/src/mesa/program/ir_to_mesa.cpp: In constructor
‘{anonymous}::add_uniform_to_shader::add_uniform_to_shader(gl_shader_program*,
gl_program_parameter_list*)’:
../../../mesa/src/mesa/program/ir_to_mesa.cpp:2419:4: warning:
‘{anonymous}::add_uniform_to_shader::ctx’ is initialized with itself
[-Winit-self]
add_uniform_to_shader(struct gl_shader_program *shader_program,
^~~~~~~~~~~~~~~~~~~~~
Cheers,
Nicolai
> {
> /* empty */
> }
>
> void process(ir_variable *var)
> {
> this->idx = -1;
> this->var = var;
> - this->program_resource_visitor::process(var);
> + this->program_resource_visitor::process(var,
> + ctx->Const.UseSTD430AsDefaultPacking);
> var->data.param_index = this->idx;
> }
>
> private:
> virtual void visit_field(const glsl_type *type, const char *name,
> bool row_major, const glsl_type *record_type,
> const enum glsl_interface_packing packing,
> bool last_field);
>
> + struct gl_context *ctx;
> struct gl_shader_program *shader_program;
> struct gl_program_parameter_list *params;
> int idx;
> ir_variable *var;
> };
>
> } /* anonymous namespace */
>
> void
> add_uniform_to_shader::visit_field(const glsl_type *type, const char *name,
>
--
Lerne, wie die Welt wirklich ist,
Aber vergiss niemals, wie sie sein sollte.
More information about the mesa-dev
mailing list