Skip to content

Commit

Permalink
Add a blog post covering the recent reflection API documentation upda…
Browse files Browse the repository at this point in the history
…tes (#36)

* Add reflection API update blog post

* Add image for reflection API doc update blog post

* Update 2024-12-18-reflection-api-doc-update.md
  • Loading branch information
swoods-nv authored Dec 19, 2024
1 parent 74e19a2 commit 25f75da
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions _posts/2024-12-18-reflection-api-doc-update.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
---
layout: post
title: "Documentation Update: Reflection API"
date: 2024-12-18 18:00:00 +0000
categories: [ "blog" ]
tags: [slang]
author: "Shannon Woods, NVIDIA, Slang Working Group Chair, and Theresa Foley, NVIDIA"
image: /images/posts/2024-12-18-reflection-api-doc-update.webp
human_date: "December 18, 2024"
---

The Slang reflection API gives developers the ability to examine shader parameters, types, and their layouts from their application during runtime – a big benefit for things like dynamic shader parameter binding. Based on user feedback, we’ve given the documentation for reflection a major update, making it easier to understand how to interact with and use it to your best advantage.

The [basic reflection API documentation](https://shader-slang.com/slang/user-guide/reflection) provides an overview of best practices for retrieving reflection information from a compiled shader, and how Slang reports out the individual variables and types and their layouts. It also references a [simple example](https://github.com/shader-slang/slang/tree/master/examples/reflection-api) to demonstrate how the code is used in practice, and provides coverage of details like how to calculate offsets into parameter blocks, how Slang handles global parameter declarations, and how to avoid common pitfalls.

For developers targeting multiple API environments, we’ve also put together an overview of one strategy for handling parameter passing in a cross-platform safe way in our [shader cursors documentation](https://shader-slang.com/docs/shader-cursors/). Because the way in which different GPU APIs accept parameters from the caller varies significantly, handing that information off to your shader program is something that many developers wrestle with. Slang’s reflection API was designed with this understanding in mind, to help you manage shader parameters wherever you need to deploy, across the wide range of targets that Slang supports.

We’re continuing to add to our reflection API documentation, so stay tuned for more updates! And if there are areas you’d like to see more detailed documentation, please let us know – you can join us at any time on our [Discord server](https://khr.io/slangdiscord)!

Binary file not shown.

0 comments on commit 25f75da

Please sign in to comment.