def __init__(self, block): """Constructor.""" GlslBlock.__init__(self) # Assumed block is already within the tree. if block.getParent(): block.removeFromParent() self.addChildren(block)
def __init__(self, name, lst, terminator): """Constructor.""" GlslBlock.__init__(self) self.__name = name self.__terminator = terminator # Hierarchy. self.addNamesUsed(name) self.addChildren(lst)
def __init__(self, typeid, name): """Constructor.""" GlslBlock.__init__(self) self.__typeid = typeid self.__name = name # Hierarchy. name.setType(typeid) self.addNamesUsed(name)
def __init__(self, definition_ld, filename, varname, output_name=None): """Constructor.""" GlslBlock.__init__(self) self.__definition_ld = definition_ld self.__filename = filename self.__variable_name = varname self.__output_name = output_name self.__content = "" self.detectType()
def __init__(self, typeid, children, terminator): """Constructor.""" GlslBlock.__init__(self) self.__typeid = typeid self.__terminator = terminator # Hierarchy. if not children: raise RuntimeError("array literal must have children") self.addChildren(children)
def __init__(self, lst, terminator = ""): """Constructor.""" GlslBlock.__init__(self) self.__content = lst self.__terminator = terminator if (not is_listing(self.__content)) or (None in self.__content): raise RuntimeError("content must be a listing") # Hierarchy. self.addAccesses(lst) self.addNamesUsed(lst)
def __init__(self, typeid, lst): """Constructor.""" GlslBlock.__init__(self) self.__typeid = typeid # Hierarchy. for ii in lst: name = ii.getName() name.setType(typeid) self.addNamesDeclared(name) self.addChildren(lst)
def __init__(self, lst, terminator=""): """Constructor.""" GlslBlock.__init__(self) self.__content = lst self.__terminator = terminator if (not is_listing(self.__content)) or (None in self.__content): raise RuntimeError("content must be a listing") # Hierarchy. self.addAccesses(lst) self.addNamesUsed(lst)
def __init__(self, layout, typeid, size, name): """Constructor.""" GlslBlock.__init__(self) self.__layout = layout self.__typeid = typeid self.__size = size self.__name = name # Hierarchy. self.addNamesDeclared(name) name.setType(typeid) self.addNamesUsed(name)
def __init__(self, type_name, members, name=None, size=0): """Constructor.""" GlslBlock.__init__(self) self.__type_name = type_name self.__members = members self.__name = name self.__size = size self.__member_accesses = [] # Hierarchy. name.setType(type_name) self.addNamesDeclared(name) self.addNamesUsed(name)
def __init__(self, control, declaration, lst): """Constructor.""" GlslBlock.__init__(self) self.__control = control self.__declaration = declaration self.__statements = lst self.__target = None # Hierarchy. if declaration: self.addChildren(declaration) if lst: self.addChildren(lst)
def __init__(self, inout, typeid, assignment): """Constructor.""" GlslBlock.__init__(self) self.__inout = inout self.__typeid = typeid self.__assignment = assignment # Set type of name. name = assignment.getName() name.setType(typeid) # Hierarchy. self.addNamesDeclared(name) self.addChildren(assignment)
def __init__(self, typeid): """Constructor.""" GlslBlock.__init__(self) self.__typeid = typeid # Validate type id. if not typeid.getPrecision(): raise RuntimeError( "type '%s' in precision block missing precision qualifier" % (self.__typeid.format())) # Type must be in allowed precision types. if not is_glsl_precision_type_string(self.getType()): raise RuntimeError("invalid type '%s' for precision block" % (self.getType()))
def __init__(self, name, lst, assign, statement): """Constructor.""" GlslBlock.__init__(self) self.__name = name self.__modifiers = lst self.__assign = assign if self.__assign and (not statement): raise RuntimeError("if assigning, must have a statement") # Hierarchy. self.addNamesUsed(name) self.addAccesses(lst) if statement: self.addChildren(statement)
def __init__(self, name, lst, assign, children, terminator): """Constructor.""" GlslBlock.__init__(self) self.__name = name self.__modifiers = lst self.__assign = assign self.__terminator = terminator # Error cases. if self.__assign and (not children): raise RuntimeError("if assigning, must have child statements") # Hierarchy. self.addNamesUsed(name) self.addAccesses(lst) if children: self.addChildren(children)
def __init__(self, lst, explicit): """Constructor.""" GlslBlock.__init__(self) self.__explicit = explicit self.__squashable = False self.__allow_squash = False # Check for degenerate scope. if (1 == len(lst)) and is_glsl_block_declaration(lst[0]): raise RuntimeError("scope with only block '%s' is degenerate" % (lst[0].format(True))) # Check for empty scope (likely an error). if 0 >= len(lst): if is_verbose(): print("WARNING: empty scope") # Hierarchy. self.addChildren(lst)
def __init__(self, typeid, name, lst, scope): """Constructor.""" GlslBlock.__init__(self) self.__typeid = typeid self.__name = name self.__parameters = lst self.__scope = scope if not is_listing(self.__parameters): raise RuntimeError("parameters must be a listing") # Hierarchy. name.setType(typeid) self.addNamesDeclared(name) self.addNamesUsed(name) self.addChildren(lst) self.addChildren(scope)
def __init__(self, definition_ld, filename, output_name=None, varname=None): """Constructor.""" GlslBlock.__init__(self) self.__definition_ld = definition_ld self.__filename = filename self.__basename = os.path.basename(filename) self.__output_name = output_name self.__variable_name = varname self.__content = "" # Determine remaining fields from the former. self.detectType()
def __init__(self, content): """Constructor.""" GlslBlock.__init__(self) self.__content = content
def __init__(self, elements): """Constructor.""" GlslBlock.__init__(self) self.__elements = elements
def __init__(self, lst): """Constructor.""" GlslBlock.__init__(self) # Hierarchy. self.addChildren(lst)
def __init__(self, layout, inout): """Constructor.""" GlslBlock.__init__(self) self._layout = layout self._inout = inout
def __init__(self, source): """Constructor.""" GlslBlock.__init__(self) lines = source.strip().split() self.__content = " ".join(lines)
def __init__(self, inout, lst): """Constructor.""" GlslBlock.__init__(self) self.__inout = inout self.__scope = lst