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
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
..
Asset Add newlines to the end of all files 5 years ago
Buffer ATOM-15658 Better option of CreateCommonBuffer requires unique buffer name (#1133) 5 years ago
Image Add newlines to the end of all files 5 years ago
Material Fixed race conditions that could prevent successful hot-reload of shaders. 5 years ago
Model ensure brute force ray intersection works (#1170) 5 years ago
Pass Integrating up through commit 90f050496 5 years ago
Shader Fixed race conditions that could prevent successful hot-reload of shaders. 5 years ago
System Initial commit 5 years ago
Base.cpp ATOM-15252 [Atom 0.8.5] Track View capture crashes when scene contains certain postfx 5 years ago
FeatureProcessorDescriptor.cpp Initial commit 5 years ago
GpuQuerySystemDescriptor.cpp Initial commit 5 years ago
RPISystemDescriptor.cpp Initial commit 5 years ago
ResourcePoolAsset.cpp Initial commit 5 years ago
ResourcePoolAssetCreator.cpp Add newlines to the end of all files 5 years ago