dce

package
v0.3.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 28, 2025 License: CC0-1.0 Imports: 1 Imported by: 0

Documentation

Overview

Package dce implements dead code elimination for WGSL modules.

DCE works by: 1. Finding entry points (@vertex, @fragment, @compute functions) 2. Building a dependency graph of symbol references 3. Marking all symbols reachable from entry points as "live" 4. Filtering out declarations for non-live symbols during printing

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsDeclarationLive

func IsDeclarationLive(decl ast.Decl, symbols []ast.Symbol) bool

IsDeclarationLive returns true if the declaration should be included in output.

func Mark

func Mark(module *ast.Module) int

Mark performs dead code elimination on the module. It marks all symbols reachable from entry points with the IsLive flag. Returns the number of symbols marked as dead (not live).

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL