@ -12,10 +12,10 @@
# include <Atom/RHI.Edit/Utils.h>
# include <Atom/RHI.Reflect/DX12/PipelineLayoutDescriptor.h>
# include <Atom/RHI.Reflect/DX12/ShaderStageFunction.h>
# include <Atom/RHI/RHIUtils.h>
# include <AzCore/IO/FileIO.h>
# include <AzCore/IO/SystemFile.h>
# include <AzFramework/StringFunc/StringFunc.h>
namespace AZ
@ -253,9 +253,11 @@ namespace AZ
return false ;
}
const bool graphicsDevMode = RHI : : IsGraphicsDevModeEnabled ( ) ;
// Compilation parameters
AZStd : : string params = shaderCompilerArguments . MakeAdditionalDxcCommandLineString ( ) ;
if ( BuildHasDebugInfo( shaderCompilerArguments ) )
if ( graphicsDevMode | | BuildHasDebugInfo( shaderCompilerArguments ) )
{
params + = " -Zi " ; // Generate debug information
params + = " -Zss " ; // Compute Shader Hash considering source information
@ -284,7 +286,7 @@ namespace AZ
// If we use the auto-name (hash), there is no way we can retrieve that name apart from listing the directory.
// Instead, let's just generate that hash ourselves.
AZStd : : string symbolDatabaseFileCliArgument { " " } ; // when not debug: still insert a space between 5.dxil and 7.hlsl-in
if ( BuildHasDebugInfo( shaderCompilerArguments ) )
if ( graphicsDevMode | | BuildHasDebugInfo( shaderCompilerArguments ) )
{
// prepare .pdb filename:
AZStd : : string md5hex = RHI : : ByteToHexString ( md5 ) ;
@ -353,7 +355,7 @@ namespace AZ
byProducts . m_dynamicBranchCount = ByProducts : : UnknownDynamicBranchCount ;
}
if ( BuildHasDebugInfo( shaderCompilerArguments ) )
if ( graphicsDevMode | | BuildHasDebugInfo( shaderCompilerArguments ) )
{
byProducts . m_intermediatePaths . emplace ( AZStd : : move ( objectCodeOutputFile ) ) ;
}