Move shader source code length adjustment to the main compilation routine
This commit is contained in:
@@ -60,7 +60,7 @@ public:
|
||||
|
||||
ShadersCompilationService ShadersCompilationServiceInstance;
|
||||
|
||||
bool ShadersCompilation::Compile(const ShaderCompilationOptions& options)
|
||||
bool ShadersCompilation::Compile(ShaderCompilationOptions& options)
|
||||
{
|
||||
PROFILE_CPU_NAMED("Shader.Compile");
|
||||
|
||||
@@ -86,6 +86,10 @@ bool ShadersCompilation::Compile(const ShaderCompilationOptions& options)
|
||||
return true;
|
||||
}
|
||||
|
||||
// Adjust input source length if it ends with null
|
||||
while (options.SourceLength > 2 && options.Source[options.SourceLength - 1] == 0)
|
||||
options.SourceLength--;
|
||||
|
||||
const DateTime startTime = DateTime::NowUTC();
|
||||
const FeatureLevel featureLevel = RenderTools::GetFeatureLevel(options.Profile);
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@ public:
|
||||
/// </summary>
|
||||
/// <param name="options">Compilation options</param>
|
||||
/// <returns>True if failed, otherwise false</returns>
|
||||
static bool Compile(const ShaderCompilationOptions& options);
|
||||
static bool Compile(ShaderCompilationOptions& options);
|
||||
|
||||
/// <summary>
|
||||
/// Registers shader asset for the automated reloads on source includes changes.
|
||||
|
||||
Reference in New Issue
Block a user