* Shaders changes require two or more change cycles before updating
This fixes the problem described in the title.
Consolidated the responsibility to update the root shader variant
asset into the Shader() class. It was unnecessarily spread across
Shader(), ShaderVariant() and ShaderAsset().
In particular OnAssetReloaded now makes a temporary copy of the root
ShaderVariantAsset and updates the ShaderAsset with such reference
only when OnAssetReloaded() is called on behalf of the ShaderAsset.
Signed-off-by: galibzon <66021303+galibzon@users.noreply.github.com>
Replaced get and set functions with explicit types with templates
Added special case handling for setting enum values as strings or numbers from script
Signed-off-by: Guthrie Adams <guthadam@amazon.com>
Move imageAttachmentCopy instance from RenderPass to Pass so it can support preview image for all passes but not only for RenderPass.
Fixed an issue with image attachment preview when switching render pipeline with attachment preview on.
Signed-off-by: Qing Tao <qingtao@amazon.com>
* ATOM-16489 Add find passes functions for Scene or RenderPipeline in PassSystemInterface
Introduced new PassSystemInterface::ForEachPass() funtion to replace PassSystemInterface::FindPasses(), PassSystemInterface::GetPassesByTemplateName and ParentPass::FindPassByNameRecursive() functions.
Update all the places which were using those three functions.
The new pass finding filter support any combination of pass name, pass template name, pass class type, pass hirechary, owner scene, owner render pipeline.
Update unit tests.
Signed-off-by: Qing Tao <qingtao@amazon.com>
(cherry picked from commit fe8dac7989)
MaterialAssignment::ApplyProperties() still reports warnings but does not update the m_propertyOverrides.
MaterialAssignment::ApplyProperties() will now skip the old name'd overrides if overrides are present for the new names. I'm not sure if this will ever happen, but it did happen while I had some intermediate changes, so I imagine it could happen again.
I had to update the Material::FindPropertyIndex function to expose information about renames when they occur. This should make it easier for other systems to get (somewhat) automatic benefit from the version update feature.
I also found that there was an issue with material inspector where it wouldn't be initialized the the right override values when renames were present. Now it applies the renames to whatever override data it gets from the Material Component.
Signed-off-by: santorac <55155825+santorac@users.noreply.github.com>
* Implement simple tint for white balance color grading. Adjust temperature slider to feel linear.
Signed-off-by: rbarrand <rbarrand@amazon.com>
* Change white balance luminance preservation equation and remove unused code.
Signed-off-by: rbarrand <rbarrand@amazon.com>
Co-authored-by: rbarrand <rbarrand@amazon.com>
I added an ApplyPropertyRenames function to MaterialTypeAsset very similar to the one in MaterialTypeSourceData.
Updated the MaterialAssignment class to apply any property renames when it discovers the old name doesn't work. This will be written to disk when the level or prefab is saved.
Signed-off-by: santorac <55155825+santorac@users.noreply.github.com>
* Disable partial Descriptor Set updates as Vk validation layer does not like that
Signed-off-by: moudgils <moudgils@amazon.com>
* Enable parallel encoding for Vulkan
Disable partial SRG updates for Vk as the validation layer did not like that. There is a way to just updat SRG constants but that will require more work
Fix a bunch of Vulkan validation errors (mostly the ones spammming each frame)
Signed-off-by: moudgils <moudgils@amazon.com>
* Minor feedback update
Signed-off-by: moudgils <moudgils@amazon.com>
Atom Sample Viewer screenshot tests were failing because they couldn't be saved. The code was passing the previous RHI Format instead of the updated one.
Vulkan screenshot tests are operational again. ASV material screenshot test script passes on vulkan and dx12 now (other than known issues).
Merge pull request #4719 from aws-lumberyard-dev/Atom/santorac/FixVulkanPngCapture
* Added a stateless allocator which uses AZ_OS_MALLOC/AZ_OS_FREE to
allocate memory for objects in static memory.
Signed-off-by: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com>
* Updated the Maestro and LyShine Anim Nodes to use the
stateless_allocator for its static containers.
This prevents crashes in static de-init due to the SystemAllocator being
destroyed at that poitn
Signed-off-by: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com>
* Updated the EBus AllocatorType to use the EBusEnvironmentAllocator
Because the EBus Context resides in static memory, the SystemAllocator
lifetime is shorter than the EBus Context.
This results in shutdown crashes in monolithic builds due to all of the
gem modules being linked in as static libraries and the EBus context now
destructing at the point of the executable static de-init, instead of
the module de-init, where the SystemAllocator would still be around.
Signed-off-by: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com>
* Fixed an assortment of shutdown issues due to deleting objects after
AZ allocators are no longer available
Fixed the NameDictionary IsReady() function to not assert when the
dictionary when invoked after the environment variable it was stored in
was destroyed.
Updated the NameData destructor to check that the NameDictionary
IsReady() before attempting to remove itself from the dictionary
Signed-off-by: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com>
* Fixed NameDictionary destory workflow, to reset the EnvironmentVariable
instance
Updated the EnvironmentVariable instance to store the NameDictionary as a
value.
Added a rvalue reference `Set` function overload to the
EnvironmentVariable class to support move only types.
Signed-off-by: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com>
* Clang 6.0.0 build fixes
The C++17 std::launder feature isn't available in that compiler version
Signed-off-by: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com>
- Each resource type is tracked and updated separately
- Added caching ability for Raytracing srg to save ~2ms for a scene containing 100 x 50 vegetation patch
Signed-off-by: moudgils <moudgils@amazon.com>
This change is a preparation for moving the CPU profiler/visualization system from Atom into its own Gem by removing the dependency on local time tracking object AZ::RHI::CpuTimingStatistics
Full changes include:
- Removed all usage of AZ::RHI::CpuTimingStatistics
-- Replaced with pushing to AZ::Statistics::StatisticalProfilerProxy global instance
- Promoted VariableTimer from AZ::RHI to AZ::Debug
- Removed now unused CpuTimingStatistics.h
Signed-off-by: AMZN-ScottR 24445312+AMZN-ScottR@users.noreply.github.com
* Define fallback slots when shader is disabled
* Disable SSAO parent pass depending on the settings
* Move SSAO modulation pass into SsaoParent pass so it can be disabled with the rest of SSAO
* Enable SSAO by default
Co-authored-by: Tobias Alexander Franke <tobias.alexander.franke@huawei.com>
* Create helper function for getting threads per
group from a compute shader
Added GetComputeShaderNumThreads() functions to RPIUtils.
By default the function returns 1, 1, 1 in case of errors.
Updated existing code that was looking for 'numthreads' attribute data
with the new GetComputeShaderNumThreads() API.
Signed-off-by: garrieta <garrieta@amazon.com>
* Added a ModelReloader class that handles reloading the hierarchy of assets in the correct order. A ModelReloaderSystem that is used to make sure there is only one ModelReloader at a time for a given asset. Modified the Model, ModelLodAsset, and Buffer assets to not automatically reload, and instead handle reloads manually via AssetCatalog events. Modified the MeshLoader to kick off a reload via the ModelReloaderSystem whenever a model asset is added or changed.
Signed-off-by: amzn-tommy <waltont@amazon.com>
* Comment updates
Signed-off-by: amzn-tommy <waltont@amazon.com>
* Minor naming and comment updates based on PR feedback
Signed-off-by: amzn-tommy <waltont@amazon.com>
* Correcting previous commit. I flipped == to != when switching from count to find, when it should have stayed ==
Signed-off-by: amzn-tommy <waltont@amazon.com>
* Updating RenderCommon header
Signed-off-by: amzn-tommy <waltont@amazon.com>
* Removing unneeded headers
Signed-off-by: amzn-tommy <waltont@amazon.com>
* Reverting RayTracingFeatureProcessor change following Doug's guidance. This logic was tricky to get right initially, and leads to TDR when incorrect, so leaving as is.
Signed-off-by: amzn-tommy <waltont@amazon.com>
* Removing a tab
Signed-off-by: amzn-tommy <waltont@amazon.com>
* Added missing #include for AssetId
Signed-off-by: amzn-tommy <waltont@amazon.com>
* Adding missing RTTI header
Signed-off-by: amzn-tommy <waltont@amazon.com>
* Include ModelAsset definition intead of forward declaring it to avoid a static assert on Linux
Signed-off-by: amzn-tommy <waltont@amazon.com>