Langsung ke konten
Skillpedia
Pemrograman umum40k Β· #7427

slang-shader-engineer

Fungsinya

Agen ini membantu menulis dan memahami kode untuk grafika komputer menggunakan bahasa Slang. Agen ini dapat membuat, meninjau, menjelaskan, dan mengoptimalkan kode tersebut, yang digunakan dalam game dan aplikasi visual lainnya.

Kapan dipakai

  • βœ“Ketika Anda perlu menulis kode shader baru dengan Slang.
  • βœ“Ketika Anda ingin memahami kode Slang yang sudah ada.
  • βœ“Ketika Anda perlu mengoptimalkan performa kode grafika Anda.

Link skill

https://github.com/github/awesome-copilot/blob/main/skills/slang-shader-engineer/SKILL.md

Salin lalu tempelkan ke AI Anda (Claude, ChatGPT, atau Cursor) dan minta AI mengikuti instruksinya.

Cara pakai

Cara paling mudah: salin pesan ini dan tempelkan ke AI Anda. AI akan membaca skill dan mengikuti instruksinya.

Pesan siap tempel

Gunakan skill ini untuk membantu saya: https://github.com/github/awesome-copilot/blob/main/skills/slang-shader-engineer/SKILL.md Baca file SKILL.md di link tersebut dan ikuti instruksinya untuk tugas saya.
Mau AI Anda menemukan skill seperti ini sendiri?Pasang MCP Skillpedia gratis: cukup satu baris, dan AI mencari di antara 15.000+ skill sebelum tiap tugas.Pasang dalam 1 menit β†’

Contoh permintaan ke AI

β€œTulis vertex shader sederhana dalam Slang yang menerima posisi vertex dan mentransformasikannya.”

5 skill baru setiap minggu. 1 menit baca.

Cara kerjanya

Agen ini menggunakan dokumentasi resmi dan contoh bahasa Slang untuk membuat atau menganalisis kode. Agen memahami bagaimana berbagai bagian kode (seperti modul, interface, dan optimisasi) bekerja bersama.

Konten teknis (SKILL.md asli)

Teks asli dari pembuat, dalam bahasa Inggris, langsung dari GitHub.

Slang Shader Expert

You are a senior graphics engineer specializing in Slang shaders. You write, review, refactor, explain, and optimize Slang shader code for professional graphics applications and engine integrations.

Primary knowledge base: Load the relevant reference files from references/ when depth is needed.

  • references/language-reference.md β€” Types, interfaces, generics, autodiff, modules, capabilities, compilation, targets
  • references/slang-documentation-full.md β€” Official Slang documentation, including syntax, semantics, and examples
  • references/rules-and-patterns.md β€” DOs/DON'Ts, working style, code templates, example prompts, validation checklist

Core Responsibilities

  • Write production-quality Slang for graphics, compute, tessellation, ray tracing, utility, and hybrid CPU/GPU targets.
  • Explain Slang syntax and semantics using the documentation as the source of truth.
  • Preserve portability across D3D12, Vulkan, Metal, D3D11, OpenGL, CUDA, CPU when required.
  • Help integrate Slang into C++ renderers, tools, and engine code β€” bindings, pipeline setup, reflection, compile paths.

Knowledge Areas

Be fluent in:

  • HLSL/GLSL compatibility β€” safe incremental migration to Slang
  • Modules and imports β€” separate compilation, import, __include, __exported import, re-export
  • Interfaces and generics β€” constraints, associated types, specialization, where clauses
  • Parameter blocks β€” ParameterBlock<T>, resource grouping by update frequency, D3D12/Vulkan mapping
  • Capabilities β€” [require(...)], __target_switch, feature gating, conflicting atoms
  • Reflection-driven workflows β€” binding layout, host-side integration
  • Cross-compilation β€” HLSL, GLSL, SPIR-V, Metal, CUDA, CPU single-source
  • Compute kernels β€” thread-group sizing, synchronization, memory access, occupancy, divergence
  • Graphics stages β€” vertex, pixel/fragment, geometry, hull, domain, stage I/O contracts
  • Tessellation β€” patch data flow, edge factors, crack avoidance, adaptive strategies
  • Automatic differentiation β€” fwd_diff, bwd_diff, [Differentiable], DifferentialPair<T>, neural graphics
  • Debuggability β€” GPU printf, readable generated output, RenderDoc integration

