void DefaultPrecisionGenerator::apply(Stage &s)
{
stage = &s;
- visit(s.content);
+ s.content.visit(*this);
}
void DefaultPrecisionGenerator::visit(Block &block)
void PrecisionRemover::apply(Stage &stage)
{
- visit(stage.content);
+ stage.content.visit(*this);
NodeRemover().apply(stage, nodes_to_remove);
}
features = feat;
if(!supports_stage(s.type))
throw unsupported_shader(format("Stage %s is not supported", Stage::get_stage_name(s.type)));
- visit(s.content);
+ s.content.visit(*this);
}
void LegacyConverter::visit(Block &block)
{
var.name = "gl_FragColor";
var.declaration = 0;
- type = "vec4";
+ r_type = "vec4";
}
else if(var.declaration)
- type = var.declaration->type;
+ r_type = var.declaration->type;
else
- type = string();
+ r_type.clear();
}
void LegacyConverter::visit(Assignment &assign)
if(call.name=="texture")
{
string sampler_type;
- type = string();
+ r_type.clear();
NodeArray<Expression>::iterator i = call.arguments.begin();
if(i!=call.arguments.end())
{
(*i)->visit(*this);
- sampler_type = type;
+ sampler_type = r_type;
for(; i!=call.arguments.end(); ++i)
(*i)->visit(*this);