Newer
Older
David Parks
committed
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
LLGLSyncFence::LLGLSyncFence()
{
#ifdef GL_ARB_sync
mSync = 0;
#endif
}
LLGLSyncFence::~LLGLSyncFence()
{
#ifdef GL_ARB_sync
if (mSync)
{
glDeleteSync(mSync);
}
#endif
}
void LLGLSyncFence::placeFence()
{
#ifdef GL_ARB_sync
if (mSync)
{
glDeleteSync(mSync);
}
mSync = glFenceSync(GL_SYNC_GPU_COMMANDS_COMPLETE, 0);
#endif
}
bool LLGLSyncFence::isCompleted()
{
bool ret = true;
#ifdef GL_ARB_sync
if (mSync)
{
GLenum status = glClientWaitSync(mSync, 0, 1);
if (status == GL_TIMEOUT_EXPIRED)
{
ret = false;
}
}
#endif
return ret;
}
void LLGLSyncFence::wait()
{
#ifdef GL_ARB_sync
if (mSync)
{
while (glClientWaitSync(mSync, 0, FENCE_WAIT_TIME_NANOSECONDS) == GL_TIMEOUT_EXPIRED)
{ //track the number of times we've waited here
static S32 waits = 0;
waits++;
}
}
#endif
}
LLGLSPipelineSkyBox::LLGLSPipelineSkyBox()
: mAlphaTest(GL_ALPHA_TEST)
, mCullFace(GL_CULL_FACE)
, mSquashClip()
{
if (!LLGLSLShader::sNoFixedFunction)
{
glDisable(GL_LIGHTING);
glDisable(GL_FOG);
glDisable(GL_CLIP_PLANE0);
}
}
David Parks
committed
LLGLSPipelineSkyBox::~LLGLSPipelineSkyBox()
{
if (!LLGLSLShader::sNoFixedFunction)
{
glEnable(GL_LIGHTING);
glEnable(GL_FOG);
glEnable(GL_CLIP_PLANE0);
}
}
David Parks
committed
LLGLSPipelineDepthTestSkyBox::LLGLSPipelineDepthTestSkyBox(bool depth_test, bool depth_write)
: LLGLSPipelineSkyBox()
, mDepth(depth_test ? GL_TRUE : GL_FALSE, depth_write ? GL_TRUE : GL_FALSE, GL_LEQUAL)
{
}
LLGLSPipelineBlendSkyBox::LLGLSPipelineBlendSkyBox(bool depth_test, bool depth_write)
: LLGLSPipelineDepthTestSkyBox(depth_test, depth_write)
, mBlend(GL_BLEND)
{
gGL.setSceneBlendType(LLRender::BT_ALPHA);
}
Graham Linden
committed
#if LL_WINDOWS
// Expose desired use of high-performance graphics processor to Optimus driver and to AMD driver
{
__declspec(dllexport) DWORD NvOptimusEnablement = 0x00000001;
__declspec(dllexport) int AmdPowerXpressRequestHighPerformance = 1;