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
Chris Santora b176697ce9 Fixed ATOM-14613 Baseviewer MatertialHotReloadTest fails to change the color after turning blending on and off
The problem was...
After a MaterialAsset reload, there could be two different versions of the MaterialAsset in memory: the old one and the reloaded one. The old one is still connected to buses and can send reinitialization messages when other things reload or reinitialize. So when the shader asset reloaded, both the old and new MaterialAsset were sending reinitialization messages. Material::OnMaterialAssetReinitialized was using the materialAsset parameter to initialize the Material, and the latest call to OnMaterialAssetReinitialized was for the *old* MaterialAsset.

The solution is to use the m_materialAsset member when reinitializing the Material. I also added checks in a couple places to skip unnecessary reinitialization, and added comments in the bus headers to warn developers about this issue.

Testing: Added a new step to ASV's MaterialHotReloadTest.bv.lua script for the error scenario, and this now passes. Ran ASV full test suite, both dx12 and vulkan, only known issues occurred.
5 years ago
..
Platform Fixed non-Windows platform include 5 years ago
RPI.Builders ATOM-15658 Better option of CreateCommonBuffer requires unique buffer name (#1133) 5 years ago
RPI.Edit [ATOM-15618] Shader Build Pipeline: Add UnitTest To Validate Shader C… (#918) 5 years ago
RPI.Editor Initial commit 5 years ago
RPI.Private Add newlines to the end of all files 5 years ago
RPI.Public Fixed ATOM-14613 Baseviewer MatertialHotReloadTest fails to change the color after turning blending on and off 5 years ago
RPI.Reflect Fixed ATOM-14613 Baseviewer MatertialHotReloadTest fails to change the color after turning blending on and off 5 years ago