forge-uniforms-and-motion

Push per-frame uniform data from CPU to GPU shaders with SDL3.

36|6|Updated Mar 25, 2026
One-click install
npx skills add https://github.com/Nebulavenus/forge-gpu --skill forge-uniforms-and-motion-nebulavenus
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: forge-uniforms-and-motion
Source: https://github.com/Nebulavenus/forge-gpu/tree/main/.claude/skills/forge-uniforms-and-motion
Command: npx skills add https://github.com/Nebulavenus/forge-gpu --skill forge-uniforms-and-motion-nebulavenus

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Pass per-frame data from CPU to GPU shaders using SDL3 GPU's push uniform API.

Core Features & Use Cases

  • Push uniforms vs GPU uniform buffers: choose the right mechanism for small, frequently changing data.
  • Uniform data struct & shader mapping: define a CPU struct that matches the shader's cbuffer layout and ensure proper std140 alignment.
  • Per-frame pushing: update data on the command buffer before the render pass to update time, matrices, and colors each frame.

Quick Start

Initialize the per-frame Uniforms struct and push it to the GPU before starting 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 push per-frame data to GPU shaders using SDL3 GPU?

To push per-frame data to GPU shaders using SDL3 GPU, define a CPU-side Uniforms struct aligned to std140 layout and call SDL_PushGPUVertexUniformData or SDL_PushGPUFragmentUniformData before beginning your render pass. This updates dynamic parameters like time and matrices.

When should I use push uniforms instead of uniform buffers in SDL3?

Use push uniforms instead of uniform buffers in SDL3 for small, frequently changing per-frame data. Push uniforms are ideal for dynamic parameters like time-based shader effects and animations, whereas uniform buffers suit larger datasets.

Does SDL3 GPU push uniform data require std140 alignment?

Yes, SDL3 GPU push uniform data requires std140 alignment. You must define your CPU-side Uniforms struct to match the shader's cbuffer layout exactly, ensuring proper memory alignment before pushing the data to the vertex or fragment stages.

Can I update shader time and matrices dynamically before SDL_BeginGPURenderPass?

Yes, you can update shader time and matrices dynamically before SDL_BeginGPURenderPass. By calling SDL_PushGPUVertexUniformData or SDL_PushGPUFragmentUniformData on the command buffer, you pass per-frame data like time and colors directly to the GPU shaders.

What is the best way to pass dynamic parameters to vertex and fragment stages in SDL3?

The best way to pass dynamic parameters to vertex and fragment stages in SDL3 is using push uniforms. Define a matching Uniforms struct, apply std140 alignment, and push the data via SDL_PushGPUVertexUniformData and SDL_PushGPUFragmentUniformData before rendering.