Agent skill

Agfx Render Targets And Passes

by AmelieHeinrich in AmelieHeinrich/agfx

ALWAYS use when creating agfxRenderTarget or agfxRenderPass objects in AGFX, or wiring up color/depth attachments, load/store ops, viewport/scissor, or draw calls within a render pass.

MITAuto-check passedGame Development

Install Agfx Render Targets And Passes

skills CLI
$ npx skills add AmelieHeinrich/agfx --skill agfx-render-targets-and-passes -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install AmelieHeinrich/agfx agfx-render-targets-and-passes --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/AmelieHeinrich/agfx.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.claude/skills/agfx-render-targets-and-passes .claude/skills/agfx-render-targets-and-passes && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
agfx-render-targets-and-passes
GitHub stars
146
Token cost
~2.1k tokens
SKILL.md length
626 words
Files
1
Skills in repo
8
Repo updated
First seen
Licence
MIT

At a glance

ALWAYS use when creating agfxRenderTarget or agfxRenderPass objects in AGFX, or wiring up color/depth attachments, load/store ops, viewport/scissor, or draw calls within a render pass.

  • Creating agfxRenderTarget
  • SKILL.md covers Overview, Ownership, References and Design Patterns
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md
  • AgfxRenderPass objects in AGFX

What it does

Agfx Render Targets And Passes is an agent skill from AmelieHeinrich/agfx. ALWAYS use when creating agfxRenderTarget or agfxRenderPass objects in AGFX, or wiring up color/depth attachments, load/store ops, viewport/scissor, or draw calls within a render pass. Trigger for agfxRenderTargetCreate, agfxRenderPassBegin/End, agfxRenderPassAttachment, AGFXLOADOPERATION, AGFXSTOREOPERATION, agfxRenderPassSetViewport/SetScissor, agfxRenderPassDraw/DrawIndexed/DrawMesh, GBuffer/HDR/depth target setup, "wrong render target format", "render pass validation error". Do NOT trigger for swap chain…

Its SKILL.md is about 2.1k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in Game Development. The licence is MIT.

When your agent uses it

  • Creating agfxRenderTarget
  • AgfxRenderPass objects in AGFX
  • Wiring up color/depth attachments
  • Viewport/scissor

Example prompts

  • “wrong render target format”
  • “render pass validation error”
  • “Use the agfx-render-targets-and-passes skill to alway use when creating agfxRenderTarget or agfxRenderPass objects in AGFX, or wiring up color/depth…”
  • “/agfx-render-targets-and-passes”

What it can do on your machine

Read from SKILL.md and the folder at commit d8ad38b. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md (its code samples are cpp).

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Agfx Render Targets And Passes loads about 2.1k tokens when it runs. Until then it costs about 189 tokens; SKILL.md has 626 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~189
When it runs · the whole SKILL.md, loaded when a task matches
~2.1k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from AmelieHeinrich/agfx at commit d8ad38b, republished under its MIT licence (© AmelieHeinrich). 626 words, ~2,067 tokens.

