Jump to content
  • Advertisement
Sign in to follow this  
ucfchuck

DX11 does the hlsl compiler optimize for specific gpus

This topic is 526 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I have a set of shaders that i want to compile to run on different machines, and I want to precompile them. does the compiler optimize the code for the current graphics driver of the machine it is being compiled on?

 

say i have an nvidia 750m and precompile my shaders with D3DXSHADER_OPTIMIZATION_LEVEL3 set. and then i move those shaders to run on an intel integrated gpu. Are they as efficient on the intel gpu when precompiled on the nvidia vs compiled directly on the intel at runtime?

Share this post


Link to post
Share on other sites
Advertisement

On mobile right now, but briefly - the HLSL compiler will spit out the same intermediate bytecode regardless of what your system specs are. When your application calls a D3D function to load the shader from the pre-compiled bytecode, it will be compiled again in a vendor-specific way before actually being used. So to answer your question - you can compile a shader on one machine with a dedicated GPU and run it on another machine with an integrated GPU just fine.

Share this post


Link to post
Share on other sites

Thank you, I couldnt find where i read it before, but i kept thinking that the compile used the gpu driver to optimize to that hardware. I had set it up to compile on the target machine on the first execution, and output the compiled shader byte code to an fxo file and just load that every time the application started thereafter. but it left me nervous about shipping  the uncompiled, unobfuscated, and fully commented shaders.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!