Logo de Forge Vertex Pulling

Forge Vertex Pulling

Comunidade
Nebulavenus
forge-vertex-pulling

Add vertex pulling (programmable vertex fetch) to an SDL GPU project. Replace fixed-function vertex input with storage buffer reads in the vertex shader using SV_VertexID and StructuredBuffer.

Visão geral

Publicado porNebulavenus
Repositórioforge-gpu
Nome da habilidadeforge-vertex-pulling
Estrelas
46
Forks
7
Arquivos incluídos
Somente instruções
LicençaZlib
Links
  • Instruções em Markdown

    Um arquivo SKILL.md que o modelo carrega sob demanda, consumindo tokens apenas quando uma solicitação é realmente relevante para a habilidade.

  • Funciona com qualquer LLM

    As habilidades de IA são escritas em Markdown simples, não em código específico de um provedor. Por isso, funcionam com GPT, Claude, Gemini, Grok ou um modelo local.

  • Sem arquivos extras

    Tudo de que o modelo precisa está nas instruções — sem arquivos extras para sincronizar.

  • Código aberto

    Publicada por Nebulavenus no GitHub. Leia os arquivos da habilidade antes de instalá-la.

Instalação

Instale a habilidade de IA Forge Vertex Pulling no TypingMind para usá-la com qualquer LLM ou adicione-a a outro agente que leia SKILL.md.

1

Instalar no TypingMind

O TypingMind instala uma habilidade diretamente da pasta dela no GitHub — lê o arquivo SKILL.md, reúne os arquivos de recursos em um pacote e armazena o resultado localmente.

  1. Abra o app e vá para Plugins → Habilidades.
  2. Escolha "Instalar do GitHub".
  3. Cole a URL abaixo, que aponta para a pasta da habilidade, e confirme.
    https://github.com/Nebulavenus/forge-gpu/tree/main/.claude/skills/forge-vertex-pulling
  4. Ative a habilidade em cada chat em que quiser disponibilizá-la.
Plugins → Habilidades → Adicionar habilidade → Via URL do GitHub. Depois, cole a URL da pasta e pressione Continuar.
2

Instalar em outro agente

Qualquer agente que leia o formato Agent Skills pode usar esta habilidade — copie a pasta para o diretório de habilidades desse agente.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/Nebulavenus/forge-gpu.git /tmp/forge-gpu
mkdir -p .claude/skills
cp -r /tmp/forge-gpu/.claude/skills/forge-vertex-pulling .claude/skills/forge-vertex-pulling
Reinicie Claude Code após copiar para que a nova habilidade seja reconhecida.

Use no TypingMind

Ative Forge Vertex Pulling em qualquer chat do TypingMind e o modelo cuida do resto. O nome e a descrição da habilidade ficam no prompt do sistema e, assim que uma solicitação relevante aparece, o modelo carrega as instruções completas automaticamente — sem precisar de acionamento manual e sem consumir tokens até que ela seja realmente usada.

O modelo carrega Forge Vertex Pulling automaticamente assim que uma solicitação é relevante para essa habilidade.

Funciona com qualquer modelo de IA

Habilidades de IA são instruções em Markdown simples, não código específico de um provedor. Por isso, Forge Vertex Pulling não fica vinculada ao modelo para o qual foi criada. Instale-a uma vez no TypingMind e use-a com GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama ou um modelo local executado por conta própria — tudo com suas próprias chaves de API.

  • Carregada apenas quando necessário

    O prompt do sistema contém apenas o nome e a descrição. As instruções são buscadas na primeira solicitação relevante, então uma habilidade sem uso não gera custo.

  • Troque de modelo durante a conversa

    Como a habilidade é composta de instruções, não de código, trocar de modelo não afeta seu funcionamento — o próximo modelo lê o mesmo arquivo SKILL.md.

Instruções da habilidade

Este é o conteúdo de SKILL.md que o modelo carrega. Leia antes de instalar — uma habilidade é um conjunto de instruções que seu modelo seguirá.

Vertex Pulling with SDL3 GPU

Replace the fixed-function vertex input assembler with manual storage buffer reads in the vertex shader. The pipeline declares zero vertex attributes and the shader fetches vertex data from a StructuredBuffer using SV_VertexID.

Based on GPU Lesson 33 — Vertex Pulling.

