Compare commits
27 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 1dc48c3eba | |||
| 44eb2510c7 | |||
| b319f291be | |||
| 193806b4bd | |||
| bf3f294112 | |||
| 9e278a6bb8 | |||
| b11c7df9b5 | |||
| d750fa7f73 | |||
| b3feaedb0f | |||
| e0421cc784 | |||
| 802e02c634 | |||
| 13aaf1dff3 | |||
| a333641abd | |||
| ba40e4d71b | |||
| 1171449681 | |||
| 9ad6f53cb1 | |||
| 3ad5bc01d7 | |||
| 944f898648 | |||
| bcdca262ed | |||
| 6a28c2daef | |||
| 444fe83888 | |||
| 4638998471 | |||
| 91514f00bf | |||
| 9c28aa8d1e | |||
| eafbb08dd3 | |||
| c72e1327bd | |||
| d83d1a4fd6 |
@@ -37,13 +37,13 @@ Layer::~Layer()
|
||||
Save();
|
||||
}
|
||||
|
||||
bool Layer::Exists(const ConfigLocation& location) const
|
||||
bool Layer::Exists(const Location& location) const
|
||||
{
|
||||
const auto iter = m_map.find(location);
|
||||
return iter != m_map.end() && iter->second.has_value();
|
||||
}
|
||||
|
||||
bool Layer::DeleteKey(const ConfigLocation& location)
|
||||
bool Layer::DeleteKey(const Location& location)
|
||||
{
|
||||
m_is_dirty = true;
|
||||
bool had_value = false;
|
||||
@@ -68,19 +68,21 @@ void Layer::DeleteAllKeys()
|
||||
|
||||
Section Layer::GetSection(System system, const std::string& section)
|
||||
{
|
||||
return Section{m_map.lower_bound(ConfigLocation{system, section, ""}),
|
||||
m_map.lower_bound(ConfigLocation{system, section + '\001', ""})};
|
||||
return Section{m_map.lower_bound(Location{system, section, ""}),
|
||||
m_map.lower_bound(Location{system, section + '\001', ""})};
|
||||
}
|
||||
|
||||
ConstSection Layer::GetSection(System system, const std::string& section) const
|
||||
{
|
||||
return ConstSection{m_map.lower_bound(ConfigLocation{system, section, ""}),
|
||||
m_map.lower_bound(ConfigLocation{system, section + '\001', ""})};
|
||||
return ConstSection{m_map.lower_bound(Location{system, section, ""}),
|
||||
m_map.lower_bound(Location{system, section + '\001', ""})};
|
||||
}
|
||||
|
||||
void Layer::Load()
|
||||
{
|
||||
return;
|
||||
if (m_loader)
|
||||
m_loader->Load(this);
|
||||
m_is_dirty = false;
|
||||
}
|
||||
|
||||
void Layer::Save()
|
||||
|
||||
@@ -1,6 +1,3 @@
|
||||
//// Copyright 2008 Dolphin Emulator Project
|
||||
//// Licensed under GPLv2+
|
||||
//// Refer to the license.txt file included.
|
||||
// Copyright 2008 Dolphin Emulator Project
|
||||
// Licensed under GPLv2+
|
||||
// Refer to the license.txt file included.
|
||||
@@ -96,7 +93,6 @@ void SConfig::SaveSettings()
|
||||
SaveInputSettings(ini);
|
||||
SaveFifoPlayerSettings(ini);
|
||||
SaveAnalyticsSettings(ini);
|
||||
SaveNetworkSettings(ini);
|
||||
SaveBluetoothPassthroughSettings(ini);
|
||||
SaveUSBPassthroughSettings(ini);
|
||||
SaveAutoUpdateSettings(ini);
|
||||
@@ -191,9 +187,13 @@ void SConfig::SaveGameListSettings(IniFile& ini)
|
||||
gamelist->Set("ColumnTitle", m_showTitleColumn);
|
||||
gamelist->Set("ColumnNotes", m_showMakerColumn);
|
||||
gamelist->Set("ColumnFileName", m_showFileNameColumn);
|
||||
gamelist->Set("ColumnFilePath", m_showFilePathColumn);
|
||||
gamelist->Set("ColumnID", m_showIDColumn);
|
||||
gamelist->Set("ColumnRegion", m_showRegionColumn);
|
||||
gamelist->Set("ColumnSize", m_showSizeColumn);
|
||||
gamelist->Set("ColumnFileFormat", m_showFileFormatColumn);
|
||||
gamelist->Set("ColumnBlockSize", m_showBlockSizeColumn);
|
||||
gamelist->Set("ColumnCompression", m_showCompressionColumn);
|
||||
gamelist->Set("ColumnTags", m_showTagsColumn);
|
||||
}
|
||||
|
||||
@@ -227,6 +227,8 @@ void SConfig::SaveCoreSettings(IniFile& ini)
|
||||
core->Set("SlotB", m_EXIDevice[1]);
|
||||
core->Set("SerialPort1", m_EXIDevice[2]);
|
||||
core->Set("BBA_MAC", m_bba_mac);
|
||||
core->Set("BBA_XLINK_IP", m_bba_xlink_ip);
|
||||
core->Set("BBA_XLINK_CHAT_OSD", m_bba_xlink_chat_osd);
|
||||
for (int i = 0; i < SerialInterface::MAX_SI_CHANNELS; ++i)
|
||||
{
|
||||
core->Set(fmt::format("SIDevice{}", i), m_SIDevice[i]);
|
||||
@@ -237,13 +239,13 @@ void SConfig::SaveCoreSettings(IniFile& ini)
|
||||
core->Set("WiiKeyboard", m_WiiKeyboard);
|
||||
core->Set("WiimoteContinuousScanning", m_WiimoteContinuousScanning);
|
||||
core->Set("WiimoteEnableSpeaker", m_WiimoteEnableSpeaker);
|
||||
core->Set("WiimoteControllerInterface", connect_wiimotes_for_ciface);
|
||||
core->Set("RunCompareServer", bRunCompareServer);
|
||||
core->Set("RunCompareClient", bRunCompareClient);
|
||||
core->Set("MMU", bMMU);
|
||||
core->Set("EmulationSpeed", m_EmulationSpeed);
|
||||
core->Set("Overclock", m_OCFactor);
|
||||
core->Set("OverclockEnable", m_OCEnable);
|
||||
core->Set("GFXBackend", m_strVideoBackend);
|
||||
core->Set("GPUDeterminismMode", m_strGPUDeterminismMode);
|
||||
core->Set("PerfMapDir", m_perfDir);
|
||||
core->Set("EnableCustomRTC", bEnableCustomRTC);
|
||||
@@ -293,17 +295,6 @@ void SConfig::SaveFifoPlayerSettings(IniFile& ini)
|
||||
fifoplayer->Set("LoopReplay", bLoopFifoReplay);
|
||||
}
|
||||
|
||||
void SConfig::SaveNetworkSettings(IniFile& ini)
|
||||
{
|
||||
IniFile::Section* network = ini.GetOrCreateSection("Network");
|
||||
|
||||
network->Set("SSLDumpRead", m_SSLDumpRead);
|
||||
network->Set("SSLDumpWrite", m_SSLDumpWrite);
|
||||
network->Set("SSLVerifyCertificates", m_SSLVerifyCert);
|
||||
network->Set("SSLDumpRootCA", m_SSLDumpRootCA);
|
||||
network->Set("SSLDumpPeerCert", m_SSLDumpPeerCert);
|
||||
}
|
||||
|
||||
void SConfig::SaveAnalyticsSettings(IniFile& ini)
|
||||
{
|
||||
IniFile::Section* analytics = ini.GetOrCreateSection("Analytics");
|
||||
@@ -358,6 +349,7 @@ void SConfig::SaveJitDebugSettings(IniFile& ini)
|
||||
section->Set("JitPairedOff", bJITPairedOff);
|
||||
section->Set("JitSystemRegistersOff", bJITSystemRegistersOff);
|
||||
section->Set("JitBranchOff", bJITBranchOff);
|
||||
section->Set("JitRegisterCacheOff", bJITRegisterCacheOff);
|
||||
}
|
||||
|
||||
void SConfig::LoadSettings()
|
||||
@@ -376,7 +368,6 @@ void SConfig::LoadSettings()
|
||||
LoadDSPSettings(ini);
|
||||
LoadInputSettings(ini);
|
||||
LoadFifoPlayerSettings(ini);
|
||||
LoadNetworkSettings(ini);
|
||||
LoadAnalyticsSettings(ini);
|
||||
LoadBluetoothPassthroughSettings(ini);
|
||||
LoadUSBPassthroughSettings(ini);
|
||||
@@ -465,9 +456,13 @@ void SConfig::LoadGameListSettings(IniFile& ini)
|
||||
gamelist->Get("ColumnTitle", &m_showTitleColumn, true);
|
||||
gamelist->Get("ColumnNotes", &m_showMakerColumn, true);
|
||||
gamelist->Get("ColumnFileName", &m_showFileNameColumn, false);
|
||||
gamelist->Get("ColumnFilePath", &m_showFilePathColumn, false);
|
||||
gamelist->Get("ColumnID", &m_showIDColumn, false);
|
||||
gamelist->Get("ColumnRegion", &m_showRegionColumn, true);
|
||||
gamelist->Get("ColumnSize", &m_showSizeColumn, true);
|
||||
gamelist->Get("ColumnFileFormat", &m_showFileFormatColumn, false);
|
||||
gamelist->Get("ColumnBlockSize", &m_showBlockSizeColumn, false);
|
||||
gamelist->Get("ColumnCompression", &m_showCompressionColumn, false);
|
||||
gamelist->Get("ColumnTags", &m_showTagsColumn, false);
|
||||
}
|
||||
|
||||
@@ -502,18 +497,20 @@ void SConfig::LoadCoreSettings(IniFile& ini)
|
||||
core->Get("SlotB", (int*)&m_EXIDevice[1], ExpansionInterface::EXIDEVICE_NONE);
|
||||
core->Get("SerialPort1", (int*)&m_EXIDevice[2], ExpansionInterface::EXIDEVICE_NONE);
|
||||
core->Get("BBA_MAC", &m_bba_mac);
|
||||
core->Get("BBA_XLINK_IP", &m_bba_xlink_ip, "127.0.0.1");
|
||||
core->Get("BBA_XLINK_CHAT_OSD", &m_bba_xlink_chat_osd, true);
|
||||
for (size_t i = 0; i < std::size(m_SIDevice); ++i)
|
||||
{
|
||||
//OpenEmu make all devices GCpads
|
||||
core->Get(fmt::format("SIDevice{}", i), &m_SIDevice[i], SerialInterface::SIDEVICE_GC_CONTROLLER);
|
||||
|
||||
core->Get(fmt::format("AdapterRumble{}", i), &m_AdapterRumble[i], true);
|
||||
core->Get(fmt::format("SimulateKonga{}", i), &m_AdapterKonga[i], false);
|
||||
}
|
||||
core->Get("WiiSDCard", &m_WiiSDCard, false);
|
||||
core->Get("WiiSDCard", &m_WiiSDCard, true);
|
||||
core->Get("WiiKeyboard", &m_WiiKeyboard, false);
|
||||
core->Get("WiimoteContinuousScanning", &m_WiimoteContinuousScanning, false);
|
||||
core->Get("WiimoteEnableSpeaker", &m_WiimoteEnableSpeaker, false);
|
||||
core->Get("WiimoteControllerInterface", &connect_wiimotes_for_ciface, false);
|
||||
core->Get("RunCompareServer", &bRunCompareServer, false);
|
||||
core->Get("RunCompareClient", &bRunCompareClient, false);
|
||||
core->Get("MMU", &bMMU, bMMU);
|
||||
@@ -529,7 +526,6 @@ void SConfig::LoadCoreSettings(IniFile& ini)
|
||||
core->Get("EmulationSpeed", &m_EmulationSpeed, 1.0f);
|
||||
core->Get("Overclock", &m_OCFactor, 1.0f);
|
||||
core->Get("OverclockEnable", &m_OCEnable, false);
|
||||
core->Get("GFXBackend", &m_strVideoBackend, "");
|
||||
core->Get("GPUDeterminismMode", &m_strGPUDeterminismMode, "auto");
|
||||
core->Get("PerfMapDir", &m_perfDir, "");
|
||||
core->Get("EnableCustomRTC", &bEnableCustomRTC, false);
|
||||
@@ -582,17 +578,6 @@ void SConfig::LoadFifoPlayerSettings(IniFile& ini)
|
||||
fifoplayer->Get("LoopReplay", &bLoopFifoReplay, true);
|
||||
}
|
||||
|
||||
void SConfig::LoadNetworkSettings(IniFile& ini)
|
||||
{
|
||||
IniFile::Section* network = ini.GetOrCreateSection("Network");
|
||||
|
||||
network->Get("SSLDumpRead", &m_SSLDumpRead, false);
|
||||
network->Get("SSLDumpWrite", &m_SSLDumpWrite, false);
|
||||
network->Get("SSLVerifyCertificates", &m_SSLVerifyCert, true);
|
||||
network->Get("SSLDumpRootCA", &m_SSLDumpRootCA, false);
|
||||
network->Get("SSLDumpPeerCert", &m_SSLDumpPeerCert, false);
|
||||
}
|
||||
|
||||
void SConfig::LoadAnalyticsSettings(IniFile& ini)
|
||||
{
|
||||
IniFile::Section* analytics = ini.GetOrCreateSection("Analytics");
|
||||
@@ -651,6 +636,7 @@ void SConfig::LoadJitDebugSettings(IniFile& ini)
|
||||
section->Get("JitPairedOff", &bJITPairedOff, false);
|
||||
section->Get("JitSystemRegistersOff", &bJITSystemRegistersOff, false);
|
||||
section->Get("JitBranchOff", &bJITBranchOff, false);
|
||||
section->Get("JitRegisterCacheOff", &bJITRegisterCacheOff, false);
|
||||
}
|
||||
|
||||
void SConfig::ResetRunningGameMetadata()
|
||||
@@ -803,6 +789,7 @@ void SConfig::LoadDefaults()
|
||||
bJITPairedOff = false;
|
||||
bJITSystemRegistersOff = false;
|
||||
bJITBranchOff = false;
|
||||
bJITRegisterCacheOff = false;
|
||||
|
||||
ResetRunningGameMetadata();
|
||||
}
|
||||
|
||||
@@ -0,0 +1,162 @@
|
||||
// Copyright 2017 Dolphin Emulator Project
|
||||
// Licensed under GPLv2+
|
||||
// Refer to the license.txt file included.
|
||||
|
||||
#include "Core/Config/GraphicsSettings.h"
|
||||
|
||||
#include <string>
|
||||
|
||||
#include "Common/Config/Config.h"
|
||||
#include "VideoCommon/VideoConfig.h"
|
||||
|
||||
namespace Config
|
||||
{
|
||||
// Configuration Information
|
||||
|
||||
// Graphics.Hardware
|
||||
|
||||
const Info<bool> GFX_VSYNC{{System::GFX, "Hardware", "VSync"}, false};
|
||||
const Info<int> GFX_ADAPTER{{System::GFX, "Hardware", "Adapter"}, 0};
|
||||
|
||||
// Graphics.Settings
|
||||
|
||||
const Info<bool> GFX_WIDESCREEN_HACK{{System::GFX, "Settings", "wideScreenHack"}, false};
|
||||
const Info<AspectMode> GFX_ASPECT_RATIO{{System::GFX, "Settings", "AspectRatio"}, AspectMode::Auto};
|
||||
|
||||
//OpenEmu change apect to stretch
|
||||
const Info<AspectMode> GFX_SUGGESTED_ASPECT_RATIO{{System::GFX, "Settings", "SuggestedAspectRatio"},
|
||||
AspectMode::Stretch};
|
||||
const Info<bool> GFX_CROP{{System::GFX, "Settings", "Crop"}, false};
|
||||
const Info<int> GFX_SAFE_TEXTURE_CACHE_COLOR_SAMPLES{
|
||||
{System::GFX, "Settings", "SafeTextureCacheColorSamples"}, 128};
|
||||
const Info<bool> GFX_SHOW_FPS{{System::GFX, "Settings", "ShowFPS"}, false};
|
||||
const Info<bool> GFX_SHOW_NETPLAY_PING{{System::GFX, "Settings", "ShowNetPlayPing"}, false};
|
||||
const Info<bool> GFX_SHOW_NETPLAY_MESSAGES{{System::GFX, "Settings", "ShowNetPlayMessages"}, false};
|
||||
const Info<bool> GFX_LOG_RENDER_TIME_TO_FILE{{System::GFX, "Settings", "LogRenderTimeToFile"},
|
||||
false};
|
||||
const Info<bool> GFX_OVERLAY_STATS{{System::GFX, "Settings", "OverlayStats"}, false};
|
||||
const Info<bool> GFX_OVERLAY_PROJ_STATS{{System::GFX, "Settings", "OverlayProjStats"}, false};
|
||||
const Info<bool> GFX_DUMP_TEXTURES{{System::GFX, "Settings", "DumpTextures"}, false};
|
||||
const Info<bool> GFX_DUMP_MIP_TEXTURES{{System::GFX, "Settings", "DumpMipTextures"}, true};
|
||||
const Info<bool> GFX_DUMP_BASE_TEXTURES{{System::GFX, "Settings", "DumpBaseTextures"}, true};
|
||||
const Info<bool> GFX_HIRES_TEXTURES{{System::GFX, "Settings", "HiresTextures"}, false};
|
||||
const Info<bool> GFX_CACHE_HIRES_TEXTURES{{System::GFX, "Settings", "CacheHiresTextures"}, false};
|
||||
const Info<bool> GFX_DUMP_EFB_TARGET{{System::GFX, "Settings", "DumpEFBTarget"}, false};
|
||||
const Info<bool> GFX_DUMP_XFB_TARGET{{System::GFX, "Settings", "DumpXFBTarget"}, false};
|
||||
const Info<bool> GFX_DUMP_FRAMES_AS_IMAGES{{System::GFX, "Settings", "DumpFramesAsImages"}, false};
|
||||
const Info<bool> GFX_FREE_LOOK{{System::GFX, "Settings", "FreeLook"}, false};
|
||||
const Info<FreelookControlType> GFX_FREE_LOOK_CONTROL_TYPE{
|
||||
{System::GFX, "Settings", "FreeLookControlType"}, FreelookControlType::SixAxis};
|
||||
const Info<bool> GFX_USE_FFV1{{System::GFX, "Settings", "UseFFV1"}, false};
|
||||
const Info<std::string> GFX_DUMP_FORMAT{{System::GFX, "Settings", "DumpFormat"}, "avi"};
|
||||
const Info<std::string> GFX_DUMP_CODEC{{System::GFX, "Settings", "DumpCodec"}, ""};
|
||||
const Info<std::string> GFX_DUMP_ENCODER{{System::GFX, "Settings", "DumpEncoder"}, ""};
|
||||
const Info<std::string> GFX_DUMP_PATH{{System::GFX, "Settings", "DumpPath"}, ""};
|
||||
const Info<int> GFX_BITRATE_KBPS{{System::GFX, "Settings", "BitrateKbps"}, 25000};
|
||||
const Info<bool> GFX_INTERNAL_RESOLUTION_FRAME_DUMPS{
|
||||
{System::GFX, "Settings", "InternalResolutionFrameDumps"}, false};
|
||||
const Info<bool> GFX_ENABLE_GPU_TEXTURE_DECODING{
|
||||
{System::GFX, "Settings", "EnableGPUTextureDecoding"}, false};
|
||||
const Info<bool> GFX_ENABLE_PIXEL_LIGHTING{{System::GFX, "Settings", "EnablePixelLighting"}, false};
|
||||
const Info<bool> GFX_FAST_DEPTH_CALC{{System::GFX, "Settings", "FastDepthCalc"}, true};
|
||||
const Info<u32> GFX_MSAA{{System::GFX, "Settings", "MSAA"}, 1};
|
||||
const Info<bool> GFX_SSAA{{System::GFX, "Settings", "SSAA"}, false};
|
||||
const Info<int> GFX_EFB_SCALE{{System::GFX, "Settings", "InternalResolution"}, 1};
|
||||
const Info<int> GFX_MAX_EFB_SCALE{{System::GFX, "Settings", "MaxInternalResolution"}, 8};
|
||||
const Info<bool> GFX_TEXFMT_OVERLAY_ENABLE{{System::GFX, "Settings", "TexFmtOverlayEnable"}, false};
|
||||
const Info<bool> GFX_TEXFMT_OVERLAY_CENTER{{System::GFX, "Settings", "TexFmtOverlayCenter"}, false};
|
||||
const Info<bool> GFX_ENABLE_WIREFRAME{{System::GFX, "Settings", "WireFrame"}, false};
|
||||
const Info<bool> GFX_DISABLE_FOG{{System::GFX, "Settings", "DisableFog"}, false};
|
||||
const Info<bool> GFX_BORDERLESS_FULLSCREEN{{System::GFX, "Settings", "BorderlessFullscreen"},
|
||||
false};
|
||||
const Info<bool> GFX_ENABLE_VALIDATION_LAYER{{System::GFX, "Settings", "EnableValidationLayer"},
|
||||
false};
|
||||
|
||||
#if defined(ANDROID)
|
||||
const Info<bool> GFX_BACKEND_MULTITHREADING{{System::GFX, "Settings", "BackendMultithreading"},
|
||||
false};
|
||||
const Info<int> GFX_COMMAND_BUFFER_EXECUTE_INTERVAL{
|
||||
{System::GFX, "Settings", "CommandBufferExecuteInterval"}, 0};
|
||||
#else
|
||||
const Info<bool> GFX_BACKEND_MULTITHREADING{{System::GFX, "Settings", "BackendMultithreading"},
|
||||
true};
|
||||
const Info<int> GFX_COMMAND_BUFFER_EXECUTE_INTERVAL{
|
||||
{System::GFX, "Settings", "CommandBufferExecuteInterval"}, 100};
|
||||
#endif
|
||||
|
||||
////OpenEmu change ShaderCache True, WaitForShaders false, Compiler and Precompiler thread -1
|
||||
const Info<bool> GFX_SHADER_CACHE{{System::GFX, "Settings", "ShaderCache"}, true};
|
||||
const Info<bool> GFX_WAIT_FOR_SHADERS_BEFORE_STARTING{
|
||||
{System::GFX, "Settings", "WaitForShadersBeforeStarting"}, false};
|
||||
const Info<ShaderCompilationMode> GFX_SHADER_COMPILATION_MODE{
|
||||
{System::GFX, "Settings", "ShaderCompilationMode"}, ShaderCompilationMode::Synchronous};
|
||||
const Info<int> GFX_SHADER_COMPILER_THREADS{{System::GFX, "Settings", "ShaderCompilerThreads"}, -1};
|
||||
const Info<int> GFX_SHADER_PRECOMPILER_THREADS{
|
||||
{System::GFX, "Settings", "ShaderPrecompilerThreads"}, -1};
|
||||
const Info<bool> GFX_SAVE_TEXTURE_CACHE_TO_STATE{
|
||||
{System::GFX, "Settings", "SaveTextureCacheToState"}, true};
|
||||
// End OpenEmu Settings
|
||||
|
||||
const Info<bool> GFX_SW_ZCOMPLOC{{System::GFX, "Settings", "SWZComploc"}, true};
|
||||
const Info<bool> GFX_SW_ZFREEZE{{System::GFX, "Settings", "SWZFreeze"}, true};
|
||||
const Info<bool> GFX_SW_DUMP_OBJECTS{{System::GFX, "Settings", "SWDumpObjects"}, false};
|
||||
const Info<bool> GFX_SW_DUMP_TEV_STAGES{{System::GFX, "Settings", "SWDumpTevStages"}, false};
|
||||
const Info<bool> GFX_SW_DUMP_TEV_TEX_FETCHES{{System::GFX, "Settings", "SWDumpTevTexFetches"},
|
||||
false};
|
||||
const Info<int> GFX_SW_DRAW_START{{System::GFX, "Settings", "SWDrawStart"}, 0};
|
||||
const Info<int> GFX_SW_DRAW_END{{System::GFX, "Settings", "SWDrawEnd"}, 100000};
|
||||
|
||||
const Info<bool> GFX_PREFER_GLES{{System::GFX, "Settings", "PreferGLES"}, false};
|
||||
|
||||
// Graphics.Enhancements
|
||||
|
||||
const Info<bool> GFX_ENHANCE_FORCE_FILTERING{{System::GFX, "Enhancements", "ForceFiltering"},
|
||||
false};
|
||||
const Info<int> GFX_ENHANCE_MAX_ANISOTROPY{{System::GFX, "Enhancements", "MaxAnisotropy"}, 0};
|
||||
const Info<std::string> GFX_ENHANCE_POST_SHADER{
|
||||
{System::GFX, "Enhancements", "PostProcessingShader"}, ""};
|
||||
const Info<bool> GFX_ENHANCE_FORCE_TRUE_COLOR{{System::GFX, "Enhancements", "ForceTrueColor"},
|
||||
true};
|
||||
const Info<bool> GFX_ENHANCE_DISABLE_COPY_FILTER{{System::GFX, "Enhancements", "DisableCopyFilter"},
|
||||
true};
|
||||
const Info<bool> GFX_ENHANCE_ARBITRARY_MIPMAP_DETECTION{
|
||||
{System::GFX, "Enhancements", "ArbitraryMipmapDetection"}, true};
|
||||
const Info<float> GFX_ENHANCE_ARBITRARY_MIPMAP_DETECTION_THRESHOLD{
|
||||
{System::GFX, "Enhancements", "ArbitraryMipmapDetectionThreshold"}, 14.0f};
|
||||
|
||||
// Graphics.Stereoscopy
|
||||
|
||||
const Info<StereoMode> GFX_STEREO_MODE{{System::GFX, "Stereoscopy", "StereoMode"}, StereoMode::Off};
|
||||
const Info<int> GFX_STEREO_DEPTH{{System::GFX, "Stereoscopy", "StereoDepth"}, 20};
|
||||
const Info<int> GFX_STEREO_CONVERGENCE_PERCENTAGE{
|
||||
{System::GFX, "Stereoscopy", "StereoConvergencePercentage"}, 100};
|
||||
const Info<bool> GFX_STEREO_SWAP_EYES{{System::GFX, "Stereoscopy", "StereoSwapEyes"}, false};
|
||||
const Info<int> GFX_STEREO_CONVERGENCE{{System::GFX, "Stereoscopy", "StereoConvergence"}, 20};
|
||||
const Info<bool> GFX_STEREO_EFB_MONO_DEPTH{{System::GFX, "Stereoscopy", "StereoEFBMonoDepth"},
|
||||
false};
|
||||
const Info<int> GFX_STEREO_DEPTH_PERCENTAGE{{System::GFX, "Stereoscopy", "StereoDepthPercentage"},
|
||||
100};
|
||||
|
||||
// Graphics.Hacks
|
||||
|
||||
const Info<bool> GFX_HACK_EFB_ACCESS_ENABLE{{System::GFX, "Hacks", "EFBAccessEnable"}, true};
|
||||
const Info<bool> GFX_HACK_EFB_DEFER_INVALIDATION{
|
||||
{System::GFX, "Hacks", "EFBAccessDeferInvalidation"}, false};
|
||||
const Info<int> GFX_HACK_EFB_ACCESS_TILE_SIZE{{System::GFX, "Hacks", "EFBAccessTileSize"}, 64};
|
||||
const Info<bool> GFX_HACK_BBOX_ENABLE{{System::GFX, "Hacks", "BBoxEnable"}, false};
|
||||
const Info<bool> GFX_HACK_FORCE_PROGRESSIVE{{System::GFX, "Hacks", "ForceProgressive"}, true};
|
||||
const Info<bool> GFX_HACK_SKIP_EFB_COPY_TO_RAM{{System::GFX, "Hacks", "EFBToTextureEnable"}, true};
|
||||
const Info<bool> GFX_HACK_SKIP_XFB_COPY_TO_RAM{{System::GFX, "Hacks", "XFBToTextureEnable"}, true};
|
||||
const Info<bool> GFX_HACK_DISABLE_COPY_TO_VRAM{{System::GFX, "Hacks", "DisableCopyToVRAM"}, false};
|
||||
const Info<bool> GFX_HACK_DEFER_EFB_COPIES{{System::GFX, "Hacks", "DeferEFBCopies"}, true};
|
||||
const Info<bool> GFX_HACK_IMMEDIATE_XFB{{System::GFX, "Hacks", "ImmediateXFBEnable"}, false};
|
||||
const Info<bool> GFX_HACK_SKIP_DUPLICATE_XFBS{{System::GFX, "Hacks", "SkipDuplicateXFBs"}, true};
|
||||
const Info<bool> GFX_HACK_COPY_EFB_SCALED{{System::GFX, "Hacks", "EFBScaledCopy"}, true};
|
||||
const Info<bool> GFX_HACK_EFB_EMULATE_FORMAT_CHANGES{
|
||||
{System::GFX, "Hacks", "EFBEmulateFormatChanges"}, false};
|
||||
const Info<bool> GFX_HACK_VERTEX_ROUDING{{System::GFX, "Hacks", "VertexRounding"}, false};
|
||||
|
||||
// Graphics.GameSpecific
|
||||
|
||||
const Info<bool> GFX_PERF_QUERIES_ENABLE{{System::GFX, "GameSpecific", "PerfQueriesEnable"}, false};
|
||||
} // namespace Config
|
||||
@@ -4,15 +4,44 @@
|
||||
|
||||
#include "InputCommon/ControllerInterface/ControllerInterface.h"
|
||||
|
||||
//OpenEmu undefine the OSX settings
|
||||
#ifdef CIFACE_USE_OSX
|
||||
#undef CIFACE_USE_OSX
|
||||
#endif
|
||||
|
||||
//OpenEmu incluse OE input header
|
||||
#include "OpenEmuInput.h"
|
||||
|
||||
#include <algorithm>
|
||||
|
||||
#include "Common/Logging/Log.h"
|
||||
#include "Core/HW/WiimoteReal/WiimoteReal.h"
|
||||
|
||||
#include "OpenEmuInput.h"
|
||||
#ifdef CIFACE_USE_WIN32
|
||||
#include "InputCommon/ControllerInterface/Win32/Win32.h"
|
||||
#endif
|
||||
#ifdef CIFACE_USE_XLIB
|
||||
#include "InputCommon/ControllerInterface/Xlib/XInput2.h"
|
||||
#endif
|
||||
#ifdef CIFACE_USE_OSX
|
||||
#include "InputCommon/ControllerInterface/OSX/OSX.h"
|
||||
#include "InputCommon/ControllerInterface/Quartz/Quartz.h"
|
||||
#endif
|
||||
#ifdef CIFACE_USE_SDL
|
||||
#include "InputCommon/ControllerInterface/SDL/SDL.h"
|
||||
#endif
|
||||
#ifdef CIFACE_USE_ANDROID
|
||||
#include "InputCommon/ControllerInterface/Android/Android.h"
|
||||
#endif
|
||||
#ifdef CIFACE_USE_EVDEV
|
||||
#include "InputCommon/ControllerInterface/evdev/evdev.h"
|
||||
#endif
|
||||
#ifdef CIFACE_USE_PIPES
|
||||
#include "InputCommon/ControllerInterface/Pipes/Pipes.h"
|
||||
#endif
|
||||
#ifdef CIFACE_USE_DUALSHOCKUDPCLIENT
|
||||
#include "InputCommon/ControllerInterface/DualShockUDPClient/DualShockUDPClient.h"
|
||||
#endif
|
||||
|
||||
ControllerInterface g_controller_interface;
|
||||
|
||||
@@ -28,10 +57,39 @@ void ControllerInterface::Initialize(const WindowSystemInfo& wsi)
|
||||
|
||||
m_is_populating_devices = true;
|
||||
|
||||
Input::Openemu_Input_Init();
|
||||
#ifdef CIFACE_USE_WIN32
|
||||
ciface::Win32::Init(wsi.render_window);
|
||||
#endif
|
||||
#ifdef CIFACE_USE_XLIB
|
||||
// nothing needed
|
||||
#endif
|
||||
#ifdef CIFACE_USE_OSX
|
||||
if (m_wsi.type == WindowSystemType::MacOS)
|
||||
ciface::OSX::Init(wsi.render_window);
|
||||
// nothing needed for Quartz
|
||||
#endif
|
||||
#ifdef CIFACE_USE_SDL
|
||||
ciface::SDL::Init();
|
||||
#endif
|
||||
#ifdef CIFACE_USE_ANDROID
|
||||
// nothing needed
|
||||
#endif
|
||||
#ifdef CIFACE_USE_EVDEV
|
||||
ciface::evdev::Init();
|
||||
#endif
|
||||
#ifdef CIFACE_USE_PIPES
|
||||
// nothing needed
|
||||
#endif
|
||||
#ifdef CIFACE_USE_DUALSHOCKUDPCLIENT
|
||||
ciface::DualShockUDPClient::Init();
|
||||
#endif
|
||||
|
||||
//OpenEmu initalize OpenEmu Input
|
||||
Input::Openemu_Input_Init();
|
||||
|
||||
RefreshDevices();
|
||||
|
||||
//OpenEmu set populating devices to false
|
||||
m_is_populating_devices = false;
|
||||
}
|
||||
|
||||
@@ -40,7 +98,8 @@ void ControllerInterface::ChangeWindow(void* hwnd)
|
||||
if (!m_is_init)
|
||||
return;
|
||||
|
||||
m_wsi.render_surface = hwnd;
|
||||
// This shouldn't use render_surface so no need to update it.
|
||||
m_wsi.render_window = hwnd;
|
||||
RefreshDevices();
|
||||
}
|
||||
|
||||
@@ -49,6 +108,49 @@ void ControllerInterface::RefreshDevices()
|
||||
if (!m_is_init)
|
||||
return;
|
||||
|
||||
//OpenEmu comment out this section so we can maintain our controller input
|
||||
// {
|
||||
// std::lock_guard lk(m_devices_mutex);
|
||||
// m_devices.clear();
|
||||
// }
|
||||
|
||||
m_is_populating_devices = true;
|
||||
|
||||
// Make sure shared_ptr<Device> objects are released before repopulating.
|
||||
InvokeDevicesChangedCallbacks();
|
||||
|
||||
#ifdef CIFACE_USE_WIN32
|
||||
ciface::Win32::PopulateDevices(m_wsi.render_window);
|
||||
#endif
|
||||
#ifdef CIFACE_USE_XLIB
|
||||
if (m_wsi.type == WindowSystemType::X11)
|
||||
ciface::XInput2::PopulateDevices(m_wsi.render_window);
|
||||
#endif
|
||||
#ifdef CIFACE_USE_OSX
|
||||
if (m_wsi.type == WindowSystemType::MacOS)
|
||||
{
|
||||
ciface::OSX::PopulateDevices(m_wsi.render_window);
|
||||
ciface::Quartz::PopulateDevices(m_wsi.render_window);
|
||||
}
|
||||
#endif
|
||||
#ifdef CIFACE_USE_SDL
|
||||
ciface::SDL::PopulateDevices();
|
||||
#endif
|
||||
#ifdef CIFACE_USE_ANDROID
|
||||
ciface::Android::PopulateDevices();
|
||||
#endif
|
||||
#ifdef CIFACE_USE_EVDEV
|
||||
ciface::evdev::PopulateDevices();
|
||||
#endif
|
||||
#ifdef CIFACE_USE_PIPES
|
||||
ciface::Pipes::PopulateDevices();
|
||||
#endif
|
||||
#ifdef CIFACE_USE_DUALSHOCKUDPCLIENT
|
||||
ciface::DualShockUDPClient::PopulateDevices();
|
||||
#endif
|
||||
|
||||
WiimoteReal::ProcessWiimotePool();
|
||||
|
||||
m_is_populating_devices = false;
|
||||
InvokeDevicesChangedCallbacks();
|
||||
}
|
||||
@@ -63,7 +165,7 @@ void ControllerInterface::Shutdown()
|
||||
m_is_init = false;
|
||||
|
||||
{
|
||||
std::lock_guard<std::mutex> lk(m_devices_mutex);
|
||||
std::lock_guard lk(m_devices_mutex);
|
||||
|
||||
for (const auto& d : m_devices)
|
||||
{
|
||||
@@ -79,6 +181,28 @@ void ControllerInterface::Shutdown()
|
||||
// BEFORE we shutdown the backends.
|
||||
InvokeDevicesChangedCallbacks();
|
||||
|
||||
#ifdef CIFACE_USE_WIN32
|
||||
ciface::Win32::DeInit();
|
||||
#endif
|
||||
#ifdef CIFACE_USE_XLIB
|
||||
// nothing needed
|
||||
#endif
|
||||
#ifdef CIFACE_USE_OSX
|
||||
ciface::OSX::DeInit();
|
||||
ciface::Quartz::DeInit();
|
||||
#endif
|
||||
#ifdef CIFACE_USE_SDL
|
||||
ciface::SDL::DeInit();
|
||||
#endif
|
||||
#ifdef CIFACE_USE_ANDROID
|
||||
// nothing needed
|
||||
#endif
|
||||
#ifdef CIFACE_USE_EVDEV
|
||||
ciface::evdev::Shutdown();
|
||||
#endif
|
||||
#ifdef CIFACE_USE_DUALSHOCKUDPCLIENT
|
||||
ciface::DualShockUDPClient::DeInit();
|
||||
#endif
|
||||
}
|
||||
|
||||
void ControllerInterface::AddDevice(std::shared_ptr<ciface::Core::Device> device)
|
||||
@@ -88,7 +212,7 @@ void ControllerInterface::AddDevice(std::shared_ptr<ciface::Core::Device> device
|
||||
return;
|
||||
|
||||
{
|
||||
std::lock_guard<std::mutex> lk(m_devices_mutex);
|
||||
std::lock_guard lk(m_devices_mutex);
|
||||
|
||||
const auto is_id_in_use = [&device, this](int id) {
|
||||
return std::any_of(m_devices.begin(), m_devices.end(), [&device, &id](const auto& d) {
|
||||
@@ -124,7 +248,7 @@ void ControllerInterface::AddDevice(std::shared_ptr<ciface::Core::Device> device
|
||||
void ControllerInterface::RemoveDevice(std::function<bool(const ciface::Core::Device*)> callback)
|
||||
{
|
||||
{
|
||||
std::lock_guard<std::mutex> lk(m_devices_mutex);
|
||||
std::lock_guard lk(m_devices_mutex);
|
||||
auto it = std::remove_if(m_devices.begin(), m_devices.end(), [&callback](const auto& dev) {
|
||||
if (callback(dev.get()))
|
||||
{
|
||||
@@ -146,12 +270,27 @@ void ControllerInterface::UpdateInput()
|
||||
// Don't block the UI or CPU thread (to avoid a short but noticeable frame drop)
|
||||
if (m_devices_mutex.try_lock())
|
||||
{
|
||||
std::lock_guard<std::mutex> lk(m_devices_mutex, std::adopt_lock);
|
||||
std::lock_guard lk(m_devices_mutex, std::adopt_lock);
|
||||
for (const auto& d : m_devices)
|
||||
d->UpdateInput();
|
||||
}
|
||||
}
|
||||
|
||||
void ControllerInterface::SetAspectRatioAdjustment(float value)
|
||||
{
|
||||
m_aspect_ratio_adjustment = value;
|
||||
}
|
||||
|
||||
Common::Vec2 ControllerInterface::GetWindowInputScale() const
|
||||
{
|
||||
const auto ar = m_aspect_ratio_adjustment.load();
|
||||
|
||||
if (ar > 1)
|
||||
return {1.f, ar};
|
||||
else
|
||||
return {1 / ar, 1.f};
|
||||
}
|
||||
|
||||
// Register a callback to be called when a device is added or removed (as from the input backends'
|
||||
// hotplug thread), or when devices are refreshed
|
||||
// Returns a handle for later removing the callback.
|
||||
|
||||
@@ -3,44 +3,35 @@
|
||||
typedef struct
|
||||
{
|
||||
int openemuButton;
|
||||
unsigned dolphinButton;
|
||||
int value;
|
||||
} keymap;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
float Xaxis;
|
||||
float Yaxis;
|
||||
} axismap;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
keymap gc_pad_keymap[20] = {
|
||||
{OEGCButtonUp, OEDolJoypadUp, 0},
|
||||
{OEGCButtonDown,OEDolJoypadDown, 0},
|
||||
{OEGCButtonLeft, OEDolJoypadLeft, 0},
|
||||
{OEGCButtonRight, OEDolJoypadRight, 0},
|
||||
{OEGCAnalogUp, OEGCAnalog, 0},
|
||||
{OEGCAnalogDown, OEGCAnalog, 0},
|
||||
{OEGCAnalogLeft, OEGCAnalog, 0},
|
||||
{OEGCAnalogRight, OEGCAnalog, 0},
|
||||
{OEGCAnalogCUp, OEGCAnalogC, 0},
|
||||
{OEGCAnalogCDown, OEGCAnalogC, 0},
|
||||
{OEGCAnalogCLeft, OEGCAnalogC, 0},
|
||||
{OEGCAnalogCRight, OEGCAnalogC, 0},
|
||||
{OEGCButtonA, OEDolJoypadA, 0},
|
||||
{OEGCButtonB, OEDolJoypadB, 0},
|
||||
{OEGCButtonX, OEDolJoypadX, 0},
|
||||
{OEGCButtonY, OEDolJoypadY, 0},
|
||||
{OEGCButtonL, OEDolJoypadL, 0},
|
||||
{OEGCButtonR, OEDolJoypadR, 0},
|
||||
{OEGCButtonZ, OEDolJoypadR2, 0},
|
||||
{OEGCButtonStart, OEDolJoypadStart, 0},
|
||||
keymap gc_pad_keymap[22] = {
|
||||
{OEGCButtonUp, 0},
|
||||
{OEGCButtonDown, 0},
|
||||
{OEGCButtonLeft, 0},
|
||||
{OEGCButtonRight, 0},
|
||||
{OEGCAnalogUp, 0},
|
||||
{OEGCAnalogDown, 0},
|
||||
{OEGCAnalogLeft, 0},
|
||||
{OEGCAnalogRight, 0},
|
||||
{OEGCAnalogCUp, 0},
|
||||
{OEGCAnalogCDown, 0},
|
||||
{OEGCAnalogCLeft, 0},
|
||||
{OEGCAnalogCRight, 0},
|
||||
{OEGCButtonA, 0},
|
||||
{OEGCButtonB, 0},
|
||||
{OEGCButtonX, 0},
|
||||
{OEGCButtonY, 0},
|
||||
{OEGCButtonL, 0},
|
||||
{OEGCButtonR, 0},
|
||||
{OEGCButtonZ, 0},
|
||||
{OEGCButtonStart, 0},
|
||||
{OEGCDigitalL, 0},
|
||||
{OEGCDigitalR, 0},
|
||||
};
|
||||
|
||||
// axismap gc_pad_Analog;
|
||||
// axismap gc_pad_AnalogC;
|
||||
axismap gc_pad_Trigger;
|
||||
} gc_pad;
|
||||
|
||||
|
||||
@@ -50,96 +41,79 @@ void init_Callback();
|
||||
|
||||
static gc_pad GameCubePads[4];
|
||||
|
||||
//
|
||||
//static unsigned connected_wiimote_type[MAX_BBMOTES];
|
||||
//static int current_mote_id;
|
||||
//static InputConfig s_config(WIIMOTE_INI_NAME, _trans("Wii Remote"), "Wiimote");
|
||||
typedef struct
|
||||
{
|
||||
keymap wiimote_dpad[4] = {
|
||||
{OEWiiMoteButtonLeft, 0},
|
||||
{OEWiiMoteButtonRight, 0},
|
||||
{OEWiiMoteButtonDown, 0},
|
||||
{OEWiiMoteButtonUp, 0},
|
||||
};
|
||||
|
||||
keymap wiimote_sideways[4] = {
|
||||
{OEWiiMoteButtonUp, 0},
|
||||
{OEWiiMoteButtonDown, 0},
|
||||
{OEWiiMoteButtonLeft, 0},
|
||||
{OEWiiMoteButtonRight, 0},
|
||||
};
|
||||
|
||||
keymap wiimote_keymap[48] = {
|
||||
{OEWiiMoteButtonA, 0},
|
||||
{OEWiiMoteButtonB, 0},
|
||||
{OEWiiMoteButton1, 0},
|
||||
{OEWiiMoteButton2, 0},
|
||||
{OEWiiMoteButtonPlus, 0},
|
||||
{OEWiiMoteButtonMinus, 0},
|
||||
{OEWiiMoteButtonHome, 0},
|
||||
{OEWiiMoteTiltLeft, 0},
|
||||
{OEWiiMoteTiltRight, 0},
|
||||
{OEWiiMoteTiltForward, 0},
|
||||
{OEWiiMoteTiltBackward, 0},
|
||||
{OEWiiMoteShake, 0},
|
||||
{OEWiiMoteSwingUp, 0},
|
||||
{OEWiiMoteSwingDown, 0},
|
||||
{OEWiiMoteSwingLeft, 0},
|
||||
{OEWiiMoteSwingRight, 0},
|
||||
{OEWiiMoteSwingForward, 0},
|
||||
{OEWiiMoteSwingBackward, 0},
|
||||
{OEWiiNunchukAnalogUp, 0},
|
||||
{OEWiiNunchukAnalogDown, 0},
|
||||
{OEWiiNunchukAnalogLeft, 0},
|
||||
{OEWiiNunchukAnalogRight, 0},
|
||||
{OEWiiNunchukButtonC, 0},
|
||||
{OEWiiNunchukButtonZ, 0},
|
||||
{OEWiiNunchukShake, 0},
|
||||
{OEWiiClassicButtonUp, 0},
|
||||
{OEWiiClassicButtonDown, 0},
|
||||
{OEWiiClassicButtonLeft, 0},
|
||||
{OEWiiClassicButtonRight, 0},
|
||||
{OEWiiClassicAnalogLUp, 0},
|
||||
{OEWiiClassicAnalogLDown, 0},
|
||||
{OEWiiClassicAnalogLLeft, 0},
|
||||
{OEWiiClassicAnalogLRight, 0},
|
||||
{OEWiiClassicAnalogRUp, 0},
|
||||
{OEWiiClassicAnalogRDown, 0},
|
||||
{OEWiiClassicAnalogRLeft, 0},
|
||||
{OEWiiClassicAnalogRRight, 0},
|
||||
{OEWiiClassicButtonA, 0},
|
||||
{OEWiiClassicButtonB, 0},
|
||||
{OEWiiClassicButtonX, 0},
|
||||
{OEWiiClassicButtonY, 0},
|
||||
{OEWiiClassicButtonL, 0},
|
||||
{OEWiiClassicButtonR, 0},
|
||||
{OEWiiClassicButtonZl, 0},
|
||||
{OEWiiClassicButtonZr, 0},
|
||||
{OEWiiClassicButtonStart, 0},
|
||||
{OEWiiClassicButtonSelect, 0},
|
||||
{OEWiiClassicButtonHome, 0},
|
||||
};
|
||||
|
||||
OEWiiConType wiimoteType;
|
||||
ControlState dx, dy;
|
||||
} wii_remote;
|
||||
|
||||
//
|
||||
//typedef struct
|
||||
//{
|
||||
// keymap wiimote_keymap[12] = {
|
||||
// {OEWiiMoteButtonLeft, OEDolJoypadLeft, 0},
|
||||
// {OEWiiMoteButtonRight, OEDolJoypadRight, 0},
|
||||
// {OEWiiMoteButtonDown, OEDolJoypadDown, 0},
|
||||
// {OEWiiMoteButtonUp, OEDolJoypadUp, 0},
|
||||
// {OEWiiMoteButtonPlus, OEDolJoypadStart, 0},
|
||||
// {OEWiiMoteButton2, OEDolJoypadY, 0},
|
||||
// {OEWiiMoteButton1, OEDolJoypadX, 0},
|
||||
// {OEWiiMoteButtonB, OEDolJoypadB, 0},
|
||||
// {OEWiiMoteButtonA, OEDolJoypadA, 0},
|
||||
// {OEWiiMoteButtonMinus, OEDolJoypadSelect, 0},
|
||||
// {OEWiiMoteButtonHome, OEDolJoypadR3, 0},
|
||||
// {OEWiiMoteShake, OEDolJoypadR2, 0},
|
||||
// };
|
||||
//
|
||||
// keymap sideways_keymap[12] = {
|
||||
// {OEWiiMoteButtonLeft, OEDolJoypadUp, 0},
|
||||
// {OEWiiMoteButtonRight, OEDolJoypadDown, 0},
|
||||
// {OEWiiMoteButtonDown, OEDolJoypadLeft, 0},
|
||||
// {OEWiiMoteButtonUp, OEDolJoypadRight, 0},
|
||||
// {OEWiiMoteButtonPlus, OEDolJoypadStart, 0},
|
||||
// {OEWiiMoteButton2, OEDolJoypadB, 0},
|
||||
// {OEWiiMoteButton1, OEDolJoypadA, 0},
|
||||
// {OEWiiMoteButtonB, OEDolJoypadY, 0},
|
||||
// {OEWiiMoteButtonA, OEDolJoypadX, 0},
|
||||
// {OEWiiMoteButtonMinus, OEDolJoypadSelect, 0},
|
||||
// {OEWiiMoteButtonHome, OEDolJoypadR3, 0},
|
||||
// {OEWiiMoteShake, OEDolJoypadR2, 0},
|
||||
//};
|
||||
//
|
||||
// axismap wiimote_tilt_LR;
|
||||
// axismap wiimote_tilt_FB;
|
||||
//
|
||||
// keymap nunchuk_keymap[3] = {
|
||||
// {OEWiiNunchukButtonC, OEDolJoypadL, 0},
|
||||
// {OEWiiNunchukButtonZ, OEDolJoypadR, 0},
|
||||
// {OEWiiNunchukShake, OEDolJoypadL3, 0},
|
||||
// };
|
||||
//
|
||||
// axismap nunchuck_Analog;
|
||||
//
|
||||
// keymap classic_keymap[15] = {
|
||||
// {OEWiiClassicButtonRight, WiimoteEmu::Classic::PAD_RIGHT, 0},
|
||||
// {OEWiiClassicButtonDown, WiimoteEmu::Classic::PAD_DOWN, 0},
|
||||
// {OEWiiClassicButtonL, WiimoteEmu::Classic::TRIGGER_L, 0},
|
||||
// {OEWiiClassicButtonSelect, WiimoteEmu::Classic::BUTTON_MINUS, 0},
|
||||
// {OEWiiClassicButtonHome, WiimoteEmu::Classic::BUTTON_HOME, 0},
|
||||
// {OEWiiClassicButtonStart, WiimoteEmu::Classic::BUTTON_PLUS, 0},
|
||||
// {OEWiiClassicButtonR, WiimoteEmu::Classic::TRIGGER_R, 0},
|
||||
// {OEWiiClassicButtonZl, WiimoteEmu::Classic::BUTTON_ZL, 0},
|
||||
// {OEWiiClassicButtonB, WiimoteEmu::Classic::BUTTON_B, 0},
|
||||
// {OEWiiClassicButtonY, WiimoteEmu::Classic::BUTTON_Y, 0},
|
||||
// {OEWiiClassicButtonX, WiimoteEmu::Classic::BUTTON_X, 0},
|
||||
// {OEWiiClassicButtonA, WiimoteEmu::Classic::BUTTON_A, 0},
|
||||
// {OEWiiClassicButtonZr, WiimoteEmu::Classic::BUTTON_ZR, 0},
|
||||
// {OEWiiClassicButtonLeft, WiimoteEmu::Classic::PAD_LEFT, 0},
|
||||
// {OEWiiClassicButtonUp, WiimoteEmu::Classic::PAD_UP, 0},
|
||||
// };
|
||||
//
|
||||
// axismap classic_AnalogLeft;
|
||||
// axismap classic_AnalogRight;
|
||||
// axismap classic_TriggerLeft;
|
||||
// axismap classic_TriggerRight;
|
||||
//
|
||||
// int extension;
|
||||
// ControlState dx, dy;
|
||||
//
|
||||
//} wii_remote;
|
||||
|
||||
// static gc_pad GameCubePads[4];
|
||||
// static wii_remote WiiRemotes[4];
|
||||
static wii_remote WiiRemotes[4];
|
||||
// static int want_extension[4];
|
||||
|
||||
//void setWiiButton(int pad_num, int button , int value);
|
||||
//void setWiimoteButton(int pad_num, int button , int value);
|
||||
//void setWiiClassicButton(int pad_num, int button , int value);
|
||||
//void setWiiNunchukButton(int pad_num, int button , int value);
|
||||
//
|
||||
//void setWiiAxis(int pad_num, int button , float value);
|
||||
//void setWiimoteAxis(int pad_num, int button , float value);
|
||||
//void setWiiClassicAxis(int pad_num, int button , float value);
|
||||
//void setWiiNunchukAxis(int pad_num, int button , float value);
|
||||
//void setWiiIR(int pad_num, float x , float y);
|
||||
//
|
||||
//int getWiiExtension (int pad_num);
|
||||
void setWiiButton(int pad_num, int button , int value);
|
||||
void setWiiAxis(int pad_num, int button , int value);
|
||||
|
||||
@@ -28,8 +28,6 @@
|
||||
|
||||
#include "DolHost.h"
|
||||
|
||||
extern WindowSystemInfo wsi;
|
||||
|
||||
static Input::openemu_input_state_t input_cb;
|
||||
static Input::openemu_input_poll_t poll_cb;
|
||||
static const std::string source = "OpenEmu";
|
||||
@@ -155,22 +153,22 @@ static unsigned input_types[4];
|
||||
AddButton(OEGCButtonRight, "Right");
|
||||
AddButton(OEGCButtonA, "A");
|
||||
AddButton(OEGCButtonX, "X");
|
||||
AddButton(OEGCButtonL, "L");
|
||||
AddButton(OEGCButtonR, "R");
|
||||
AddButton(OEGCDigitalL, "L");
|
||||
AddButton(OEGCDigitalR, "R");
|
||||
AddButton(OEGCButtonZ, "Z");
|
||||
return;
|
||||
|
||||
case OEDolDevAnalog:
|
||||
AddAxis(OEGCAnalogLeft, -0x8000, "X0-", OEGCAnalog);
|
||||
AddAxis(OEGCAnalogRight, 0x7FFF, "X0+", OEGCAnalog);
|
||||
AddAxis(OEGCAnalogUp, -0x8000, "Y0-", OEGCAnalog);
|
||||
AddAxis(OEGCAnalogDown, 0x7FFF, "Y0+", OEGCAnalog);
|
||||
AddAxis(OEGCAnalogCLeft, -0x8000, "X1-", OEGCAnalogC);
|
||||
AddAxis(OEGCAnalogCRight, 0x7FFF, "X1+", OEGCAnalogC);
|
||||
AddAxis(OEGCAnalogCUp, -0x8000, "Y1-", OEGCAnalogC);
|
||||
AddAxis(OEGCAnalogCDown, 0x7FFF, "Y1+", OEGCAnalogC);
|
||||
AddAxis(OEDolJoypadL2, 0x7FFF, "Trigger0+", OEGCAnalogTrigger);
|
||||
AddAxis(OEDolJoypadR2, 0x7FFF, "Trigger1+", OEGCAnalogTrigger);
|
||||
AddAxis(OEGCAnalogLeft, -0x8000, "X0-");
|
||||
AddAxis(OEGCAnalogRight, 0x7FFF, "X0+");
|
||||
AddAxis(OEGCAnalogUp, -0x8000, "Y0-");
|
||||
AddAxis(OEGCAnalogDown, 0x7FFF, "Y0+");
|
||||
AddAxis(OEGCAnalogCLeft, -0x8000, "X1-");
|
||||
AddAxis(OEGCAnalogCRight, 0x7FFF, "X1+");
|
||||
AddAxis(OEGCAnalogCUp, -0x8000, "Y1-");
|
||||
AddAxis(OEGCAnalogCDown, 0x7FFF, "Y1+");
|
||||
AddAxis(OEGCButtonL, 0x7FFF, "Trigger0+");
|
||||
AddAxis(OEGCButtonR, 0x7FFF, "Trigger1+");
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -234,7 +232,7 @@ void Input::openemu_set_input_poll(Input::openemu_input_poll_t cb)
|
||||
|
||||
void Input::openemu_set_controller_port_device(unsigned port, unsigned device)
|
||||
{
|
||||
if (port > 3)
|
||||
if (port > 4)
|
||||
return;
|
||||
|
||||
input_types[port] = device;
|
||||
|
||||
@@ -9,80 +9,23 @@ typedef enum _OEDolDev
|
||||
OEDolDevPointer
|
||||
} OEDolDevs;
|
||||
|
||||
typedef enum _OEDolJoyControls
|
||||
typedef enum _OEGCDigital
|
||||
{
|
||||
OEDolJoypadB,
|
||||
OEDolJoypadY,
|
||||
OEDolJoypadSelect,
|
||||
OEDolJoypadStart,
|
||||
OEDolJoypadUp,
|
||||
OEDolJoypadDown,
|
||||
OEDolJoypadLeft,
|
||||
OEDolJoypadRight,
|
||||
OEDolJoypadA,
|
||||
OEDolJoypadX,
|
||||
OEDolJoypadL,
|
||||
OEDolJoypadR,
|
||||
OEDolJoypadL2,
|
||||
OEDolJoypadR2,
|
||||
OEDolJoypadL3,
|
||||
OEDolJoypadR3
|
||||
} OEDolJoyControls;
|
||||
OEGCDigitalL = 21,
|
||||
OEGCDigitalR
|
||||
} OEGCDigital;
|
||||
|
||||
typedef enum _OEGCAnalogControls
|
||||
{
|
||||
OEGCAnalog,
|
||||
OEGCAnalogC,
|
||||
OEGCAnalogTrigger
|
||||
} OEGCAnalogContols;
|
||||
|
||||
typedef enum _OEDolAnalogAxis
|
||||
{
|
||||
OEDolAnalogX,
|
||||
OEDolAnalogY
|
||||
} OEDolAnalogAxis;
|
||||
|
||||
typedef enum _OEGCAxis
|
||||
{
|
||||
OEGCAnalogX,
|
||||
OEGCAnalogY,
|
||||
OEGCAnalogCX,
|
||||
OEGCAnalogCY,
|
||||
OEGCAxisCount
|
||||
} OEGCAxis;
|
||||
|
||||
typedef enum _OEWiimote
|
||||
typedef enum _OEWiiConYype
|
||||
{
|
||||
OEWiimote = 1,
|
||||
OEWiimoteSW,
|
||||
OEWiimoteNC,
|
||||
OEWiimoteCC,
|
||||
OEWiiMoteReal
|
||||
} OEWiiController;
|
||||
} OEWiiConType;
|
||||
|
||||
namespace Input
|
||||
{
|
||||
struct openemu_controller_description
|
||||
{
|
||||
const char *desc;
|
||||
unsigned id;
|
||||
};
|
||||
|
||||
struct openemu_controller_info
|
||||
{
|
||||
const struct openemu_controller_description *types;
|
||||
unsigned num_types;
|
||||
};
|
||||
|
||||
struct openemu_input_descriptor
|
||||
{
|
||||
unsigned port;
|
||||
unsigned device;
|
||||
unsigned index;
|
||||
unsigned id;
|
||||
const char *description;
|
||||
};
|
||||
|
||||
typedef int16_t (*openemu_input_state_t)(unsigned port, unsigned device, unsigned index, unsigned id);
|
||||
typedef void (*openemu_input_poll_t)();
|
||||
|
||||
|
||||
@@ -1,693 +0,0 @@
|
||||
// Copyright 2009 Dolphin Emulator Project
|
||||
// Licensed under GPLv2+
|
||||
// Refer to the license.txt file included.
|
||||
|
||||
#include "VideoBackends/OGL/FramebufferManager.h"
|
||||
|
||||
#include <memory>
|
||||
#include <sstream>
|
||||
#include <vector>
|
||||
|
||||
#include "Common/Common.h"
|
||||
#include "Common/CommonTypes.h"
|
||||
#include "Common/GL/GLInterfaceBase.h"
|
||||
#include "Common/Logging/Log.h"
|
||||
#include "Common/MsgHandler.h"
|
||||
|
||||
#include "Core/HW/Memmap.h"
|
||||
|
||||
#include "VideoBackends/OGL/Render.h"
|
||||
#include "VideoBackends/OGL/SamplerCache.h"
|
||||
#include "VideoBackends/OGL/TextureConverter.h"
|
||||
|
||||
#include "VideoCommon/OnScreenDisplay.h"
|
||||
#include "VideoCommon/VertexShaderGen.h"
|
||||
#include "VideoCommon/VideoBackendBase.h"
|
||||
|
||||
namespace OGL
|
||||
{
|
||||
int FramebufferManager::m_targetWidth;
|
||||
int FramebufferManager::m_targetHeight;
|
||||
int FramebufferManager::m_msaaSamples;
|
||||
bool FramebufferManager::m_enable_stencil_buffer;
|
||||
|
||||
GLenum FramebufferManager::m_textureType;
|
||||
std::vector<GLuint> FramebufferManager::m_efbFramebuffer;
|
||||
GLuint FramebufferManager::m_xfbFramebuffer;
|
||||
GLuint FramebufferManager::m_efbColor;
|
||||
GLuint FramebufferManager::m_efbDepth;
|
||||
GLuint FramebufferManager::m_efbColorSwap; // for hot swap when reinterpreting EFB pixel formats
|
||||
|
||||
// Only used in MSAA mode.
|
||||
std::vector<GLuint> FramebufferManager::m_resolvedFramebuffer;
|
||||
GLuint FramebufferManager::m_resolvedColorTexture;
|
||||
GLuint FramebufferManager::m_resolvedDepthTexture;
|
||||
|
||||
// reinterpret pixel format
|
||||
SHADER FramebufferManager::m_pixel_format_shaders[2];
|
||||
|
||||
// EFB pokes
|
||||
GLuint FramebufferManager::m_EfbPokes_VBO;
|
||||
GLuint FramebufferManager::m_EfbPokes_VAO;
|
||||
SHADER FramebufferManager::m_EfbPokes;
|
||||
|
||||
GLuint FramebufferManager::CreateTexture(GLenum texture_type, GLenum internal_format,
|
||||
GLenum pixel_format, GLenum data_type)
|
||||
{
|
||||
GLuint texture;
|
||||
glGenTextures(1, &texture);
|
||||
glBindTexture(texture_type, texture);
|
||||
if (texture_type == GL_TEXTURE_2D_ARRAY)
|
||||
{
|
||||
glTexParameteri(texture_type, GL_TEXTURE_MAX_LEVEL, 0);
|
||||
glTexImage3D(texture_type, 0, internal_format, m_targetWidth, m_targetHeight, m_EFBLayers, 0,
|
||||
pixel_format, data_type, nullptr);
|
||||
}
|
||||
else if (texture_type == GL_TEXTURE_2D_MULTISAMPLE_ARRAY)
|
||||
{
|
||||
if (g_ogl_config.bSupports3DTextureStorageMultisample)
|
||||
glTexStorage3DMultisample(texture_type, m_msaaSamples, internal_format, m_targetWidth,
|
||||
m_targetHeight, m_EFBLayers, false);
|
||||
else
|
||||
glTexImage3DMultisample(texture_type, m_msaaSamples, internal_format, m_targetWidth,
|
||||
m_targetHeight, m_EFBLayers, false);
|
||||
}
|
||||
else if (texture_type == GL_TEXTURE_2D_MULTISAMPLE)
|
||||
{
|
||||
if (g_ogl_config.bSupports2DTextureStorageMultisample)
|
||||
glTexStorage2DMultisample(texture_type, m_msaaSamples, internal_format, m_targetWidth,
|
||||
m_targetHeight, false);
|
||||
else
|
||||
glTexImage2DMultisample(texture_type, m_msaaSamples, internal_format, m_targetWidth,
|
||||
m_targetHeight, false);
|
||||
}
|
||||
else
|
||||
{
|
||||
PanicAlert("Unhandled texture type %d", texture_type);
|
||||
}
|
||||
glBindTexture(texture_type, 0);
|
||||
return texture;
|
||||
}
|
||||
|
||||
void FramebufferManager::BindLayeredTexture(GLuint texture, const std::vector<GLuint>& framebuffers,
|
||||
GLenum attachment, GLenum texture_type)
|
||||
{
|
||||
glBindFramebuffer(GL_FRAMEBUFFER, framebuffers[0]);
|
||||
FramebufferTexture(GL_FRAMEBUFFER, attachment, texture_type, texture, 0);
|
||||
// Bind all the other layers as separate FBOs for blitting.
|
||||
for (unsigned int i = 1; i < m_EFBLayers; i++)
|
||||
{
|
||||
glBindFramebuffer(GL_FRAMEBUFFER, framebuffers[i]);
|
||||
glFramebufferTextureLayer(GL_FRAMEBUFFER, attachment, texture, 0, i);
|
||||
}
|
||||
}
|
||||
|
||||
bool FramebufferManager::HasStencilBuffer()
|
||||
{
|
||||
return m_enable_stencil_buffer;
|
||||
}
|
||||
|
||||
FramebufferManager::FramebufferManager(int targetWidth, int targetHeight, int msaaSamples,
|
||||
bool enable_stencil_buffer)
|
||||
{
|
||||
m_xfbFramebuffer = g_Config.iRenderFBO;
|
||||
m_efbColor = 0;
|
||||
m_efbDepth = 0;
|
||||
m_efbColorSwap = 0;
|
||||
m_resolvedColorTexture = 0;
|
||||
m_resolvedDepthTexture = 0;
|
||||
|
||||
m_targetWidth = targetWidth;
|
||||
m_targetHeight = targetHeight;
|
||||
m_msaaSamples = msaaSamples;
|
||||
m_enable_stencil_buffer = enable_stencil_buffer;
|
||||
|
||||
// The EFB can be set to different pixel formats by the game through the
|
||||
// BPMEM_ZCOMPARE register (which should probably have a different name).
|
||||
// They are:
|
||||
// - 24-bit RGB (8-bit components) with 24-bit Z
|
||||
// - 24-bit RGBA (6-bit components) with 24-bit Z
|
||||
// - Multisampled 16-bit RGB (5-6-5 format) with 16-bit Z
|
||||
// We only use one EFB format here: 32-bit ARGB with 24-bit Z.
|
||||
// Multisampling depends on user settings.
|
||||
// The distinction becomes important for certain operations, i.e. the
|
||||
// alpha channel should be ignored if the EFB does not have one.
|
||||
|
||||
glActiveTexture(GL_TEXTURE9);
|
||||
|
||||
m_EFBLayers = (g_ActiveConfig.iStereoMode > 0) ? 2 : 1;
|
||||
m_efbFramebuffer.resize(m_EFBLayers);
|
||||
m_resolvedFramebuffer.resize(m_EFBLayers);
|
||||
|
||||
GLenum depth_internal_format = GL_DEPTH_COMPONENT32F;
|
||||
GLenum depth_pixel_format = GL_DEPTH_COMPONENT;
|
||||
GLenum depth_data_type = GL_FLOAT;
|
||||
if (m_enable_stencil_buffer)
|
||||
{
|
||||
depth_internal_format = GL_DEPTH32F_STENCIL8;
|
||||
depth_pixel_format = GL_DEPTH_STENCIL;
|
||||
depth_data_type = GL_FLOAT_32_UNSIGNED_INT_24_8_REV;
|
||||
}
|
||||
|
||||
if (m_msaaSamples <= 1)
|
||||
{
|
||||
m_textureType = GL_TEXTURE_2D_ARRAY;
|
||||
}
|
||||
else
|
||||
{
|
||||
// Only use a layered multisample texture if needed. Some drivers
|
||||
// slow down significantly with single-layered multisample textures.
|
||||
if (m_EFBLayers > 1)
|
||||
m_textureType = GL_TEXTURE_2D_MULTISAMPLE_ARRAY;
|
||||
else
|
||||
m_textureType = GL_TEXTURE_2D_MULTISAMPLE;
|
||||
|
||||
// Although we are able to access the multisampled texture directly, we don't do it everywhere.
|
||||
// The old way is to "resolve" this multisampled texture by copying it into a non-sampled
|
||||
// texture.
|
||||
// This would lead to an unneeded copy of the EFB, so we are going to avoid it.
|
||||
// But as this job isn't done right now, we do need that texture for resolving:
|
||||
GLenum resolvedType = GL_TEXTURE_2D_ARRAY;
|
||||
|
||||
m_resolvedColorTexture = CreateTexture(resolvedType, GL_RGBA8, GL_RGBA, GL_UNSIGNED_BYTE);
|
||||
m_resolvedDepthTexture =
|
||||
CreateTexture(resolvedType, depth_internal_format, depth_pixel_format, depth_data_type);
|
||||
|
||||
// Bind resolved textures to resolved framebuffer.
|
||||
glGenFramebuffers(m_EFBLayers, m_resolvedFramebuffer.data());
|
||||
BindLayeredTexture(m_resolvedColorTexture, m_resolvedFramebuffer, GL_COLOR_ATTACHMENT0,
|
||||
resolvedType);
|
||||
BindLayeredTexture(m_resolvedDepthTexture, m_resolvedFramebuffer, GL_DEPTH_ATTACHMENT,
|
||||
resolvedType);
|
||||
if (m_enable_stencil_buffer)
|
||||
BindLayeredTexture(m_resolvedDepthTexture, m_resolvedFramebuffer, GL_STENCIL_ATTACHMENT,
|
||||
resolvedType);
|
||||
}
|
||||
|
||||
m_efbColor = CreateTexture(m_textureType, GL_RGBA8, GL_RGBA, GL_UNSIGNED_BYTE);
|
||||
m_efbDepth =
|
||||
CreateTexture(m_textureType, depth_internal_format, depth_pixel_format, depth_data_type);
|
||||
m_efbColorSwap = CreateTexture(m_textureType, GL_RGBA8, GL_RGBA, GL_UNSIGNED_BYTE);
|
||||
|
||||
// Create XFB framebuffer; targets will be created elsewhere.
|
||||
glGenFramebuffers(1, &m_xfbFramebuffer);
|
||||
|
||||
// Bind target textures to EFB framebuffer.
|
||||
glGenFramebuffers(m_EFBLayers, m_efbFramebuffer.data());
|
||||
BindLayeredTexture(m_efbColor, m_efbFramebuffer, GL_COLOR_ATTACHMENT0, m_textureType);
|
||||
BindLayeredTexture(m_efbDepth, m_efbFramebuffer, GL_DEPTH_ATTACHMENT, m_textureType);
|
||||
if (m_enable_stencil_buffer)
|
||||
BindLayeredTexture(m_efbDepth, m_efbFramebuffer, GL_STENCIL_ATTACHMENT, m_textureType);
|
||||
|
||||
// EFB framebuffer is currently bound, make sure to clear it before use.
|
||||
glViewport(0, 0, m_targetWidth, m_targetHeight);
|
||||
glScissor(0, 0, m_targetWidth, m_targetHeight);
|
||||
glClearColor(0.f, 0.f, 0.f, 0.f);
|
||||
glClearDepthf(1.0f);
|
||||
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
|
||||
if (m_enable_stencil_buffer)
|
||||
{
|
||||
glClearStencil(0);
|
||||
glClear(GL_STENCIL_BUFFER_BIT);
|
||||
}
|
||||
|
||||
// reinterpret pixel format
|
||||
const char* vs = m_EFBLayers > 1 ? "void main(void) {\n"
|
||||
" vec2 rawpos = vec2(gl_VertexID&1, gl_VertexID&2);\n"
|
||||
" gl_Position = vec4(rawpos*2.0-1.0, 0.0, 1.0);\n"
|
||||
"}\n" :
|
||||
"flat out int layer;\n"
|
||||
"void main(void) {\n"
|
||||
" layer = 0;\n"
|
||||
" vec2 rawpos = vec2(gl_VertexID&1, gl_VertexID&2);\n"
|
||||
" gl_Position = vec4(rawpos*2.0-1.0, 0.0, 1.0);\n"
|
||||
"}\n";
|
||||
|
||||
// The way to sample the EFB is based on the on the current configuration.
|
||||
// As we use the same sampling way for both interpreting shaders, the sampling
|
||||
// shader are generated first:
|
||||
std::string sampler;
|
||||
if (m_msaaSamples <= 1)
|
||||
{
|
||||
// non-msaa, so just fetch the pixel
|
||||
sampler = "SAMPLER_BINDING(9) uniform sampler2DArray samp9;\n"
|
||||
"vec4 sampleEFB(ivec3 pos) {\n"
|
||||
" return texelFetch(samp9, pos, 0);\n"
|
||||
"}\n";
|
||||
}
|
||||
else if (g_ActiveConfig.backend_info.bSupportsSSAA)
|
||||
{
|
||||
// msaa + sample shading available, so just fetch the sample
|
||||
// This will lead to sample shading, but it's the only way to not loose
|
||||
// the values of each sample.
|
||||
if (m_EFBLayers > 1)
|
||||
{
|
||||
sampler = "SAMPLER_BINDING(9) uniform sampler2DMSArray samp9;\n"
|
||||
"vec4 sampleEFB(ivec3 pos) {\n"
|
||||
" return texelFetch(samp9, pos, gl_SampleID);\n"
|
||||
"}\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
sampler = "SAMPLER_BINDING(9) uniform sampler2DMS samp9;\n"
|
||||
"vec4 sampleEFB(ivec3 pos) {\n"
|
||||
" return texelFetch(samp9, pos.xy, gl_SampleID);\n"
|
||||
"}\n";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// msaa without sample shading: calculate the mean value of the pixel
|
||||
std::stringstream samples;
|
||||
samples << m_msaaSamples;
|
||||
if (m_EFBLayers > 1)
|
||||
{
|
||||
sampler = "SAMPLER_BINDING(9) uniform sampler2DMSArray samp9;\n"
|
||||
"vec4 sampleEFB(ivec3 pos) {\n"
|
||||
" vec4 color = vec4(0.0, 0.0, 0.0, 0.0);\n"
|
||||
" for(int i=0; i<" +
|
||||
samples.str() + "; i++)\n"
|
||||
" color += texelFetch(samp9, pos, i);\n"
|
||||
" return color / " +
|
||||
samples.str() + ";\n"
|
||||
"}\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
sampler = "SAMPLER_BINDING(9) uniform sampler2DMS samp9;\n"
|
||||
"vec4 sampleEFB(ivec3 pos) {\n"
|
||||
" vec4 color = vec4(0.0, 0.0, 0.0, 0.0);\n"
|
||||
" for(int i=0; i<" +
|
||||
samples.str() + "; i++)\n"
|
||||
" color += texelFetch(samp9, pos.xy, i);\n"
|
||||
" return color / " +
|
||||
samples.str() + ";\n"
|
||||
"}\n";
|
||||
}
|
||||
}
|
||||
|
||||
std::string ps_rgba6_to_rgb8 =
|
||||
sampler + "flat in int layer;\n"
|
||||
"out vec4 ocol0;\n"
|
||||
"void main()\n"
|
||||
"{\n"
|
||||
" ivec4 src6 = ivec4(round(sampleEFB(ivec3(gl_FragCoord.xy, layer)) * 63.f));\n"
|
||||
" ivec4 dst8;\n"
|
||||
" dst8.r = (src6.r << 2) | (src6.g >> 4);\n"
|
||||
" dst8.g = ((src6.g & 0xF) << 4) | (src6.b >> 2);\n"
|
||||
" dst8.b = ((src6.b & 0x3) << 6) | src6.a;\n"
|
||||
" dst8.a = 255;\n"
|
||||
" ocol0 = float4(dst8) / 255.f;\n"
|
||||
"}";
|
||||
|
||||
std::string ps_rgb8_to_rgba6 =
|
||||
sampler + "flat in int layer;\n"
|
||||
"out vec4 ocol0;\n"
|
||||
"void main()\n"
|
||||
"{\n"
|
||||
" ivec4 src8 = ivec4(round(sampleEFB(ivec3(gl_FragCoord.xy, layer)) * 255.f));\n"
|
||||
" ivec4 dst6;\n"
|
||||
" dst6.r = src8.r >> 2;\n"
|
||||
" dst6.g = ((src8.r & 0x3) << 4) | (src8.g >> 4);\n"
|
||||
" dst6.b = ((src8.g & 0xF) << 2) | (src8.b >> 6);\n"
|
||||
" dst6.a = src8.b & 0x3F;\n"
|
||||
" ocol0 = float4(dst6) / 63.f;\n"
|
||||
"}";
|
||||
|
||||
std::stringstream vertices, layers;
|
||||
vertices << m_EFBLayers * 3;
|
||||
layers << m_EFBLayers;
|
||||
std::string gs = "layout(triangles) in;\n"
|
||||
"layout(triangle_strip, max_vertices = " +
|
||||
vertices.str() + ") out;\n"
|
||||
"flat out int layer;\n"
|
||||
"void main()\n"
|
||||
"{\n"
|
||||
" for (int j = 0; j < " +
|
||||
layers.str() + "; ++j) {\n"
|
||||
" for (int i = 0; i < 3; ++i) {\n"
|
||||
" layer = j;\n"
|
||||
" gl_Layer = j;\n"
|
||||
" gl_Position = gl_in[i].gl_Position;\n"
|
||||
" EmitVertex();\n"
|
||||
" }\n"
|
||||
" EndPrimitive();\n"
|
||||
" }\n"
|
||||
"}\n";
|
||||
|
||||
ProgramShaderCache::CompileShader(m_pixel_format_shaders[0], vs, ps_rgb8_to_rgba6,
|
||||
(m_EFBLayers > 1) ? gs : "");
|
||||
ProgramShaderCache::CompileShader(m_pixel_format_shaders[1], vs, ps_rgba6_to_rgb8,
|
||||
(m_EFBLayers > 1) ? gs : "");
|
||||
|
||||
ProgramShaderCache::CompileShader(
|
||||
m_EfbPokes,
|
||||
StringFromFormat("in vec2 rawpos;\n"
|
||||
"in vec4 rawcolor0;\n" // color
|
||||
"in int rawcolor1;\n" // depth
|
||||
"out vec4 v_c;\n"
|
||||
"out float v_z;\n"
|
||||
"void main(void) {\n"
|
||||
" gl_Position = vec4(((rawpos + 0.5) / vec2(640.0, 528.0) * 2.0 - 1.0) * "
|
||||
"vec2(1.0, -1.0), 0.0, 1.0);\n"
|
||||
" gl_PointSize = %d.0 / 640.0;\n"
|
||||
" v_c = rawcolor0.bgra;\n"
|
||||
" v_z = float(rawcolor1 & 0xFFFFFF) / 16777216.0;\n"
|
||||
"}\n",
|
||||
m_targetWidth),
|
||||
|
||||
StringFromFormat("in vec4 %s_c;\n"
|
||||
"in float %s_z;\n"
|
||||
"out vec4 ocol0;\n"
|
||||
"void main(void) {\n"
|
||||
" ocol0 = %s_c;\n"
|
||||
" gl_FragDepth = %s_z;\n"
|
||||
"}\n",
|
||||
m_EFBLayers > 1 ? "g" : "v", m_EFBLayers > 1 ? "g" : "v",
|
||||
m_EFBLayers > 1 ? "g" : "v", m_EFBLayers > 1 ? "g" : "v"),
|
||||
|
||||
m_EFBLayers > 1 ? StringFromFormat("layout(points) in;\n"
|
||||
"layout(points, max_vertices = %d) out;\n"
|
||||
"in vec4 v_c[1];\n"
|
||||
"in float v_z[1];\n"
|
||||
"out vec4 g_c;\n"
|
||||
"out float g_z;\n"
|
||||
"void main()\n"
|
||||
"{\n"
|
||||
" for (int j = 0; j < %d; ++j) {\n"
|
||||
" gl_Layer = j;\n"
|
||||
" gl_Position = gl_in[0].gl_Position;\n"
|
||||
" gl_PointSize = %d.0 / 640.0;\n"
|
||||
" g_c = v_c[0];\n"
|
||||
" g_z = v_z[0];\n"
|
||||
" EmitVertex();\n"
|
||||
" EndPrimitive();\n"
|
||||
" }\n"
|
||||
"}\n",
|
||||
m_EFBLayers, m_EFBLayers, m_targetWidth) :
|
||||
"");
|
||||
glGenBuffers(1, &m_EfbPokes_VBO);
|
||||
glGenVertexArrays(1, &m_EfbPokes_VAO);
|
||||
glBindBuffer(GL_ARRAY_BUFFER, m_EfbPokes_VBO);
|
||||
glBindVertexArray(m_EfbPokes_VAO);
|
||||
glEnableVertexAttribArray(SHADER_POSITION_ATTRIB);
|
||||
glVertexAttribPointer(SHADER_POSITION_ATTRIB, 2, GL_UNSIGNED_SHORT, 0, sizeof(EfbPokeData),
|
||||
(void*)offsetof(EfbPokeData, x));
|
||||
glEnableVertexAttribArray(SHADER_COLOR0_ATTRIB);
|
||||
glVertexAttribPointer(SHADER_COLOR0_ATTRIB, 4, GL_UNSIGNED_BYTE, 1, sizeof(EfbPokeData),
|
||||
(void*)offsetof(EfbPokeData, data));
|
||||
glEnableVertexAttribArray(SHADER_COLOR1_ATTRIB);
|
||||
glVertexAttribIPointer(SHADER_COLOR1_ATTRIB, 1, GL_INT, sizeof(EfbPokeData),
|
||||
(void*)offsetof(EfbPokeData, data));
|
||||
|
||||
if (GLInterface->GetMode() == GLInterfaceMode::MODE_OPENGL)
|
||||
glEnable(GL_PROGRAM_POINT_SIZE);
|
||||
}
|
||||
|
||||
FramebufferManager::~FramebufferManager()
|
||||
{
|
||||
glBindFramebuffer(GL_FRAMEBUFFER, g_Config.iRenderFBO);
|
||||
|
||||
GLuint glObj[3];
|
||||
|
||||
// Note: OpenGL deletion functions silently ignore parameters of "0".
|
||||
|
||||
glDeleteFramebuffers(m_EFBLayers, m_efbFramebuffer.data());
|
||||
glDeleteFramebuffers(m_EFBLayers, m_resolvedFramebuffer.data());
|
||||
|
||||
// Required, as these are static class members
|
||||
m_efbFramebuffer.clear();
|
||||
m_resolvedFramebuffer.clear();
|
||||
|
||||
glDeleteFramebuffers(1, &m_xfbFramebuffer);
|
||||
m_xfbFramebuffer = g_Config.iRenderFBO;
|
||||
|
||||
glObj[0] = m_resolvedColorTexture;
|
||||
glObj[1] = m_resolvedDepthTexture;
|
||||
glDeleteTextures(2, glObj);
|
||||
m_resolvedColorTexture = 0;
|
||||
m_resolvedDepthTexture = 0;
|
||||
|
||||
glObj[0] = m_efbColor;
|
||||
glObj[1] = m_efbDepth;
|
||||
glObj[2] = m_efbColorSwap;
|
||||
glDeleteTextures(3, glObj);
|
||||
m_efbColor = 0;
|
||||
m_efbDepth = 0;
|
||||
m_efbColorSwap = 0;
|
||||
|
||||
// reinterpret pixel format
|
||||
m_pixel_format_shaders[0].Destroy();
|
||||
m_pixel_format_shaders[1].Destroy();
|
||||
|
||||
// EFB pokes
|
||||
glDeleteBuffers(1, &m_EfbPokes_VBO);
|
||||
glDeleteVertexArrays(1, &m_EfbPokes_VAO);
|
||||
m_EfbPokes_VBO = 0;
|
||||
m_EfbPokes_VAO = 0;
|
||||
m_EfbPokes.Destroy();
|
||||
}
|
||||
|
||||
GLuint FramebufferManager::GetEFBColorTexture(const EFBRectangle& sourceRc)
|
||||
{
|
||||
if (m_msaaSamples <= 1)
|
||||
{
|
||||
return m_efbColor;
|
||||
}
|
||||
else
|
||||
{
|
||||
// Transfer the EFB to a resolved texture. EXT_framebuffer_blit is
|
||||
// required.
|
||||
|
||||
TargetRectangle targetRc = g_renderer->ConvertEFBRectangle(sourceRc);
|
||||
targetRc.ClampUL(0, 0, m_targetWidth, m_targetHeight);
|
||||
|
||||
// Resolve.
|
||||
for (unsigned int i = 0; i < m_EFBLayers; i++)
|
||||
{
|
||||
glBindFramebuffer(GL_READ_FRAMEBUFFER, m_efbFramebuffer[i]);
|
||||
glBindFramebuffer(GL_DRAW_FRAMEBUFFER, m_resolvedFramebuffer[i]);
|
||||
glBlitFramebuffer(targetRc.left, targetRc.top, targetRc.right, targetRc.bottom, targetRc.left,
|
||||
targetRc.top, targetRc.right, targetRc.bottom, GL_COLOR_BUFFER_BIT,
|
||||
GL_NEAREST);
|
||||
}
|
||||
|
||||
// Return to EFB.
|
||||
glBindFramebuffer(GL_FRAMEBUFFER, m_efbFramebuffer[0]);
|
||||
|
||||
return m_resolvedColorTexture;
|
||||
}
|
||||
}
|
||||
|
||||
GLuint FramebufferManager::GetEFBDepthTexture(const EFBRectangle& sourceRc)
|
||||
{
|
||||
if (m_msaaSamples <= 1)
|
||||
{
|
||||
return m_efbDepth;
|
||||
}
|
||||
else
|
||||
{
|
||||
// Transfer the EFB to a resolved texture.
|
||||
|
||||
TargetRectangle targetRc = g_renderer->ConvertEFBRectangle(sourceRc);
|
||||
targetRc.ClampUL(0, 0, m_targetWidth, m_targetHeight);
|
||||
|
||||
// Resolve.
|
||||
for (unsigned int i = 0; i < m_EFBLayers; i++)
|
||||
{
|
||||
glBindFramebuffer(GL_READ_FRAMEBUFFER, m_efbFramebuffer[i]);
|
||||
glBindFramebuffer(GL_DRAW_FRAMEBUFFER, m_resolvedFramebuffer[i]);
|
||||
glBlitFramebuffer(targetRc.left, targetRc.top, targetRc.right, targetRc.bottom, targetRc.left,
|
||||
targetRc.top, targetRc.right, targetRc.bottom, GL_DEPTH_BUFFER_BIT,
|
||||
GL_NEAREST);
|
||||
}
|
||||
|
||||
// Return to EFB.
|
||||
glBindFramebuffer(GL_FRAMEBUFFER, m_efbFramebuffer[0]);
|
||||
|
||||
return m_resolvedDepthTexture;
|
||||
}
|
||||
}
|
||||
|
||||
void FramebufferManager::ResolveEFBStencilTexture()
|
||||
{
|
||||
if (m_msaaSamples <= 1)
|
||||
return;
|
||||
|
||||
// Resolve.
|
||||
for (unsigned int i = 0; i < m_EFBLayers; i++)
|
||||
{
|
||||
glBindFramebuffer(GL_READ_FRAMEBUFFER, m_efbFramebuffer[i]);
|
||||
glBindFramebuffer(GL_DRAW_FRAMEBUFFER, m_resolvedFramebuffer[i]);
|
||||
glBlitFramebuffer(0, 0, m_targetWidth, m_targetHeight, 0, 0, m_targetWidth, m_targetHeight,
|
||||
GL_STENCIL_BUFFER_BIT, GL_NEAREST);
|
||||
}
|
||||
|
||||
// Return to EFB.
|
||||
glBindFramebuffer(GL_FRAMEBUFFER, m_efbFramebuffer[0]);
|
||||
}
|
||||
|
||||
void FramebufferManager::CopyToRealXFB(u32 xfbAddr, u32 fbStride, u32 fbHeight,
|
||||
const EFBRectangle& sourceRc, float Gamma)
|
||||
{
|
||||
u8* xfb_in_ram = Memory::GetPointer(xfbAddr);
|
||||
if (!xfb_in_ram)
|
||||
{
|
||||
WARN_LOG(VIDEO, "Tried to copy to invalid XFB address");
|
||||
return;
|
||||
}
|
||||
|
||||
TargetRectangle targetRc = g_renderer->ConvertEFBRectangle(sourceRc);
|
||||
TextureConverter::EncodeToRamYUYV(ResolveAndGetRenderTarget(sourceRc), targetRc, xfb_in_ram,
|
||||
sourceRc.GetWidth(), fbStride, fbHeight);
|
||||
}
|
||||
|
||||
GLuint FramebufferManager::GetResolvedFramebuffer()
|
||||
{
|
||||
if (m_msaaSamples <= 1)
|
||||
return m_efbFramebuffer[0];
|
||||
return m_resolvedFramebuffer[0];
|
||||
}
|
||||
|
||||
void FramebufferManager::SetFramebuffer(GLuint fb)
|
||||
{
|
||||
glBindFramebuffer(GL_FRAMEBUFFER, fb != 0 ? fb : GetEFBFramebuffer());
|
||||
}
|
||||
|
||||
void FramebufferManager::FramebufferTexture(GLenum target, GLenum attachment, GLenum textarget,
|
||||
GLuint texture, GLint level)
|
||||
{
|
||||
if (textarget == GL_TEXTURE_2D_ARRAY || textarget == GL_TEXTURE_2D_MULTISAMPLE_ARRAY)
|
||||
{
|
||||
if (m_EFBLayers > 1)
|
||||
glFramebufferTexture(target, attachment, texture, level);
|
||||
else
|
||||
glFramebufferTextureLayer(target, attachment, texture, level, 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
glFramebufferTexture2D(target, attachment, textarget, texture, level);
|
||||
}
|
||||
}
|
||||
|
||||
// Apply AA if enabled
|
||||
GLuint FramebufferManager::ResolveAndGetRenderTarget(const EFBRectangle& source_rect)
|
||||
{
|
||||
return GetEFBColorTexture(source_rect);
|
||||
}
|
||||
|
||||
GLuint FramebufferManager::ResolveAndGetDepthTarget(const EFBRectangle& source_rect)
|
||||
{
|
||||
return GetEFBDepthTexture(source_rect);
|
||||
}
|
||||
|
||||
void FramebufferManager::ReinterpretPixelData(unsigned int convtype)
|
||||
{
|
||||
g_renderer->ResetAPIState();
|
||||
|
||||
OpenGL_BindAttributelessVAO();
|
||||
|
||||
GLuint src_texture = 0;
|
||||
|
||||
// We aren't allowed to render and sample the same texture in one draw call,
|
||||
// so we have to create a new texture and overwrite it completely.
|
||||
// To not allocate one big texture every time, we've allocated two on
|
||||
// initialization and just swap them here:
|
||||
src_texture = m_efbColor;
|
||||
m_efbColor = m_efbColorSwap;
|
||||
m_efbColorSwap = src_texture;
|
||||
FramebufferTexture(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, m_textureType, m_efbColor, 0);
|
||||
|
||||
glViewport(0, 0, m_targetWidth, m_targetHeight);
|
||||
glActiveTexture(GL_TEXTURE9);
|
||||
glBindTexture(m_textureType, src_texture);
|
||||
g_sampler_cache->BindNearestSampler(9);
|
||||
|
||||
m_pixel_format_shaders[convtype ? 1 : 0].Bind();
|
||||
glDrawArrays(GL_TRIANGLE_STRIP, 0, 4);
|
||||
glBindTexture(m_textureType, 0);
|
||||
|
||||
g_renderer->RestoreAPIState();
|
||||
}
|
||||
|
||||
XFBSource::~XFBSource()
|
||||
{
|
||||
glDeleteTextures(1, &texture);
|
||||
}
|
||||
|
||||
void XFBSource::DecodeToTexture(u32 xfbAddr, u32 fbWidth, u32 fbHeight)
|
||||
{
|
||||
TextureConverter::DecodeToTexture(xfbAddr, fbWidth, fbHeight, texture);
|
||||
}
|
||||
|
||||
void XFBSource::CopyEFB(float Gamma)
|
||||
{
|
||||
g_renderer->ResetAPIState();
|
||||
|
||||
// Copy EFB data to XFB and restore render target again
|
||||
glBindFramebuffer(GL_DRAW_FRAMEBUFFER, FramebufferManager::GetXFBFramebuffer());
|
||||
|
||||
for (int i = 0; i < m_layers; i++)
|
||||
{
|
||||
// Bind EFB and texture layer
|
||||
glBindFramebuffer(GL_READ_FRAMEBUFFER, FramebufferManager::GetEFBFramebuffer(i));
|
||||
glFramebufferTextureLayer(GL_DRAW_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, texture, 0, i);
|
||||
|
||||
glBlitFramebuffer(0, 0, texWidth, texHeight, 0, 0, texWidth, texHeight, GL_COLOR_BUFFER_BIT,
|
||||
GL_NEAREST);
|
||||
}
|
||||
|
||||
// Return to EFB.
|
||||
FramebufferManager::SetFramebuffer(0);
|
||||
|
||||
g_renderer->RestoreAPIState();
|
||||
}
|
||||
|
||||
std::unique_ptr<XFBSourceBase> FramebufferManager::CreateXFBSource(unsigned int target_width,
|
||||
unsigned int target_height,
|
||||
unsigned int layers)
|
||||
{
|
||||
GLuint texture;
|
||||
|
||||
glGenTextures(1, &texture);
|
||||
|
||||
glActiveTexture(GL_TEXTURE9);
|
||||
glBindTexture(GL_TEXTURE_2D_ARRAY, texture);
|
||||
glTexParameteri(GL_TEXTURE_2D_ARRAY, GL_TEXTURE_MAX_LEVEL, 0);
|
||||
glTexImage3D(GL_TEXTURE_2D_ARRAY, 0, GL_RGBA, target_width, target_height, layers, 0, GL_RGBA,
|
||||
GL_UNSIGNED_BYTE, nullptr);
|
||||
|
||||
return std::make_unique<XFBSource>(texture, layers);
|
||||
}
|
||||
|
||||
std::pair<u32, u32> FramebufferManager::GetTargetSize() const
|
||||
{
|
||||
return std::make_pair(m_targetWidth, m_targetHeight);
|
||||
}
|
||||
|
||||
void FramebufferManager::PokeEFB(EFBAccessType type, const EfbPokeData* points, size_t num_points)
|
||||
{
|
||||
g_renderer->ResetAPIState();
|
||||
|
||||
if (type == EFBAccessType::PokeZ)
|
||||
{
|
||||
glDepthMask(GL_TRUE);
|
||||
glColorMask(GL_FALSE, GL_FALSE, GL_FALSE, GL_FALSE);
|
||||
glEnable(GL_DEPTH_TEST);
|
||||
glDepthFunc(GL_ALWAYS);
|
||||
}
|
||||
|
||||
glBindVertexArray(m_EfbPokes_VAO);
|
||||
glBindBuffer(GL_ARRAY_BUFFER, m_EfbPokes_VBO);
|
||||
glBufferData(GL_ARRAY_BUFFER, sizeof(EfbPokeData) * num_points, points, GL_STREAM_DRAW);
|
||||
m_EfbPokes.Bind();
|
||||
glViewport(0, 0, m_targetWidth, m_targetHeight);
|
||||
glDrawArrays(GL_POINTS, 0, (GLsizei)num_points);
|
||||
|
||||
g_renderer->RestoreAPIState();
|
||||
|
||||
// TODO: Could just update the EFB cache with the new value
|
||||
ClearEFBCache();
|
||||
}
|
||||
|
||||
} // namespace OGL
|
||||
File diff suppressed because it is too large
Load Diff
@@ -10,10 +10,7 @@
|
||||
#include <cstdio>
|
||||
#include <memory>
|
||||
#include <string>
|
||||
#include <tuple>
|
||||
#include <vector>
|
||||
|
||||
#include "Common/Assert.h"
|
||||
#include "Common/Atomic.h"
|
||||
#include "Common/CommonTypes.h"
|
||||
#include "Common/GL/GLContext.h"
|
||||
@@ -24,7 +21,6 @@
|
||||
#include "Common/StringUtil.h"
|
||||
|
||||
#include "Core/Config/GraphicsSettings.h"
|
||||
#include "Core/Core.h"
|
||||
|
||||
#include "VideoBackends/OGL/BoundingBox.h"
|
||||
#include "VideoBackends/OGL/OGLPipeline.h"
|
||||
@@ -32,22 +28,16 @@
|
||||
#include "VideoBackends/OGL/OGLTexture.h"
|
||||
#include "VideoBackends/OGL/ProgramShaderCache.h"
|
||||
#include "VideoBackends/OGL/SamplerCache.h"
|
||||
#include "VideoBackends/OGL/StreamBuffer.h"
|
||||
#include "VideoBackends/OGL/VertexManager.h"
|
||||
|
||||
#include "VideoCommon/BPFunctions.h"
|
||||
#include "VideoCommon/DriverDetails.h"
|
||||
#include "VideoCommon/FramebufferManager.h"
|
||||
#include "VideoCommon/IndexGenerator.h"
|
||||
#include "VideoCommon/OnScreenDisplay.h"
|
||||
#include "VideoCommon/PixelEngine.h"
|
||||
#include "VideoCommon/PostProcessing.h"
|
||||
#include "VideoCommon/RenderState.h"
|
||||
#include "VideoCommon/ShaderGenCommon.h"
|
||||
#include "VideoCommon/VertexShaderManager.h"
|
||||
#include "VideoCommon/VideoBackendBase.h"
|
||||
#include "VideoCommon/VideoCommon.h"
|
||||
#include "VideoCommon/VideoConfig.h"
|
||||
#include "VideoCommon/XFMemory.h"
|
||||
|
||||
namespace OGL
|
||||
{
|
||||
@@ -144,28 +134,35 @@ static void APIENTRY ClearDepthf(GLfloat depthval)
|
||||
|
||||
static void InitDriverInfo()
|
||||
{
|
||||
std::string svendor = std::string(g_ogl_config.gl_vendor);
|
||||
std::string srenderer = std::string(g_ogl_config.gl_renderer);
|
||||
std::string sversion = std::string(g_ogl_config.gl_version);
|
||||
const std::string_view svendor(g_ogl_config.gl_vendor);
|
||||
const std::string_view srenderer(g_ogl_config.gl_renderer);
|
||||
const std::string_view sversion(g_ogl_config.gl_version);
|
||||
DriverDetails::Vendor vendor = DriverDetails::VENDOR_UNKNOWN;
|
||||
DriverDetails::Driver driver = DriverDetails::DRIVER_UNKNOWN;
|
||||
DriverDetails::Family family = DriverDetails::Family::UNKNOWN;
|
||||
double version = 0.0;
|
||||
|
||||
// Get the vendor first
|
||||
if (svendor == "NVIDIA Corporation" && srenderer != "NVIDIA Tegra")
|
||||
if (svendor == "NVIDIA Corporation")
|
||||
{
|
||||
vendor = DriverDetails::VENDOR_NVIDIA;
|
||||
if (srenderer != "NVIDIA Tegra")
|
||||
{
|
||||
vendor = DriverDetails::VENDOR_NVIDIA;
|
||||
}
|
||||
else
|
||||
{
|
||||
vendor = DriverDetails::VENDOR_TEGRA;
|
||||
}
|
||||
}
|
||||
else if (svendor == "ATI Technologies Inc." || svendor == "Advanced Micro Devices, Inc.")
|
||||
{
|
||||
vendor = DriverDetails::VENDOR_ATI;
|
||||
}
|
||||
else if (std::string::npos != sversion.find("Mesa"))
|
||||
else if (sversion.find("Mesa") != std::string::npos)
|
||||
{
|
||||
vendor = DriverDetails::VENDOR_MESA;
|
||||
}
|
||||
else if (std::string::npos != svendor.find("Intel"))
|
||||
else if (svendor.find("Intel") != std::string::npos)
|
||||
{
|
||||
vendor = DriverDetails::VENDOR_INTEL;
|
||||
}
|
||||
@@ -186,10 +183,6 @@ static void InitDriverInfo()
|
||||
{
|
||||
vendor = DriverDetails::VENDOR_IMGTEC;
|
||||
}
|
||||
else if (svendor == "NVIDIA Corporation" && srenderer == "NVIDIA Tegra")
|
||||
{
|
||||
vendor = DriverDetails::VENDOR_TEGRA;
|
||||
}
|
||||
else if (svendor == "Vivante Corporation")
|
||||
{
|
||||
vendor = DriverDetails::VENDOR_VIVANTE;
|
||||
@@ -238,8 +231,8 @@ static void InitDriverInfo()
|
||||
else if (srenderer.find("Ivybridge") != std::string::npos)
|
||||
family = DriverDetails::Family::INTEL_IVY;
|
||||
}
|
||||
else if (std::string::npos != srenderer.find("AMD") ||
|
||||
std::string::npos != srenderer.find("ATI"))
|
||||
else if (srenderer.find("AMD") != std::string::npos ||
|
||||
srenderer.find("ATI") != std::string::npos)
|
||||
{
|
||||
driver = DriverDetails::DRIVER_R600;
|
||||
}
|
||||
@@ -339,16 +332,16 @@ Renderer::Renderer(std::unique_ptr<GLContext> main_gl_context, float backbuffer_
|
||||
m_current_depth_state(RenderState::GetInvalidDepthState()),
|
||||
m_current_blend_state(RenderState::GetInvalidBlendingState())
|
||||
{
|
||||
// Create the window framebuffer.
|
||||
if (!m_main_gl_context->IsHeadless())
|
||||
{
|
||||
//OpenEmu Video FBO attached here
|
||||
m_system_framebuffer = std::make_unique<OGLFramebuffer>(
|
||||
nullptr, nullptr, AbstractTextureFormat::RGBA8, AbstractTextureFormat::Undefined,
|
||||
std::max(m_main_gl_context->GetBackBufferWidth(), 1u),
|
||||
std::max(m_main_gl_context->GetBackBufferHeight(), 1u), 1, 1, g_Config.iRenderFBO);
|
||||
m_current_framebuffer = m_system_framebuffer.get();
|
||||
}
|
||||
// Create the window framebuffer.
|
||||
if (!m_main_gl_context->IsHeadless())
|
||||
{
|
||||
//OpenEmu Framebuffer attaches here
|
||||
m_system_framebuffer = std::make_unique<OGLFramebuffer>(
|
||||
nullptr, nullptr, AbstractTextureFormat::RGBA8, AbstractTextureFormat::Undefined,
|
||||
std::max(m_main_gl_context->GetBackBufferWidth(), 1u),
|
||||
std::max(m_main_gl_context->GetBackBufferHeight(), 1u), 1, 1, g_Config.iRenderFBO);
|
||||
m_current_framebuffer = m_system_framebuffer.get();
|
||||
}
|
||||
|
||||
bool bSuccess = true;
|
||||
bool supports_glsl_cache = false;
|
||||
@@ -519,6 +512,10 @@ Renderer::Renderer(std::unique_ptr<GLContext> main_gl_context, float backbuffer_
|
||||
// GLES does not support logic op.
|
||||
g_Config.backend_info.bSupportsLogicOp = false;
|
||||
|
||||
// glReadPixels() can't be used with non-color formats. But, if we support
|
||||
// ARB_get_texture_sub_image (unlikely, except maybe on NVIDIA), we can use that instead.
|
||||
g_Config.backend_info.bSupportsDepthReadback = g_ogl_config.bSupportsTextureSubImage;
|
||||
|
||||
if (GLExtensions::Supports("GL_EXT_shader_framebuffer_fetch"))
|
||||
{
|
||||
g_ogl_config.SupportedFramebufferFetch = EsFbFetchType::FbFetchExt;
|
||||
@@ -721,10 +718,10 @@ Renderer::Renderer(std::unique_ptr<GLContext> main_gl_context, float backbuffer_
|
||||
// MSAA on default framebuffer isn't working because of glBlitFramebuffer.
|
||||
// It also isn't useful as we don't render anything to the default framebuffer.
|
||||
// We also try to get a non-msaa fb, so this only happens when forced by the driver.
|
||||
PanicAlert("MSAA on default framebuffer isn't supported.\n"
|
||||
"Please avoid forcing Dolphin to use MSAA by the driver.\n"
|
||||
"%d samples on default framebuffer found.",
|
||||
samples);
|
||||
PanicAlertT("The graphics driver is forcibly enabling anti-aliasing for Dolphin. You need to "
|
||||
"turn this off in the graphics driver's settings in order for Dolphin to work.\n\n"
|
||||
"(MSAA with %d samples found on default framebuffer)",
|
||||
samples);
|
||||
bSuccess = false;
|
||||
}
|
||||
|
||||
|
||||
@@ -14,7 +14,8 @@
|
||||
#include <vector>
|
||||
|
||||
#include "Common/CommonTypes.h"
|
||||
#include "VideoCommon/VideoCommon.h"
|
||||
|
||||
enum class APIType;
|
||||
|
||||
// Log in two categories, and save three other options in the same byte
|
||||
#define CONF_LOG 1
|
||||
@@ -26,221 +27,232 @@ constexpr int EFB_SCALE_AUTO_INTEGRAL = 0;
|
||||
|
||||
enum class AspectMode : int
|
||||
{
|
||||
Auto,
|
||||
AnalogWide,
|
||||
Analog,
|
||||
Stretch,
|
||||
Auto,
|
||||
AnalogWide,
|
||||
Analog,
|
||||
Stretch,
|
||||
};
|
||||
|
||||
enum class StereoMode : int
|
||||
{
|
||||
Off,
|
||||
SBS,
|
||||
TAB,
|
||||
Anaglyph,
|
||||
QuadBuffer,
|
||||
Passive,
|
||||
Nvidia3DVision,
|
||||
Off,
|
||||
SBS,
|
||||
TAB,
|
||||
Anaglyph,
|
||||
QuadBuffer,
|
||||
Passive
|
||||
};
|
||||
|
||||
enum class ShaderCompilationMode : int
|
||||
{
|
||||
Synchronous,
|
||||
SynchronousUberShaders,
|
||||
AsynchronousUberShaders,
|
||||
AsynchronousSkipRendering
|
||||
Synchronous,
|
||||
SynchronousUberShaders,
|
||||
AsynchronousUberShaders,
|
||||
AsynchronousSkipRendering
|
||||
};
|
||||
|
||||
enum class FreelookControlType : int
|
||||
{
|
||||
SixAxis,
|
||||
FPS,
|
||||
Orbital
|
||||
};
|
||||
|
||||
// NEVER inherit from this class.
|
||||
struct VideoConfig final
|
||||
{
|
||||
VideoConfig();
|
||||
void Refresh();
|
||||
void VerifyValidity();
|
||||
|
||||
// General
|
||||
bool bVSync;
|
||||
bool bVSyncActive;
|
||||
bool bWidescreenHack;
|
||||
AspectMode aspect_mode;
|
||||
AspectMode suggested_aspect_mode;
|
||||
bool bCrop; // Aspect ratio controls.
|
||||
bool bShaderCache;
|
||||
|
||||
// Enhancements
|
||||
u32 iMultisamples;
|
||||
bool bSSAA;
|
||||
int iEFBScale;
|
||||
bool bForceFiltering;
|
||||
int iMaxAnisotropy;
|
||||
std::string sPostProcessingShader;
|
||||
bool bForceTrueColor;
|
||||
bool bDisableCopyFilter;
|
||||
bool bArbitraryMipmapDetection;
|
||||
float fArbitraryMipmapDetectionThreshold;
|
||||
|
||||
// Information
|
||||
bool bShowFPS;
|
||||
bool bShowNetPlayPing;
|
||||
bool bShowNetPlayMessages;
|
||||
bool bOverlayStats;
|
||||
bool bOverlayProjStats;
|
||||
bool bTexFmtOverlayEnable;
|
||||
bool bTexFmtOverlayCenter;
|
||||
bool bLogRenderTimeToFile;
|
||||
|
||||
// Render
|
||||
bool bWireFrame;
|
||||
bool bDisableFog;
|
||||
|
||||
// OE render buffer
|
||||
int iRenderFBO = 0;
|
||||
|
||||
// Utility
|
||||
bool bDumpTextures;
|
||||
bool bHiresTextures;
|
||||
bool bCacheHiresTextures;
|
||||
bool bDumpEFBTarget;
|
||||
bool bDumpXFBTarget;
|
||||
bool bDumpFramesAsImages;
|
||||
bool bUseFFV1;
|
||||
std::string sDumpCodec;
|
||||
std::string sDumpEncoder;
|
||||
std::string sDumpFormat;
|
||||
std::string sDumpPath;
|
||||
bool bInternalResolutionFrameDumps;
|
||||
bool bFreeLook;
|
||||
bool bBorderlessFullscreen;
|
||||
bool bEnableGPUTextureDecoding;
|
||||
int iBitrateKbps;
|
||||
|
||||
// Hacks
|
||||
bool bEFBAccessEnable;
|
||||
bool bEFBAccessDeferInvalidation;
|
||||
bool bPerfQueriesEnable;
|
||||
bool bBBoxEnable;
|
||||
bool bForceProgressive;
|
||||
|
||||
bool bEFBEmulateFormatChanges;
|
||||
bool bSkipEFBCopyToRam;
|
||||
bool bSkipXFBCopyToRam;
|
||||
bool bDisableCopyToVRAM;
|
||||
bool bDeferEFBCopies;
|
||||
bool bImmediateXFB;
|
||||
bool bCopyEFBScaled;
|
||||
int iSafeTextureCache_ColorSamples;
|
||||
float fAspectRatioHackW, fAspectRatioHackH;
|
||||
bool bEnablePixelLighting;
|
||||
bool bFastDepthCalc;
|
||||
bool bVertexRounding;
|
||||
int iEFBAccessTileSize;
|
||||
int iLog; // CONF_ bits
|
||||
int iSaveTargetId; // TODO: Should be dropped
|
||||
|
||||
// Stereoscopy
|
||||
StereoMode stereo_mode;
|
||||
int iStereoDepth;
|
||||
int iStereoConvergence;
|
||||
int iStereoConvergencePercentage;
|
||||
bool bStereoSwapEyes;
|
||||
bool bStereoEFBMonoDepth;
|
||||
int iStereoDepthPercentage;
|
||||
|
||||
// D3D only config, mostly to be merged into the above
|
||||
int iAdapter;
|
||||
|
||||
// VideoSW Debugging
|
||||
int drawStart;
|
||||
int drawEnd;
|
||||
bool bZComploc;
|
||||
bool bZFreeze;
|
||||
bool bDumpObjects;
|
||||
bool bDumpTevStages;
|
||||
bool bDumpTevTextureFetches;
|
||||
|
||||
// Enable API validation layers, currently only supported with Vulkan.
|
||||
bool bEnableValidationLayer;
|
||||
|
||||
// Multithreaded submission, currently only supported with Vulkan.
|
||||
bool bBackendMultithreading;
|
||||
|
||||
// Early command buffer execution interval in number of draws.
|
||||
// Currently only supported with Vulkan.
|
||||
int iCommandBufferExecuteInterval;
|
||||
|
||||
// Shader compilation settings.
|
||||
bool bWaitForShadersBeforeStarting;
|
||||
ShaderCompilationMode iShaderCompilationMode;
|
||||
|
||||
// Number of shader compiler threads.
|
||||
// 0 disables background compilation.
|
||||
// -1 uses an automatic number based on the CPU threads.
|
||||
int iShaderCompilerThreads;
|
||||
int iShaderPrecompilerThreads;
|
||||
|
||||
// Static config per API
|
||||
// TODO: Move this out of VideoConfig
|
||||
struct
|
||||
{
|
||||
APIType api_type;
|
||||
|
||||
std::vector<std::string> Adapters; // for D3D
|
||||
std::vector<u32> AAModes;
|
||||
|
||||
// TODO: merge AdapterName and Adapters array
|
||||
std::string AdapterName; // for OpenGL
|
||||
|
||||
u32 MaxTextureSize;
|
||||
bool bUsesLowerLeftOrigin;
|
||||
|
||||
bool bSupportsExclusiveFullscreen;
|
||||
bool bSupportsDualSourceBlend;
|
||||
bool bSupportsPrimitiveRestart;
|
||||
bool bSupportsOversizedViewports;
|
||||
bool bSupportsGeometryShaders;
|
||||
bool bSupportsComputeShaders;
|
||||
bool bSupports3DVision;
|
||||
bool bSupportsEarlyZ; // needed by PixelShaderGen, so must stay in VideoCommon
|
||||
bool bSupportsBindingLayout; // Needed by ShaderGen, so must stay in VideoCommon
|
||||
bool bSupportsBBox;
|
||||
bool bSupportsGSInstancing; // Needed by GeometryShaderGen, so must stay in VideoCommon
|
||||
bool bSupportsPostProcessing;
|
||||
bool bSupportsPaletteConversion;
|
||||
bool bSupportsClipControl; // Needed by VertexShaderGen, so must stay in VideoCommon
|
||||
bool bSupportsSSAA;
|
||||
bool bSupportsFragmentStoresAndAtomics; // a.k.a. OpenGL SSBOs a.k.a. Direct3D UAVs
|
||||
bool bSupportsDepthClamp; // Needed by VertexShaderGen, so must stay in VideoCommon
|
||||
bool bSupportsReversedDepthRange;
|
||||
bool bSupportsLogicOp;
|
||||
bool bSupportsMultithreading;
|
||||
bool bSupportsGPUTextureDecoding;
|
||||
bool bSupportsST3CTextures;
|
||||
bool bSupportsCopyToVram;
|
||||
bool bSupportsBitfield; // Needed by UberShaders, so must stay in VideoCommon
|
||||
bool bSupportsDynamicSamplerIndexing; // Needed by UberShaders, so must stay in VideoCommon
|
||||
bool bSupportsBPTCTextures;
|
||||
bool bSupportsFramebufferFetch; // Used as an alternative to dual-source blend on GLES
|
||||
bool bSupportsBackgroundCompiling;
|
||||
bool bSupportsLargePoints;
|
||||
bool bSupportsPartialDepthCopies;
|
||||
bool bSupportsShaderBinaries;
|
||||
bool bSupportsPipelineCacheData;
|
||||
} backend_info;
|
||||
|
||||
// Utility
|
||||
bool MultisamplingEnabled() const { return iMultisamples > 1; }
|
||||
bool ExclusiveFullscreenEnabled() const
|
||||
{
|
||||
return backend_info.bSupportsExclusiveFullscreen && !bBorderlessFullscreen;
|
||||
}
|
||||
bool UseGPUTextureDecoding() const
|
||||
{
|
||||
return backend_info.bSupportsGPUTextureDecoding && bEnableGPUTextureDecoding;
|
||||
}
|
||||
bool UseVertexRounding() const { return bVertexRounding && iEFBScale != 1; }
|
||||
bool UsingUberShaders() const;
|
||||
u32 GetShaderCompilerThreads() const;
|
||||
u32 GetShaderPrecompilerThreads() const;
|
||||
VideoConfig();
|
||||
void Refresh();
|
||||
void VerifyValidity();
|
||||
|
||||
// General
|
||||
bool bVSync;
|
||||
bool bVSyncActive;
|
||||
bool bWidescreenHack;
|
||||
AspectMode aspect_mode;
|
||||
AspectMode suggested_aspect_mode;
|
||||
bool bCrop; // Aspect ratio controls.
|
||||
bool bShaderCache;
|
||||
|
||||
// Enhancements
|
||||
u32 iMultisamples;
|
||||
bool bSSAA;
|
||||
int iEFBScale;
|
||||
bool bForceFiltering;
|
||||
int iMaxAnisotropy;
|
||||
std::string sPostProcessingShader;
|
||||
bool bForceTrueColor;
|
||||
bool bDisableCopyFilter;
|
||||
bool bArbitraryMipmapDetection;
|
||||
float fArbitraryMipmapDetectionThreshold;
|
||||
|
||||
// Information
|
||||
bool bShowFPS;
|
||||
bool bShowNetPlayPing;
|
||||
bool bShowNetPlayMessages;
|
||||
bool bOverlayStats;
|
||||
bool bOverlayProjStats;
|
||||
bool bTexFmtOverlayEnable;
|
||||
bool bTexFmtOverlayCenter;
|
||||
bool bLogRenderTimeToFile;
|
||||
|
||||
// Render
|
||||
bool bWireFrame;
|
||||
bool bDisableFog;
|
||||
|
||||
// OpenEmu render buffer
|
||||
int iRenderFBO = 0;
|
||||
|
||||
// Utility
|
||||
bool bDumpTextures;
|
||||
bool bDumpMipmapTextures;
|
||||
bool bDumpBaseTextures;
|
||||
bool bHiresTextures;
|
||||
bool bCacheHiresTextures;
|
||||
bool bDumpEFBTarget;
|
||||
bool bDumpXFBTarget;
|
||||
bool bDumpFramesAsImages;
|
||||
bool bUseFFV1;
|
||||
std::string sDumpCodec;
|
||||
std::string sDumpEncoder;
|
||||
std::string sDumpFormat;
|
||||
std::string sDumpPath;
|
||||
bool bInternalResolutionFrameDumps;
|
||||
bool bFreeLook;
|
||||
FreelookControlType iFreelookControlType;
|
||||
bool bBorderlessFullscreen;
|
||||
bool bEnableGPUTextureDecoding;
|
||||
int iBitrateKbps;
|
||||
|
||||
// Hacks
|
||||
bool bEFBAccessEnable;
|
||||
bool bEFBAccessDeferInvalidation;
|
||||
bool bPerfQueriesEnable;
|
||||
bool bBBoxEnable;
|
||||
bool bForceProgressive;
|
||||
|
||||
bool bEFBEmulateFormatChanges;
|
||||
bool bSkipEFBCopyToRam;
|
||||
bool bSkipXFBCopyToRam;
|
||||
bool bDisableCopyToVRAM;
|
||||
bool bDeferEFBCopies;
|
||||
bool bImmediateXFB;
|
||||
bool bSkipPresentingDuplicateXFBs;
|
||||
bool bCopyEFBScaled;
|
||||
int iSafeTextureCache_ColorSamples;
|
||||
float fAspectRatioHackW, fAspectRatioHackH;
|
||||
bool bEnablePixelLighting;
|
||||
bool bFastDepthCalc;
|
||||
bool bVertexRounding;
|
||||
int iEFBAccessTileSize;
|
||||
int iLog; // CONF_ bits
|
||||
int iSaveTargetId; // TODO: Should be dropped
|
||||
|
||||
// Stereoscopy
|
||||
StereoMode stereo_mode;
|
||||
int iStereoDepth;
|
||||
int iStereoConvergence;
|
||||
int iStereoConvergencePercentage;
|
||||
bool bStereoSwapEyes;
|
||||
bool bStereoEFBMonoDepth;
|
||||
int iStereoDepthPercentage;
|
||||
|
||||
// D3D only config, mostly to be merged into the above
|
||||
int iAdapter;
|
||||
|
||||
// VideoSW Debugging
|
||||
int drawStart;
|
||||
int drawEnd;
|
||||
bool bZComploc;
|
||||
bool bZFreeze;
|
||||
bool bDumpObjects;
|
||||
bool bDumpTevStages;
|
||||
bool bDumpTevTextureFetches;
|
||||
|
||||
// Enable API validation layers, currently only supported with Vulkan.
|
||||
bool bEnableValidationLayer;
|
||||
|
||||
// Multithreaded submission, currently only supported with Vulkan.
|
||||
bool bBackendMultithreading;
|
||||
|
||||
// Early command buffer execution interval in number of draws.
|
||||
// Currently only supported with Vulkan.
|
||||
int iCommandBufferExecuteInterval;
|
||||
|
||||
// Shader compilation settings.
|
||||
bool bWaitForShadersBeforeStarting;
|
||||
ShaderCompilationMode iShaderCompilationMode;
|
||||
|
||||
// Number of shader compiler threads.
|
||||
// 0 disables background compilation.
|
||||
// -1 uses an automatic number based on the CPU threads.
|
||||
int iShaderCompilerThreads;
|
||||
int iShaderPrecompilerThreads;
|
||||
|
||||
// Static config per API
|
||||
// TODO: Move this out of VideoConfig
|
||||
struct
|
||||
{
|
||||
APIType api_type;
|
||||
|
||||
std::vector<std::string> Adapters; // for D3D
|
||||
std::vector<u32> AAModes;
|
||||
|
||||
// TODO: merge AdapterName and Adapters array
|
||||
std::string AdapterName; // for OpenGL
|
||||
|
||||
u32 MaxTextureSize;
|
||||
bool bUsesLowerLeftOrigin;
|
||||
|
||||
bool bSupportsExclusiveFullscreen;
|
||||
bool bSupportsDualSourceBlend;
|
||||
bool bSupportsPrimitiveRestart;
|
||||
bool bSupportsOversizedViewports;
|
||||
bool bSupportsGeometryShaders;
|
||||
bool bSupportsComputeShaders;
|
||||
bool bSupports3DVision;
|
||||
bool bSupportsEarlyZ; // needed by PixelShaderGen, so must stay in VideoCommon
|
||||
bool bSupportsBindingLayout; // Needed by ShaderGen, so must stay in VideoCommon
|
||||
bool bSupportsBBox;
|
||||
bool bSupportsGSInstancing; // Needed by GeometryShaderGen, so must stay in VideoCommon
|
||||
bool bSupportsPostProcessing;
|
||||
bool bSupportsPaletteConversion;
|
||||
bool bSupportsClipControl; // Needed by VertexShaderGen, so must stay in VideoCommon
|
||||
bool bSupportsSSAA;
|
||||
bool bSupportsFragmentStoresAndAtomics; // a.k.a. OpenGL SSBOs a.k.a. Direct3D UAVs
|
||||
bool bSupportsDepthClamp; // Needed by VertexShaderGen, so must stay in VideoCommon
|
||||
bool bSupportsReversedDepthRange;
|
||||
bool bSupportsLogicOp;
|
||||
bool bSupportsMultithreading;
|
||||
bool bSupportsGPUTextureDecoding;
|
||||
bool bSupportsST3CTextures;
|
||||
bool bSupportsCopyToVram;
|
||||
bool bSupportsBitfield; // Needed by UberShaders, so must stay in VideoCommon
|
||||
bool bSupportsDynamicSamplerIndexing; // Needed by UberShaders, so must stay in VideoCommon
|
||||
bool bSupportsBPTCTextures;
|
||||
bool bSupportsFramebufferFetch; // Used as an alternative to dual-source blend on GLES
|
||||
bool bSupportsBackgroundCompiling;
|
||||
bool bSupportsLargePoints;
|
||||
bool bSupportsPartialDepthCopies;
|
||||
bool bSupportsDepthReadback;
|
||||
bool bSupportsShaderBinaries;
|
||||
bool bSupportsPipelineCacheData;
|
||||
} backend_info;
|
||||
|
||||
// Utility
|
||||
bool MultisamplingEnabled() const { return iMultisamples > 1; }
|
||||
bool ExclusiveFullscreenEnabled() const
|
||||
{
|
||||
return backend_info.bSupportsExclusiveFullscreen && !bBorderlessFullscreen;
|
||||
}
|
||||
bool UseGPUTextureDecoding() const
|
||||
{
|
||||
return backend_info.bSupportsGPUTextureDecoding && bEnableGPUTextureDecoding;
|
||||
}
|
||||
bool UseVertexRounding() const { return bVertexRounding && iEFBScale != 1; }
|
||||
bool UsingUberShaders() const;
|
||||
u32 GetShaderCompilerThreads() const;
|
||||
u32 GetShaderPrecompilerThreads() const;
|
||||
};
|
||||
|
||||
extern VideoConfig g_Config;
|
||||
|
||||
@@ -0,0 +1,505 @@
|
||||
/* Define if building universal (internal helper macro) */
|
||||
/* #undef AC_APPLE_UNIVERSAL_BUILD */
|
||||
|
||||
/* How many MiB of RAM to assume if the real amount cannot be determined. */
|
||||
#define ASSUME_RAM 128
|
||||
|
||||
/* Define to 1 if translation of program messages to the user's native
|
||||
language is requested. */
|
||||
/* #undef #define ENABLE_NLS 1 */
|
||||
|
||||
/* Define to 1 if bswap_16 is available. */
|
||||
#define HAVE_BSWAP_16 1
|
||||
|
||||
/* Define to 1 if bswap_32 is available. */
|
||||
#define HAVE_BSWAP_32 1
|
||||
|
||||
/* Define to 1 if bswap_64 is available. */
|
||||
#define HAVE_BSWAP_64 1
|
||||
|
||||
/* Define to 1 if you have the <byteswap.h> header file. */
|
||||
/* #undef HAVE_BYTESWAP_H 1 */
|
||||
|
||||
/* Define to 1 if Capsicum is available. */
|
||||
/* #undef HAVE_CAPSICUM */
|
||||
|
||||
/* Define to 1 if the system has the type `CC_SHA256_CTX'. */
|
||||
/* #undef HAVE_CC_SHA256_CTX */
|
||||
|
||||
/* Define to 1 if you have the `CC_SHA256_Init' function. */
|
||||
/* #undef HAVE_CC_SHA256_INIT */
|
||||
|
||||
/* Define to 1 if you have the Mac OS X function CFLocaleCopyCurrent in the
|
||||
CoreFoundation framework. */
|
||||
/* #undef HAVE_CFLOCALECOPYCURRENT */
|
||||
|
||||
/* Define to 1 if you have the Mac OS X function CFPreferencesCopyAppValue in
|
||||
the CoreFoundation framework. */
|
||||
/* #undef HAVE_CFPREFERENCESCOPYAPPVALUE */
|
||||
|
||||
/* Define to 1 if crc32 integrity check is enabled. */
|
||||
#define HAVE_CHECK_CRC32 1
|
||||
|
||||
/* Define to 1 if crc64 integrity check is enabled. */
|
||||
#define HAVE_CHECK_CRC64 1
|
||||
|
||||
/* Define to 1 if sha256 integrity check is enabled. */
|
||||
#define HAVE_CHECK_SHA256 1
|
||||
|
||||
/* Define to 1 if you have the `clock_gettime' function. */
|
||||
#define HAVE_CLOCK_GETTIME 1
|
||||
|
||||
/* Define to 1 if you have the <CommonCrypto/CommonDigest.h> header file. */
|
||||
/* #undef HAVE_COMMONCRYPTO_COMMONDIGEST_H */
|
||||
|
||||
/* Define if the GNU dcgettext() function is already present or preinstalled.
|
||||
*/
|
||||
#define HAVE_DCGETTEXT 1
|
||||
|
||||
/* Define to 1 if you have the declaration of `CLOCK_MONOTONIC', and to 0 if
|
||||
you don't. */
|
||||
#define HAVE_DECL_CLOCK_MONOTONIC 1
|
||||
|
||||
/* Define to 1 if you have the declaration of `program_invocation_name', and
|
||||
to 0 if you don't. */
|
||||
/* undef HAVE_DECL_PROGRAM_INVOCATION_NAME 1 */
|
||||
|
||||
/* Define to 1 if any of HAVE_DECODER_foo have been defined. */
|
||||
#define HAVE_DECODERS 1
|
||||
|
||||
/* Define to 1 if arm decoder is enabled. */
|
||||
// #define HAVE_DECODER_ARM 1
|
||||
|
||||
/* Define to 1 if armthumb decoder is enabled. */
|
||||
// #define HAVE_DECODER_ARMTHUMB 1
|
||||
|
||||
/* Define to 1 if delta decoder is enabled. */
|
||||
#define HAVE_DECODER_DELTA 1
|
||||
|
||||
/* Define to 1 if ia64 decoder is enabled. */
|
||||
// #define HAVE_DECODER_IA64 1
|
||||
|
||||
/* Define to 1 if lzma1 decoder is enabled. */
|
||||
#define HAVE_DECODER_LZMA1 1
|
||||
|
||||
/* Define to 1 if lzma2 decoder is enabled. */
|
||||
#define HAVE_DECODER_LZMA2 1
|
||||
|
||||
/* Define to 1 if powerpc decoder is enabled. */
|
||||
// #define HAVE_DECODER_POWERPC 1
|
||||
|
||||
/* Define to 1 if sparc decoder is enabled. */
|
||||
// #define HAVE_DECODER_SPARC 1
|
||||
|
||||
/* Define to 1 if x86 decoder is enabled. */
|
||||
// #define HAVE_DECODER_X86 1
|
||||
|
||||
/* Define to 1 if you have the <dlfcn.h> header file. */
|
||||
#define HAVE_DLFCN_H 1
|
||||
|
||||
/* Define to 1 if any of HAVE_ENCODER_foo have been defined. */
|
||||
#define HAVE_ENCODERS 1
|
||||
|
||||
/* Define to 1 if arm encoder is enabled. */
|
||||
// #define HAVE_ENCODER_ARM 1
|
||||
|
||||
/* Define to 1 if armthumb encoder is enabled. */
|
||||
// #define HAVE_ENCODER_ARMTHUMB 1
|
||||
|
||||
/* Define to 1 if delta encoder is enabled. */
|
||||
#define HAVE_ENCODER_DELTA 1
|
||||
|
||||
/* Define to 1 if ia64 encoder is enabled. */
|
||||
// #define HAVE_ENCODER_IA64 1
|
||||
|
||||
/* Define to 1 if lzma1 encoder is enabled. */
|
||||
#define HAVE_ENCODER_LZMA1 1
|
||||
|
||||
/* Define to 1 if lzma2 encoder is enabled. */
|
||||
#define HAVE_ENCODER_LZMA2 1
|
||||
|
||||
/* Define to 1 if powerpc encoder is enabled. */
|
||||
// #define HAVE_ENCODER_POWERPC 1
|
||||
|
||||
/* Define to 1 if sparc encoder is enabled. */
|
||||
// #define HAVE_ENCODER_SPARC 1
|
||||
|
||||
/* Define to 1 if x86 encoder is enabled. */
|
||||
// #define HAVE_ENCODER_X86 1
|
||||
|
||||
/* Define to 1 if you have the <fcntl.h> header file. */
|
||||
#define HAVE_FCNTL_H 1
|
||||
|
||||
/* Define to 1 if you have the `futimens' function. */
|
||||
#define HAVE_FUTIMENS 1
|
||||
|
||||
/* Define to 1 if you have the `futimes' function. */
|
||||
/* #undef HAVE_FUTIMES */
|
||||
|
||||
/* Define to 1 if you have the `futimesat' function. */
|
||||
/* #undef HAVE_FUTIMESAT */
|
||||
|
||||
/* Define to 1 if you have the <getopt.h> header file. */
|
||||
#define HAVE_GETOPT_H 1
|
||||
|
||||
/* Define to 1 if you have the `getopt_long' function. */
|
||||
#define HAVE_GETOPT_LONG 1
|
||||
|
||||
/* Define if the GNU gettext() function is already present or preinstalled. */
|
||||
/* #undef HAVE_GETTEXT 1 */
|
||||
|
||||
/* Define if you have the iconv() function and it works. */
|
||||
/* #undef HAVE_ICONV */
|
||||
|
||||
#ifdef _M_X86
|
||||
/* Define to 1 if you have the <immintrin.h> header file. */
|
||||
#define HAVE_IMMINTRIN_H 1
|
||||
#endif
|
||||
|
||||
/* Define to 1 if you have the <inttypes.h> header file. */
|
||||
#define HAVE_INTTYPES_H 1
|
||||
|
||||
/* Define to 1 if you have the <limits.h> header file. */
|
||||
#define HAVE_LIMITS_H 1
|
||||
|
||||
/* Define to 1 if mbrtowc and mbstate_t are properly declared. */
|
||||
#define HAVE_MBRTOWC 1
|
||||
|
||||
/* Define to 1 if you have the <memory.h> header file. */
|
||||
#define HAVE_MEMORY_H 1
|
||||
|
||||
/* Define to 1 to enable bt2 match finder. */
|
||||
#define HAVE_MF_BT2 1
|
||||
|
||||
/* Define to 1 to enable bt3 match finder. */
|
||||
#define HAVE_MF_BT3 1
|
||||
|
||||
/* Define to 1 to enable bt4 match finder. */
|
||||
#define HAVE_MF_BT4 1
|
||||
|
||||
/* Define to 1 to enable hc3 match finder. */
|
||||
#define HAVE_MF_HC3 1
|
||||
|
||||
/* Define to 1 to enable hc4 match finder. */
|
||||
#define HAVE_MF_HC4 1
|
||||
|
||||
/* Define to 1 if getopt.h declares extern int optreset. */
|
||||
/* #undef HAVE_OPTRESET */
|
||||
|
||||
/* Define to 1 if you have the `posix_fadvise' function. */
|
||||
#define HAVE_POSIX_FADVISE 1
|
||||
|
||||
/* Define to 1 if you have the `pthread_condattr_setclock' function. */
|
||||
//#define HAVE_PTHREAD_CONDATTR_SETCLOCK 1
|
||||
|
||||
/* Have PTHREAD_PRIO_INHERIT. */
|
||||
#define HAVE_PTHREAD_PRIO_INHERIT 1
|
||||
|
||||
/* Define to 1 if you have the `SHA256Init' function. */
|
||||
/* #undef HAVE_SHA256INIT */
|
||||
|
||||
/* Define to 1 if the system has the type `SHA256_CTX'. */
|
||||
/* #undef HAVE_SHA256_CTX */
|
||||
|
||||
/* Define to 1 if you have the <sha256.h> header file. */
|
||||
/* #undef HAVE_SHA256_H */
|
||||
|
||||
/* Define to 1 if you have the `SHA256_Init' function. */
|
||||
/* #undef HAVE_SHA256_INIT */
|
||||
|
||||
/* Define to 1 if the system has the type `SHA2_CTX'. */
|
||||
/* #undef HAVE_SHA2_CTX */
|
||||
|
||||
/* Define to 1 if you have the <sha2.h> header file. */
|
||||
/* #undef HAVE_SHA2_H */
|
||||
|
||||
/* Define to 1 if optimizing for size. */
|
||||
/* #undef HAVE_SMALL */
|
||||
|
||||
/* Define to 1 if stdbool.h conforms to C99. */
|
||||
#define HAVE_STDBOOL_H 1
|
||||
|
||||
/* Define to 1 if you have the <stdint.h> header file. */
|
||||
#define HAVE_STDINT_H 1
|
||||
|
||||
/* Define to 1 if you have the <stdlib.h> header file. */
|
||||
#define HAVE_STDLIB_H 1
|
||||
|
||||
/* Define to 1 if you have the <strings.h> header file. */
|
||||
/* #undef HAVE_STRINGS_H 1 */
|
||||
|
||||
/* Define to 1 if you have the <string.h> header file. */
|
||||
#define HAVE_STRING_H 1
|
||||
|
||||
/* Define to 1 if `st_atimensec' is a member of `struct stat'. */
|
||||
/* #undef HAVE_STRUCT_STAT_ST_ATIMENSEC */
|
||||
|
||||
/* Define to 1 if `st_atimespec.tv_nsec' is a member of `struct stat'. */
|
||||
/* #undef HAVE_STRUCT_STAT_ST_ATIMESPEC_TV_NSEC */
|
||||
|
||||
/* Define to 1 if `st_atim.st__tim.tv_nsec' is a member of `struct stat'. */
|
||||
/* #undef HAVE_STRUCT_STAT_ST_ATIM_ST__TIM_TV_NSEC */
|
||||
|
||||
/* Define to 1 if `st_atim.tv_nsec' is a member of `struct stat'. */
|
||||
#define HAVE_STRUCT_STAT_ST_ATIM_TV_NSEC 1
|
||||
|
||||
/* Define to 1 if `st_uatime' is a member of `struct stat'. */
|
||||
/* #undef HAVE_STRUCT_STAT_ST_UATIME */
|
||||
|
||||
/* Define to 1 if you have the <sys/byteorder.h> header file. */
|
||||
/* #undef HAVE_SYS_BYTEORDER_H */
|
||||
|
||||
/* Define to 1 if you have the <sys/capsicum.h> header file. */
|
||||
/* #undef HAVE_SYS_CAPSICUM_H */
|
||||
|
||||
/* Define to 1 if you have the <sys/endian.h> header file. */
|
||||
/* #undef HAVE_SYS_ENDIAN_H */
|
||||
|
||||
/* Define to 1 if you have the <sys/param.h> header file. */
|
||||
#define HAVE_SYS_PARAM_H 1
|
||||
|
||||
/* Define to 1 if you have the <sys/stat.h> header file. */
|
||||
#define HAVE_SYS_STAT_H 1
|
||||
|
||||
/* Define to 1 if you have the <sys/time.h> header file. */
|
||||
/* #undef HAVE_SYS_TIME_H 1 */
|
||||
|
||||
/* Define to 1 if you have the <sys/types.h> header file. */
|
||||
#define HAVE_SYS_TYPES_H 1
|
||||
|
||||
/* Define to 1 if the system has the type `uintptr_t'. */
|
||||
#define HAVE_UINTPTR_T 1
|
||||
|
||||
/* Define to 1 if you have the <unistd.h> header file. */
|
||||
#define HAVE_UNISTD_H 1
|
||||
|
||||
/* Define to 1 if you have the `utime' function. */
|
||||
/* #undef HAVE_UTIME */
|
||||
|
||||
/* Define to 1 if you have the `utimes' function. */
|
||||
/* #undef HAVE_UTIMES */
|
||||
|
||||
/* Define to 1 or 0, depending whether the compiler supports simple visibility
|
||||
declarations. */
|
||||
#define HAVE_VISIBILITY 1
|
||||
|
||||
/* Define to 1 if you have the `wcwidth' function. */
|
||||
#define HAVE_WCWIDTH 1
|
||||
|
||||
/* Define to 1 if the system has the type `_Bool'. */
|
||||
#define HAVE__BOOL 1
|
||||
|
||||
/* Define to 1 if you have the `_futime' function. */
|
||||
/* #undef HAVE__FUTIME */
|
||||
|
||||
/* Define to 1 if _mm_movemask_epi8 is available. */
|
||||
#define HAVE__MM_MOVEMASK_EPI8 1
|
||||
|
||||
/* Define to the sub-directory where libtool stores uninstalled libraries. */
|
||||
#define LT_OBJDIR ".libs/"
|
||||
|
||||
#ifndef _WIN32
|
||||
/* Define to 1 when using POSIX threads (pthreads). */
|
||||
#define MYTHREAD_POSIX 1
|
||||
#else
|
||||
/* Define to 1 when using Windows Vista compatible threads. This uses features
|
||||
that are not available on Windows XP. */
|
||||
#define MYTHREAD_VISTA
|
||||
#endif
|
||||
|
||||
/* Define to 1 when using Windows 95 (and thus XP) compatible threads. This
|
||||
avoids use of features that were added in Windows Vista. */
|
||||
/* #undef MYTHREAD_WIN95 */
|
||||
|
||||
/* Define to 1 to disable debugging code. */
|
||||
#define NDEBUG 1
|
||||
|
||||
/* Name of package */
|
||||
#define PACKAGE "xz"
|
||||
|
||||
/* Define to the address where bug reports for this package should be sent. */
|
||||
#define PACKAGE_BUGREPORT "lasse.collin@tukaani.org"
|
||||
|
||||
/* Define to the full name of this package. */
|
||||
#define PACKAGE_NAME "XZ Utils"
|
||||
|
||||
/* Define to the full name and version of this package. */
|
||||
#define PACKAGE_STRING "XZ Utils 5.2.4"
|
||||
|
||||
/* Define to the one symbol short name of this package. */
|
||||
#define PACKAGE_TARNAME "xz"
|
||||
|
||||
/* Define to the home page for this package. */
|
||||
#define PACKAGE_URL "https://tukaani.org/xz/"
|
||||
|
||||
/* Define to the version of this package. */
|
||||
#define PACKAGE_VERSION "5.2.4"
|
||||
|
||||
/* Define to necessary symbol if this constant uses a non-standard name on
|
||||
your system. */
|
||||
/* #undef PTHREAD_CREATE_JOINABLE */
|
||||
|
||||
/* The size of `size_t', as computed by sizeof. */
|
||||
#define SIZEOF_SIZE_T 8
|
||||
|
||||
/* Define to 1 if you have the ANSI C header files. */
|
||||
#define STDC_HEADERS 1
|
||||
|
||||
/* Define to 1 if the number of available CPU cores can be detected with
|
||||
cpuset(2). */
|
||||
/* #undef TUKLIB_CPUCORES_CPUSET */
|
||||
|
||||
/* Define to 1 if the number of available CPU cores can be detected with
|
||||
pstat_getdynamic(). */
|
||||
/* #undef TUKLIB_CPUCORES_PSTAT_GETDYNAMIC */
|
||||
|
||||
/* Define to 1 if the number of available CPU cores can be detected with
|
||||
sched_getaffinity() */
|
||||
/* #undef TUKLIB_CPUCORES_SCHED_GETAFFINITY */
|
||||
|
||||
/* Define to 1 if the number of available CPU cores can be detected with
|
||||
sysconf(_SC_NPROCESSORS_ONLN) or sysconf(_SC_NPROC_ONLN). */
|
||||
/* #undef TUKLIB_CPUCORES_SYSCONF */
|
||||
|
||||
/* Define to 1 if the number of available CPU cores can be detected with
|
||||
sysctl(). */
|
||||
/* #undef TUKLIB_CPUCORES_SYSCTL */
|
||||
|
||||
#ifdef _M_X86
|
||||
/* Define to 1 if the system supports fast unaligned access to 16-bit and
|
||||
32-bit integers. */
|
||||
#define TUKLIB_FAST_UNALIGNED_ACCESS 1
|
||||
#endif
|
||||
|
||||
/* Define to 1 if the amount of physical memory can be detected with
|
||||
_system_configuration.physmem. */
|
||||
/* #undef TUKLIB_PHYSMEM_AIX */
|
||||
|
||||
/* Define to 1 if the amount of physical memory can be detected with
|
||||
getinvent_r(). */
|
||||
/* #undef TUKLIB_PHYSMEM_GETINVENT_R */
|
||||
|
||||
/* Define to 1 if the amount of physical memory can be detected with
|
||||
getsysinfo(). */
|
||||
/* #undef TUKLIB_PHYSMEM_GETSYSINFO */
|
||||
|
||||
/* Define to 1 if the amount of physical memory can be detected with
|
||||
pstat_getstatic(). */
|
||||
/* #undef TUKLIB_PHYSMEM_PSTAT_GETSTATIC */
|
||||
|
||||
/* Define to 1 if the amount of physical memory can be detected with
|
||||
sysconf(_SC_PAGESIZE) and sysconf(_SC_PHYS_PAGES). */
|
||||
#define TUKLIB_PHYSMEM_SYSCONF 1
|
||||
|
||||
/* Define to 1 if the amount of physical memory can be detected with sysctl().
|
||||
*/
|
||||
/* #undef TUKLIB_PHYSMEM_SYSCTL */
|
||||
|
||||
/* Define to 1 if the amount of physical memory can be detected with Linux
|
||||
sysinfo(). */
|
||||
/* #undef TUKLIB_PHYSMEM_SYSINFO */
|
||||
|
||||
/* Enable extensions on AIX 3, Interix. */
|
||||
#ifndef _ALL_SOURCE
|
||||
# define _ALL_SOURCE 1
|
||||
#endif
|
||||
/* Enable GNU extensions on systems that have them. */
|
||||
#ifndef _GNU_SOURCE
|
||||
# define _GNU_SOURCE 1
|
||||
#endif
|
||||
/* Enable threading extensions on Solaris. */
|
||||
#ifndef _POSIX_PTHREAD_SEMANTICS
|
||||
# define _POSIX_PTHREAD_SEMANTICS 1
|
||||
#endif
|
||||
/* Enable extensions on HP NonStop. */
|
||||
#ifndef _TANDEM_SOURCE
|
||||
# define _TANDEM_SOURCE 1
|
||||
#endif
|
||||
/* Enable general extensions on Solaris. */
|
||||
#ifndef __EXTENSIONS__
|
||||
# define __EXTENSIONS__ 1
|
||||
#endif
|
||||
|
||||
|
||||
/* Version number of package */
|
||||
#define VERSION "5.2.4"
|
||||
|
||||
/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most
|
||||
significant byte first (like Motorola and SPARC, unlike Intel). */
|
||||
#if defined AC_APPLE_UNIVERSAL_BUILD
|
||||
# if defined __BIG_ENDIAN__
|
||||
# define WORDS_BIGENDIAN 1
|
||||
# endif
|
||||
#else
|
||||
# ifndef WORDS_BIGENDIAN
|
||||
/* # undef WORDS_BIGENDIAN */
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/* Enable large inode numbers on Mac OS X 10.5. */
|
||||
#ifndef _DARWIN_USE_64_BIT_INODE
|
||||
# define _DARWIN_USE_64_BIT_INODE 1
|
||||
#endif
|
||||
|
||||
/* Number of bits in a file offset, on hosts where this is settable. */
|
||||
/* #undef _FILE_OFFSET_BITS */
|
||||
|
||||
/* Define for large files, on AIX-style hosts. */
|
||||
/* #undef _LARGE_FILES */
|
||||
|
||||
/* Define to 1 if on MINIX. */
|
||||
/* #undef _MINIX */
|
||||
|
||||
/* Define to 2 if the system does not provide POSIX.1 features except with
|
||||
this defined. */
|
||||
/* #undef _POSIX_1_SOURCE */
|
||||
|
||||
/* Define to 1 if you need to in order for `stat' and other things to work. */
|
||||
/* #undef _POSIX_SOURCE */
|
||||
|
||||
/* Define for Solaris 2.5.1 so the uint32_t typedef from <sys/synch.h>,
|
||||
<pthread.h>, or <semaphore.h> is not used. If the typedef were allowed, the
|
||||
#define below would cause a syntax error. */
|
||||
/* #undef _UINT32_T */
|
||||
|
||||
/* Define for Solaris 2.5.1 so the uint64_t typedef from <sys/synch.h>,
|
||||
<pthread.h>, or <semaphore.h> is not used. If the typedef were allowed, the
|
||||
#define below would cause a syntax error. */
|
||||
/* #undef _UINT64_T */
|
||||
|
||||
/* Define for Solaris 2.5.1 so the uint8_t typedef from <sys/synch.h>,
|
||||
<pthread.h>, or <semaphore.h> is not used. If the typedef were allowed, the
|
||||
#define below would cause a syntax error. */
|
||||
/* #undef _UINT8_T */
|
||||
|
||||
/* Define to rpl_ if the getopt replacement functions and variables should be
|
||||
used. */
|
||||
/* #undef __GETOPT_PREFIX */
|
||||
|
||||
/* Define to the type of a signed integer type of width exactly 32 bits if
|
||||
such a type exists and the standard includes do not define it. */
|
||||
/* #undef int32_t */
|
||||
|
||||
/* Define to the type of a signed integer type of width exactly 64 bits if
|
||||
such a type exists and the standard includes do not define it. */
|
||||
/* #undef int64_t */
|
||||
|
||||
/* Define to the type of an unsigned integer type of width exactly 16 bits if
|
||||
such a type exists and the standard includes do not define it. */
|
||||
/* #undef uint16_t */
|
||||
|
||||
/* Define to the type of an unsigned integer type of width exactly 32 bits if
|
||||
such a type exists and the standard includes do not define it. */
|
||||
/* #undef uint32_t */
|
||||
|
||||
/* Define to the type of an unsigned integer type of width exactly 64 bits if
|
||||
such a type exists and the standard includes do not define it. */
|
||||
/* #undef uint64_t */
|
||||
|
||||
/* Define to the type of an unsigned integer type of width exactly 8 bits if
|
||||
such a type exists and the standard includes do not define it. */
|
||||
/* #undef uint8_t */
|
||||
|
||||
/* Define to the type of an unsigned integer type wide enough to hold a
|
||||
pointer, if such a type exists, and if the system does not define it. */
|
||||
/* #undef uintptr_t */
|
||||
@@ -65,6 +65,7 @@ public:
|
||||
void volumeUp();
|
||||
void SetVolume(float value);
|
||||
void DisplayMessage(std::string message);
|
||||
float GetFrameInterval();
|
||||
|
||||
bool SaveState(std::string saveStateFile);
|
||||
bool LoadState(std::string saveStateFile);
|
||||
|
||||
+33
-73
@@ -84,8 +84,8 @@ static Common::Flag s_running{true};
|
||||
static Common::Flag s_shutdown_requested{false};
|
||||
static Common::Flag s_tried_graceful_shutdown{false};
|
||||
|
||||
static std::unique_ptr<Platform> s_platform;
|
||||
|
||||
WindowSystemInfo wsi(WindowSystemType::Headless, nullptr, nullptr, nullptr);
|
||||
|
||||
DolHost* DolHost::GetInstance()
|
||||
{
|
||||
if (DolHost::m_instance == nullptr)
|
||||
@@ -128,8 +128,8 @@ void DolHost::Init(std::string supportDirectoryPath, std::string cpath)
|
||||
SConfig::GetInstance().m_ShowFrameCount = false;
|
||||
|
||||
//Video
|
||||
SConfig::GetInstance().m_strVideoBackend = "OGL";
|
||||
VideoBackendBase::ActivateBackend(SConfig::GetInstance().m_strVideoBackend);
|
||||
// SConfig::GetInstance().m_strVideoBackend = "OGL";
|
||||
//VideoBackendBase::ActivateBackend(SConfig::GetInstance().m_strVideoBackend);
|
||||
|
||||
//Set the Sound
|
||||
SConfig::GetInstance().bDSPHLE = true;
|
||||
@@ -137,7 +137,7 @@ void DolHost::Init(std::string supportDirectoryPath, std::string cpath)
|
||||
SConfig::GetInstance().m_Volume = 0;
|
||||
|
||||
//Split CPU thread from GPU
|
||||
SConfig::GetInstance().bCPUThread = false;
|
||||
SConfig::GetInstance().bCPUThread = true;
|
||||
|
||||
//Analitics
|
||||
SConfig::GetInstance().m_analytics_permission_asked = true;
|
||||
@@ -149,7 +149,7 @@ void DolHost::Init(std::string supportDirectoryPath, std::string cpath)
|
||||
|
||||
|
||||
//Choose Wiimote Type
|
||||
_wiiMoteType = WIIMOTE_SRC_EMU; // WIIMOTE_SRC_EMU, WIIMOTE_SRC_HYBRID or WIIMOTE_SRC_REAL
|
||||
// _wiiMoteType = WIIMOTE_SRC_EMU; // WIIMOTE_SRC_EMU, WIIMOTE_SRC_HYBRID or WIIMOTE_SRC_REAL
|
||||
|
||||
//Get game info from file path
|
||||
GetGameInfo();
|
||||
@@ -192,18 +192,16 @@ void DolHost::Init(std::string supportDirectoryPath, std::string cpath)
|
||||
SConfig::GetInstance().m_WiimoteContinuousScanning = false;
|
||||
|
||||
//Set the Wiimote type
|
||||
WiimoteReal::ChangeWiimoteSource(0, _wiiMoteType);
|
||||
WiimoteReal::ChangeWiimoteSource(1, _wiiMoteType);
|
||||
WiimoteReal::ChangeWiimoteSource(2, _wiiMoteType);
|
||||
WiimoteReal::ChangeWiimoteSource(3, _wiiMoteType);
|
||||
// WiimoteReal::ChangeWiimoteSource(0, _wiiMoteType);
|
||||
// WiimoteReal::ChangeWiimoteSource(1, _wiiMoteType);
|
||||
// WiimoteReal::ChangeWiimoteSource(2, _wiiMoteType);
|
||||
// WiimoteReal::ChangeWiimoteSource(3, _wiiMoteType);
|
||||
}
|
||||
}
|
||||
|
||||
# pragma mark - Execution
|
||||
bool DolHost::LoadFileAtPath()
|
||||
{
|
||||
s_platform = Platform::CreateHeadlessPlatform();
|
||||
|
||||
Core::SetOnStateChangedCallback([](Core::State state) {
|
||||
if (state == Core::State::Uninitialized)
|
||||
s_running.Clear();
|
||||
@@ -215,9 +213,8 @@ bool DolHost::LoadFileAtPath()
|
||||
// WiiUtils::InstallWAD(_gamePath);
|
||||
// // else
|
||||
// // WiiUtils::DoDiscUpdate(nil, _gameRegionName);
|
||||
|
||||
|
||||
if (!BootManager::BootCore(BootParameters::GenerateFromFile(_gamePath), s_platform->GetWindowSystemInfo()))
|
||||
|
||||
if (!BootManager::BootCore(BootParameters::GenerateFromFile(_gamePath), wsi))
|
||||
return false;
|
||||
|
||||
// Initialize Input
|
||||
@@ -265,9 +262,9 @@ void DolHost::Reset()
|
||||
|
||||
void DolHost::UpdateFrame()
|
||||
{
|
||||
Core::HostDispatchJobs();
|
||||
//Core::HostDispatchJobs();
|
||||
|
||||
// Input::OpenEmu_Input_Update();
|
||||
//Input::OpenEmu_Input_Update();
|
||||
|
||||
if(_onBoot) _onBoot = false;
|
||||
}
|
||||
@@ -284,11 +281,6 @@ bool DolHost::CoreRunning()
|
||||
void DolHost::SetPresentationFBO(int RenderFBO)
|
||||
{
|
||||
g_Config.iRenderFBO = RenderFBO;
|
||||
g_Config.bCrop = false;
|
||||
g_Config.bWidescreenHack = false;
|
||||
g_Config.bHiresTextures = false;
|
||||
g_Config.bSSAA = false;
|
||||
g_Config.iEFBScale = 2;
|
||||
}
|
||||
|
||||
void DolHost::SetBackBufferSize(int width, int height) {
|
||||
@@ -324,13 +316,13 @@ bool DolHost::LoadState(std::string saveStateFile)
|
||||
{
|
||||
// We have to set the wiimote type, cause the gamesave may
|
||||
// have used a different type
|
||||
WiimoteReal::ChangeWiimoteSource(0 , _wiiMoteType);
|
||||
WiimoteReal::ChangeWiimoteSource(1 , _wiiMoteType);
|
||||
WiimoteReal::ChangeWiimoteSource(2 , _wiiMoteType);
|
||||
WiimoteReal::ChangeWiimoteSource(3 , _wiiMoteType);
|
||||
|
||||
if( _wiiMoteType != WIIMOTE_SRC_EMU)
|
||||
WiimoteReal::Refresh();
|
||||
// WiimoteReal::ChangeWiimoteSource(0 , _wiiMoteType);
|
||||
// WiimoteReal::ChangeWiimoteSource(1 , _wiiMoteType);
|
||||
// WiimoteReal::ChangeWiimoteSource(2 , _wiiMoteType);
|
||||
// WiimoteReal::ChangeWiimoteSource(3 , _wiiMoteType);
|
||||
//
|
||||
// if( _wiiMoteType != WIIMOTE_SRC_EMU)
|
||||
// WiimoteReal::Refresh();
|
||||
}
|
||||
return true;
|
||||
}
|
||||
@@ -483,28 +475,6 @@ void DolHost::setButtonState(int button, int state, int player)
|
||||
{
|
||||
// setWiiButton(player, button, state);
|
||||
}
|
||||
|
||||
// if (button == OEWiiChangeExtension)
|
||||
// {
|
||||
// //set the Extension change state and return. The next key pressed
|
||||
// // while the Change Extension key is held will determine the Extension added
|
||||
// _wiiChangeExtension[player] = state;
|
||||
// return;
|
||||
// }
|
||||
|
||||
// if ( _wiiChangeExtension[player] && state == 1)
|
||||
// {
|
||||
// if ( button <= OEWiiMoteSwingBackward ) {
|
||||
// changeWiimoteExtension(WiimoteEmu::EXT_NONE, player);
|
||||
// Core::DisplayMessage("Extenstion Removed", 1500);
|
||||
// } else if (button <= OEWiiNunchuckButtonZ ) {
|
||||
// changeWiimoteExtension(WiimoteEmu::EXT_NUNCHUK, player);
|
||||
// Core::DisplayMessage("Nunchuk Connected", 1500);
|
||||
// } else if (button <= OEWiiClassicButtonHome ) {
|
||||
// changeWiimoteExtension(WiimoteEmu::EXT_CLASSIC, player);
|
||||
// Core::DisplayMessage("Classic Controller Connected", 1500);
|
||||
// }
|
||||
// }
|
||||
}
|
||||
|
||||
void DolHost::SetAxis(int button, float value, int player)
|
||||
@@ -513,6 +483,11 @@ void DolHost::SetAxis(int button, float value, int player)
|
||||
|
||||
if (_gameType == DiscIO::Platform::GameCubeDisc) {
|
||||
setGameCubeAxis(player, button, value);
|
||||
if (button == OEGCButtonR || button == OEGCButtonL) {
|
||||
int digVal = 0;
|
||||
if (value == 1) digVal = 1;
|
||||
setGameCubeButton(player, button + 5, digVal);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -549,6 +524,11 @@ void DolHost::GetGameInfo()
|
||||
_gameType = pVolume->GetVolumeType();
|
||||
}
|
||||
|
||||
float DolHost::GetFrameInterval()
|
||||
{
|
||||
return DiscIO::IsNTSC(SConfig::GetInstance().m_region) ? (60.0f / 1.001f) : 50.0f;
|
||||
}
|
||||
|
||||
std::string DolHost::GetNameOfRegion(DiscIO::Region region)
|
||||
{
|
||||
switch (region)
|
||||
@@ -603,33 +583,13 @@ std::string DolHost::GetDirOfCountry(DiscIO::Country country)
|
||||
|
||||
WindowSystemInfo DolHost::GetWSI()
|
||||
{
|
||||
return s_platform->GetWindowSystemInfo();
|
||||
return wsi;
|
||||
}
|
||||
|
||||
# pragma mark - Dolphin Host callbacks
|
||||
void Host_NotifyMapLoaded() {}
|
||||
void Host_RefreshDSPDebuggerWindow() {}
|
||||
void Host_Message(HostMessageID id) {
|
||||
if ( id == HostMessageID::WMUserCreate ) {
|
||||
#ifdef DEBUG
|
||||
//We have to set FPS display here or it doesn't work
|
||||
g_Config.bShowFPS = true;
|
||||
Core::SetState(Core::State::Running);
|
||||
#endif
|
||||
|
||||
// Set the aspect to stretch
|
||||
g_Config.aspect_mode = AspectMode::Stretch;
|
||||
|
||||
// Core is up, lets enable Hybric Ubershaders
|
||||
g_Config.iShaderCompilationMode = ShaderCompilationMode::AsynchronousUberShaders;
|
||||
g_Config.bWaitForShadersBeforeStarting = false;
|
||||
|
||||
//Set the threads to auto (-1)
|
||||
g_Config.iShaderCompilerThreads = -1;
|
||||
g_Config.iShaderPrecompilerThreads = -1;
|
||||
|
||||
}
|
||||
}
|
||||
void Host_Message(HostMessageID id) {}
|
||||
void* Host_GetRenderHandle() { return (void *)-1; }
|
||||
void Host_UpdateTitle(const std::string&) {}
|
||||
void Host_UpdateDisasmDialog() {}
|
||||
|
||||
+3
-3
@@ -99,7 +99,6 @@ extern std::unique_ptr<SoundStream> g_sound_stream;
|
||||
{
|
||||
_dolphinCoreModule = @"gc";
|
||||
_isWii = false;
|
||||
_frameInterval = 60;
|
||||
_dolphinCoreAspect = OEIntSizeMake(4, 3);
|
||||
_dolphinCoreScreen = OEIntSizeMake(640, 480);
|
||||
}
|
||||
@@ -107,7 +106,6 @@ extern std::unique_ptr<SoundStream> g_sound_stream;
|
||||
{
|
||||
_dolphinCoreModule = @"Wii";
|
||||
_isWii = true;
|
||||
_frameInterval = 60;
|
||||
_dolphinCoreAspect = OEIntSizeMake(16,9);
|
||||
_dolphinCoreScreen = OEIntSizeMake(854, 480);
|
||||
}
|
||||
@@ -144,7 +142,9 @@ extern std::unique_ptr<SoundStream> g_sound_stream;
|
||||
|
||||
if(dol_host->LoadFileAtPath())
|
||||
_isInitialized = true;
|
||||
|
||||
|
||||
_frameInterval = dol_host->GetFrameInterval();
|
||||
|
||||
}
|
||||
[super startEmulation];
|
||||
|
||||
|
||||
+2
-2
@@ -9,7 +9,7 @@
|
||||
<key>CFBundleIconFile</key>
|
||||
<string></string>
|
||||
<key>CFBundleIdentifier</key>
|
||||
<string>org.openemu.${PRODUCT_NAME:identifier}</string>
|
||||
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
|
||||
<key>CFBundleInfoDictionaryVersion</key>
|
||||
<string>6.0</string>
|
||||
<key>CFBundleName</key>
|
||||
@@ -19,7 +19,7 @@
|
||||
<key>CFBundleSignature</key>
|
||||
<string>????</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>5.0.1</string>
|
||||
<string>5.0.4</string>
|
||||
<key>NSPrincipalClass</key>
|
||||
<string>OEGameCoreController</string>
|
||||
<key>OEGameCoreClass</key>
|
||||
|
||||
+1
-1
Submodule dolphin updated: bac8c060b5...225592a106
+1829
-109
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user