For AMD and Intel you can find documentation on how these shader instructions need to be encoded (you won't be able to use them directly, unless you're writing your own OS/driver). For example, for Intel check intel-gfx-prm-osrc-tgl-vol02a-commandreference-instructions.pdf file for Tiger Lake GPU instructions - you can find docs for older Intel GPU's in https://01.org/linuxgraphics/documentation
Thanks for the links. I will check them out a little later and see if I can gain some insight.
Older GPU's ~15 years ago had dedicated cores for vertex or fragment shaders with different instructions & encodings. Nowadays they all have so called unified shader model - which means they are generic shader cores that can execute any workflow.
Ah, okay. So this means that D3D, opengl, etc. are responsible for creating the correct series of instructions from all the shaders you pass them to get out the desired behavior, as if there still was dedicated hardware on the GPU for each shader. If I got that right, then at this point in time are shaders even a necessary construct? I mean, why break it down to these separate stages instead of just writing a GPU program like we would a CPU program? Is this just because of legacy purposes or is there still an advantage to thinking about GPU programs in set stages like this?
What happens when you use one these languages (or their binary encodings) is that user-space part of Direct3D, OpenGL or Vulkan driver compiles & optimizes source code for specific GPU instructions & state (what buffers are bound, state set, texture formats & similar info). Then it sends produced instructions stream to GPU to execute when you issue draw calls.
I'm currently reading this series of blog posts by fabian: https://fgiesen.wordpress.com/2011/07/01/a-trip-through-the-graphics-pipeline-2011-part-1/ (was written in 2011 but hoping it's still pretty relevant today). From what I gather, there is technically 2 stages of compilation, there's a compilation stage that D3D performs itself, generating a sort of IR with some high level optimizations completed, and then there's further compilation done by the user-mode graphics driver dll which gives you the final GPU assembly instructions. I'm I understanding this correctly?