shader-edsl-core

Construct stage-agnostic GPU shader expressions via a Rust typed EDSL targeting WGSL-like output.

74|5|Updated Dec 13, 2019
One-click install
npx skills add https://github.com/mikialex/rendiation --skill shader-edsl-core
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: shader-edsl-core
Source: https://github.com/mikialex/rendiation/tree/main/.claude/skills/shader-edsl-core
Command: npx skills add https://github.com/mikialex/rendiation --skill shader-edsl-core

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

It eliminates the guesswork of authoring GPU shader code by providing a stage-agnostic, typed Rust EDSL that compiles to WGSL-like output, ensuring correct composition of expressions, structs, memory layout, and GPU-side operations.

Core Features & Use Cases

  • Typed shader values with Node<T>: Build constants, arithmetic, comparisons, and selection logic in a type-safe way using Node<T> handles.
  • Memory-safe struct modeling and layout rules: Define shader structs via ShaderStruct, access them as ENode, and control buffer layouts with std140_layout and std430_layout (including common pitfalls like Bool field handling and mat3/array padding).
  • Shader control flow and GPU-side iteration primitives: Express if/else chains, switch/case, loops, returns, and GPU iteration over buffer-backed collections using into_shader_iter adaptors.
  • GPU-side systems building blocks: Support texture sampling and texel load/store, atomics through pointer views, subgroup operations (reduce/scan/collectives), and reusable GPU functions via #[shader_fn].
  • Math and data construction utilities: Provide a rich Node<T> method surface for vector/matrix ops, conversions, swizzles, and screen-space derivatives for shader authoring.

Quick Start

Use the shader-edsl-core skill to define and manipulate a stage-agnostic shader expression graph for your material or lighting logic (for example, sampling textures, constructing vectors/matrices, and composing it into GPU-executable functions).

Frequently Asked Questions about shader-edsl-core

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I write type-safe GPU shaders in Rust that compile to WGSL?

Use a Rust typed EDSL to construct stage-agnostic GPU shader expressions with Node<T> primitives, compiling to WGSL-like output via a naga backend for type-safe shader authoring.

How do I define shader structs in Rust with correct std140 and std430 memory layouts?

Derive shader structs with ShaderStruct and access them as ENode field accesses, enforcing correct std140 and std430 buffer layouts to handle array padding and mat3 alignment pitfalls.

Can I perform GPU-side iteration over buffer-backed collections in WGSL?

Use into_shader_iter adaptors to iterate over buffer-backed collections on the GPU, expressing loops and control flow directly within the Rust typed shader EDSL.

How do I handle subgroup operations and atomics in a Rust GPU shader?

Use provided subgroup collective primitives for reduce and scan operations, and perform atomic operations through pointer views within the Rust typed shader EDSL.

Does this Rust shader EDSL support texture sampling and texel load/store operations?

The Rust shader EDSL provides texture primitives for sampling and texel load/store operations, enabling screen-space derivatives and texel manipulation without leaking stage-specific integration concerns.

What is the best way to compose reusable GPU functions in Rust without leaking stage-specific integration concerns?

Annotate shader logic with #[shader_fn] and use provided control-flow, texture, and subgroup primitives within the typed EDSL to maintain stage-agnostic construction of reusable GPU functions.