diff options
Diffstat (limited to 'src/3rdparty/angle/src/common')
-rw-r--r-- | src/3rdparty/angle/src/common/angleutils.h | 14 | ||||
-rw-r--r-- | src/3rdparty/angle/src/common/debug.cpp | 44 | ||||
-rw-r--r-- | src/3rdparty/angle/src/common/debug.h | 32 | ||||
-rw-r--r-- | src/3rdparty/angle/src/common/event_tracer.cpp | 2 | ||||
-rw-r--r-- | src/3rdparty/angle/src/common/event_tracer.h | 12 | ||||
-rw-r--r-- | src/3rdparty/angle/src/common/system.h | 26 | ||||
-rw-r--r-- | src/3rdparty/angle/src/common/version.h | 18 |
7 files changed, 75 insertions, 73 deletions
diff --git a/src/3rdparty/angle/src/common/angleutils.h b/src/3rdparty/angle/src/common/angleutils.h index 9761567fb2..7723f0fb72 100644 --- a/src/3rdparty/angle/src/common/angleutils.h +++ b/src/3rdparty/angle/src/common/angleutils.h @@ -42,6 +42,20 @@ void SafeRelease(T& resource) } } +template <typename T> +void SafeDelete(T*& resource) +{ + delete resource; + resource = NULL; +} + +template <typename T> +void SafeDeleteArray(T*& resource) +{ + delete[] resource; + resource = NULL; +} + #if defined(_MSC_VER) #define snprintf _snprintf #endif diff --git a/src/3rdparty/angle/src/common/debug.cpp b/src/3rdparty/angle/src/common/debug.cpp index 9b932567b0..05d3dc62ad 100644 --- a/src/3rdparty/angle/src/common/debug.cpp +++ b/src/3rdparty/angle/src/common/debug.cpp @@ -7,21 +7,23 @@ // debug.cpp: Debugging utilities. #include "common/debug.h" -#include "common/system.h" -#ifndef ANGLE_ENABLE_D3D11 +#include <stdarg.h> + +#if defined(ANGLE_ENABLE_PERF) #include <d3d9.h> -#else -typedef DWORD D3DCOLOR; #endif namespace gl { - +#if defined(ANGLE_ENABLE_PERF) typedef void (WINAPI *PerfOutputFunction)(D3DCOLOR, LPCWSTR); +#else +typedef void (*PerfOutputFunction)(unsigned int, const wchar_t*); +#endif static void output(bool traceFileDebugOnly, PerfOutputFunction perfFunc, const char *format, va_list vararg) { -#if !defined(ANGLE_DISABLE_PERF) +#if defined(ANGLE_ENABLE_PERF) if (perfActive()) { char message[32768]; @@ -41,15 +43,15 @@ static void output(bool traceFileDebugOnly, PerfOutputFunction perfFunc, const c perfFunc(0, wideMessage); } -#endif +#endif // ANGLE_ENABLE_PERF -#if !defined(ANGLE_DISABLE_TRACE) +#if defined(ANGLE_ENABLE_TRACE) #if defined(NDEBUG) if (traceFileDebugOnly) { return; } -#endif +#endif // NDEBUG FILE* file = fopen(TRACE_OUTPUT_FILE, "a"); if (file) @@ -57,50 +59,50 @@ static void output(bool traceFileDebugOnly, PerfOutputFunction perfFunc, const c vfprintf(file, format, vararg); fclose(file); } -#endif +#endif // ANGLE_ENABLE_TRACE } void trace(bool traceFileDebugOnly, const char *format, ...) { va_list vararg; va_start(vararg, format); -#if defined(ANGLE_DISABLE_PERF) - output(traceFileDebugOnly, NULL, format, vararg); -#else +#if defined(ANGLE_ENABLE_PERF) output(traceFileDebugOnly, D3DPERF_SetMarker, format, vararg); +#else + output(traceFileDebugOnly, NULL, format, vararg); #endif va_end(vararg); } bool perfActive() { -#if defined(ANGLE_DISABLE_PERF) - return false; -#else +#if defined(ANGLE_ENABLE_PERF) static bool active = D3DPERF_GetStatus() != 0; return active; +#else + return false; #endif } ScopedPerfEventHelper::ScopedPerfEventHelper(const char* format, ...) { -#if !defined(ANGLE_DISABLE_PERF) -#if defined(ANGLE_DISABLE_TRACE) +#if defined(ANGLE_ENABLE_PERF) +#if !defined(ANGLE_ENABLE_TRACE) if (!perfActive()) { return; } -#endif +#endif // !ANGLE_ENABLE_TRACE va_list vararg; va_start(vararg, format); output(true, reinterpret_cast<PerfOutputFunction>(D3DPERF_BeginEvent), format, vararg); va_end(vararg); -#endif +#endif // ANGLE_ENABLE_PERF } ScopedPerfEventHelper::~ScopedPerfEventHelper() { -#if !defined(ANGLE_DISABLE_PERF) +#if defined(ANGLE_ENABLE_PERF) if (perfActive()) { D3DPERF_EndEvent(); diff --git a/src/3rdparty/angle/src/common/debug.h b/src/3rdparty/angle/src/common/debug.h index 23ee26d23b..793843895c 100644 --- a/src/3rdparty/angle/src/common/debug.h +++ b/src/3rdparty/angle/src/common/debug.h @@ -39,33 +39,35 @@ namespace gl } // A macro to output a trace of a function call and its arguments to the debugging log -#if defined(ANGLE_DISABLE_TRACE) && defined(ANGLE_DISABLE_PERF) -#define TRACE(message, ...) (void(0)) -#else +#if defined(ANGLE_ENABLE_TRACE) || defined(ANGLE_ENABLE_PERF) #define TRACE(message, ...) gl::trace(true, "trace: %s(%d): " message "\n", __FUNCTION__, __LINE__, ##__VA_ARGS__) +#else +#define TRACE(message, ...) (void(0)) #endif // A macro to output a function call and its arguments to the debugging log, to denote an item in need of fixing. -#if defined(ANGLE_DISABLE_TRACE) && defined(ANGLE_DISABLE_PERF) -#define FIXME(message, ...) (void(0)) -#else +#if defined(ANGLE_ENABLE_TRACE) || defined(ANGLE_ENABLE_PERF) #define FIXME(message, ...) gl::trace(false, "fixme: %s(%d): " message "\n", __FUNCTION__, __LINE__, ##__VA_ARGS__) +#else +#define FIXME(message, ...) (void(0)) #endif // A macro to output a function call and its arguments to the debugging log, in case of error. -#if defined(ANGLE_DISABLE_TRACE) && defined(ANGLE_DISABLE_PERF) -#define ERR(message, ...) (void(0)) -#else +#if defined(ANGLE_ENABLE_TRACE) || defined(ANGLE_ENABLE_PERF) #define ERR(message, ...) gl::trace(false, "err: %s(%d): " message "\n", __FUNCTION__, __LINE__, ##__VA_ARGS__) +#else +#define ERR(message, ...) (void(0)) #endif // A macro to log a performance event around a scope. -#if defined(ANGLE_DISABLE_TRACE) && defined(ANGLE_DISABLE_PERF) -#define EVENT(message, ...) (void(0)) -#elif defined(_MSC_VER) +#if defined(ANGLE_ENABLE_TRACE) || defined(ANGLE_ENABLE_PERF) +#if defined(_MSC_VER) #define EVENT(message, ...) gl::ScopedPerfEventHelper scopedPerfEventHelper ## __LINE__(__FUNCTION__ message "\n", __VA_ARGS__); #else #define EVENT(message, ...) gl::ScopedPerfEventHelper scopedPerfEventHelper(message "\n", ##__VA_ARGS__); +#endif // _MSC_VER +#else +#define EVENT(message, ...) (void(0)) #endif // A macro asserting a condition and outputting failures to the debug log @@ -99,8 +101,10 @@ namespace gl #define UNREACHABLE() ERR("\t! Unreachable reached: %s(%d)\n", __FUNCTION__, __LINE__) #endif -// A macro that determines whether an object has a given runtime type. -#if !defined(NDEBUG) && (!defined(_MSC_VER) || defined(_CPPRTTI)) +// A macro that determines whether an object has a given runtime type. MSVC uses _CPPRTTI. +// GCC uses __GXX_RTTI, but the macro was introduced in version 4.3, so we assume that all older +// versions support RTTI. +#if !defined(NDEBUG) && (!defined(_MSC_VER) || defined(_CPPRTTI)) && (!defined(__GNUC__) || __GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 3) || defined(__GXX_RTTI)) #define HAS_DYNAMIC_TYPE(type, obj) (dynamic_cast<type >(obj) != NULL) #else #define HAS_DYNAMIC_TYPE(type, obj) true diff --git a/src/3rdparty/angle/src/common/event_tracer.cpp b/src/3rdparty/angle/src/common/event_tracer.cpp index 96cbb01061..142373d13f 100644 --- a/src/3rdparty/angle/src/common/event_tracer.cpp +++ b/src/3rdparty/angle/src/common/event_tracer.cpp @@ -14,7 +14,7 @@ AddTraceEventFunc g_addTraceEvent; extern "C" { -void __stdcall SetTraceFunctionPointers(GetCategoryEnabledFlagFunc getCategoryEnabledFlag, +void TRACE_ENTRY SetTraceFunctionPointers(GetCategoryEnabledFlagFunc getCategoryEnabledFlag, AddTraceEventFunc addTraceEvent) { gl::g_getCategoryEnabledFlag = getCategoryEnabledFlag; diff --git a/src/3rdparty/angle/src/common/event_tracer.h b/src/3rdparty/angle/src/common/event_tracer.h index ae397e7db9..14b7b298fd 100644 --- a/src/3rdparty/angle/src/common/event_tracer.h +++ b/src/3rdparty/angle/src/common/event_tracer.h @@ -5,6 +5,14 @@ #ifndef COMMON_EVENT_TRACER_H_ #define COMMON_EVENT_TRACER_H_ +#if !defined(TRACE_ENTRY) +#if defined(_WIN32) +#define TRACE_ENTRY __stdcall +#else +#define TRACE_ENTRY +#endif // // _WIN32 +#endif //TRACE_ENTRY + extern "C" { typedef const unsigned char* (*GetCategoryEnabledFlagFunc)(const char* name); @@ -14,8 +22,8 @@ typedef void (*AddTraceEventFunc)(char phase, const unsigned char* categoryGroup unsigned char flags); // extern "C" so that it has a reasonable name for GetProcAddress. -void __stdcall SetTraceFunctionPointers(GetCategoryEnabledFlagFunc get_category_enabled_flag, - AddTraceEventFunc add_trace_event_func); +void TRACE_ENTRY SetTraceFunctionPointers(GetCategoryEnabledFlagFunc get_category_enabled_flag, + AddTraceEventFunc add_trace_event_func); } diff --git a/src/3rdparty/angle/src/common/system.h b/src/3rdparty/angle/src/common/system.h deleted file mode 100644 index 5eb140bccd..0000000000 --- a/src/3rdparty/angle/src/common/system.h +++ /dev/null @@ -1,26 +0,0 @@ -// -// Copyright (c) 2002-2012 The ANGLE Project Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. -// - -// system.h: Includes Windows system headers and undefines macros that conflict. - -#ifndef COMMON_SYSTEM_H -#define COMMON_SYSTEM_H - -#if !defined(WIN32_LEAN_AND_MEAN) -#define WIN32_LEAN_AND_MEAN -#endif - -#include <windows.h> - -#if defined(min) -#undef min -#endif - -#if defined(max) -#undef max -#endif - -#endif // COMMON_SYSTEM_H diff --git a/src/3rdparty/angle/src/common/version.h b/src/3rdparty/angle/src/common/version.h index 7a4942ad88..f6ae19f541 100644 --- a/src/3rdparty/angle/src/common/version.h +++ b/src/3rdparty/angle/src/common/version.h @@ -1,12 +1,12 @@ -#define MAJOR_VERSION 1 -#define MINOR_VERSION 2 -#define BUILD_VERSION 0 -#define BUILD_REVISION 2446 +#include "commit.h" -#define STRINGIFY(x) #x -#define MACRO_STRINGIFY(x) STRINGIFY(x) +#define ANGLE_MAJOR_VERSION 1 +#define ANGLE_MINOR_VERSION 3 -#define REVISION_STRING MACRO_STRINGIFY(BUILD_REVISION) -#define VERSION_STRING MACRO_STRINGIFY(MAJOR_VERSION) "." MACRO_STRINGIFY(MINOR_VERSION) "." MACRO_STRINGIFY(BUILD_VERSION) "." MACRO_STRINGIFY(BUILD_REVISION) +#define ANGLE_STRINGIFY(x) #x +#define ANGLE_MACRO_STRINGIFY(x) ANGLE_STRINGIFY(x) -#define VERSION_DWORD ((MAJOR_VERSION << 24) | (MINOR_VERSION << 16) | BUILD_REVISION) +#define ANGLE_VERSION_STRING \ + ANGLE_MACRO_STRINGIFY(ANGLE_MAJOR_VERSION) "." \ + ANGLE_MACRO_STRINGIFY(ANGLE_MINOR_VERSION) "." \ + ANGLE_COMMIT_HASH |