When to use

  • Meshes with different vertex layouts sharing one pipeline
  • Compute shaders writing vertex data for the vertex shader to read
  • Compressed or packed vertex formats decoded in the shader
  • GPU-driven rendering with indirect draw calls
  • Reducing pipeline state complexity and pipeline object count

HLSL pattern

Vertex shader (pulled)

hlsl
struct PulledVertex
{
    float3 position;
    float3 normal;
    float2 uv;
};

/* Vertex storage buffer: register(t0, space0) for DXIL vertex shaders.
 * Slot index follows sampled textures and storage textures (if any). */
StructuredBuffer<PulledVertex> vertex_buffer : register(t0, space0);

cbuffer SceneUniforms : register(b0, space1)
{
    column_major float4x4 mvp;
    column_major float4x4 model;
};

struct VSOutput
{
    float4 clip_pos  : SV_Position;
    float3 world_pos : TEXCOORD0;
    float3 world_nrm : TEXCOORD1;
    float2 uv        : TEXCOORD2;
};

VSOutput main(uint vertex_id : SV_VertexID)
{
    VSOutput output;
    PulledVertex v = vertex_buffer[vertex_id];

    float4 world = mul(model, float4(v.position, 1.0));
    output.clip_pos  = mul(mvp, float4(v.position, 1.0));
    output.world_pos = world.xyz;
    output.world_nrm = normalize(mul((float3x3)model, v.normal));
    output.uv        = v.uv;
    return output;
}

Fragment shader

No changes needed — fragment shaders work identically regardless of whether vertex data came from the input assembler or a storage buffer.

C-side pattern

1. Define the vertex struct (must match HLSL)

c
typedef struct PulledVertex {
    vec3 position;   /* 12 bytes */
    vec3 normal;     /* 12 bytes */
    vec2 uv;         /*  8 bytes */
} PulledVertex;      /* 32 bytes */

2. Upload as storage buffer (not vertex buffer)

c
/* The only CPU-side difference: buffer usage flag */
SDL_GPUBuffer *storage_buf = upload_gpu_buffer(
    device,
    SDL_GPU_BUFFERUSAGE_GRAPHICS_STORAGE_READ,  /* NOT VERTEX */
    vertex_data,
    vertex_count * sizeof(PulledVertex));

3. Create shader with storage buffer count

c
/* Vertex shader: declare 1 storage buffer */
SDL_GPUShaderCreateInfo info;
SDL_zero(info);
info.stage               = SDL_GPU_SHADERSTAGE_VERTEX;
info.num_samplers        = 0;
info.num_storage_buffers = 1;   /* <-- vertex data storage buffer */
info.num_uniform_buffers = 1;
/* ... format, code, entrypoint ... */

4. Create pipeline with empty vertex input

c
/* No vertex buffer descriptions, no vertex attributes */
SDL_GPUVertexInputState vis;
SDL_zero(vis);
/* vis.num_vertex_buffers    = 0;  already zero */
/* vis.num_vertex_attributes = 0;  already zero */

SDL_GPUGraphicsPipelineCreateInfo pi;
SDL_zero(pi);
pi.vertex_input_state = vis;
/* ... rest of pipeline setup ... */

5. Bind and draw

c
/* Bind storage buffer instead of vertex buffer */
SDL_GPUBuffer *bufs[1] = { storage_buf };
SDL_BindGPUVertexStorageBuffers(pass, 0, bufs, 1);

/* Index buffer binding is unchanged */
SDL_GPUBufferBinding ib = { index_buffer, 0 };
SDL_BindGPUIndexBuffer(pass, &ib, index_type);
SDL_DrawGPUIndexedPrimitives(pass, index_count, 1, 0, 0, 0);

SDL GPU register mapping

For DXIL vertex shaders, resources are bound in this order at space0:

  1. Sampled textures (t0..tN)
  2. Storage textures (tN+1..)
  3. Storage buffers (tN+M+1..)

With zero sampled/storage textures, the first storage buffer is t0, space0.

For SPIR-V vertex shaders, storage buffers go in descriptor set 0 after sampled and storage textures.

