diff options
author | Sergio Ahumada <sergio.ahumada@digia.com> | 2013-04-10 15:41:47 +0200 |
---|---|---|
committer | Sergio Ahumada <sergio.ahumada@digia.com> | 2013-04-10 15:42:22 +0200 |
commit | 90297a64f203959f90041887ea31f4bd04bc059a (patch) | |
tree | 86f8ad6a5af26fd618cdb2e20601e6df89ac94d6 /src/3rdparty/angle/src/common | |
parent | 537a4bc4011d32de193dc31caf09a44c1810ab33 (diff) | |
parent | f273d6fbc02055ff3999adc0df76360ca0670435 (diff) |
Merge branch 'stable' into dev
Change-Id: Icff019d74ae04c628a80f66aa478e4db40fae464
Diffstat (limited to 'src/3rdparty/angle/src/common')
-rw-r--r-- | src/3rdparty/angle/src/common/angleutils.h | 28 | ||||
-rw-r--r-- | src/3rdparty/angle/src/common/debug.cpp | 15 | ||||
-rw-r--r-- | src/3rdparty/angle/src/common/debug.h | 7 | ||||
-rw-r--r-- | src/3rdparty/angle/src/common/system.h | 26 | ||||
-rw-r--r-- | src/3rdparty/angle/src/common/version.h | 6 |
5 files changed, 76 insertions, 6 deletions
diff --git a/src/3rdparty/angle/src/common/angleutils.h b/src/3rdparty/angle/src/common/angleutils.h index ff9730c4da..31ac559279 100644 --- a/src/3rdparty/angle/src/common/angleutils.h +++ b/src/3rdparty/angle/src/common/angleutils.h @@ -15,6 +15,31 @@ TypeName(const TypeName&); \ void operator=(const TypeName&) +template <typename T, unsigned int N> +inline unsigned int ArraySize(T(&)[N]) +{ + return N; +} + +template <typename T, unsigned int N> +void SafeRelease(T (&resourceBlock)[N]) +{ + for (unsigned int i = 0; i < N; i++) + { + SafeRelease(resourceBlock[i]); + } +} + +template <typename T> +void SafeRelease(T& resource) +{ + if (resource) + { + resource->Release(); + resource = NULL; + } +} + #if defined(_MSC_VER) #define snprintf _snprintf #endif @@ -23,4 +48,7 @@ #define VENDOR_ID_INTEL 0x8086 #define VENDOR_ID_NVIDIA 0x10DE +#define GL_BGRA4_ANGLEX 0x6ABC +#define GL_BGR5_A1_ANGLEX 0x6ABD + #endif // COMMON_ANGLEUTILS_H_ diff --git a/src/3rdparty/angle/src/common/debug.cpp b/src/3rdparty/angle/src/common/debug.cpp index b2238f9708..438d3975e8 100644 --- a/src/3rdparty/angle/src/common/debug.cpp +++ b/src/3rdparty/angle/src/common/debug.cpp @@ -7,11 +7,12 @@ // debug.cpp: Debugging utilities. #include "common/debug.h" - -#include <stdio.h> -#include <stdarg.h> +#include "common/system.h" +#ifdef ANGLE_ENABLE_D3D11 +typedef DWORD D3DCOLOR; +#else #include <d3d9.h> -#include <windows.h> +#endif namespace gl { @@ -84,6 +85,12 @@ bool perfActive() ScopedPerfEventHelper::ScopedPerfEventHelper(const char* format, ...) { #if !defined(ANGLE_DISABLE_PERF) +#if defined(ANGLE_DISABLE_TRACE) + if (!perfActive()) + { + return; + } +#endif va_list vararg; va_start(vararg, format); output(true, reinterpret_cast<PerfOutputFunction>(D3DPERF_BeginEvent), format, vararg); diff --git a/src/3rdparty/angle/src/common/debug.h b/src/3rdparty/angle/src/common/debug.h index 5f8f60fe61..23ee26d23b 100644 --- a/src/3rdparty/angle/src/common/debug.h +++ b/src/3rdparty/angle/src/common/debug.h @@ -99,6 +99,13 @@ 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)) +#define HAS_DYNAMIC_TYPE(type, obj) (dynamic_cast<type >(obj) != NULL) +#else +#define HAS_DYNAMIC_TYPE(type, obj) true +#endif + // A macro functioning as a compile-time assert to validate constant conditions #define META_ASSERT(condition) typedef int COMPILE_TIME_ASSERT_##__LINE__[static_cast<bool>(condition)?1:-1] diff --git a/src/3rdparty/angle/src/common/system.h b/src/3rdparty/angle/src/common/system.h new file mode 100644 index 0000000000..5eb140bccd --- /dev/null +++ b/src/3rdparty/angle/src/common/system.h @@ -0,0 +1,26 @@ +// +// 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 fec98a15c9..7913851e6a 100644 --- a/src/3rdparty/angle/src/common/version.h +++ b/src/3rdparty/angle/src/common/version.h @@ -1,10 +1,12 @@ #define MAJOR_VERSION 1 -#define MINOR_VERSION 0 +#define MINOR_VERSION 1 #define BUILD_VERSION 0 -#define BUILD_REVISION 1318 +#define BUILD_REVISION 2037 #define STRINGIFY(x) #x #define MACRO_STRINGIFY(x) STRINGIFY(x) #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 VERSION_DWORD ((MAJOR_VERSION << 24) | (MINOR_VERSION << 16) | BUILD_REVISION) |