Files
Steve Pham 38261d0800 Shorten copyright headers by splitting into 2 lines (#2213)
* Updated all copyright headers to split the longer original copyright line into 2 shorter lines

Signed-off-by: Steve Pham <spham@amazon.com>
2021-07-16 15:25:48 -07:00

64 lines
1.5 KiB
C++

/*
* Copyright (c) Contributors to the Open 3D Engine Project.
* For complete copyright and license terms please see the LICENSE at the root of this distribution.
*
* SPDX-License-Identifier: Apache-2.0 OR MIT
*
*/
#include <Tests/Scope.h>
namespace UnitTest
{
using namespace AZ;
void Scope::InitInternal()
{
AZ_Assert(IsInitialized() == false, "Is initialized!");
}
void Scope::ActivateInternal()
{
AZ_Assert(IsActive() == false, "Is Active");
}
void Scope::CompileInternal([[maybe_unused]] AZ::RHI::Device& device)
{
for (const AZ::RHI::ScopeAttachment* scopeAttachment : GetAttachments())
{
ValidateBinding(scopeAttachment);
}
}
void Scope::DeactivateInternal()
{
AZ_Assert(IsActive(), "Is not active");
}
void Scope::ShutdownInternal()
{
AZ_Assert(IsInitialized(), "Is not initialized");
}
void Scope::ValidateBinding(const AZ::RHI::ScopeAttachment* scopeAttachment)
{
ASSERT_TRUE(&scopeAttachment->GetScope() == this);
const AZ::RHI::FrameAttachment& attachment = scopeAttachment->GetFrameAttachment();
bool found = false;
for (
const AZ::RHI::ScopeAttachment* search = attachment.GetFirstScopeAttachment();
search;
search = search->GetNext())
{
if (search == scopeAttachment)
{
found = true;
break;
}
}
ASSERT_TRUE(found);
}
}