Skip to content

Commit

Permalink
Move most backend functionality to VideoCommon
Browse files Browse the repository at this point in the history
  • Loading branch information
stenzek committed Feb 14, 2019
1 parent f578059 commit 1c56082
Show file tree
Hide file tree
Showing 181 changed files with 7,971 additions and 15,431 deletions.
3 changes: 3 additions & 0 deletions Source/Core/Common/GL/GLUtil.h
Expand Up @@ -10,6 +10,9 @@

class GLContext;

// Texture which we use to not disturb the other bindings.
constexpr GLenum GL_MUTABLE_TEXTURE_INDEX = GL_TEXTURE10;

namespace GLUtil
{
GLuint CompileProgram(const std::string& vertexShader, const std::string& fragmentShader);
Expand Down
2 changes: 0 additions & 2 deletions Source/Core/Core/Config/GraphicsSettings.cpp
Expand Up @@ -137,8 +137,6 @@ const ConfigInfo<int> GFX_STEREO_DEPTH_PERCENTAGE{

const ConfigInfo<bool> GFX_HACK_EFB_ACCESS_ENABLE{{System::GFX, "Hacks", "EFBAccessEnable"}, true};
const ConfigInfo<bool> GFX_HACK_BBOX_ENABLE{{System::GFX, "Hacks", "BBoxEnable"}, false};
const ConfigInfo<bool> GFX_HACK_BBOX_PREFER_STENCIL_IMPLEMENTATION{
{System::GFX, "Hacks", "BBoxPreferStencilImplementation"}, false};
const ConfigInfo<bool> GFX_HACK_FORCE_PROGRESSIVE{{System::GFX, "Hacks", "ForceProgressive"}, true};
const ConfigInfo<bool> GFX_HACK_SKIP_EFB_COPY_TO_RAM{{System::GFX, "Hacks", "EFBToTextureEnable"},
true};
Expand Down
1 change: 0 additions & 1 deletion Source/Core/Core/Config/GraphicsSettings.h
Expand Up @@ -102,7 +102,6 @@ extern const ConfigInfo<int> GFX_STEREO_DEPTH_PERCENTAGE;

extern const ConfigInfo<bool> GFX_HACK_EFB_ACCESS_ENABLE;
extern const ConfigInfo<bool> GFX_HACK_BBOX_ENABLE;
extern const ConfigInfo<bool> GFX_HACK_BBOX_PREFER_STENCIL_IMPLEMENTATION;
extern const ConfigInfo<bool> GFX_HACK_FORCE_PROGRESSIVE;
extern const ConfigInfo<bool> GFX_HACK_SKIP_EFB_COPY_TO_RAM;
extern const ConfigInfo<bool> GFX_HACK_SKIP_XFB_COPY_TO_RAM;
Expand Down
1 change: 0 additions & 1 deletion Source/Core/Core/ConfigLoaders/IsSettingSaveable.cpp
Expand Up @@ -114,7 +114,6 @@ bool IsSettingSaveable(const Config::ConfigLocation& config_location)

Config::GFX_HACK_EFB_ACCESS_ENABLE.location,
Config::GFX_HACK_BBOX_ENABLE.location,
Config::GFX_HACK_BBOX_PREFER_STENCIL_IMPLEMENTATION.location,
Config::GFX_HACK_FORCE_PROGRESSIVE.location,
Config::GFX_HACK_SKIP_EFB_COPY_TO_RAM.location,
Config::GFX_HACK_SKIP_XFB_COPY_TO_RAM.location,
Expand Down
11 changes: 5 additions & 6 deletions Source/Core/DolphinQt/Config/Graphics/EnhancementsWidget.cpp
Expand Up @@ -152,10 +152,9 @@ void EnhancementsWidget::ConnectWidgets()
void EnhancementsWidget::LoadPPShaders()
{
const bool anaglyph = g_Config.stereo_mode == StereoMode::Anaglyph;
std::vector<std::string> shaders =
anaglyph ? PostProcessingShaderImplementation::GetAnaglyphShaderList(
g_Config.backend_info.api_type) :
PostProcessingShaderImplementation::GetShaderList(g_Config.backend_info.api_type);
std::vector<std::string> shaders = anaglyph ?
VideoCommon::PostProcessing::GetAnaglyphShaderList() :
VideoCommon::PostProcessing::GetShaderList();

m_pp_effect->clear();

Expand Down Expand Up @@ -187,7 +186,7 @@ void EnhancementsWidget::LoadPPShaders()
tr("%1 doesn't support this feature.")
.arg(tr(g_video_backend->GetDisplayName().c_str())));

PostProcessingShaderConfiguration pp_shader;
VideoCommon::PostProcessingConfiguration pp_shader;
if (selected_shader != "(off)" && supports_postprocessing)
{
pp_shader.LoadShader(selected_shader);
Expand Down Expand Up @@ -266,7 +265,7 @@ void EnhancementsWidget::SaveSettings()
"(off)" :
m_pp_effect->currentText().toStdString());

PostProcessingShaderConfiguration pp_shader;
VideoCommon::PostProcessingConfiguration pp_shader;
if (Config::Get(Config::GFX_ENHANCE_POST_SHADER) != "(off)")
{
pp_shader.LoadShader(Config::Get(Config::GFX_ENHANCE_POST_SHADER));
Expand Down
Expand Up @@ -25,7 +25,7 @@
#include "VideoCommon/RenderBase.h"
#include "VideoCommon/VideoConfig.h"

using ConfigurationOption = PostProcessingShaderConfiguration::ConfigurationOption;
using ConfigurationOption = VideoCommon::PostProcessingConfiguration::ConfigurationOption;
using OptionType = ConfigurationOption::OptionType;

PostProcessingConfigWindow::PostProcessingConfigWindow(EnhancementsWidget* parent,
Expand All @@ -38,7 +38,7 @@ PostProcessingConfigWindow::PostProcessingConfigWindow(EnhancementsWidget* paren
}
else
{
m_post_processor = new PostProcessingShaderConfiguration();
m_post_processor = new VideoCommon::PostProcessingConfiguration();
m_post_processor->LoadShader(m_shader);
}

Expand All @@ -61,7 +61,8 @@ PostProcessingConfigWindow::~PostProcessingConfigWindow()

void PostProcessingConfigWindow::PopulateGroups()
{
const PostProcessingShaderConfiguration::ConfigMap& config_map = m_post_processor->GetOptions();
const VideoCommon::PostProcessingConfiguration::ConfigMap& config_map =
m_post_processor->GetOptions();

auto config_groups = std::vector<std::unique_ptr<ConfigGroup>>();
for (const auto& it : config_map)
Expand Down
Expand Up @@ -35,7 +35,7 @@ class PostProcessingConfigWindow final : public QDialog
{
public:
explicit ConfigGroup(
const PostProcessingShaderConfiguration::ConfigurationOption* config_option);
const VideoCommon::PostProcessingConfiguration::ConfigurationOption* config_option);

const std::string& GetGUIName() const noexcept;
const std::string& GetParent() const noexcept;
Expand All @@ -57,7 +57,7 @@ class PostProcessingConfigWindow final : public QDialog
std::vector<QSlider*> m_sliders;
std::vector<QLineEdit*> m_value_boxes;

const PostProcessingShaderConfiguration::ConfigurationOption* m_config_option;
const VideoCommon::PostProcessingConfiguration::ConfigurationOption* m_config_option;
std::vector<std::unique_ptr<ConfigGroup>> m_subgroups;
};
void Create();
Expand All @@ -72,7 +72,7 @@ class PostProcessingConfigWindow final : public QDialog
QDialogButtonBox* m_buttons;

const std::string& m_shader;
PostProcessingShaderConfiguration* m_post_processor;
VideoCommon::PostProcessingConfiguration* m_post_processor;
std::unordered_map<std::string, ConfigGroup*> m_config_map;
std::vector<std::unique_ptr<ConfigGroup>> m_config_groups;
};
5 changes: 4 additions & 1 deletion Source/Core/VideoBackends/D3D/BoundingBox.cpp
Expand Up @@ -5,6 +5,7 @@
#include "VideoBackends/D3D/BoundingBox.h"
#include "Common/CommonTypes.h"
#include "Common/MsgHandler.h"
#include "VideoBackends/D3D/D3DState.h"
#include "VideoCommon/VideoConfig.h"

namespace DX11
Expand Down Expand Up @@ -54,6 +55,8 @@ void BBox::Init()
hr = D3D::device->CreateUnorderedAccessView(s_bbox_buffer, &UAVdesc, &s_bbox_uav);
CHECK(SUCCEEDED(hr), "Create BoundingBox UAV.");
D3D::SetDebugObjectName(s_bbox_uav, "BoundingBox UAV");

D3D::stateman->SetOMUAV(s_bbox_uav);
}
}

Expand Down Expand Up @@ -83,4 +86,4 @@ int BBox::Get(int index)
D3D::context->Unmap(s_bbox_staging_buffer, 0);
return data;
}
};
}; // namespace DX11
20 changes: 0 additions & 20 deletions Source/Core/VideoBackends/D3D/CMakeLists.txt
Expand Up @@ -3,42 +3,22 @@ add_library(videod3d
BoundingBox.h
D3DBase.cpp
D3DBase.h
D3DBlob.cpp
D3DBlob.h
D3DShader.cpp
D3DShader.h
D3DState.cpp
D3DState.h
D3DTexture.cpp
D3DTexture.h
D3DUtil.cpp
D3DUtil.h
DXPipeline.cpp
DXPipeline.h
DXShader.cpp
DXShader.h
DXTexture.cpp
DXTexture.h
FramebufferManager.cpp
FramebufferManager.h
GeometryShaderCache.cpp
GeometryShaderCache.h
main.cpp
NativeVertexFormat.cpp
PerfQuery.cpp
PerfQuery.h
PixelShaderCache.cpp
PixelShaderCache.h
PSTextureEncoder.cpp
PSTextureEncoder.h
Render.cpp
Render.h
TextureCache.cpp
TextureCache.h
VertexManager.cpp
VertexManager.h
VertexShaderCache.cpp
VertexShaderCache.h
VideoBackend.h
)

