ATOM-16063 Remove SetShaderResourceGroupCallback in scene and update scene srg handling (#3969)
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>
This commit is contained in:
@@ -308,10 +308,10 @@ namespace AZ
|
||||
// The fix is to clear the buffer outside of the callback.
|
||||
for (int32_t i = 0; i < RHI::Limits::Device::FrameCountMax; i++)
|
||||
{
|
||||
if (m_isReadbackComplete[m_readbackBufferCurrentIndex])
|
||||
if (m_isReadbackComplete[i])
|
||||
{
|
||||
m_isReadbackComplete[m_readbackBufferCurrentIndex] = false;
|
||||
m_readbackBufferArray[m_readbackBufferCurrentIndex] = nullptr;
|
||||
m_isReadbackComplete[i] = false;
|
||||
m_readbackBufferArray[i] = nullptr;
|
||||
}
|
||||
}
|
||||
// Loop the triple buffer index and cache the current index to the callback.
|
||||
|
||||
Reference in New Issue
Block a user