There are plenty of books on it, it would be wrong of me to push one and I always have to program to my clients requirements so I don't have a favourite. However that said none of them would have you include every header in every fileLizardLad_1 wrote: ↑Tue Sep 11, 2018 8:28 amThank you LdB. Sorry about my coding style I'm in an Australian high school where the only language the teacher knows is php and pascal. My teacher I think had a worse coding style than me all of his programs use global variables, nothing local. If you have any ideas of how I can improve and learn please feel free to share them.
The shader is nothing more than a block of VC4 assembler code. Usually there exists a shader compiler either on the GPU itself or even on the net that will take a standard shader file language like GLSL or SPIR-V and compile you the code. NVidia, Mali GPU's and a host of others do that. So usually it is as simple as learn the shader language put that into the shader compiler and then emit the code into a memory block (you now understand what emit means). The VC4 is awkward because the only shader that existed was in the bottom of MESA in the opengl drivers for linux. So usually there is actually nothing to learn beyond the standard shader language and I originally stopped because I did not feel like trying to redux a shader compiler out of the MESA code.
Recently that has changed Eric Anholt has been working away on developments on VC4 and VC5 driver and he has exposed a much cleaner interface to a shader compiler code. So it is on my todo list but you are welcome to take on the task
There is stuff on the Pi userland repo which you can hook up into baremetal (as some have) but it is largely old opengl stuff that has known limitations and is out of date. The updated linux drivers open up far more possibilities and functions.
Whatever way you go including using the old userland libraries or linux itself you will need to learn a shader language. Personally I would suggest it be GLSL as that tends to be the most covered on the net but someone who plays in that area a lot like paeryn could probably help you out and may have a different view. You can largely learn the shader language online there are websites that let you write shader code and show the effect and there are binaries that will do the same on your PC, things like Shadertoy (tm).