Collection of theoretical improvements for ATI cards, as well as a couple memory leaks. Thanks to Shyotl for bringing them up and offering solutions.
Signed-off-by: Beeks <HgDelirium@gmail.com>
This commit is contained in:
@@ -873,6 +873,7 @@ void LLStringUtilBase<T>::addCRLF(std::basic_string<T>& string)
|
|||||||
}
|
}
|
||||||
|
|
||||||
string.assign(t, size);
|
string.assign(t, size);
|
||||||
|
delete[] t;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -36,7 +36,7 @@
|
|||||||
const S32 LL_VERSION_MAJOR = 1;
|
const S32 LL_VERSION_MAJOR = 1;
|
||||||
const S32 LL_VERSION_MINOR = 4;
|
const S32 LL_VERSION_MINOR = 4;
|
||||||
const S32 LL_VERSION_PATCH = 2;
|
const S32 LL_VERSION_PATCH = 2;
|
||||||
const S32 LL_VERSION_BUILD = 5;
|
const S32 LL_VERSION_BUILD = 6;
|
||||||
|
|
||||||
const char * const LL_CHANNEL = "Ascent Viewer Release";
|
const char * const LL_CHANNEL = "Ascent Viewer Release";
|
||||||
|
|
||||||
|
|||||||
@@ -135,6 +135,7 @@ BOOL LLImagePNG::encode(const LLImageRaw* raw_image, F32 encode_time)
|
|||||||
if (! pngWrapper.writePng(raw_image, mTmpWriteBuffer))
|
if (! pngWrapper.writePng(raw_image, mTmpWriteBuffer))
|
||||||
{
|
{
|
||||||
setLastError(pngWrapper.getErrorMessage());
|
setLastError(pngWrapper.getErrorMessage());
|
||||||
|
delete[] mTmpWriteBuffer;
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -161,10 +161,9 @@ namespace
|
|||||||
fstream.seekg(0, std::ios::end);
|
fstream.seekg(0, std::ios::end);
|
||||||
U32 fileSize = fstream.tellg();
|
U32 fileSize = fstream.tellg();
|
||||||
fstream.seekg(0, std::ios::beg);
|
fstream.seekg(0, std::ios::beg);
|
||||||
char* fileBuffer;
|
std::vector<char> fileBuffer(fileSize); //Mem leak fix'd
|
||||||
fileBuffer = new char [fileSize];
|
fstream.read(&fileBuffer[0], fileSize);
|
||||||
fstream.read(fileBuffer, fileSize);
|
ostream.write(&fileBuffer[0], fileSize);
|
||||||
ostream.write(fileBuffer, fileSize);
|
|
||||||
fstream.close();
|
fstream.close();
|
||||||
eos = true;
|
eos = true;
|
||||||
return STATUS_DONE;
|
return STATUS_DONE;
|
||||||
@@ -191,10 +190,9 @@ namespace
|
|||||||
|
|
||||||
LLVFile vfile(gVFS, mUUID, mAssetType, LLVFile::READ);
|
LLVFile vfile(gVFS, mUUID, mAssetType, LLVFile::READ);
|
||||||
S32 fileSize = vfile.getSize();
|
S32 fileSize = vfile.getSize();
|
||||||
U8* fileBuffer;
|
std::vector<U8> fileBuffer(fileSize);
|
||||||
fileBuffer = new U8 [fileSize];
|
vfile.read(&fileBuffer[0], fileSize);
|
||||||
vfile.read(fileBuffer, fileSize);
|
ostream.write((char*)&fileBuffer[0], fileSize);
|
||||||
ostream.write((char*)fileBuffer, fileSize);
|
|
||||||
eos = true;
|
eos = true;
|
||||||
return STATUS_DONE;
|
return STATUS_DONE;
|
||||||
}
|
}
|
||||||
@@ -341,6 +339,20 @@ void LLHTTPClient::get(const std::string& url, const LLSD& query, ResponderPtr r
|
|||||||
get(uri.asString(), responder, headers, timeout);
|
get(uri.asString(), responder, headers, timeout);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
class LLHTTPFileBuffer
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
llofstream * stream;
|
||||||
|
LLHTTPFileBuffer(llofstream * fstream):stream(fstream){}
|
||||||
|
static size_t curl_write( void *ptr, size_t size, size_t nmemb, void *user_data)
|
||||||
|
{
|
||||||
|
LLHTTPFileBuffer* self = (LLHTTPFileBuffer*)user_data;
|
||||||
|
size_t bytes = (size * nmemb);
|
||||||
|
self->stream->write((char*)ptr,bytes);
|
||||||
|
return nmemb;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
// A simple class for managing data returned from a curl http request.
|
// A simple class for managing data returned from a curl http request.
|
||||||
class LLHTTPBuffer
|
class LLHTTPBuffer
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -255,7 +255,7 @@ PFNGLGETACTIVEATTRIBARBPROC glGetActiveAttribARB = NULL;
|
|||||||
PFNGLGETATTRIBLOCATIONARBPROC glGetAttribLocationARB = NULL;
|
PFNGLGETATTRIBLOCATIONARBPROC glGetAttribLocationARB = NULL;
|
||||||
|
|
||||||
#if LL_WINDOWS
|
#if LL_WINDOWS
|
||||||
PFNWGLSWAPINTERVALEXTPROC wglSwapIntervalEXT = NULL;
|
PFNWGLSWAPINTERVALEXTPROC wglSwapIntervalEXT = NULL;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if LL_LINUX_NV_GL_HEADERS
|
#if LL_LINUX_NV_GL_HEADERS
|
||||||
@@ -748,11 +748,13 @@ void LLGLManager::initExtensions()
|
|||||||
LL_INFOS("RenderInit") << "Disabling mip-map generation for Intel GPUs" << LL_ENDL;
|
LL_INFOS("RenderInit") << "Disabling mip-map generation for Intel GPUs" << LL_ENDL;
|
||||||
mHasMipMapGeneration = FALSE;
|
mHasMipMapGeneration = FALSE;
|
||||||
}
|
}
|
||||||
|
//Don't do this! This has since been fixed. I've benchmarked it. Hardware generation considerably faster. -Shyotl
|
||||||
|
/*
|
||||||
if (mIsATI && mHasMipMapGeneration)
|
if (mIsATI && mHasMipMapGeneration)
|
||||||
{
|
{
|
||||||
LL_INFOS("RenderInit") << "Disabling mip-map generation for ATI GPUs (performance opt)" << LL_ENDL;
|
LL_INFOS("RenderInit") << "Disabling mip-map generation for ATI GPUs (performance opt)" << LL_ENDL;
|
||||||
mHasMipMapGeneration = FALSE;
|
mHasMipMapGeneration = FALSE;
|
||||||
}
|
}*/
|
||||||
|
|
||||||
// Misc
|
// Misc
|
||||||
glGetIntegerv(GL_MAX_ELEMENTS_VERTICES, (GLint*) &mGLMaxVertexRange);
|
glGetIntegerv(GL_MAX_ELEMENTS_VERTICES, (GLint*) &mGLMaxVertexRange);
|
||||||
|
|||||||
@@ -62,6 +62,7 @@ BOOL LLVertexBuffer::sVBOActive = FALSE;
|
|||||||
BOOL LLVertexBuffer::sIBOActive = FALSE;
|
BOOL LLVertexBuffer::sIBOActive = FALSE;
|
||||||
U32 LLVertexBuffer::sAllocatedBytes = 0;
|
U32 LLVertexBuffer::sAllocatedBytes = 0;
|
||||||
BOOL LLVertexBuffer::sMapped = FALSE;
|
BOOL LLVertexBuffer::sMapped = FALSE;
|
||||||
|
BOOL LLVertexBuffer::sUseStreamDraw = TRUE;
|
||||||
|
|
||||||
std::vector<U32> LLVertexBuffer::sDeleteList;
|
std::vector<U32> LLVertexBuffer::sDeleteList;
|
||||||
|
|
||||||
@@ -348,6 +349,11 @@ LLVertexBuffer::LLVertexBuffer(U32 typemask, S32 usage) :
|
|||||||
mUsage = 0 ;
|
mUsage = 0 ;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (mUsage == GL_STREAM_DRAW_ARB && !sUseStreamDraw)
|
||||||
|
{
|
||||||
|
mUsage = 0;
|
||||||
|
}
|
||||||
|
|
||||||
S32 stride = calcStride(typemask, mOffsets);
|
S32 stride = calcStride(typemask, mOffsets);
|
||||||
|
|
||||||
mTypeMask = typemask;
|
mTypeMask = typemask;
|
||||||
@@ -771,7 +777,7 @@ BOOL LLVertexBuffer::useVBOs() const
|
|||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
return sEnableVBOs;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------------
|
//----------------------------------------------------------------------------
|
||||||
@@ -1078,7 +1084,7 @@ void LLVertexBuffer::setBuffer(U32 data_mask)
|
|||||||
{
|
{
|
||||||
if (mGLBuffer)
|
if (mGLBuffer)
|
||||||
{
|
{
|
||||||
if (sEnableVBOs && sVBOActive)
|
if (sVBOActive)
|
||||||
{
|
{
|
||||||
glBindBufferARB(GL_ARRAY_BUFFER_ARB, 0);
|
glBindBufferARB(GL_ARRAY_BUFFER_ARB, 0);
|
||||||
sBindCount++;
|
sBindCount++;
|
||||||
@@ -1090,7 +1096,7 @@ void LLVertexBuffer::setBuffer(U32 data_mask)
|
|||||||
setup = TRUE; // ... or a client memory pointer changed
|
setup = TRUE; // ... or a client memory pointer changed
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (sEnableVBOs && mGLIndices && sIBOActive)
|
if (mGLIndices && sIBOActive)
|
||||||
{
|
{
|
||||||
/*if (sMapped)
|
/*if (sMapped)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -85,6 +85,8 @@ public:
|
|||||||
static LLVBOPool sStreamIBOPool;
|
static LLVBOPool sStreamIBOPool;
|
||||||
static LLVBOPool sDynamicIBOPool;
|
static LLVBOPool sDynamicIBOPool;
|
||||||
|
|
||||||
|
static BOOL sUseStreamDraw;
|
||||||
|
|
||||||
static void initClass(bool use_vbo);
|
static void initClass(bool use_vbo);
|
||||||
static void cleanupClass();
|
static void cleanupClass();
|
||||||
static void setupClientArrays(U32 data_mask);
|
static void setupClientArrays(U32 data_mask);
|
||||||
|
|||||||
@@ -2,10 +2,21 @@
|
|||||||
<llsd>
|
<llsd>
|
||||||
<map>
|
<map>
|
||||||
<!--Expanded settings from Vanilla SL -->
|
<!--Expanded settings from Vanilla SL -->
|
||||||
|
<key>ShyotlRenderUseStreamVBO</key>
|
||||||
|
<map>
|
||||||
|
<key>Comment</key>
|
||||||
|
<string>Use VBO's for stream buffers</string>
|
||||||
|
<key>Persist</key>
|
||||||
|
<integer>1</integer>
|
||||||
|
<key>Type</key>
|
||||||
|
<string>Boolean</string>
|
||||||
|
<key>Value</key>
|
||||||
|
<integer>1</integer>
|
||||||
|
</map>
|
||||||
<key>AscentShowLookAt</key>
|
<key>AscentShowLookAt</key>
|
||||||
<map>
|
<map>
|
||||||
<key>Comment</key>
|
<key>Comment</key>
|
||||||
<string>Avatar position modifier (X)</string>
|
<string>Show Others' Lookat points</string>
|
||||||
<key>Persist</key>
|
<key>Persist</key>
|
||||||
<integer>1</integer>
|
<integer>1</integer>
|
||||||
<key>Type</key>
|
<key>Type</key>
|
||||||
|
|||||||
@@ -99,7 +99,17 @@ void LLFloaterHardwareSettings::refreshEnabledState()
|
|||||||
!gGLManager.mHasVertexBufferObject)
|
!gGLManager.mHasVertexBufferObject)
|
||||||
{
|
{
|
||||||
childSetEnabled("vbo", FALSE);
|
childSetEnabled("vbo", FALSE);
|
||||||
|
//Streaming VBOs -Shyotl
|
||||||
|
childSetEnabled("vbo_stream", FALSE);
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
#if LL_DARWIN
|
||||||
|
childSetEnabled("vbo_stream", FALSE); //Hardcoded disable on mac
|
||||||
|
childSetValue("vbo_stream", (LLSD::Boolean) FALSE); //Hardcoded disable on mac
|
||||||
|
#else
|
||||||
|
childSetEnabled("vbo_stream", LLVertexBuffer::sEnableVBOs);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
// if no windlight shaders, turn off nighttime brightness, gamma, and fog distance
|
// if no windlight shaders, turn off nighttime brightness, gamma, and fog distance
|
||||||
childSetEnabled("gamma", !gPipeline.canUseWindLightShaders());
|
childSetEnabled("gamma", !gPipeline.canUseWindLightShaders());
|
||||||
|
|||||||
@@ -526,6 +526,8 @@ void settings_setup_listeners()
|
|||||||
gSavedSettings.getControl("RenderFastAlpha")->getSignal()->connect(boost::bind(&handleResetVertexBuffersChanged, _1));
|
gSavedSettings.getControl("RenderFastAlpha")->getSignal()->connect(boost::bind(&handleResetVertexBuffersChanged, _1));
|
||||||
gSavedSettings.getControl("RenderObjectBump")->getSignal()->connect(boost::bind(&handleResetVertexBuffersChanged, _1));
|
gSavedSettings.getControl("RenderObjectBump")->getSignal()->connect(boost::bind(&handleResetVertexBuffersChanged, _1));
|
||||||
gSavedSettings.getControl("RenderMaxVBOSize")->getSignal()->connect(boost::bind(&handleResetVertexBuffersChanged, _1));
|
gSavedSettings.getControl("RenderMaxVBOSize")->getSignal()->connect(boost::bind(&handleResetVertexBuffersChanged, _1));
|
||||||
|
//See LL jira VWR-3258 comment section. Implemented by LL in 2.1 -Shyotl
|
||||||
|
gSavedSettings.getControl("ShyotlRenderUseStreamVBO")->getSignal()->connect(boost::bind(&handleResetVertexBuffersChanged, _1));
|
||||||
gSavedSettings.getControl("RenderUseFBO")->getSignal()->connect(boost::bind(&handleRenderUseFBOChanged, _1));
|
gSavedSettings.getControl("RenderUseFBO")->getSignal()->connect(boost::bind(&handleRenderUseFBOChanged, _1));
|
||||||
gSavedSettings.getControl("RenderDeferredNoise")->getSignal()->connect(boost::bind(&handleReleaseGLBufferChanged, _1));
|
gSavedSettings.getControl("RenderDeferredNoise")->getSignal()->connect(boost::bind(&handleReleaseGLBufferChanged, _1));
|
||||||
gSavedSettings.getControl("RenderUseImpostors")->getSignal()->connect(boost::bind(&handleRenderUseImpostorsChanged, _1));
|
gSavedSettings.getControl("RenderUseImpostors")->getSignal()->connect(boost::bind(&handleRenderUseImpostorsChanged, _1));
|
||||||
|
|||||||
@@ -102,6 +102,10 @@
|
|||||||
#include "llspatialpartition.h"
|
#include "llspatialpartition.h"
|
||||||
#include "llmutelist.h"
|
#include "llmutelist.h"
|
||||||
|
|
||||||
|
#if !LL_DARWIN
|
||||||
|
#include "llfloaterhardwaresettings.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef _DEBUG
|
#ifdef _DEBUG
|
||||||
// Debug indices is disabled for now for debug performance - djs 4/24/02
|
// Debug indices is disabled for now for debug performance - djs 4/24/02
|
||||||
//#define DEBUG_INDICES
|
//#define DEBUG_INDICES
|
||||||
@@ -321,6 +325,7 @@ void LLPipeline::init()
|
|||||||
|
|
||||||
sDynamicLOD = gSavedSettings.getBOOL("RenderDynamicLOD");
|
sDynamicLOD = gSavedSettings.getBOOL("RenderDynamicLOD");
|
||||||
sRenderBump = gSavedSettings.getBOOL("RenderObjectBump");
|
sRenderBump = gSavedSettings.getBOOL("RenderObjectBump");
|
||||||
|
LLVertexBuffer::sUseStreamDraw = gSavedSettings.getBOOL("ShyotlRenderUseStreamVBO");
|
||||||
sRenderAttachedLights = gSavedSettings.getBOOL("RenderAttachedLights");
|
sRenderAttachedLights = gSavedSettings.getBOOL("RenderAttachedLights");
|
||||||
sRenderAttachedParticles = gSavedSettings.getBOOL("RenderAttachedParticles");
|
sRenderAttachedParticles = gSavedSettings.getBOOL("RenderAttachedParticles");
|
||||||
|
|
||||||
@@ -4911,6 +4916,10 @@ void LLPipeline::setUseVBO(BOOL use_vbo)
|
|||||||
|
|
||||||
resetVertexBuffers();
|
resetVertexBuffers();
|
||||||
LLVertexBuffer::initClass(use_vbo);
|
LLVertexBuffer::initClass(use_vbo);
|
||||||
|
#if !LL_DARWIN
|
||||||
|
if(LLFloaterHardwareSettings::isOpen())
|
||||||
|
LLFloaterHardwareSettings::instance()->refreshEnabledState();
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -63,7 +63,12 @@
|
|||||||
mouse_opaque="true" name="vbo" radio_style="false"
|
mouse_opaque="true" name="vbo" radio_style="false"
|
||||||
tool_tip="Enabling this on modern hardware gives a performance gain. However, older hardware often has poor implementations of VBOs and you may get crashes when this is enabled."
|
tool_tip="Enabling this on modern hardware gives a performance gain. However, older hardware often has poor implementations of VBOs and you may get crashes when this is enabled."
|
||||||
width="315" />
|
width="315" />
|
||||||
|
<check_box bottom_delta="-18" control_name="ShyotlRenderUseStreamVBO" enabled="true" follows="left|top"
|
||||||
|
font="SansSerifSmall" height="16" initial_value="false"
|
||||||
|
label="Enable Streamed VBOs" left="157"
|
||||||
|
mouse_opaque="true" name="vbo_stream" radio_style="false"
|
||||||
|
tool_tip="Disabling this may improve performance when VBOs are enabled. Disabling produced observable improvement on various AMD GPUs."
|
||||||
|
width="315" />
|
||||||
<slider bottom_delta="-21" can_edit_text="false" control_name="TextureMemory"
|
<slider bottom_delta="-21" can_edit_text="false" control_name="TextureMemory"
|
||||||
decimal_digits="0" enabled="true"
|
decimal_digits="0" enabled="true"
|
||||||
follows="left|top" height="16" increment="16"
|
follows="left|top" height="16" increment="16"
|
||||||
|
|||||||
Reference in New Issue
Block a user