class
CrShader::GDShaderIncEmitter
- CrShader::GDShaderIncEmitter
- CrShader::GDShaderEmitter
- CrShader::BaseVisitor
- Crystal::Visitor
- Reference
- Object
Overview
Emits reusable Godot 4 .gdshaderinc include headers from .crshader modules.
Strips shader_type, render_mode, and processor entry points, wraps in an
#ifndef include guard, closes any trailing group_uniforms;, and emits all
public constants, structs, uniform groups, varyings, and helper functions.
Defined in:
crshader/transpiler/gdshader/gdshaderinc_emitter.crConstructors
Instance Method Summary
- #emit(helper_functions : Array(Crystal::Def) = [] of Crystal::Def, reachable_identifiers : Set(String) | Nil = nil)
- #guard_name : String
Instance methods inherited from class CrShader::GDShaderEmitter
emit(helper_functions : Array(Crystal::Def) = [] of Crystal::Def, reachable_identifiers : Set(String) | Nil = nil)
emit,
emitted_functions : Set(String)
emitted_functions,
emitted_functions=(emitted_functions : Set(String))
emitted_functions=,
program : ShaderProgram
program
Constructor methods inherited from class CrShader::GDShaderEmitter
new(io : IO, program : ShaderProgram, symbol_table : SymbolTable = SymbolTable.new(ShaderTarget::GDShader), target : ShaderTarget = ShaderTarget::GDShader)
new
Instance methods inherited from class CrShader::BaseVisitor
current_function_name : String | Nil
current_function_name,
current_function_name=(current_function_name : String | Nil)
current_function_name=,
current_return_type : String | Nil
current_return_type,
current_return_type=(current_return_type : String | Nil)
current_return_type=,
emit_block_body(node : Crystal::ASTNode, is_function_body : Bool = false)
emit_block_body,
emit_indent
emit_indent,
in_expression : Bool
in_expression,
in_expression=(in_expression : Bool)
in_expression=,
in_function_return : Bool
in_function_return,
in_function_return=(in_function_return : Bool)
in_function_return=,
in_processor_function : Bool
in_processor_function,
in_processor_function=(in_processor_function : Bool)
in_processor_function=,
indent(&)
indent,
indent_level : Int32
indent_level,
indent_level=(indent_level : Int32)
indent_level=,
io : IO
io,
io=(io : IO)
io=,
symbol_table : SymbolTable
symbol_table,
symbol_table=(symbol_table : SymbolTable)
symbol_table=,
target : ShaderTarget
target,
target=(target : ShaderTarget)
target=,
visit(node : Crystal::Expressions)visit(node : Crystal::Assign)
visit(node : Crystal::OpAssign)
visit(node : Crystal::TypeDeclaration)
visit(node : Crystal::If)
visit(node : Crystal::ArrayLiteral)
visit(node : Crystal::Case)
visit(node : Crystal::Unless)
visit(node : Crystal::While)
visit(node : Crystal::Until)
visit(node : Crystal::Return)
visit(node : Crystal::Break)
visit(node : Crystal::Next)
visit(node : Crystal::And)
visit(node : Crystal::Or)
visit(node : Crystal::Not)
visit(node : Crystal::Var)
visit(node : Crystal::Path)
visit(node : Crystal::NumberLiteral)
visit(node : Crystal::BoolLiteral)
visit(node : Crystal::StringLiteral)
visit(node : Crystal::RangeLiteral)
visit(node : Crystal::Call)
visit(node : Crystal::ASTNode) visit
Constructor methods inherited from class CrShader::BaseVisitor
new(io : IO, target : ShaderTarget, symbol_table : SymbolTable)
new
Constructor Detail
def self.new(io : IO, program : ShaderProgram, filename : String | Nil = nil, symbol_table : SymbolTable = SymbolTable.new(ShaderTarget::GDShaderInc))
#
Instance Method Detail
def emit(helper_functions : Array(Crystal::Def) = [] of Crystal::Def, reachable_identifiers : Set(String) | Nil = nil)
#