Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Remove vertex streaming hack.
NV has buffer_storage, AMD has pinned memory.
Both are better than that hack which shouldn't ever have been introduced in the first place.
  • Loading branch information
neobrain committed Jan 15, 2014
1 parent b49c09c commit f1adc56
Show file tree
Hide file tree
Showing 6 changed files with 4 additions and 41 deletions.
2 changes: 0 additions & 2 deletions Source/Core/DolphinWX/VideoConfigDiag.cpp
Expand Up @@ -86,7 +86,6 @@ wxString af_desc = wxTRANSLATE("Enable anisotropic filtering.\nEnhances visual q
wxString aa_desc = wxTRANSLATE("Reduces the amount of aliasing caused by rasterizing 3D graphics.\nThis makes the rendered picture look less blocky.\nHeavily decreases emulation speed and sometimes causes issues.\n\nIf unsure, select None.");
wxString scaled_efb_copy_desc = wxTRANSLATE("Greatly increases quality of textures generated using render to texture effects.\nRaising the internal resolution will improve the effect of this setting.\nSlightly decreases performance and possibly causes issues (although unlikely).\n\nIf unsure, leave this checked.");
wxString pixel_lighting_desc = wxTRANSLATE("Calculate lighting of 3D graphics per-pixel rather than per vertex.\nDecreases emulation speed by some percent (depending on your GPU).\nThis usually is a safe enhancement, but might cause issues sometimes.\n\nIf unsure, leave this unchecked.");
wxString hacked_buffer_upload_desc = wxTRANSLATE("Uses unsafe operations to speed up vertex streaming in OpenGL. There are no known problems on supported GPUs, but it will cause severe stability and graphical issues otherwise.\n\nIf unsure, leave this unchecked.");
wxString fast_depth_calc_desc = wxTRANSLATE("Use a less accurate algorithm to calculate depth values.\nCauses issues in a few games but might give a decent speedup.\n\nIf unsure, leave this checked.");
wxString force_filtering_desc = wxTRANSLATE("Force texture filtering even if the emulated game explicitly disabled it.\nImproves texture quality slightly but causes glitches in some games.\n\nIf unsure, leave this unchecked.");
wxString _3d_vision_desc = wxTRANSLATE("Enable 3D effects via stereoscopy using Nvidia 3D Vision technology if it's supported by your GPU.\nPossibly causes issues.\nRequires fullscreen to work.\n\nIf unsure, leave this unchecked.");
Expand Down Expand Up @@ -500,7 +499,6 @@ VideoConfigDiag::VideoConfigDiag(wxWindow* parent, const std::string &title, con
szr_other->Add(CreateCheckBox(page_hacks, _("Disable Destination Alpha"), wxGetTranslation(disable_dstalpha_desc), vconfig.bDstAlphaPass));
szr_other->Add(CreateCheckBox(page_hacks, _("OpenMP Texture Decoder"), wxGetTranslation(omp_desc), vconfig.bOMPDecoder));
szr_other->Add(CreateCheckBox(page_hacks, _("Fast Depth Calculation"), wxGetTranslation(fast_depth_calc_desc), vconfig.bFastDepthCalc));
szr_other->Add(hacked_buffer_upload = CreateCheckBox(page_hacks, _("Vertex Streaming Hack"), wxGetTranslation(hacked_buffer_upload_desc), vconfig.bHackedBufferUpload));

wxStaticBoxSizer* const group_other = new wxStaticBoxSizer(wxVERTICAL, page_hacks, _("Other"));
group_other->Add(szr_other, 1, wxEXPAND | wxLEFT | wxRIGHT | wxBOTTOM, 5);
Expand Down
5 changes: 0 additions & 5 deletions Source/Core/DolphinWX/VideoConfigDiag.h
Expand Up @@ -167,10 +167,6 @@ class VideoConfigDiag : public wxDialog
virtual_xfb->Enable(vconfig.bUseXFB);
real_xfb->Enable(vconfig.bUseXFB);

// OGL Hacked buffer
hacked_buffer_upload->Enable(Core::GetState() == Core::CORE_UNINITIALIZED && vconfig.backend_info.APIType == API_OPENGL);
hacked_buffer_upload->Show(vconfig.backend_info.APIType == API_OPENGL);

ev.Skip();
}

Expand Down Expand Up @@ -199,7 +195,6 @@ class VideoConfigDiag : public wxDialog
SettingRadioButton* efbcopy_ram;
SettingCheckBox* cache_efb_copies;
SettingCheckBox* emulate_efb_format_changes;
SettingCheckBox* hacked_buffer_upload;

SettingRadioButton* virtual_xfb;
SettingRadioButton* real_xfb;
Expand Down
25 changes: 0 additions & 25 deletions Source/Core/VideoBackends/OGL/StreamBuffer.cpp
Expand Up @@ -23,23 +23,13 @@ StreamBuffer::StreamBuffer(u32 type, size_t size)

bool nvidia = !strcmp(g_ogl_config.gl_vendor, "NVIDIA Corporation");

// TODO: move this to InitBackendInfo
if(g_ActiveConfig.bHackedBufferUpload && DriverDetails::HasBug(DriverDetails::BUG_BROKENHACKEDBUFFER))
{
OSD::AddMessage("Vertex Streaming Hack isn't supported by your GPU.", 10000);
g_ActiveConfig.bHackedBufferUpload = false;
g_Config.bHackedBufferUpload = false;
}

if (g_ogl_config.bSupportsGLBufferStorage &&
!(DriverDetails::HasBug(DriverDetails::BUG_BROKENBUFFERSTORAGE) && type == GL_ARRAY_BUFFER))
m_uploadtype = BUFFERSTORAGE;
else if(!g_ogl_config.bSupportsGLBaseVertex && !DriverDetails::HasBug(DriverDetails::BUG_BROKENBUFFERSTREAM))
m_uploadtype = BUFFERSUBDATA;
else if(!g_ogl_config.bSupportsGLBaseVertex)
m_uploadtype = BUFFERDATA;
else if(g_ogl_config.bSupportsGLSync && g_ActiveConfig.bHackedBufferUpload)
m_uploadtype = MAP_AND_RISK;
else if(g_ogl_config.bSupportsGLSync && g_ogl_config.bSupportsGLPinnedMemory &&
!(DriverDetails::HasBug(DriverDetails::BUG_BROKENPINNEDMEMORY) && type == GL_ELEMENT_ARRAY_BUFFER))
m_uploadtype = PINNED_MEMORY;
Expand Down Expand Up @@ -117,11 +107,6 @@ void StreamBuffer::Alloc ( size_t size, u32 stride )
m_free_iterator = iter_end;
}

