You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
o3de/Gems/Atom/RPI/Code/Source/RPI.Reflect/Material
Chris Santora 982406d4d5 Fixed race conditions that could prevent successful hot-reload of shaders.
ATOM-15728 Shader Hot Reload Fails in Debug Build

The main change was to add OnAssetReady handlers to each of the asset classes. See comments in ShaderAsset::OnAssetReady for a detailed explanation. In short, OnAssetReloaded gets missed while assets are being reloaded at the same time on multiple threads, but OnAssetReady is always called whenever connecting to the AssetBus because of its AssetConnectionPolicy.

The above change required the addition of a new AssetInitBus to call the PostLoadInit() functions. Because OnAssetReady connects to buses that are not mutex-protected, they have to be connected on the main thread. AssetInitBus::PostLoadInit is called every frame in RPISystem::SimulationTick. All Atom's asset handlers that need to do post-load initialization must connect to the AssetInitBus, and the asset will disconnect itself after initialization is complete.

We also need the Shader class to handle OnShaderAssetReinitialized to properly handle the shader reload.

With these changes I can click back and forth between "Blending On" and "Blending Off" many times (like 20 times) without issue.
5 years ago
..
LuaMaterialFunctor.cpp ATOM-15133 "Clean Up EnhancedPBR" 5 years ago
MaterialAsset.cpp Fixed race conditions that could prevent successful hot-reload of shaders. 5 years ago
MaterialAssetCreator.cpp Initial commit 5 years ago
MaterialAssetCreatorCommon.cpp Initial commit 5 years ago
MaterialDynamicMetadata.cpp Made StandardMultilayerPBR hide a layer's property groups when that layer is disabled. 5 years ago
MaterialFunctor.cpp ATOM-15597 Accessing Material Instance Panel Crashes Editor 5 years ago
MaterialPropertiesLayout.cpp Initial commit 5 years ago
MaterialPropertyDescriptor.cpp Made StandardMultilayerPBR hide a layer's property groups when that layer is disabled. 5 years ago
MaterialPropertyValue.cpp Initial commit 5 years ago
MaterialTypeAsset.cpp Fixed race conditions that could prevent successful hot-reload of shaders. 5 years ago
MaterialTypeAssetCreator.cpp Initial commit 5 years ago
ShaderCollection.cpp LYN-2905 Script Canvas: Saving a graph that contains an Item Variable crashes the Editor 5 years ago