Change OPTICK_VERIFY to print error and continue, also fix Optick unreachable code

This commit is contained in:
SRSaunders 2024-02-18 22:10:00 -05:00
parent 2dd185dd69
commit 7183e8707b
4 changed files with 4 additions and 8 deletions

View file

@ -71,7 +71,7 @@
#define OPTICK_ENABLE_GPU_VULKAN (OPTICK_ENABLE_GPU /*&& 0*/)
#endif
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Vulkan Functions
// Vulkan Functions - static+dynamic (1) or dynamic linking only (0)
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
#if !defined(OPTICK_STATIC_VULKAN_FUNCTIONS)
#define OPTICK_STATIC_VULKAN_FUNCTIONS (0 /*1*/)

View file

@ -148,7 +148,7 @@ static const ProcessID INVALID_PROCESS_ID = (ProcessID)-1;
#else
#define OPTICK_ASSERT(arg, description)
#define OPTICK_FAILED(description) { throw std::runtime_error(description); }
#define OPTICK_VERIFY(arg, description, operation) if (!(arg)) { OPTICK_FAILED(description); operation; }
#define OPTICK_VERIFY(arg, description, operation) if (!(arg)) { printf("%s\n", description); operation; }
#endif
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

View file

@ -240,7 +240,7 @@ EventDescription::EventDescription() : name(""), file(""), line(0), index((uint3
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
EventDescription& EventDescription::operator=(const EventDescription&)
{
OPTICK_FAILED("It is pointless to copy EventDescription. Please, check you logic!"); return *this;
OPTICK_VERIFY( false, "It is pointless to copy EventDescription. Please, check your logic!", return *this );
}
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
EventData* Event::Start(const EventDescription& description)

View file

@ -91,11 +91,7 @@ public:
IMessage* result = factory[messageType](str);
if (header.length + str.Length() != length)
{
OPTICK_FAILED("Message Stream is corrupted! Invalid Protocol?")
return nullptr;
}
OPTICK_VERIFY( header.length + str.Length() == length, "Message Stream is corrupted! Invalid Protocol?", return nullptr );
return result;
}