break;
case MAP_AND_RISK:
if(iter_end >= m_size) {
m_iterator_aligned = 0;
}
break;
case BUFFERSUBDATA:
case BUFFERDATA:
Expand All @@ -145,7 +130,6 @@ size_t StreamBuffer::Upload ( u8* data, size_t size )
}
break;
case PINNED_MEMORY:
case MAP_AND_RISK:
case BUFFERSTORAGE:
if (pointer)
memcpy(pointer + m_iterator, data, size);
Expand Down Expand Up @@ -219,14 +203,6 @@ void StreamBuffer::Init()
ERROR_LOG(VIDEO, "Buffer allocation failed");
break;

case MAP_AND_RISK:
glBindBuffer(m_buffertype, m_buffer);
glBufferData(m_buffertype, m_size, NULL, GL_STREAM_DRAW);
pointer = (u8*)glMapBufferRange(m_buffertype, 0, m_size, GL_MAP_WRITE_BIT);
glUnmapBuffer(m_buffertype);
if(!pointer)
ERROR_LOG(VIDEO, "Buffer allocation failed");
break;
case BUFFERDATA:
glBindBuffer(m_buffertype, m_buffer);
break;
Expand All @@ -239,7 +215,6 @@ void StreamBuffer::Shutdown()
case MAP_AND_SYNC:
DeleteFences();
break;
case MAP_AND_RISK:
case MAP_AND_ORPHAN:
case BUFFERSUBDATA:
case BUFFERDATA:
Expand Down
9 changes: 4 additions & 5 deletions Source/Core/VideoBackends/OGL/StreamBuffer.h
Expand Up @@ -20,11 +20,10 @@ namespace OGL
enum StreamType {
MAP_AND_ORPHAN = (1 << 1),
MAP_AND_SYNC = (1 << 2),
MAP_AND_RISK = (1 << 3),
PINNED_MEMORY = (1 << 4),
BUFFERSUBDATA = (1 << 5),
BUFFERDATA = (1 << 6),
BUFFERSTORAGE = (1 << 7),
PINNED_MEMORY = (1 << 3),
BUFFERSUBDATA = (1 << 4),
BUFFERDATA = (1 << 5),
BUFFERSTORAGE = (1 << 6),
};

