Class: RLSL::Prism::Emitters::WGSLEmitter

Inherits:
TargetEmitter show all
Defined in:
lib/rlsl/prism/emitters/wgsl_emitter.rb

Constant Summary collapse

PROFILE =
TargetProfile.new(
  type_map: {
    float: "f32",
    int: "i32",
    bool: "bool",
    vec2: "vec2<f32>",
    vec3: "vec3<f32>",
    vec4: "vec4<f32>",
    mat2: "mat2x2<f32>",
    mat3: "mat3x3<f32>",
    mat4: "mat4x4<f32>",
    sampler2D: "texture_2d<f32>"
  },
  vector_constructors: {
    vec2: "vec2<f32>",
    vec3: "vec3<f32>",
    vec4: "vec4<f32>"
  },
  matrix_constructors: {
    mat2: "mat2x2<f32>",
    mat3: "mat3x3<f32>",
    mat4: "mat4x4<f32>"
  },
  texture_functions: {
    texture2D: "textureSample",
    texture: "textureSample",
    textureLod: "textureSampleLevel"
  },
  default_type_name: "f32"
).freeze

Constants inherited from BaseEmitter

BaseEmitter::MULTILINE_NODES, BaseEmitter::PRECEDENCE

Instance Attribute Summary

Attributes inherited from BaseEmitter

#indent_level

Method Summary

Methods inherited from BaseEmitter

#emit, #initialize

Methods included from BaseEmitter::StatementEmission

#emit_block, #emit_branch, #emit_indented_block, #emit_statement, #emit_statements, #emit_terminal_statement

Methods included from BaseEmitter::DefinitionEmission

#current_return_struct_name, #emit_array_literal, #emit_for_static_init, #emit_global_decl, #emit_multiple_assignment

Methods included from BaseEmitter::ExpressionEmission

#emit_array_index, #emit_assignment, #emit_binary_op, #emit_bool_literal, #emit_constant, #emit_field_access, #emit_func_call, #emit_literal, #emit_parenthesized, #emit_swizzle, #emit_unary_op, #emit_var_ref

Methods included from BaseEmitter::ControlFlowEmission

#elsif_node?, #emit_break, #emit_conditional, #emit_elsif, #emit_if_statement, #emit_return, #emit_tuple_return, #emit_while_loop

Constructor Details

This class inherits a constructor from RLSL::Prism::Emitters::BaseEmitter