Expand Down
20 changes: 0 additions & 20 deletions Source/Core/VideoBackends/D3D/D3D.vcxproj
Expand Up @@ -38,46 +38,26 @@
<ItemGroup>
<ClCompile Include="BoundingBox.cpp" />
<ClCompile Include="D3DBase.cpp" />
<ClCompile Include="D3DBlob.cpp" />
<ClCompile Include="D3DShader.cpp" />
<ClCompile Include="D3DState.cpp" />
<ClCompile Include="D3DTexture.cpp" />
<ClCompile Include="D3DUtil.cpp" />
<ClCompile Include="DXPipeline.cpp" />
<ClCompile Include="DXShader.cpp" />
<ClCompile Include="DXTexture.cpp" />
<ClCompile Include="FramebufferManager.cpp" />
<ClCompile Include="GeometryShaderCache.cpp" />
<ClCompile Include="main.cpp" />
<ClCompile Include="NativeVertexFormat.cpp" />
<ClCompile Include="PerfQuery.cpp" />
<ClCompile Include="PixelShaderCache.cpp" />
<ClCompile Include="PSTextureEncoder.cpp" />
<ClCompile Include="Render.cpp" />
<ClCompile Include="TextureCache.cpp" />
<ClCompile Include="VertexManager.cpp" />
<ClCompile Include="VertexShaderCache.cpp" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="BoundingBox.h" />
<ClInclude Include="D3DBase.h" />
<ClInclude Include="D3DBlob.h" />
<ClInclude Include="D3DShader.h" />
<ClInclude Include="D3DState.h" />
<ClInclude Include="D3DTexture.h" />
<ClInclude Include="D3DUtil.h" />
<ClInclude Include="DXPipeline.h" />
<ClInclude Include="DXShader.h" />
<ClInclude Include="DXTexture.h" />
<ClInclude Include="FramebufferManager.h" />
<ClInclude Include="GeometryShaderCache.h" />
<ClInclude Include="PerfQuery.h" />
<ClInclude Include="PixelShaderCache.h" />
<ClInclude Include="PSTextureEncoder.h" />
<ClInclude Include="Render.h" />
<ClInclude Include="TextureCache.h" />
<ClInclude Include="VertexManager.h" />
<ClInclude Include="VertexShaderCache.h" />
<ClInclude Include="VideoBackend.h" />
</ItemGroup>
<ItemGroup>
Expand Down
60 changes: 0 additions & 60 deletions Source/Core/VideoBackends/D3D/D3D.vcxproj.filters
Expand Up @@ -12,51 +12,21 @@
<ClCompile Include="D3DBase.cpp">
<Filter>D3D</Filter>
</ClCompile>
<ClCompile Include="D3DBlob.cpp">
<Filter>D3D</Filter>
</ClCompile>
<ClCompile Include="D3DShader.cpp">
<Filter>D3D</Filter>
</ClCompile>
<ClCompile Include="D3DTexture.cpp">
<Filter>D3D</Filter>
</ClCompile>
<ClCompile Include="D3DUtil.cpp">
<Filter>D3D</Filter>
</ClCompile>
<ClCompile Include="D3DState.cpp">
<Filter>D3D</Filter>
</ClCompile>
<ClCompile Include="FramebufferManager.cpp">
<Filter>Render</Filter>
</ClCompile>
<ClCompile Include="GeometryShaderCache.cpp">
<Filter>Render</Filter>
</ClCompile>
<ClCompile Include="NativeVertexFormat.cpp">
<Filter>Render</Filter>
</ClCompile>
<ClCompile Include="PerfQuery.cpp">
<Filter>Render</Filter>
</ClCompile>
<ClCompile Include="PixelShaderCache.cpp">
<Filter>Render</Filter>
</ClCompile>
<ClCompile Include="PSTextureEncoder.cpp">
<Filter>Render</Filter>
</ClCompile>
<ClCompile Include="Render.cpp">
<Filter>Render</Filter>
</ClCompile>
<ClCompile Include="TextureCache.cpp">
<Filter>Render</Filter>
</ClCompile>
<ClCompile Include="VertexManager.cpp">
<Filter>Render</Filter>
</ClCompile>
<ClCompile Include="VertexShaderCache.cpp">
<Filter>Render</Filter>
</ClCompile>
<ClCompile Include="main.cpp" />
<ClCompile Include="BoundingBox.cpp">
<Filter>Render</Filter>
Expand All @@ -75,48 +45,18 @@
<ClInclude Include="D3DBase.h">
<Filter>D3D</Filter>
</ClInclude>
<ClInclude Include="D3DBlob.h">
<Filter>D3D</Filter>
</ClInclude>
<ClInclude Include="D3DShader.h">
<Filter>D3D</Filter>
</ClInclude>
<ClInclude Include="D3DTexture.h">
<Filter>D3D</Filter>
</ClInclude>
<ClInclude Include="D3DUtil.h">
<Filter>D3D</Filter>
</ClInclude>
<ClInclude Include="D3DState.h">
<Filter>D3D</Filter>
</ClInclude>
<ClInclude Include="FramebufferManager.h">
<Filter>Render</Filter>
</ClInclude>
<ClInclude Include="GeometryShaderCache.h">
<Filter>Render</Filter>
</ClInclude>
<ClInclude Include="PerfQuery.h">
<Filter>Render</Filter>
</ClInclude>
<ClInclude Include="PixelShaderCache.h">
<Filter>Render</Filter>
</ClInclude>
<ClInclude Include="PSTextureEncoder.h">
<Filter>Render</Filter>
</ClInclude>
<ClInclude Include="Render.h">
<Filter>Render</Filter>
</ClInclude>
<ClInclude Include="TextureCache.h">
<Filter>Render</Filter>
</ClInclude>
<ClInclude Include="VertexManager.h">
<Filter>Render</Filter>
</ClInclude>
<ClInclude Include="VertexShaderCache.h">
<Filter>Render</Filter>
</ClInclude>
<ClInclude Include="VideoBackend.h" />
<ClInclude Include="BoundingBox.h">
<Filter>Render</Filter>
Expand Down

0 comments on commit 1c56082

Please sign in to comment.