forge-uniforms-and-motion

Push per-frame uniform data to SDL3 GPU shaders with std140 layout.

Updated Mar 17, 2026
One-click install
npx skills add https://github.com/code-review-benchmark/coderabbit_prs2__forge-gpu__coderabbit__PR323__20260317 --skill forge-uniforms-and-motion
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: forge-uniforms-and-motion
Source: https://github.com/code-review-benchmark/coderabbit_prs2__forge-gpu__coderabbit__PR323__20260317/tree/main/.claude/skills/forge-uniforms-and-motion
Command: npx skills add https://github.com/code-review-benchmark/coderabbit_prs2__forge-gpu__coderabbit__PR323__20260317 --skill forge-uniforms-and-motion

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Pass per-frame data to GPU shaders using push uniforms. This approach is ideal for small, frequently changing data like time, aspect ratio, and simple matrices that drive per-frame animation.

Core Features & Use Cases

  • Distinguishes push uniforms from GPU uniform buffers to select the right data path
  • Defines a per-frame Uniforms struct with proper std140 alignment to match shader cbuffers
  • Maps uniform slots to HLSL registers and pushes data before rendering
  • Supports time-based animation, dynamic colors, and simple transform parameters

Quick Start

Define a per-frame Uniforms struct with time and aspect, populate it each frame, and push it with SDL_PushGPUVertexUniformData before beginning the render pass.

Frequently Asked Questions about forge-uniforms-and-motion

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

FAQPage Schema
How do I pass per-frame data to GPU shaders in SDL3?▼

Pass per-frame data to GPU shaders in SDL3 by defining a Uniforms struct with std140 layout and calling SDL_PushGPUVertexUniformData before you begin the render pass. This efficiently updates time, aspect ratio, and matrices.

What is the difference between push uniforms and GPU uniform buffers?▼

Push uniforms are ideal for small, frequently changing data like time or simple matrices, whereas GPU uniform buffers handle larger per-frame data sets. Push uniforms map directly to HLSL registers for quick shader parameter updates.

Why do my SDL3 shader uniforms have mismatched alignment?▼

SDL3 shader uniform alignment mismatches occur when your C++ Uniforms struct does not follow std140 layout rules. Defining the per-frame struct with proper std140 alignment ensures it correctly matches shader cbuffers.

When should I use SDL_PushGPUVertexUniformData for time-based animation?▼

Use SDL_PushGPUVertexUniformData for time-based animation when you need to update small, dynamic shader parameters each frame. Populate the struct with elapsed time and push it prior to calling SDL_BeginGPURenderPass.

Can I use push uniforms for dynamic colors and transform parameters?▼

Yes, push uniforms support time-based animation, dynamic colors, and simple transform parameters. You populate a per-frame Uniforms struct on the CPU and push the data to the GPU before rendering to drive these visual changes.

Does SDL3 GPU support mapping uniform slots to HLSL registers?▼

Yes, SDL3 GPU supports mapping uniform slots to HLSL registers. This mechanism allows you to push per-frame shader data efficiently and ensures the GPU correctly receives your dynamic transformation matrices and parameters.