Raxol.Terminal.Renderer.GPURenderer (Raxol v2.0.1)

View Source

GPU-accelerated terminal renderer.

This module provides hardware-accelerated rendering capabilities for the terminal, utilizing the GPU for improved performance. It includes:

  • Hardware-accelerated text rendering
  • GPU-based buffer management
  • Optimized render pipeline
  • Performance monitoring and optimization

Features

  • GPU-accelerated text rendering
  • Hardware-accelerated buffer management
  • Efficient render pipeline
  • Performance optimization
  • Memory management
  • Resource pooling

Summary

Functions

Gets the current performance metrics.

Optimizes the render pipeline based on current performance metrics.

Renders the screen buffer using GPU acceleration.

Updates the render pipeline configuration.

Types

t()

@type t() :: %Raxol.Terminal.Renderer.GPURenderer{
  buffer_pool: map(),
  gpu_context: map(),
  performance_metrics: map(),
  render_pipeline: map(),
  renderer: Raxol.Terminal.Renderer.t()
}

Functions

get_performance_metrics(gpu_renderer)

@spec get_performance_metrics(t()) :: map()

Gets the current performance metrics.

Parameters

  • gpu_renderer - The GPU renderer instance

Returns

Map containing performance metrics

new(renderer, opts \\ [])

@spec new(
  Raxol.Terminal.Renderer.t(),
  keyword()
) :: t()

optimize_pipeline(gpu_renderer)

@spec optimize_pipeline(t()) :: t()

Optimizes the render pipeline based on current performance metrics.

Parameters

  • gpu_renderer - The GPU renderer instance

Returns

Updated GPU renderer instance with optimized pipeline

render(gpu_renderer, opts \\ [])

@spec render(
  t(),
  keyword()
) :: {String.t(), t()}

Renders the screen buffer using GPU acceleration.

Parameters

  • gpu_renderer - The GPU renderer instance
  • opts - Rendering options

Returns

Tuple containing {output, updated_gpu_renderer}

update_pipeline(gpu_renderer, config)

@spec update_pipeline(t(), map()) :: t()

Updates the render pipeline configuration.

Parameters

  • gpu_renderer - The GPU renderer instance
  • config - The new pipeline configuration

Returns

Updated GPU renderer instance