mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-07 20:17:37 +00:00
c1f5ed3733
--HG-- extra : rebase_source : 84a48e83aab4a71d7be05d38874942ec89721d4d
202 lines
6.7 KiB
Diff
202 lines
6.7 KiB
Diff
From: Jacek Caban <jacek@codeweavers.com>
|
|
Bug 945292 - Fixed ANGLE compilation on mingw.
|
|
|
|
|
|
diff --git a/gfx/angle/src/common/debug.h b/gfx/angle/src/common/debug.h
|
|
index 23ee26d..060b727 100644
|
|
--- a/gfx/angle/src/common/debug.h
|
|
+++ b/gfx/angle/src/common/debug.h
|
|
@@ -94,18 +94,20 @@ namespace gl
|
|
#define UNREACHABLE() do { \
|
|
ERR("\t! Unreachable reached: %s(%d)\n", __FUNCTION__, __LINE__); \
|
|
assert(false); \
|
|
} while(0)
|
|
#else
|
|
#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
|
|
#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/gfx/angle/src/libGLESv2/Constants.h b/gfx/angle/src/libGLESv2/Constants.h
|
|
new file mode 100644
|
|
index 0000000..9f24d66
|
|
--- /dev/null
|
|
+++ b/gfx/angle/src/libGLESv2/Constants.h
|
|
@@ -0,0 +1,34 @@
|
|
+//
|
|
+// Copyright (c) 2013 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.
|
|
+//
|
|
+
|
|
+// Contants.h: Defines some implementation specific and gl constants
|
|
+
|
|
+#ifndef LIBGLESV2_CONSTANTS_H_
|
|
+#define LIBGLESV2_CONSTANTS_H_
|
|
+
|
|
+namespace gl
|
|
+{
|
|
+
|
|
+enum
|
|
+{
|
|
+ MAX_VERTEX_ATTRIBS = 16,
|
|
+ MAX_TEXTURE_IMAGE_UNITS = 16,
|
|
+
|
|
+ // Implementation upper limits, real maximums depend on the hardware
|
|
+ IMPLEMENTATION_MAX_VERTEX_TEXTURE_IMAGE_UNITS = 16,
|
|
+ IMPLEMENTATION_MAX_COMBINED_TEXTURE_IMAGE_UNITS = MAX_TEXTURE_IMAGE_UNITS + IMPLEMENTATION_MAX_VERTEX_TEXTURE_IMAGE_UNITS,
|
|
+
|
|
+ IMPLEMENTATION_MAX_VARYING_VECTORS = 32,
|
|
+ IMPLEMENTATION_MAX_DRAW_BUFFERS = 8
|
|
+};
|
|
+
|
|
+const float ALIASED_LINE_WIDTH_RANGE_MIN = 1.0f;
|
|
+const float ALIASED_LINE_WIDTH_RANGE_MAX = 1.0f;
|
|
+const float ALIASED_POINT_SIZE_RANGE_MIN = 1.0f;
|
|
+
|
|
+}
|
|
+
|
|
+#endif // LIBGLESV2_CONSTANTS_H_
|
|
diff --git a/gfx/angle/src/libGLESv2/Framebuffer.h b/gfx/angle/src/libGLESv2/Framebuffer.h
|
|
index b54e008..50bfd4f 100644
|
|
--- a/gfx/angle/src/libGLESv2/Framebuffer.h
|
|
+++ b/gfx/angle/src/libGLESv2/Framebuffer.h
|
|
@@ -7,17 +7,17 @@
|
|
// Framebuffer.h: Defines the gl::Framebuffer class. Implements GL framebuffer
|
|
// objects and related functionality. [OpenGL ES 2.0.24] section 4.4 page 105.
|
|
|
|
#ifndef LIBGLESV2_FRAMEBUFFER_H_
|
|
#define LIBGLESV2_FRAMEBUFFER_H_
|
|
|
|
#include "common/angleutils.h"
|
|
#include "common/RefCountObject.h"
|
|
-#include "constants.h"
|
|
+#include "Constants.h"
|
|
|
|
namespace rx
|
|
{
|
|
class Renderer;
|
|
}
|
|
|
|
namespace gl
|
|
{
|
|
diff --git a/gfx/angle/src/libGLESv2/constants.h b/gfx/angle/src/libGLESv2/constants.h
|
|
deleted file mode 100644
|
|
index 9f24d66..0000000
|
|
--- a/gfx/angle/src/libGLESv2/constants.h
|
|
+++ /dev/null
|
|
@@ -1,34 +0,0 @@
|
|
-//
|
|
-// Copyright (c) 2013 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.
|
|
-//
|
|
-
|
|
-// Contants.h: Defines some implementation specific and gl constants
|
|
-
|
|
-#ifndef LIBGLESV2_CONSTANTS_H_
|
|
-#define LIBGLESV2_CONSTANTS_H_
|
|
-
|
|
-namespace gl
|
|
-{
|
|
-
|
|
-enum
|
|
-{
|
|
- MAX_VERTEX_ATTRIBS = 16,
|
|
- MAX_TEXTURE_IMAGE_UNITS = 16,
|
|
-
|
|
- // Implementation upper limits, real maximums depend on the hardware
|
|
- IMPLEMENTATION_MAX_VERTEX_TEXTURE_IMAGE_UNITS = 16,
|
|
- IMPLEMENTATION_MAX_COMBINED_TEXTURE_IMAGE_UNITS = MAX_TEXTURE_IMAGE_UNITS + IMPLEMENTATION_MAX_VERTEX_TEXTURE_IMAGE_UNITS,
|
|
-
|
|
- IMPLEMENTATION_MAX_VARYING_VECTORS = 32,
|
|
- IMPLEMENTATION_MAX_DRAW_BUFFERS = 8
|
|
-};
|
|
-
|
|
-const float ALIASED_LINE_WIDTH_RANGE_MIN = 1.0f;
|
|
-const float ALIASED_LINE_WIDTH_RANGE_MAX = 1.0f;
|
|
-const float ALIASED_POINT_SIZE_RANGE_MIN = 1.0f;
|
|
-
|
|
-}
|
|
-
|
|
-#endif // LIBGLESV2_CONSTANTS_H_
|
|
diff --git a/gfx/angle/src/libGLESv2/precompiled.h b/gfx/angle/src/libGLESv2/precompiled.h
|
|
index f62e71b..58ad181 100644
|
|
--- a/gfx/angle/src/libGLESv2/precompiled.h
|
|
+++ b/gfx/angle/src/libGLESv2/precompiled.h
|
|
@@ -28,15 +28,15 @@
|
|
#include <map>
|
|
#include <set>
|
|
#include <sstream>
|
|
#include <string>
|
|
#include <unordered_map>
|
|
#include <vector>
|
|
|
|
#include <d3d9.h>
|
|
-#include <D3D11.h>
|
|
+#include <d3d11.h>
|
|
#include <dxgi.h>
|
|
#include <d3dcompiler.h>
|
|
|
|
#ifdef _MSC_VER
|
|
#include <hash_map>
|
|
#endif
|
|
diff --git a/gfx/angle/src/libGLESv2/renderer/Renderer11.cpp b/gfx/angle/src/libGLESv2/renderer/Renderer11.cpp
|
|
index 774cd71..1f2b31d 100644
|
|
--- a/gfx/angle/src/libGLESv2/renderer/Renderer11.cpp
|
|
+++ b/gfx/angle/src/libGLESv2/renderer/Renderer11.cpp
|
|
@@ -7,17 +7,17 @@
|
|
|
|
// Renderer11.cpp: Implements a back-end specific class for the D3D11 renderer.
|
|
|
|
#include "libGLESv2/main.h"
|
|
#include "libGLESv2/utilities.h"
|
|
#include "libGLESv2/Buffer.h"
|
|
#include "libGLESv2/ProgramBinary.h"
|
|
#include "libGLESv2/Framebuffer.h"
|
|
-#include "libGLESv2/RenderBuffer.h"
|
|
+#include "libGLESv2/Renderbuffer.h"
|
|
#include "libGLESv2/renderer/Renderer11.h"
|
|
#include "libGLESv2/renderer/RenderTarget11.h"
|
|
#include "libGLESv2/renderer/renderer11_utils.h"
|
|
#include "libGLESv2/renderer/ShaderExecutable11.h"
|
|
#include "libGLESv2/renderer/SwapChain11.h"
|
|
#include "libGLESv2/renderer/Image11.h"
|
|
#include "libGLESv2/renderer/VertexBuffer11.h"
|
|
#include "libGLESv2/renderer/IndexBuffer11.h"
|
|
diff --git a/gfx/angle/src/libGLESv2/renderer/Renderer11.h b/gfx/angle/src/libGLESv2/renderer/Renderer11.h
|
|
index f024855..90ef04d 100644
|
|
--- a/gfx/angle/src/libGLESv2/renderer/Renderer11.h
|
|
+++ b/gfx/angle/src/libGLESv2/renderer/Renderer11.h
|
|
@@ -230,17 +230,17 @@ class Renderer11 : public Renderer
|
|
bool mDepthTextureSupport;
|
|
|
|
// Multisample format support
|
|
struct MultisampleSupportInfo
|
|
{
|
|
unsigned int qualityLevels[D3D11_MAX_MULTISAMPLE_SAMPLE_COUNT];
|
|
};
|
|
|
|
- typedef std::unordered_map<DXGI_FORMAT, MultisampleSupportInfo> MultisampleSupportMap;
|
|
+ typedef std::unordered_map<DXGI_FORMAT, MultisampleSupportInfo, std::hash<int> > MultisampleSupportMap;
|
|
MultisampleSupportMap mMultisampleSupportMap;
|
|
|
|
unsigned int mMaxSupportedSamples;
|
|
|
|
// current render target states
|
|
unsigned int mAppliedRenderTargetSerials[gl::IMPLEMENTATION_MAX_DRAW_BUFFERS];
|
|
unsigned int mAppliedDepthbufferSerial;
|
|
unsigned int mAppliedStencilbufferSerial;
|