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/Code/CryEngine/CryCommon/FrameProfiler.h

79 lines
3.0 KiB
C

/*
* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
* its licensors.
*
* For complete copyright and license terms please see the LICENSE at the root of this
* distribution (the "License"). All use of this software is governed by the License,
* or, if provided, by the license below or the license accompanying this file. Do not
* remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*
*/
// Original file Copyright Crytek GMBH or its affiliates, used under license.
#pragma once
#include <AzCore/Debug/Profiler.h>
#define SUBSYSTEM_DEFINES \
X(PROFILE_ANY, "Any") \
X(PROFILE_RENDERER, "Renderer") \
X(PROFILE_3DENGINE, "3DEngine") \
X(PROFILE_PARTICLE, "Particle") \
X(PROFILE_AI, "AI") \
X(PROFILE_ANIMATION, "Animation") \
X(PROFILE_MOVIE, "Movie") \
X(PROFILE_ENTITY, "Entity") \
X(PROFILE_UI, "UI") \
X(PROFILE_NETWORK, "Network") \
X(PROFILE_PHYSICS, "Physics") \
X(PROFILE_SCRIPT, "Script") \
X(PROFILE_SCRIPT_CFUNC, "Script C Functions") \
X(PROFILE_AUDIO, "Audio") \
X(PROFILE_EDITOR, "Editor") \
X(PROFILE_SYSTEM, "System") \
X(PROFILE_ACTION, "Action") \
X(PROFILE_GAME, "Game") \
X(PROFILE_INPUT, "Input") \
X(PROFILE_SYNC, "Sync") \
X(PROFILE_NETWORK_TRAFFIC, "Network Traffic") \
X(PROFILE_DEVICE, "Device")
#define X(Subsystem, SubsystemName) Subsystem,
enum EProfiledSubsystem
{
SUBSYSTEM_DEFINES
PROFILE_LAST_SUBSYSTEM
};
#undef X
static_assert(static_cast<AZ::Debug::ProfileCategory>(PROFILE_LAST_SUBSYSTEM) == AZ::Debug::ProfileCategory::LegacyLast, "Mismatched AZ and Legacy profile categories");
#include <AzCore/Debug/EventTrace.h>
#define FUNCTION_PROFILER_LEGACYONLY(pISystem, subsystem)
#define FUNCTION_PROFILER(pISystem, subsystem) \
AZ_PROFILE_FUNCTION(static_cast<AZ::Debug::ProfileCategory>(subsystem));
#define FUNCTION_PROFILER_FAST(pISystem, subsystem, bProfileEnabled) \
AZ_PROFILE_FUNCTION(static_cast<AZ::Debug::ProfileCategory>(subsystem));
#define FUNCTION_PROFILER_ALWAYS(pISystem, subsystem) \
AZ_PROFILE_FUNCTION(static_cast<AZ::Debug::ProfileCategory>(subsystem));
#define FRAME_PROFILER_LEGACYONLY(szProfilerName, pISystem, subsystem)
#define FRAME_PROFILER(szProfilerName, pISystem, subsystem) \
AZ_PROFILE_SCOPE(static_cast<AZ::Debug::ProfileCategory>(subsystem), szProfilerName);
#define FRAME_PROFILER_FAST(szProfilerName, pISystem, subsystem, bProfileEnabled) \
AZ_PROFILE_SCOPE(static_cast<AZ::Debug::ProfileCategory>(subsystem), szProfilerName);
#define FUNCTION_PROFILER_SYS(subsystem) \
FUNCTION_PROFILER(gEnv->pSystem, PROFILE_##subsystem)
#define STALL_PROFILER(cause)