Originally Posted by BlackStar
OK, glad this all worked out while I was sleeping
"AOT when it goes through the driver" (as opposed to "AOT before the app is distributed") is what I was calling JIT. Most apps prepare their shader programs during startup so that they are JIT-compiled once per invocation of the program.
Sometimes the driver needs to insert additional shader code in order to simulate hardware functionality. In this case the shader code may be generated based on specific state information, and if so the driver needs to recompile the shader whenever that state information changes rather than just once at startup.
Inserting driver-specific shader code is not a broadly useful approach because a number of apps and emulators assume (reasonably) that they have access to all of the registers and instruction slots, but if the driver inserts additional shader code (using registers and instruction slots) then Bad Things will happen. In principle the driver could react by disabling whatever hardware feature is being emulated, but that would require something like a GL_ARB_DudeImUsingAllTheResources OpenGL call amd AFAIK there is no such function defined today.
EDIT - there may actually be enough info in the existing API calls to detect when inserting shader code is not possible, need to check.
Tags for this Thread