| 1 | /* |
| 2 | * Copyright (c) 2008-2015, NVIDIA CORPORATION. All rights reserved. |
| 3 | * |
| 4 | * NVIDIA CORPORATION and its licensors retain all intellectual property |
| 5 | * and proprietary rights in and to this software, related documentation |
| 6 | * and any modifications thereto. Any use, reproduction, disclosure or |
| 7 | * distribution of this software and related documentation without an express |
| 8 | * license agreement from NVIDIA CORPORATION is strictly prohibited. |
| 9 | */ |
| 10 | |
| 11 | #ifndef PX_PROFILE_COMPILE_TIME_EVENT_FILTER_H |
| 12 | #define PX_PROFILE_COMPILE_TIME_EVENT_FILTER_H |
| 13 | |
| 14 | #include "physxprofilesdk/PxProfileBase.h" |
| 15 | #include "physxprofilesdk/PxProfileEventId.h" |
| 16 | |
| 17 | //Define before including header in order to enable a different |
| 18 | //compile time event profile threshold. |
| 19 | #ifndef PX_PROFILE_EVENT_PROFILE_THRESHOLD |
| 20 | #define PX_PROFILE_EVENT_PROFILE_THRESHOLD EventPriorities::Medium |
| 21 | #endif |
| 22 | |
| 23 | namespace physx { namespace profile { |
| 24 | |
| 25 | struct EventPriorities |
| 26 | { |
| 27 | enum Enum |
| 28 | { |
| 29 | None, // the filter setting to kill all events |
| 30 | Coarse, |
| 31 | Medium, |
| 32 | Detail, |
| 33 | Never // the priority to set for an event if it should never fire. |
| 34 | }; |
| 35 | }; |
| 36 | |
| 37 | //Gets the priority for a given event. |
| 38 | //specialize this object in order to get the priorities setup correctly |
| 39 | template<PxU16 TEventId> |
| 40 | struct EventPriority { static const PxU32 val = EventPriorities::Medium; }; |
| 41 | |
| 42 | |
| 43 | template<PxU16 TEventId> |
| 44 | struct EventFilter |
| 45 | { |
| 46 | static const bool val = EventPriority<TEventId>::val <= PX_PROFILE_EVENT_PROFILE_THRESHOLD; |
| 47 | }; |
| 48 | |
| 49 | }} |
| 50 | |
| 51 | #define PX_PROFILE_EVENT_PRIORITY_VALUE(subsystem, eventId ) physx::profile::EventPriority<physx::profile::EventIds::subsystem##eventId>::val |
| 52 | #define PX_PROFILE_EVENT_FILTER_VALUE( subsystem, eventId ) physx::profile::EventFilter<physx::profile::EventIds::subsystem##eventId>::val |
| 53 | #define PX_PROFILE_EVENT_ID( subsystem, eventId ) physx::PxProfileCompileTimeFilteredEventId<PX_PROFILE_EVENT_FILTER_VALUE( subsystem, eventId )>( physx::profile::EventIds::subsystem##eventId ) |
| 54 | |
| 55 | #endif // PX_PROFILE_COMPILE_TIME_EVENT_FILTER_H |
| 56 | |