SiliconStudio / xenko

Old repo for Xenko Game Engine. Please use https://github.com/xenko3d/xenko instead.
http://xenko.com
1.54k stars 345 forks source link

DXCOMPILE: SkipOptimization when Debug Enabled #398

Open Obi-Dann opened 8 years ago

Obi-Dann commented 8 years ago

It's quite unpleasant and hard to debug optimized shaders, it'd be nice to be able to skip optimization when debug is enabled

eg make a change in https://github.com/SiliconStudio/xenko/blob/master/sources/engine/SiliconStudio.Xenko.Shaders.Compiler/Direct3D/ShaderCompiler.cs#L32 to shaderFlags = ShaderFlags.Debug | ShaderFlags.SkipOptimization;

Ability to add ShaderFlags.PreferFlowControl might be also useful

xen2 commented 8 years ago

Looks like OGRE does it only on level 10.0: http://code.metager.de/source/xref/ogre/RenderSystems/Direct3D11/src/OgreD3D11HLSLProgram.cpp

Maybe it doesn't work well with level 9.

Also, what about exposing EffectSystem.EffectCompilerParameters and allowing to set it to -1 (skip optim) or an enum?