← The workbench
DEVELOPMENT JOURNAL

Shader Reflection For Vertex And Fragment Shaders

GraphicsReflection

I had a rough day with some api that was just named in a way that did not grok with my brain. The biggest challenge was around the container types of slang with variabletyplelayouts, types, typelayouts, then kinds of types that can be reflected that have to be specially handled because they are a container or array and cannot simply use the standard hierarchical traversal of structs. 


The confusion largely comes from the challenge of navigating source code, along with a lack of api documentation. Only a few functions are commented on in any given interface and typically they seem geared towards the slang development team as opposed to end users of the api. Ordinarily I would love to read the documentation and study up and gain an intuition here, but there isn’t any. I begrudgingly had to leverage ai to provide information on these apis so that I could understand how they were intended to be used together.


Despite how sour I may seem about it, I am grateful I was able to learn the material courtesy of ai and then handroll my own implementation. I am excited to move on to the implementation of the GUI controls for editing the parameters on the fly in the program. This will be the final hurdle to building out to runtime scripting.


More from the workbench ↗