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