169b8f3679
* [ATOM-5441] Shader Builders May Fail When Multiple New Files Are Added ShaderAssetBuilder::CreateJobs now recursively parses *.azsl files looking for #include lines and builds the list of source dependencies using a depth-first algorithm. It was using MCPP before but not anymore (during CreateJobs). The new algorithm may over prescribe, but fixes the issues when multiple new shader related files are added, at once or out of order, to a game project or Gem. Overall the new ShaderAssetBuilder::CreateJobs() is around 40% faster and, of course, handles source dependencies in a robust way. * Added new test suite to AutomatedTesting project: Gem/PythonTests/atom_renderer/test_Atom_ShaderBuildPipelineSuite.py Bug fix to Gems/Atom/Asset/Shader/Code/Source/Editor/ShaderAssetBuilder.cpp discovered thanks to the automated test suite. The idea is that CreateJobs doesn't fail if the AZSL file doesn't exist. The failure is deferred during ProcessJob. This way if the AZSL file exists the .shader file is rebuilt automatically. * For testability purposes and avoid memory leakage errors during Unit Tests created the class ShaderBuilderUtility::IncludedFilesParser Now accepts "# include <file>" with space between '#' and 'include'. Also now accepts the '-' character inside the file path. Added Unit Test to validate all cases of "#include <file>" parsing. * Fixed linux runtime issues for Unit Tests in Atom_Asset_Shader.Tests Signed-off-by: garrieta <garrieta@amazon.com>
19 lines
838 B
Python
19 lines
838 B
Python
"""
|
|
Copyright (c) Contributors to the Open 3D Engine Project.
|
|
For complete copyright and license terms please see the LICENSE at the root of this distribution.
|
|
|
|
SPDX-License-Identifier: Apache-2.0 OR MIT
|
|
|
|
Main suite tests for the Shader Build Pipeline.
|
|
"""
|
|
import pytest
|
|
from ly_test_tools import LAUNCHERS
|
|
from ly_test_tools.o3de.editor_test import EditorTestSuite, EditorSingleTest
|
|
|
|
@pytest.mark.parametrize("project", ["AutomatedTesting"])
|
|
@pytest.mark.parametrize("launcher_platform", ['windows_editor'])
|
|
class TestShaderBuildPipelineMain(EditorTestSuite):
|
|
"""Holds tests for Shader Build Pipeline validation"""
|
|
|
|
class ShaderAssetBuilder_RecompilesShaderAsChainOfDependenciesChanges(EditorSingleTest):
|
|
from .atom_hydra_scripts import hydra_ShaderAssetBuilder_RecompilesShaderAsChainOfDependenciesChanges as test_module |