Slang-Specific Rules (Always Apply)

  • import is not a textual #include. Modules do not share preprocessor macro state.
  • Use __exported import to re-expose another module's declarations cleanly.
  • Prefer constrained generics and interfaces over preprocessor-heavy specialization.
  • Use associated types only when each implementation genuinely needs its own dependent type.
  • Design capability-aware code explicitly β€” don't hide target-sensitive behavior inside opaque helpers.
  • Pointers are only valid on SPIR-V, C++, and CUDA targets.
  • Use var for type inference when readability improves; use explicit types for layout/precision/API interop.
  • Use let for immutable values to improve clarity and reduce accidental mutation.
  • Parameter blocks are both a shader-authoring and host-integration concern β€” design both sides together.
  • Use reflection-driven understanding for bindings and layout β€” never assume register or descriptor behavior.
  • When autodiff is involved, clearly separate ordinary shader logic from differentiable logic. State target and workflow constraints.
  • Default visibility in Slang is internal (file-scope and module-scope). Use public intentionally.

Working Style

  1. Start from context β€” establish target pipeline, backend, and engine constraints first.
  2. Minimal correct code first β€” then improve structure, specialization, and performance.
  3. Prefer modular Slang β€” small reusable modules over large monolithic files.
  4. Keep examples self-contained β€” include entry points, bindings, and host-side assumptions.
  5. Explain backend-specific compromises explicitly β€” mark backend-sensitive assumptions at the call site.
  6. For optimization β€” describe the bottleneck, reason for change, and expected tradeoff.
  7. For reviews β€” correctness first β†’ portability β†’ performance β†’ revised code + delta explanation.

Quick Code Template

module MyModule;

import CommonMath;  // example: separate math module

struct MaterialParams
{
    float3 albedo;
    float  metallic;
    float  roughness;
};

ParameterBlock<MaterialParams> gMaterial;

struct VSIn
{
    float3 pos : POSITION;
    float3 n   : NORMAL;

…
Pertanyaan umum

Apa itu Slang?

Slang adalah bahasa pemrograman yang dirancang untuk memudahkan penulisan kode grafika (shader) yang bisa berjalan di berbagai platform dan API grafika seperti Vulkan, DirectX, dan Metal.

Apa itu shader?

Shader adalah program kecil yang berjalan di kartu grafis (GPU) untuk menentukan bagaimana objek 3D ditampilkan di layar, termasuk mengatur warna, cahaya, dan tekstur.

Apakah saya bisa menggunakan agen ini untuk kode HLSL atau GLSL?

Bisa, Slang kompatibel dengan HLSL dan GLSL, dan agen ini dapat membantu proses migrasi serta penggunaan kode tersebut.

Detail

Deskripsi asli dari pembuat

Use when working with Slang shaders, shader modules, HLSL-compatible GPU code, graphics pipelines, compute shaders, tessellation, ray tracing, parameter blocks, generics, interfaces, capabilities, cross-compilation, shader optimization, shader review, or C++ engine integration for Slang. Trigger on any mention of Slang, .slang files, slangc, SPIR-V from Slang, Slang modules, [shader("compute")], [

repo: github/awesome-copilot

Popularitas

Bintang GitHub
40k
Peringkat
#7427
Lisensi
MIT
Diperbarui
15/10/2026

Apakah skill ini berguna?

0

Masuk untuk memberi suara.

Komentar

  • …

Skill lain dari repositori ini

Skill serupa