summaryrefslogtreecommitdiff
path: root/indra/llrender/llgl.h
diff options
context:
space:
mode:
Diffstat (limited to 'indra/llrender/llgl.h')
-rw-r--r--indra/llrender/llgl.h69
1 files changed, 36 insertions, 33 deletions
diff --git a/indra/llrender/llgl.h b/indra/llrender/llgl.h
index e4b106c999..a3d87e001c 100644
--- a/indra/llrender/llgl.h
+++ b/indra/llrender/llgl.h
@@ -45,9 +45,9 @@
#include "llglheaders.h"
#include "glh/glh_linear.h"
-extern BOOL gDebugGL;
-extern BOOL gDebugSession;
-extern BOOL gDebugGLSession;
+extern bool gDebugGL;
+extern bool gDebugSession;
+extern bool gDebugGLSession;
extern llofstream gFailLog;
#define LL_GL_ERRS LL_ERRS("RenderState")
@@ -73,8 +73,8 @@ public:
std::string getRawGLString(); // For sending to simulator
- BOOL mInited;
- BOOL mIsDisabled;
+ bool mInited;
+ bool mIsDisabled;
// OpenGL limits
S32 mMaxSamples;
@@ -87,6 +87,7 @@ public:
S32 mGLMaxIndexRange;
S32 mGLMaxTextureSize;
F32 mMaxAnisotropy = 0.f;
+ S32 mMaxUniformBlockSize = 0;
// GL 4.x capabilities
bool mHasCubeMapArray = false;
@@ -97,18 +98,18 @@ public:
// Vendor-specific extensions
bool mHasAMDAssociations = false;
- BOOL mIsAMD;
- BOOL mIsNVIDIA;
- BOOL mIsIntel;
- BOOL mIsApple;
+ bool mIsAMD;
+ bool mIsNVIDIA;
+ bool mIsIntel;
+ bool mIsApple;
#if LL_DARWIN
// Needed to distinguish problem cards on older Macs that break with Materials
- BOOL mIsMobileGF;
+ bool mIsMobileGF;
#endif
// Whether this version of GL is good enough for SL to use
- BOOL mHasRequirements;
+ bool mHasRequirements;
S32 mDriverVersionMajor;
S32 mDriverVersionMinor;
@@ -119,9 +120,7 @@ public:
std::string mDriverVersionVendorString;
std::string mGLVersionString;
- S32 mVRAM; // VRAM in MB
-
- void getPixelFormat(); // Get the best pixel format
+ U32 mVRAM; // VRAM in MB
std::string getGLInfoString();
void printGLInfoString();
@@ -139,7 +138,6 @@ public:
private:
void initExtensions();
void initGLStates();
- void initGLImages();
};
extern LLGLManager gGLManager;
@@ -156,13 +154,18 @@ void assert_glerror();
void clear_glerror();
-//#if LL_DEBUG
+
# define stop_glerror() assert_glerror()
# define llglassertok() assert_glerror()
-//#else
-//# define stop_glerror()
-//# define llglassertok()
-//#endif
+
+// stop_glerror is still needed on OS X but has performance implications
+// use macro below to conditionally add stop_glerror to non-release builds
+// on OS X
+#if LL_DARWIN && !LL_RELEASE_FOR_DOWNLOAD
+#define STOP_GLERROR stop_glerror()
+#else
+#define STOP_GLERROR
+#endif
#define llglassertok_always() assert_glerror()
@@ -242,16 +245,16 @@ protected:
static boost::unordered_map<LLGLenum, LLGLboolean> sStateMap;
public:
- enum { CURRENT_STATE = -2 };
+ enum { CURRENT_STATE = -2, DISABLED_STATE = 0, ENABLED_STATE = 1 };
LLGLState(LLGLenum state, S32 enabled = CURRENT_STATE);
~LLGLState();
void setEnabled(S32 enabled);
- void enable() { setEnabled(TRUE); }
- void disable() { setEnabled(FALSE); }
+ void enable() { setEnabled(ENABLED_STATE); }
+ void disable() { setEnabled(DISABLED_STATE); }
protected:
LLGLenum mState;
- BOOL mWasEnabled;
- BOOL mIsEnabled;
+ bool mWasEnabled;
+ bool mIsEnabled;
};
// New LLGLState class wrappers that don't depend on actual GL flags.
@@ -285,14 +288,14 @@ public:
class LLGLEnable : public LLGLState
{
public:
- LLGLEnable(LLGLenum state) : LLGLState(state, TRUE) {}
+ LLGLEnable(LLGLenum state) : LLGLState(state, ENABLED_STATE) {}
};
/// TODO: Being deprecated.
class LLGLDisable : public LLGLState
{
public:
- LLGLDisable(LLGLenum state) : LLGLState(state, FALSE) {}
+ LLGLDisable(LLGLenum state) : LLGLState(state, DISABLED_STATE) {}
};
/*
@@ -352,9 +355,9 @@ public:
static std::list<LLGLUpdate*> sGLQ;
- BOOL mInQ;
+ bool mInQ;
LLGLUpdate()
- : mInQ(FALSE)
+ : mInQ(false)
{
}
virtual ~LLGLUpdate()
@@ -406,10 +409,10 @@ void init_glstates();
void parse_gl_version( S32* major, S32* minor, S32* release, std::string* vendor_specific, std::string* version_string );
-extern BOOL gClothRipple;
-extern BOOL gHeadlessClient;
-extern BOOL gNonInteractive;
-extern BOOL gGLActive;
+extern bool gClothRipple;
+extern bool gHeadlessClient;
+extern bool gNonInteractive;
+extern bool gGLActive;
// Deal with changing glext.h definitions for newer SDK versions, specifically
// with MAC OSX 10.5 -> 10.6