   Compiling shaders: Runtime vs Built
  Hiya,How is this handled usually? I was under the impression shaders were built before being shipped and then simply read on the users computer in assembly, but is this really how things are done?Will the generated assembly be different on different machines and perhaps more optimized if it's build locally?   
  Not really. Devs usually ship shaders in text format so it could be compiled based on the hardware of the end user. If they use a fixed shader version, say, 3.0 is the minimum for the game, they can just compile it and ship that. Compiled and stripped shaders are much much smaller than text based ones, also much harder to actually copy them for personal use.   ;  The generated assembly will be exactly the same as long as you use the same version of the shader compiler (by linking to the same version of the DX runtimes).  They're not compiled based on the hardware present on the host machine.Some games don't compile until runtime, some compile in advance. You can do whatever you'd like. [smile]   ;  It's important to note that actually compiling them at compile time (even if you don't actually use the compiled version at runtime), could save development time by detecting various errors before even running the application.I'd certainly recommend compiling them even if you never use the compiled output.   ;  We save compiled shaders for X360, and just load text for PC.  The 360 takes a while to compile each shader, and load times must be minimized if you want to pass certification and/or not annoy your customers.   ;Quote:Original post by sirobIt's important to note that actually compiling them at compile time (even if you don't actually use the compiled version at runtime), could save development time by detecting various errors before even running the application.I'd certainly recommend compiling them even if you never use the compiled output.Seconded. Also, in order to painlessly automate this process, you can customize your build by adding custom build rules.   