I couldn't find a more relevant forum for this question, so if anyone knows of a better forum for this, let me know! We recently received new work laptops at our company that have the Intel(R) HD Graphics 4000 chipset. I should also mention that the laptop also has an NVidia GTX 640M and uses the Optimus technology. I oversee a large graphics engine that currently only has support for DirectX 11. I wrote a minimal unit test application that simply boots our renderer and loads a few hundred system shaders. The shaders have all been compiled offline with the DirectX SDK's fxc.exe binary.
The problem is that when I run the application through Visual Studio 2013 and I use the Intel HD Graphics chipset instead of the NVidia card, our renderer initialization takes approximately 7 MINUTES. I can take the exact same executable and just double click it and not go through visual studio (and still use the Intel Graphics chipset), and the renderer initialization takes about 10 seconds. When running through visual studio, every call to ID3D11Device::CreatePixelShader appears to take approximately 1 to 5 seconds for each shader...which adds up when we're loading a few hundred shaders. If I switch to the NVidia graphics card, initialization of our renderer through Visual Studio takes only about 3 seconds.
So, we have over 50 of these laptops and I do not always want all of our development laptops to have to have the NVidia graphics card enabled during Visual Studio development because that would be a huge drain on battery life, battery longevity and consume a lot more power. Does anyone have any idea why it takes so long for the Intel driver to compile shaders only when running through Visual Studio? If it's any help, this is what the callstack looks like when calling CreatePixelShader (I don't have pdb files unfortunately):
It goes through the NVidia shim first then to the Intel driver. Any help on figuring out why this takes so long would be appreciated.