namespace GL {
namespace SL {
-StructOrganizer::StructOrganizer():
- offset(-1)
-{ }
-
void StructOrganizer::visit(StructDeclaration &strct)
{
SetForScope<int> set_offset(offset, 0);
}
-PrecisionConverter::PrecisionConverter():
- stage(0)
-{ }
-
void PrecisionConverter::apply(Stage &s)
{
stage = &s;
void PrecisionConverter::visit(Precision &prec)
{
- if(stage->required_features.gl_api==OPENGL_ES2)
+ if(stage->required_features.target_api==OPENGL_ES)
have_default.insert(prec.type);
else
nodes_to_remove.insert(&prec);
void PrecisionConverter::visit(VariableDeclaration &var)
{
- if(stage->required_features.gl_api!=OPENGL_ES2)
+ if(stage->required_features.target_api!=OPENGL_ES)
{
var.precision.clear();
return;
}
-LegacyConverter::LegacyConverter():
- frag_out(0)
-{ }
-
void LegacyConverter::apply(Stage &s, const Features &feat)
{
stage = &s;
NodeRemover().apply(s, nodes_to_remove);
if(!stage->required_features.glsl_version)
- stage->required_features.glsl_version = Version(1, (stage->required_features.gl_api==OPENGL_ES2 ? 0 : 10));
+ stage->required_features.glsl_version = Version(1, (stage->required_features.target_api==OPENGL_ES ? 0 : 10));
}
else
unsupported(format("Stage %s is not supported", Stage::get_stage_name(s.type)));
{
if(st==Stage::GEOMETRY)
{
- if(features.gl_api==OPENGL_ES2)
+ if(features.target_api==OPENGL_ES)
return check_version(Version(3, 20));
else
return check_version(Version(1, 50));
bool LegacyConverter::supports_unified_interface_syntax() const
{
- if(features.gl_api==OPENGL_ES2)
+ if(features.target_api==OPENGL_ES)
return check_version(Version(3, 0));
else
return check_version(Version(1, 30));
bool LegacyConverter::supports_unified_sampling_functions() const
{
- if(features.gl_api==OPENGL_ES2)
+ if(features.target_api==OPENGL_ES)
return check_version(Version(3, 0));
else
return check_version(Version(1, 30));
bool LegacyConverter::supports_interface_layouts() const
{
- if(features.gl_api==OPENGL_ES2)
+ if(features.target_api==OPENGL_ES)
return check_version(Version(3, 0));
else if(check_version(Version(3, 30)))
return true;
bool LegacyConverter::supports_stage_interface_layouts() const
{
- if(features.gl_api==OPENGL_ES2)
+ if(features.target_api==OPENGL_ES)
return check_version(Version(3, 10));
else if(check_version(Version(4, 10)))
return true;
bool LegacyConverter::supports_centroid_sampling() const
{
- if(features.gl_api==OPENGL_ES2)
+ if(features.target_api==OPENGL_ES)
return check_version(Version(3, 0));
else if(check_version(Version(1, 20)))
return true;
bool LegacyConverter::supports_sample_sampling() const
{
- if(features.gl_api==OPENGL_ES2)
+ if(features.target_api==OPENGL_ES)
return check_version(Version(3, 20));
else if(check_version(Version(4, 0)))
return true;
bool LegacyConverter::supports_uniform_location() const
{
- if(features.gl_api==OPENGL_ES2)
+ if(features.target_api==OPENGL_ES)
return check_version(Version(3, 10));
else if(check_version(Version(4, 30)))
return true;
bool LegacyConverter::supports_binding() const
{
- if(features.gl_api==OPENGL_ES2)
+ if(features.target_api==OPENGL_ES)
return check_version(Version(3, 10));
else
return check_version(Version(4, 20));
bool LegacyConverter::supports_interface_blocks(const string &iface) const
{
- if(features.gl_api==OPENGL_ES2)
+ if(features.target_api==OPENGL_ES)
{
if(iface=="uniform")
return check_version(Version(3, 0));
bool LegacyConverter::supports_interface_block_location() const
{
- if(features.gl_api==OPENGL_ES2)
+ if(features.target_api==OPENGL_ES)
return check_version(Version(3, 20));
else if(check_version(Version(4, 40)))
return true;