fundamental-gpu-component-model

Define composable GPU components with safe pipeline caching and resource binding.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

It solves the problem of defining renderable GPU entities that reliably compile the right pipeline, bind the right resources, and dispatch draw calls without cache corruption or WGPU validation errors.

Core Features & Use Cases

  • Auto-renderability via super-traits: Implement ShaderHashProvider, GraphicsShaderProvider, and ShaderPassBuilder to get an auto-implemented RenderComponent render path.
  • Deterministic pipeline caching: Use hash_type_info and a correctness-focused hash_pipeline to ensure pipeline cache keys match shader generation and fixed-function state.
  • Onion/middleware composition: Use RenderSlice-style forward (setup_pass) and reverse (post_setup_pass) ordering to compose effects cleanly.
  • Binding contract safety: Ensure setup_pass/post_setup_pass binding declarations exactly match build/post_build binding order and types.

Quick Start

Implement the three super-traits for your component type, make hash_pipeline cover every shader-generation and fixed-function pipeline input, then use your type as a render component in a pass so it binds resources and dispatches draws correctly.

Frequently Asked Questions about fundamental-gpu-component-model

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

FAQPage Schema
How do I cache WebGPU render pipelines safely without WGPU validation errors?

To cache WebGPU render pipelines safely, implement a deterministic hash that exhaustively covers shader generation and fixed-function pipeline state. This ensures pipeline cache keys match the generated shaders and binding layouts, preventing cache corruption and WGPU validation errors across frames.

What's the best way to compose WebGPU render effects with middleware ordering?

Composing WebGPU render effects uses a RenderSlice-style onion model with forward setup_pass and reverse post_setup_pass ordering. This middleware approach cleanly layers binding setup and post-processing effects while maintaining correct render dispatch sequence.

Why does my WebGPU shader binding layout mismatch during incremental rendering?

WebGPU shader binding layout mismatches occur when setup_pass and post_setup_pass binding declarations do not exactly match the build and post_build binding order and types. Enforcing a strict binding contract between shader stage registration and pass binding setup resolves the mismatch.

How do I make a custom WebGPU render component auto-derive draw dispatch behavior?

To make a WebGPU render component auto-derive draw dispatch behavior, implement the ShaderHashProvider, GraphicsShaderProvider, and ShaderPassBuilder super-traits. This automatically generates the RenderComponent trait, handling pipeline lookup, setup, and draw dispatch without manual implementation.

Does WebGPU pipeline caching require hashing all fixed-function state inputs?

Yes, WebGPU pipeline caching requires hashing all fixed-function state inputs. The hash_pipeline implementation must exhaustively cover every shader-generation input and fixed-function pipeline state to ensure deterministic cache keys and prevent pipeline lookup mismatches.

When do I need to implement ShaderHashProvider for WebGPU shader composition?

You need to implement ShaderHashProvider for WebGPU shader composition when building renderable GPU entities that require deterministic pipeline caching. It provides the hash_type_info and exhaustive hash_pipeline coverage needed to ensure pipeline cache keys match shader generation and fixed-function state.