Drop useless stuff about VBO and occlusion from the impostor patch.
This commit is contained in:
@@ -47,25 +47,27 @@
|
|||||||
#include "pipeline.h"
|
#include "pipeline.h"
|
||||||
|
|
||||||
LLFloaterHardwareSettings* LLFloaterHardwareSettings::sHardwareSettings = NULL;
|
LLFloaterHardwareSettings* LLFloaterHardwareSettings::sHardwareSettings = NULL;
|
||||||
BOOL LLFloaterHardwareSettings::sUseStreamVBOexists = FALSE;
|
|
||||||
|
|
||||||
LLFloaterHardwareSettings::LLFloaterHardwareSettings() : LLFloater(std::string("Hardware Settings Floater"))
|
LLFloaterHardwareSettings::LLFloaterHardwareSettings() : LLFloater(std::string("Hardware Settings Floater"))
|
||||||
{
|
{
|
||||||
LLUICtrlFactory::getInstance()->buildFloater(this, "floater_hardware_settings.xml");
|
LLUICtrlFactory::getInstance()->buildFloater(this, "floater_hardware_settings.xml");
|
||||||
|
|
||||||
|
// load it up
|
||||||
|
initCallbacks();
|
||||||
}
|
}
|
||||||
|
|
||||||
LLFloaterHardwareSettings::~LLFloaterHardwareSettings()
|
LLFloaterHardwareSettings::~LLFloaterHardwareSettings()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
void LLFloaterHardwareSettings::onCommitCheckBoxVBO(LLUICtrl* ctrl, void* user_data)
|
void LLFloaterHardwareSettings::onClickHelp(void* data)
|
||||||
|
{
|
||||||
|
const char* xml_alert = "HardwareSettingsHelpButton";
|
||||||
|
LLNotifications::instance().add(xml_alert);
|
||||||
|
}
|
||||||
|
|
||||||
|
void LLFloaterHardwareSettings::initCallbacks(void)
|
||||||
{
|
{
|
||||||
LLFloaterHardwareSettings* self = (LLFloaterHardwareSettings*)user_data;
|
|
||||||
if (self && sUseStreamVBOexists)
|
|
||||||
{
|
|
||||||
gSavedSettings.setBOOL("RenderUseStreamVBO", self->childGetValue("stream_vbo").asBoolean());
|
|
||||||
self->refreshEnabledState();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// menu maintenance functions
|
// menu maintenance functions
|
||||||
@@ -75,10 +77,6 @@ void LLFloaterHardwareSettings::refresh()
|
|||||||
LLPanel::refresh();
|
LLPanel::refresh();
|
||||||
|
|
||||||
mUseVBO = gSavedSettings.getBOOL("RenderVBOEnable");
|
mUseVBO = gSavedSettings.getBOOL("RenderVBOEnable");
|
||||||
if (sUseStreamVBOexists)
|
|
||||||
{
|
|
||||||
mUseStreamVBO = gSavedSettings.getBOOL("RenderUseStreamVBO");
|
|
||||||
}
|
|
||||||
mUseFBO = gSavedSettings.getBOOL("RenderUseFBO");
|
mUseFBO = gSavedSettings.getBOOL("RenderUseFBO");
|
||||||
mUseAniso = gSavedSettings.getBOOL("RenderAnisotropic");
|
mUseAniso = gSavedSettings.getBOOL("RenderAnisotropic");
|
||||||
mFSAASamples = gSavedSettings.getU32("RenderFSAASamples");
|
mFSAASamples = gSavedSettings.getU32("RenderFSAASamples");
|
||||||
@@ -98,7 +96,6 @@ void LLFloaterHardwareSettings::refreshEnabledState()
|
|||||||
childSetMinValue("GrapicsCardTextureMemory", min_tex_mem);
|
childSetMinValue("GrapicsCardTextureMemory", min_tex_mem);
|
||||||
childSetMaxValue("GrapicsCardTextureMemory", max_tex_mem);
|
childSetMaxValue("GrapicsCardTextureMemory", max_tex_mem);
|
||||||
|
|
||||||
bool vbo_ok = true;
|
|
||||||
mLastVBOState = LLVertexBuffer::sEnableVBOs;
|
mLastVBOState = LLVertexBuffer::sEnableVBOs;
|
||||||
if (!LLFeatureManager::getInstance()->isFeatureAvailable("RenderVBOEnable") ||
|
if (!LLFeatureManager::getInstance()->isFeatureAvailable("RenderVBOEnable") ||
|
||||||
!gGLManager.mHasVertexBufferObject)
|
!gGLManager.mHasVertexBufferObject)
|
||||||
@@ -106,23 +103,6 @@ void LLFloaterHardwareSettings::refreshEnabledState()
|
|||||||
childSetEnabled("vbo", FALSE);
|
childSetEnabled("vbo", FALSE);
|
||||||
//Streaming VBOs -Shyotl
|
//Streaming VBOs -Shyotl
|
||||||
childSetEnabled("vbo_stream", FALSE);
|
childSetEnabled("vbo_stream", FALSE);
|
||||||
vbo_ok = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (sUseStreamVBOexists)
|
|
||||||
{
|
|
||||||
childSetVisible("stream_vbo", true);
|
|
||||||
childSetEnabled("stream_vbo", vbo_ok && childGetValue("vbo") &&
|
|
||||||
LLFeatureManager::getInstance()->isFeatureAvailable("RenderUseStreamVBO"));
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
childSetVisible("stream_vbo", false);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!LLFeatureManager::getInstance()->isFeatureAvailable("UseOcclusion"))
|
|
||||||
{
|
|
||||||
childSetEnabled("occlusion", false);
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -135,7 +115,7 @@ void LLFloaterHardwareSettings::refreshEnabledState()
|
|||||||
childSetEnabled("gamma", !gPipeline.canUseWindLightShaders());
|
childSetEnabled("gamma", !gPipeline.canUseWindLightShaders());
|
||||||
childSetEnabled("(brightness, lower is brighter)", !gPipeline.canUseWindLightShaders());
|
childSetEnabled("(brightness, lower is brighter)", !gPipeline.canUseWindLightShaders());
|
||||||
childSetEnabled("fog", !gPipeline.canUseWindLightShaders());
|
childSetEnabled("fog", !gPipeline.canUseWindLightShaders());
|
||||||
childSetVisible("note", gPipeline.canUseWindLightShaders());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// static instance of it
|
// static instance of it
|
||||||
@@ -193,13 +173,6 @@ BOOL LLFloaterHardwareSettings::postBuild()
|
|||||||
{
|
{
|
||||||
childSetAction("OK", onBtnOK, this);
|
childSetAction("OK", onBtnOK, this);
|
||||||
|
|
||||||
sUseStreamVBOexists = gSavedSettings.controlExists("RenderUseStreamVBO");
|
|
||||||
if (sUseStreamVBOexists)
|
|
||||||
{
|
|
||||||
childSetCommitCallback("vbo", onCommitCheckBoxVBO, this);
|
|
||||||
childSetCommitCallback("stream_vbo", onCommitCheckBoxVBO, this);
|
|
||||||
}
|
|
||||||
|
|
||||||
refresh();
|
refresh();
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
@@ -229,10 +202,6 @@ void LLFloaterHardwareSettings::apply()
|
|||||||
void LLFloaterHardwareSettings::cancel()
|
void LLFloaterHardwareSettings::cancel()
|
||||||
{
|
{
|
||||||
gSavedSettings.setBOOL("RenderVBOEnable", mUseVBO);
|
gSavedSettings.setBOOL("RenderVBOEnable", mUseVBO);
|
||||||
if (sUseStreamVBOexists)
|
|
||||||
{
|
|
||||||
gSavedSettings.setBOOL("RenderUseStreamVBO", mUseStreamVBO);
|
|
||||||
}
|
|
||||||
gSavedSettings.setBOOL("RenderUseFBO", mUseFBO);
|
gSavedSettings.setBOOL("RenderUseFBO", mUseFBO);
|
||||||
gSavedSettings.setBOOL("RenderAnisotropic", mUseAniso);
|
gSavedSettings.setBOOL("RenderAnisotropic", mUseAniso);
|
||||||
gSavedSettings.setU32("RenderFSAASamples", mFSAASamples);
|
gSavedSettings.setU32("RenderFSAASamples", mFSAASamples);
|
||||||
|
|||||||
@@ -49,11 +49,14 @@ public:
|
|||||||
|
|
||||||
virtual BOOL postBuild();
|
virtual BOOL postBuild();
|
||||||
|
|
||||||
|
/// initialize all the callbacks for the menu
|
||||||
|
void initCallbacks(void);
|
||||||
|
|
||||||
/// one and one instance only
|
/// one and one instance only
|
||||||
static LLFloaterHardwareSettings* instance();
|
static LLFloaterHardwareSettings* instance();
|
||||||
|
|
||||||
/// callback for the VBO-related settings checkboxes
|
/// callback for the menus help button
|
||||||
static void onCommitCheckBoxVBO(LLUICtrl* ctrl, void* user_data);
|
static void onClickHelp(void* data);
|
||||||
|
|
||||||
/// OK button
|
/// OK button
|
||||||
static void onBtnOK( void* userdata );
|
static void onBtnOK( void* userdata );
|
||||||
@@ -84,12 +87,11 @@ public:
|
|||||||
/// refresh the enabled values
|
/// refresh the enabled values
|
||||||
void refreshEnabledState();
|
void refreshEnabledState();
|
||||||
|
|
||||||
private:
|
protected:
|
||||||
LLSliderCtrl* mCtrlVideoCardMem;
|
LLSliderCtrl* mCtrlVideoCardMem;
|
||||||
|
|
||||||
//Retained values for cancel/reset
|
//Retained values for cancel/reset
|
||||||
BOOL mUseVBO;
|
BOOL mUseVBO;
|
||||||
BOOL mUseStreamVBO;
|
|
||||||
BOOL mUseFBO;
|
BOOL mUseFBO;
|
||||||
BOOL mUseAniso;
|
BOOL mUseAniso;
|
||||||
U32 mFSAASamples;
|
U32 mFSAASamples;
|
||||||
@@ -99,9 +101,9 @@ private:
|
|||||||
BOOL mProbeHardwareOnStartup;
|
BOOL mProbeHardwareOnStartup;
|
||||||
|
|
||||||
bool mLastVBOState; //track changes to LLVertexBuffer::sEnableVBOs every frame. Bleh.
|
bool mLastVBOState; //track changes to LLVertexBuffer::sEnableVBOs every frame. Bleh.
|
||||||
|
private:
|
||||||
// one instance on the inside
|
// one instance on the inside
|
||||||
static LLFloaterHardwareSettings* sHardwareSettings;
|
static LLFloaterHardwareSettings* sHardwareSettings;
|
||||||
static BOOL sUseStreamVBOexists;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -1524,6 +1524,10 @@ void init_debug_rendering_menu(LLMenuGL* menu)
|
|||||||
'R', MASK_CONTROL|MASK_SHIFT));
|
'R', MASK_CONTROL|MASK_SHIFT));
|
||||||
|
|
||||||
LLMenuItemCheckGL* item;
|
LLMenuItemCheckGL* item;
|
||||||
|
item = new LLMenuItemCheckGL("Object-Object Occlusion", menu_toggle_control, NULL, menu_check_control, (void*)"UseOcclusion", 'O', MASK_CONTROL|MASK_SHIFT);
|
||||||
|
item->setEnabled(gGLManager.mHasOcclusionQuery && LLFeatureManager::getInstance()->isFeatureAvailable("UseOcclusion"));
|
||||||
|
menu->append(item);
|
||||||
|
|
||||||
item = new LLMenuItemCheckGL("Debug GL", menu_toggle_control, NULL, menu_check_control, (void*)"RenderDebugGL");
|
item = new LLMenuItemCheckGL("Debug GL", menu_toggle_control, NULL, menu_check_control, (void*)"RenderDebugGL");
|
||||||
menu->append(item);
|
menu->append(item);
|
||||||
|
|
||||||
|
|||||||
@@ -55,34 +55,13 @@
|
|||||||
font="SansSerifSmall" h_pad="0" halign="left" height="12"
|
font="SansSerifSmall" h_pad="0" halign="left" height="12"
|
||||||
left="10" mouse_opaque="true" name="Enable VBO:" v_pad="0"
|
left="10" mouse_opaque="true" name="Enable VBO:" v_pad="0"
|
||||||
width="128">
|
width="128">
|
||||||
Vertex Buffer Object:
|
Enable VBO:
|
||||||
</text>
|
</text>
|
||||||
<check_box bottom_delta="-5" control_name="RenderVBOEnable" enabled="true" follows="left|top"
|
<check_box bottom_delta="-5" control_name="RenderVBOEnable" enabled="true" follows="left|top"
|
||||||
font="SansSerifSmall" height="16" initial_value="true"
|
font="SansSerifSmall" height="16" initial_value="true"
|
||||||
label="Enable OpenGL Vertex Buffer Objects" left="148"
|
label="Enable OpenGL Vertex Buffer Objects" left="148"
|
||||||
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="220" />
|
|
||||||
|
|
||||||
<check_box bottom_delta="0" name="stream_vbo" enabled="true" follows="left|top"
|
|
||||||
font="SansSerifSmall" height="16" initial_value="true"
|
|
||||||
label="Stream VBO" left_delta="240"
|
|
||||||
mouse_opaque="true" radio_style="false"
|
|
||||||
tool_tip="This option is usually best kept off for ATI cards (watch your FPS rate and see how it fares)."
|
|
||||||
width="150" />
|
|
||||||
|
|
||||||
<text type="string" length="1" bg_visible="false" border_drop_shadow_visible="false" border_visible="false"
|
|
||||||
bottom_delta="-16" drop_shadow_visible="true" enabled="true" follows="left|top"
|
|
||||||
font="SansSerifSmall" h_pad="0" halign="left" height="12"
|
|
||||||
left="10" mouse_opaque="true" name="Enable Occlusion" v_pad="0"
|
|
||||||
width="128">
|
|
||||||
Occlusion:
|
|
||||||
</text>
|
|
||||||
<check_box bottom_delta="-5" control_name="UseOcclusion" enabled="true" follows="left|top"
|
|
||||||
font="SansSerifSmall" height="16" initial_value="true"
|
|
||||||
label="Enable Object-Object Occlusion" left="148"
|
|
||||||
mouse_opaque="true" name="occlusion" radio_style="false"
|
|
||||||
tool_tip="Speeds up rendering on hardware supporting it."
|
|
||||||
width="315" />
|
width="315" />
|
||||||
<check_box bottom_delta="-18" control_name="ShyotlRenderUseStreamVBO" enabled="true" follows="left|top"
|
<check_box bottom_delta="-18" control_name="ShyotlRenderUseStreamVBO" enabled="true" follows="left|top"
|
||||||
font="SansSerifSmall" height="16" initial_value="false"
|
font="SansSerifSmall" height="16" initial_value="false"
|
||||||
|
|||||||
Reference in New Issue
Block a user