class nir_visitor : public ir_visitor
{
public:
- nir_visitor(nir_shader *shader, gl_shader_stage stage);
+ nir_visitor(nir_shader *shader);
~nir_visitor();
virtual void visit(ir_variable *);
bool supports_ints;
nir_shader *shader;
- gl_shader_stage stage;
nir_function_impl *impl;
exec_list *cf_node_list;
nir_instr *result; /* result of the expression tree last visited */
{
nir_shader *shader = nir_shader_create(NULL, sh->Stage, options);
- nir_visitor v1(shader, sh->Stage);
+ nir_visitor v1(shader);
nir_function_visitor v2(&v1);
v2.run(sh->ir);
visit_exec_list(sh->ir, &v1);
return shader;
}
-nir_visitor::nir_visitor(nir_shader *shader, gl_shader_stage stage)
+nir_visitor::nir_visitor(nir_shader *shader)
{
this->supports_ints = shader->options->native_integers;
this->shader = shader;
- this->stage = stage;
this->is_global = true;
this->var_table = _mesa_hash_table_create(NULL, _mesa_hash_pointer,
_mesa_key_pointer_equal);
break;
case ir_var_shader_in:
- if (stage == MESA_SHADER_FRAGMENT &&
+ if (shader->stage == MESA_SHADER_FRAGMENT &&
ir->data.location == VARYING_SLOT_FACE) {
/* For whatever reason, GLSL IR makes gl_FrontFacing an input */
var->data.location = SYSTEM_VALUE_FRONT_FACE;
void nir_lower_phis_to_scalar(nir_shader *shader);
void nir_lower_samplers(nir_shader *shader,
- const struct gl_shader_program *shader_program,
- gl_shader_stage stage);
+ const struct gl_shader_program *shader_program);
void nir_lower_system_values(nir_shader *shader);
void nir_lower_tex_projector(nir_shader *shader);
}
extern "C" void
-nir_lower_samplers(nir_shader *shader, const struct gl_shader_program *shader_program,
- gl_shader_stage stage)
+nir_lower_samplers(nir_shader *shader,
+ const struct gl_shader_program *shader_program)
{
nir_foreach_overload(shader, overload) {
if (overload->impl)
- lower_impl(overload->impl, shader_program, stage);
+ lower_impl(overload->impl, shader_program, shader->stage);
}
}
nir_validate_shader(nir);
if (shader_prog) {
- nir_lower_samplers(nir, shader_prog, stage);
+ nir_lower_samplers(nir, shader_prog);
nir_validate_shader(nir);
}