Download SKILL.mdSave it as .claude/skills/agfx-render-targets-and-passes/SKILL.md (or your agent's skills folder).
name
agfx-render-targets-and-passes
description
ALWAYS use when creating agfxRenderTarget or agfxRenderPass objects in AGFX, or wiring up color/depth attachments, load/store ops, viewport/scissor, or draw calls within a render pass. Trigger for agfxRenderTargetCreate, agfxRenderPassBegin/End, agfxRenderPassAttachment, AGFX_LOAD_OPERATION_*, AGFX_STORE_OPERATION_*, agfxRenderPassSetViewport/SetScissor, agfxRenderPassDraw/DrawIndexed/DrawMesh, GBuffer/HDR/depth target setup, "wrong render target format", "render pass validation error". Do NOT trigger for swap chain acquire/present or CAMetalLayer-equivalent presentation — use agfx-presentation-and-swapchain. Do NOT trigger for fences, frames-in-flight, or barrier agglomeration semantics — use agfx-synchronization.

AGFX Render Targets & Render Passes

Overview

AGFX render targets and render passes mirror the way Metal 4, D3D12, and Vulkan dynamic rendering all express "attachment then pass", flattened behind one API. An agfxRenderTarget is a thin, cheap-to-create wrapper around a texture (or texture subresource) that tells the backend how to attach it — as a color or depth-stencil target, at a given mip/layer. An agfxRenderPass is the actual encoding scope: it groups up to 8 color attachments and one optional depth attachment, and every draw call in AGFX must happen inside one.

Render targets are intentionally lightweight: create one right before agfxRenderPassBegin and destroy it right after agfxRenderPassEnd. Don't cache them across frames — cache the underlying agfxTexture instead and re-wrap it each pass (see deferred_renderer.cpp for the GBuffer/HDR/depth targets recreated only on resize, but their agfxRenderTarget wrappers created per-pass).

Ownership

Owns:

  • agfxRenderTargetCreateInfo / agfxRenderTargetCreate / agfxRenderTargetDestroy
  • agfxRenderPassCreateInfo / agfxRenderPassBegin / agfxRenderPassEnd
  • Color/depth attachment wiring, agfxLoadOp / agfxStoreOp, clear colors
  • Viewport/scissor state (agfxRenderPassSetViewport, agfxRenderPassSetScissor)
  • Draw calls within a pass (agfxRenderPassDraw, agfxRenderPassDrawIndexed, agfxRenderPassDrawMesh) and push constants
  • Render pipeline attachment-format matching (colorFormats[] / depthFormat in agfxRenderPipelineCreateInfo must match the pass it's used with)

Doesn't own:

  • Swap chain back buffer acquisition/present, HDR toggling → agfx-presentation-and-swapchain
  • Resource state barrier semantics, agglomeration, fences, frame pacing → agfx-synchronization
  • Compute/copy passes (agfxComputePass*) — those are a separate pass type for compute dispatch and copies, not covered here
  • GPU-driven replay inside a pass (agfxRenderPassExecuteIndirectBundle) and everything feeding it → agfx-mdi; the pass setup around it is ordinary and covered here, but the bundle itself, its barriers, and the supportsIndirect pipeline flag are not
  • Mesh-shader pipeline setup behind agfxRenderPassDrawMesh (meshShader/taskShader, the reflected group sizes) → agfx-writing-bindless-shaders

References

Read agfx/agfx.h before writing render-target/pass code — it's the single source of truth for every struct field and enum value in this API (search for // Render target and // Render pass section markers). agfx_demo/deferred_renderer.cpp and agfx_demo/agfx_demo_main.cpp show real per-frame usage: GBuffer, SSAO, shadow map, lighting, and backbuffer passes.

Design Patterns

Creating a render target from a texture
cpp
agfxRenderTargetCreateInfo rtCreateInfo = {};
rtCreateInfo.texture = colorTexture;                 // must have AGFX_TEXTURE_USAGE_COLOR_ATTACHMENT
rtCreateInfo.format = AGFX_TEXTURE_FORMAT_UNKNOWN;    // inherit the texture's own format
rtCreateInfo.mipLevel = 0;
rtCreateInfo.arrayLayer = 0;
rtCreateInfo.isDepth = false;
agfxRenderTarget* colorRT = agfxRenderTargetCreate(device, &rtCreateInfo);

// Depth target
agfxRenderTargetCreateInfo depthRtCreateInfo = {};
depthRtCreateInfo.texture = depthTexture;             // must have AGFX_TEXTURE_USAGE_DEPTH_STENCIL_ATTACHMENT
depthRtCreateInfo.isDepth = true;
agfxRenderTarget* depthRT = agfxRenderTargetCreate(device, &depthRtCreateInfo);

AGFX_TEXTURE_FORMAT_UNKNOWN is the correct choice whenever the render target wraps a texture whose format is already fixed (e.g. a swap chain back buffer, queried via agfxSwapChainGetFormat) — don't hardcode the format in that case, it can silently mismatch on an HDR toggle.

Show full SKILL.md (265 more words)Show less
Required state before the pass begins

Every color attachment's underlying texture must already be in AGFX_RESOURCE_STATE_RENDER_TARGET, and every depth attachment's texture in AGFX_RESOURCE_STATE_DEPTH_WRITE, before calling agfxRenderPassBegin. Barrier into that state first:

cpp
agfxCommandBufferTextureBarrier(cmd, colorTexture, AGFX_RESOURCE_STATE_PIXEL_SHADER_RESOURCE, AGFX_RESOURCE_STATE_RENDER_TARGET, 0, 0, /*agglomerate=*/true);

See agfx-synchronization for the agglomerate flag's semantics (ignored on D3D12/Vulkan, load-bearing on Metal) — get this wrong and you'll get correct D3D12/Vulkan output with garbage or validation errors on Metal.

Beginning a render pass with multiple attachments
cpp
agfxRenderPassCreateInfo passInfo = {};
passInfo.colorAttachmentCount = 1;
passInfo.colorAttachments[0].renderTarget = colorRT;
passInfo.colorAttachments[0].loadOp = AGFX_LOAD_OPERATION_CLEAR;
passInfo.colorAttachments[0].storeOp = AGFX_STORE_OPERATION_STORE;
passInfo.colorAttachments[0].clearColor[0] = 0.05f;
passInfo.colorAttachments[0].clearColor[1] = 0.05f;
passInfo.colorAttachments[0].clearColor[2] = 0.1f;
passInfo.colorAttachments[0].clearColor[3] = 1.0f;

passInfo.hasDepthAttachment = true;
passInfo.depthAttachment.renderTarget = depthRT;
passInfo.depthAttachment.loadOp = AGFX_LOAD_OPERATION_CLEAR;
passInfo.depthAttachment.storeOp = AGFX_STORE_OPERATION_DONT_CARE; // transient depth, not read afterwards

passInfo.width = width;
passInfo.height = height;
passInfo.name = "GBuffer";

agfxRenderPass* pass = agfxRenderPassBegin(cmd, &passInfo);
agfxRenderPassSetViewport(pass, 0, 0, (float)width, (float)height, 0.0f, 1.0f);
agfxRenderPassSetScissor(pass, 0, 0, width, height);
agfxRenderPassSetPipeline(pass, pipeline);
agfxRenderPassPushConstants(pass, &pushData, sizeof(pushData));
agfxRenderPassDrawIndexed(pass, indexBuffer, indexCount, 1, 0, 0, 0);
agfxRenderPassEnd(pass);

agfxRenderTargetDestroy(device, colorRT);
agfxRenderTargetDestroy(device, depthRT);
Load/store op choices
  • AGFX_LOAD_OPERATION_CLEAR + AGFX_STORE_OPERATION_STORE — standard color/depth attachment that's cleared then read later (e.g. GBuffer albedo, depth used for SSAO)
  • AGFX_LOAD_OPERATION_DONT_CARE + AGFX_STORE_OPERATION_STORE — every pixel will be fully overwritten this pass and the result is needed afterwards; skip the clear cost
  • AGFX_LOAD_OPERATION_LOAD + AGFX_STORE_OPERATION_STORE — accumulating into an attachment across multiple passes without a full clear (e.g. compositing UI on top of tonemapped output)
  • Any load op + AGFX_STORE_OPERATION_DONT_CARE — transient attachment discarded at pass end (e.g. an MSAA resolve source, or depth that's only used within the pass and never sampled afterward)
Pipeline/pass format matching

agfxRenderPipelineCreateInfo::colorFormats[]/colorAttachmentCount and depthFormat must match the actual formats of the render pass's attachments the pipeline is bound in. When a pass renders to the swap chain back buffer and the app supports toggling HDR (see agfx-presentation-and-swapchain), the pipeline bound in that pass must be recreated whenever the back buffer format changes — agfx_demo_main.cpp's RecreateTonemapPipeline on the HDR toggle is the reference pattern.

Mesh-shading vs classic draws

A pipeline is either classic (vertexShader/fragmentShader, drawn with agfxRenderPassDraw/agfxRenderPassDrawIndexed) or mesh-shading (meshShader, optional taskShader, drawn with agfxRenderPassDrawMesh). Don't mix: calling agfxRenderPassDrawMesh with a classic pipeline bound (or vice versa) is undefined — match the draw call to how the bound pipeline was created.

© AmelieHeinrich, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in .claude/skills/agfx-render-targets-and-passes of AmelieHeinrich/agfx.

Open the folder on GitHubat commit d8ad38b

Compare with similar skills

Agfx Render Targets And Passes next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Agfx Render Targets And Passes compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Agfx Render Targets And Passes this skillAmelieHeinrich/agfx146—~2.1kAutomated safety check: PassMIT
Image to Three.js Modelimg2threejs/img2threejs18k1 repos~8.2kAutomated safety check: PassApache-2.0
Web CloneJane-xiaoer/claude-skill-web-clone1k1 repos~2.7kAutomated safety check: PassMIT
Threejs Game Directormajidmanzarpour/threejs-game-skills2.5k—~2.2kAutomated safety check: PassMIT
Game Asset Generatorhtdt/godogen7.1k—~2.8kAutomated safety check: PassMIT
Threejs Gameplay Systemsvalkor-ai/loom1.2k1 repos~1.4kAutomated safety check: PassApache-2.0

Similar skills

  • Image to Three.js Model

    img2threejs/img2threejs

    Rebuilds the object in a reference image as a procedural, animation-ready Three.js model written entirely in code, using staged sculpting with quality checks.

    18k GitHub starsUsed in 1 repo~8.2k tokens
    Game DevelopmentAuto-check passed
  • Web Clone

    Jane-xiaoer/claude-skill-web-clone

    网站复刻 / 克隆方法论。USE WHEN 用户说 复刻网站、克隆网站、clone website、抄个站、仿站、 照着这个站做一个、reproduce site、还原某个网页效果、把这个站搬下来改成我的、 复刻某个交互/WebGL/Canvas/Three.js 效果。提供「先拿真源码 → 判路径 → 逆向拆解 → 搭工程 → 替换内容」的可移植决策树,覆盖静态站 /…

    1k GitHub starsUsed in 1 repo~2.7k tokens
    Game DevelopmentAuto-check passed
  • Threejs Game Director

    majidmanzarpour/threejs-game-skills

    Entrypoint for building, upgrading, and finishing Three.js browser games.

    2.5k GitHub stars~2.2k tokensUpdated 13 days ago
    Game DevelopmentAuto-check passed
  • Generates game art from text prompts: PNG images, GLB 3D models, rigged characters, animations and sprites, with background removal.

    7.1k GitHub stars~2.8k tokensUpdated 9 days ago
    Game DevelopmentAuto-check passed
  • Build and iterate playable Three.js game systems: starter scaffold, architecture, design briefs, core loops, level and encounter design, entities, input, camera, collision and physics, scoring…

    1.2k GitHub starsUsed in 1 repo~1.4k tokens
    Game DevelopmentAuto-check passed
  • Uloop Execute Dynamic Code

    CyberAgentGameEntertainment/NovaShader

    Execute C with Unity APIs when existing uloop tools cannot inspect or edit enough.

    1.6k GitHub starsUsed in 1 repo~1.9k tokens
    Game DevelopmentAuto-check passed

More from AmelieHeinrich/agfx

All 8 skills in this repo
  • Agfx Porting From D3d11

    AmelieHeinrich/agfx

    ALWAYS use when porting an existing D3D11 engine or renderer to AGFX — translating ID3D11Device/DeviceContext/InputLayout/state-object code to agfxDevice/agfxCommandBuffer/agfxRenderPipeline calls…

    146 GitHub stars~3.6k tokensUpdated 13 days ago
    Auto-check passed
  • Agfx Porting From D3d12

    AmelieHeinrich/agfx

    ALWAYS use when porting an existing D3D12 engine or renderer to AGFX — translating ID3D12Device/CommandList/PipelineState/RootSignature/DescriptorHeap code to…

    146 GitHub stars~3.4k tokensUpdated 13 days ago
    Auto-check passed
  • Agfx Porting From Opengl

    AmelieHeinrich/agfx

    ALWAYS use when porting an existing OpenGL (or OpenGL ES) engine or renderer to AGFX — translating glGenTextures/glBindTexture/glBufferData/glUseProgram/FBO code to…

    146 GitHub stars~3.8k tokensUpdated 13 days ago
    Auto-check passed
  • Agfx Porting From Vulkan

    AmelieHeinrich/agfx

    ALWAYS use when porting an existing Vulkan engine or renderer to AGFX — translating VkDevice/VkCommandBuffer/VkPipeline/VkDescriptorSet/VkRenderPass code to…

    146 GitHub stars~4.4k tokensUpdated 13 days ago
    Auto-check passed
  • ALWAYS use when creating, resizing, or presenting through an agfxSwapChain in AGFX — window/layer handle setup, HDR toggling, vsync, resize handling, or back buffer acquire/present.

    146 GitHub stars~2k tokensUpdated 13 days ago
    Auto-check passed
  • Agfx Synchronization

    AmelieHeinrich/agfx

    ALWAYS use when working with AGFX fences, frames-in-flight pacing, queue signal/wait, resource-state barriers, or the barrier "agglomerate" flag.

    146 GitHub stars~3.6k tokensUpdated 13 days ago
    Auto-check passed

Questions about Agfx Render Targets And Passes

What does Agfx Render Targets And Passes do?

ALWAYS use when creating agfxRenderTarget or agfxRenderPass objects in AGFX, or wiring up color/depth attachments, load/store ops, viewport/scissor, or draw calls within a render pass. Agfx Render Targets And Passes is an agent skill from AmelieHeinrich/agfx. ALWAYS use when creating agfxRenderTarget or agfxRenderPass objects in AGFX, or wiring up color/depth attachments, load/store ops, viewport/scissor, or draw calls within a render pass.

When should I use Agfx Render Targets And Passes?

Agfx Render Targets And Passes fits situations like: creating agfxRenderTarget; agfxRenderPass objects in AGFX; wiring up color/depth attachments; viewport/scissor.

How do I install Agfx Render Targets And Passes in Claude Code?

Run `npx skills add AmelieHeinrich/agfx --skill agfx-render-targets-and-passes -a claude-code`. Or copy the skill folder (.claude/skills/agfx-render-targets-and-passes in AmelieHeinrich/agfx) into .claude/skills/agfx-render-targets-and-passes in your project. Claude Code loads it when a task matches its description.

How do I install Agfx Render Targets And Passes in Codex?

Run `npx skills add AmelieHeinrich/agfx --skill agfx-render-targets-and-passes -a codex`. Or copy the skill folder (.claude/skills/agfx-render-targets-and-passes in AmelieHeinrich/agfx) into .agents/skills/agfx-render-targets-and-passes in your project. Codex loads it when a task matches its description.

Can I use Agfx Render Targets And Passes in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add AmelieHeinrich/agfx --skill agfx-render-targets-and-passes -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/agfx-render-targets-and-passes, .gemini/skills/agfx-render-targets-and-passes, .github/skills/agfx-render-targets-and-passes and .opencode/skills/agfx-render-targets-and-passes in your project.

What does Agfx Render Targets And Passes need to run?

SKILL.md names no scripts, command-line tools or credentials: Agfx Render Targets And Passes is instructions for the agent only.

Does Agfx Render Targets And Passes access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Agfx Render Targets And Passes safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Agfx Render Targets And Passes use?

Agfx Render Targets And Passes is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Agfx Render Targets And Passes use?

About 2.1k tokens (SKILL.md is roughly 8.3k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Agfx Render Targets And Passes?

Skills that share tags, products or a category with Agfx Render Targets And Passes: Image to Three.js Model (img2threejs/img2threejs, 18k stars), Web Clone (Jane-xiaoer/claude-skill-web-clone, 1k stars), Threejs Game Director (majidmanzarpour/threejs-game-skills, 2.5k stars) and Game Asset Generator (htdt/godogen, 7.1k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Agfx Render Targets And Passes?

AmelieHeinrich (a GitHub user) maintains it in AmelieHeinrich/agfx, which has 146 GitHub stars. The repository holds 8 skills in this directory. The repository was last updated on September 27, 2026.

Source: AmelieHeinrich/agfx on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.