ATOM-16273 Compiling SceneSRG before updating it can cause a gpu crash
Changes include:
1. Removed Scene::SetShaderResourceGroupCallback() function and clean up code which use this function.
2. Moved SceneTimeSrg.azsli to RPI's DefaultSceneSrg folder and setup the constants in RPI::Scene
3. Add AZ::Event for Scene's update srg event which features and update scene srg at proper place
4. UpdateTransformServcie FP to use PrepareSceneSrg event handler.
5. Clean up shaders and srgs used in project templates.
Signed-off-by: Qing Tao <qingtao@amazon.com>
Many of these are just extra noise in the profile, but the one in Archive.cpp could also cause PIX to crash.
Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com>
* Fix loading of PipelineLibraries from disk for DX12 backend.
Signed-off-by: moudgils <moudgils@amazon.com>
* Disabled Saving out PipelineLibraries (for DX12) if pix or Renderdoc is enabled.
Addressed some feedback
Signed-off-by: moudgils <moudgils@amazon.com>
* Fixed an issue withe loading PipelineLibraries and added a cleaner abstraction to not save empty libraries for dx12
Signed-off-by: moudgils <moudgils@amazon.com>
- Fixed cloth asset, which stopped working due to Updated skeleton logic: #2957 which changes how fbx graph nodes are collected (affecting its names, which is used by cloth modifier).
- Fixed cloth test suite active call to base's run_test function. It stopped working when its signature was changed here: 182d410#diff-3f5d93b0a76c838893693f19f2eacfe3e67040d445d6463c5c425ef5075cb409
- Renamed nvcloth TestSuite_Active.py to TestSuite_Main.py to be consistent with the other test folders.
- Fixed ModelAsset creator clone function. It was missing to copy the material slots, ultimately causing Material Component to show 0 material slots.
- Fixed crash where the revert overrides menu was not created when checking changes for selected component and selected entities.
Signed-off-by: moraaar moraaar@amazon.com
* Add material property names to material assets, disable FBX dependency on materialtype files.
Signed-off-by: Robin <rbarrand@amazon.com>
* Add reflection for MaterialAssets. Update member variable comment.
Signed-off-by: Robin <rbarrand@amazon.com>
* Switch cvar to using bus value. Refine comments.
Signed-off-by: Robin <rbarrand@amazon.com>
* Refactor functions and refine comments.
Signed-off-by: Robin <rbarrand@amazon.com>
* Realign property values when material property names are populated.
Signed-off-by: Robin <rbarrand@amazon.com>
* Switch PostLoadInit check to on asset status ready. Add realign property values code to PostLoadInit as well.
Signed-off-by: Robin <rbarrand@amazon.com>
* Stash@{1} code.
Signed-off-by: Robin <rbarrand@amazon.com>
* Refactor realignment code into the right places.
Signed-off-by: Robin <rbarrand@amazon.com>
* Remove pragma optmize off.
Signed-off-by: Robin <rbarrand@amazon.com>
* More refactoring.
Signed-off-by: Robin <rbarrand@amazon.com>
* Refactor comments and remove code no longer needed.
Signed-off-by: Robin <rbarrand@amazon.com>
* Refactor comments and remove unused include.
Signed-off-by: Robin <rbarrand@amazon.com>
* Comment refactor, corrected some code.
Signed-off-by: Robin <rbarrand@amazon.com>
Co-authored-by: Robin <rbarrand@amazon.com>
* Release build fix for Windows
* Release build fix for Android
* Release build fix for Windows
* Release build fix for Android
* Release build fix for Linux
* Release build fix for Mac
* Release build fix for iOS
Signed-off-by: Steve Pham <spham@amazon.com>
* ATOM-16237 Using setting registry to RPI system settings
Changes include:
- Remove RHISystemDesriptor since the pre-registered draw list tag is not needed.
- Remove EitorContext which was for system component settings.
- Add atom_rpi.setreg file
- Add getting RPISystemDescriptor from setting registry.
Signed-off-by: qingtao <qingtao@amazon.com>
Merge pull request #3574 from aws-lumberyard-dev/Atom/santorac/MoreShaderHotReloadFixes
Fixed a shader hot reload issue where the new root shader variant asset was not getting saved in the Shader object during OnAssetReloaded, it was only saved during OnAssetReady.
Fixed shader variant hot reload which was failing due to mismatched timestamps. The ShaderAsset was using microseconds and the ShaderVariantAsset was using system ticks. Since ticks will always be higher than microseconds, stale variants were not prevented from being used.
AtomSampleViewer's MaterialHotReloadTest script is passing again.
NOTE: The memory driller is still intact for now to avoid needing to
modify allocators, but the frame/cpu portions of driller and the
standalone executable are now gone.
Signed-off-by: Jeremy Ong <jcong@amazon.com>
Made Model Material Conversion Optional
Added a new registry setting that disables automatic conversion of materials from model files like FBX.
By default, processing of model files (like FBX) automatically convert the included materials to Atom materials, using StandardPBR. This adds a job dependency on StandardPBR.materialtype, which propagates to any related azsl files as well. Thus any change to azsl code will cause all model files in the project to rebuild.
Some game teams have no interest in using the auto-converted materials; they always use a Material Component to apply material overrides for every mesh. This new setting allows teams to disable material auto-conversion for the entire project, thus removing the job dependency on StandardPBR.materialtype. Instead, every mesh will be assigned the same default material. Any change to azsl code will cause that one default material to rebuild, but this will not trigger any models to rebuild.
Details:
- Added /O3DE/SceneAPI/MaterialConverter registry settings for configuring the scene material converter. It includes an enable flag, and a default material to use when conversion is disabled.
- Added SceneBuilderDependencyRequests::AddFingerprintInfo which allows SceneAPI components to modify the scene builder analysis fingerprint. We use this to reprocess scene files when the material converter settings change.
- Updated SceneAPI's material asset builder to skip the StandardPBR dependency when material conversion is disabled.
- Added some code to MaterialComponentController to handle an edge case that may when disabling material conversion on an existing project, and assigned materials disappear.
Testing:
- Changing the registry setting does trigger a rebuild of the fbx files.
- When material conversion is disabled, changing an azsl file does not cause fbx files to rebuild, but the shader still reloads as expected.
- Made a test level using multiple models with multiple meshes, made various adjustments to the material slots for each mesh, and tried switching the material conversion registry setting from true to false. (Details below)
- Merged this change to a customer's fork and tested on their existing content.
Details about my test level:
- Made a new test level AtomTest project
- Added two entities, both using multi-mat_mesh-groups_1m_cubes.fbx
- Added a material component to both entities
- Entity 1 material assignments
- Blue_Zaxis: left as-is
- Green_Yaxis: exported the material
- Red_Xaxis: exported the material, and changed the material instance color to pink
- StingrayPBS1: exported the material, scaled the UVs in the exported material source, and changed the material instance color to green.
- With_Texture: selected an existing brick material, changed the material instance color to red.
- Entity 2 material assignments
- Default Material: set to an existing brick material
- Blue_Zaxis: manually assigned built-in material that was converted from fbx
- Green_Yaxis: manually assigned built-in material that was converted from fbx, and changed the material instance color to orange
Fixes GPU crashes when releasing Indirect draw and query related dx12 objects
Fixes imgui profiler related to viewing buffer allocations
Signed-off-by: moudgils <moudgils@amazon.com>
* Moved PlatformLimits to setreg. Removed Device PostInit. Some clean up.
Signed-off-by: jiaweig <jiaweig@amazon.com>
* Move setreg loading the PlatformLimitsDescriptor super class.
Signed-off-by: jiaweig <jiaweig@amazon.com>
* Apply same implementation for fake device used in unit tests
Signed-off-by: jiaweig <jiaweig@amazon.com>
* Add implementation for Null renderer. Swap order for register RHI interface in initialization.
Signed-off-by: jiaweig <jiaweig@amazon.com>
* Move back setreg from PlatfromLimitsDescriptor to Device, due to Linux dependency issue.
Signed-off-by: jiaweig <jiaweig@amazon.com>
* Changed the function to take in RHI backend name
Signed-off-by: jiaweig <jiaweig@amazon.com>