class StreamBuffer {
Expand Down
3 changes: 0 additions & 3 deletions Source/Core/VideoCommon/VideoConfig.cpp
Expand Up @@ -68,7 +68,6 @@ void VideoConfig::Load(const char *ini_file)
iniFile.Get("Settings", "AnaglyphStereoSeparation", &iAnaglyphStereoSeparation, 200);
iniFile.Get("Settings", "AnaglyphFocalAngle", &iAnaglyphFocalAngle, 0);
iniFile.Get("Settings", "EnablePixelLighting", &bEnablePixelLighting, 0);
iniFile.Get("Settings", "HackedBufferUpload", &bHackedBufferUpload, 0);
iniFile.Get("Settings", "FastDepthCalc", &bFastDepthCalc, true);

iniFile.Get("Settings", "MSAA", &iMultisampleMode, 0);
Expand Down Expand Up @@ -151,7 +150,6 @@ void VideoConfig::GameIniLoad()
CHECK_SETTING("Video_Settings", "AnaglyphStereoSeparation", iAnaglyphStereoSeparation);
CHECK_SETTING("Video_Settings", "AnaglyphFocalAngle", iAnaglyphFocalAngle);
CHECK_SETTING("Video_Settings", "EnablePixelLighting", bEnablePixelLighting);
CHECK_SETTING("Video_Settings", "HackedBufferUpload", bHackedBufferUpload);
CHECK_SETTING("Video_Settings", "FastDepthCalc", bFastDepthCalc);
CHECK_SETTING("Video_Settings", "MSAA", iMultisampleMode);
int tmp = -9000;
Expand Down Expand Up @@ -250,7 +248,6 @@ void VideoConfig::Save(const char *ini_file)
iniFile.Set("Settings", "AnaglyphStereoSeparation", iAnaglyphStereoSeparation);
iniFile.Set("Settings", "AnaglyphFocalAngle", iAnaglyphFocalAngle);
iniFile.Set("Settings", "EnablePixelLighting", bEnablePixelLighting);
iniFile.Set("Settings", "HackedBufferUpload", bHackedBufferUpload);
iniFile.Set("Settings", "FastDepthCalc", bFastDepthCalc);

iniFile.Set("Settings", "ShowEFBCopyRegions", bShowEFBCopyRegions);
Expand Down
1 change: 0 additions & 1 deletion Source/Core/VideoCommon/VideoConfig.h
Expand Up @@ -119,7 +119,6 @@ struct VideoConfig
float fAspectRatioHackW, fAspectRatioHackH;
bool bUseBBox;
bool bEnablePixelLighting;
bool bHackedBufferUpload;
bool bFastDepthCalc;
int iLog; // CONF_ bits
int iSaveTargetId; // TODO: Should be dropped
Expand Down

0 comments on commit f1adc56

Please sign in to comment.