Combining with other techniques

  • Compute → Vertex: Use SDL_GPU_BUFFERUSAGE_GRAPHICS_STORAGE_READ | SDL_GPU_BUFFERUSAGE_COMPUTE_STORAGE_WRITE so a compute shader can write the buffer and the vertex shader can read it.

  • Indirect drawing (Lesson 38): Vertex pulling pairs naturally with indirect draws for fully GPU-driven rendering.

  • Multiple vertex formats: One pipeline can render meshes with different vertex layouts by defining multiple StructuredBuffer structs or using a ByteAddressBuffer with manual offset calculations.

Common mistakes

MistakeFix
Using SDL_GPU_BUFFERUSAGE_VERTEXUse SDL_GPU_BUFFERUSAGE_GRAPHICS_STORAGE_READ
Forgetting num_storage_buffers = 1 on shaderSet it in SDL_GPUShaderCreateInfo
Calling SDL_BindGPUVertexBuffersUse SDL_BindGPUVertexStorageBuffers
Mismatched C/HLSL struct layoutEnsure identical field order and sizes
Leaving vertex attributes in pipelineSet num_vertex_buffers = 0, num_vertex_attributes = 0

Perguntas frequentes

O que a habilidade de IA Forge Vertex Pulling faz?

Add vertex pulling (programmable vertex fetch) to an SDL GPU project. Replace fixed-function vertex input with storage buffer reads in the vertex shader using SV_VertexID and StructuredBuffer.

Por que usar Forge Vertex Pulling no TypingMind?

Porque basta instalar uma vez para usar com qualquer modelo. A habilidade Forge Vertex Pulling é escrita em Markdown simples, e não em código específico de um provedor, então a mesma habilidade funciona com GPT-5, Claude, Gemini, Grok ou um modelo local — e é possível trocar de modelo no meio do chat sem que ela deixe de funcionar. No TypingMind, você usa suas próprias chaves de API e paga diretamente aos provedores, em vez de pagar uma assinatura por licença de usuário. Suas habilidades e chats permanecem no seu próprio armazenamento.

Como instalar Forge Vertex Pulling no TypingMind?

Abra Plugins → Habilidades → Instalar do GitHub no TypingMind e cole https://github.com/Nebulavenus/forge-gpu/tree/main/.claude/skills/forge-vertex-pulling. O TypingMind lê o arquivo SKILL.md e instala a habilidade para que possa ser ativada em cada chat.

Quais modelos de IA podem usar Forge Vertex Pulling?

Qualquer modelo conectado no TypingMind. As habilidades de IA são instruções em Markdown simples, e não código específico de um provedor. Assim, GPT, Claude, Gemini, Grok e modelos locais podem carregar esta habilidade quando uma solicitação corresponder a ela.

Quantos modelos de IA posso usar com Forge Vertex Pulling?

Quantos quiser. Desde que o modelo ofereça suporte a habilidades, é possível usar Forge Vertex Pulling com ele — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama e outros — tudo no TypingMind com suas próprias chaves de API.

A habilidade de IA Forge Vertex Pulling é gratuita?

Sim. A habilidade é publicada no GitHub por Nebulavenus sob a licença Zlib. O pagamento é feito apenas ao seu provedor de IA pelos tokens usados.

O que são habilidades de IA?

Uma habilidade de IA é um conjunto reutilizável de instruções que ensina um modelo de IA a realizar uma tarefa específica. Ela segue o formato aberto Agent Skills: um arquivo SKILL.md com nome e descrição, além de scripts, templates ou arquivos de referência de que o modelo possa precisar. O modelo lê as instruções apenas quando sua solicitação corresponde à habilidade, então uma habilidade instalada não gera custos até ser usada.

Qual é a diferença entre habilidades de IA e plugins ou servidores MCP?

Um plugin ou servidor MCP oferece ao modelo novas ferramentas que ele pode acionar — código que é executado em algum lugar e retorna um resultado. Já uma habilidade de IA dá ao modelo o conhecimento e as orientações de que ele precisa: como abordar uma tarefa, quais etapas seguir e como deve ser um bom resultado. As habilidades são escritas em Markdown simples, por isso não precisam de servidor, chave de API nem ambiente de execução, e funcionam com qualquer modelo.

Ver lista completa

Crie seu próprio espaço de trabalho com IA agora

Inscreva-se na nossa newsletter para receber avisos sobre novos recursos e futuros sorteios 👇