2014-02-03 13:02:17 +00:00
|
|
|
// Copyright 2015 Dolphin Emulator Project
|
2021-07-05 01:22:19 +00:00
|
|
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
2014-02-03 13:02:17 +00:00
|
|
|
|
|
|
|
// Null Backend Documentation
|
|
|
|
|
|
|
|
// This backend tries not to do anything in the backend,
|
|
|
|
// but everything in VideoCommon.
|
|
|
|
|
2020-09-15 12:24:28 +00:00
|
|
|
#include "VideoBackends/Null/NullRender.h"
|
|
|
|
#include "VideoBackends/Null/NullVertexManager.h"
|
2014-02-03 13:02:17 +00:00
|
|
|
#include "VideoBackends/Null/PerfQuery.h"
|
|
|
|
#include "VideoBackends/Null/TextureCache.h"
|
|
|
|
#include "VideoBackends/Null/VideoBackend.h"
|
|
|
|
|
2019-07-27 19:50:41 +00:00
|
|
|
#include "Common/Common.h"
|
2019-02-15 01:59:50 +00:00
|
|
|
#include "Common/MsgHandler.h"
|
|
|
|
|
|
|
|
#include "VideoCommon/FramebufferManager.h"
|
2014-02-03 13:02:17 +00:00
|
|
|
#include "VideoCommon/VideoBackendBase.h"
|
2016-07-21 23:04:57 +00:00
|
|
|
#include "VideoCommon/VideoCommon.h"
|
2014-02-03 13:02:17 +00:00
|
|
|
#include "VideoCommon/VideoConfig.h"
|
|
|
|
|
|
|
|
namespace Null
|
|
|
|
{
|
2016-01-13 20:38:11 +00:00
|
|
|
void VideoBackend::InitBackendInfo()
|
2014-02-03 13:02:17 +00:00
|
|
|
{
|
2016-07-21 23:04:57 +00:00
|
|
|
g_Config.backend_info.api_type = APIType::Nothing;
|
2017-03-09 14:01:23 +00:00
|
|
|
g_Config.backend_info.MaxTextureSize = 16384;
|
2014-02-03 13:02:17 +00:00
|
|
|
g_Config.backend_info.bSupportsExclusiveFullscreen = true;
|
|
|
|
g_Config.backend_info.bSupportsDualSourceBlend = true;
|
|
|
|
g_Config.backend_info.bSupportsPrimitiveRestart = true;
|
|
|
|
g_Config.backend_info.bSupportsOversizedViewports = true;
|
|
|
|
g_Config.backend_info.bSupportsGeometryShaders = true;
|
2016-11-27 08:14:55 +00:00
|
|
|
g_Config.backend_info.bSupportsComputeShaders = false;
|
2014-02-03 13:02:17 +00:00
|
|
|
g_Config.backend_info.bSupports3DVision = false;
|
2016-09-30 13:59:40 +00:00
|
|
|
g_Config.backend_info.bSupportsEarlyZ = true;
|
|
|
|
g_Config.backend_info.bSupportsBindingLayout = true;
|
|
|
|
g_Config.backend_info.bSupportsBBox = true;
|
|
|
|
g_Config.backend_info.bSupportsGSInstancing = true;
|
2014-02-03 13:02:17 +00:00
|
|
|
g_Config.backend_info.bSupportsPostProcessing = false;
|
|
|
|
g_Config.backend_info.bSupportsPaletteConversion = true;
|
|
|
|
g_Config.backend_info.bSupportsClipControl = true;
|
2016-09-30 13:59:40 +00:00
|
|
|
g_Config.backend_info.bSupportsSSAA = true;
|
|
|
|
g_Config.backend_info.bSupportsDepthClamp = true;
|
|
|
|
g_Config.backend_info.bSupportsReversedDepthRange = true;
|
2016-08-13 12:08:46 +00:00
|
|
|
g_Config.backend_info.bSupportsMultithreading = false;
|
2016-11-27 08:14:57 +00:00
|
|
|
g_Config.backend_info.bSupportsGPUTextureDecoding = false;
|
2017-04-16 09:45:22 +00:00
|
|
|
g_Config.backend_info.bSupportsST3CTextures = false;
|
2017-07-27 12:00:04 +00:00
|
|
|
g_Config.backend_info.bSupportsBPTCTextures = false;
|
2017-10-26 05:44:39 +00:00
|
|
|
g_Config.backend_info.bSupportsFramebufferFetch = false;
|
2018-02-25 07:56:09 +00:00
|
|
|
g_Config.backend_info.bSupportsBackgroundCompiling = false;
|
2018-05-25 14:04:18 +00:00
|
|
|
g_Config.backend_info.bSupportsLogicOp = false;
|
2019-03-02 05:03:49 +00:00
|
|
|
g_Config.backend_info.bSupportsLargePoints = false;
|
2020-05-24 06:11:10 +00:00
|
|
|
g_Config.backend_info.bSupportsDepthReadback = false;
|
2019-03-02 05:03:49 +00:00
|
|
|
g_Config.backend_info.bSupportsPartialDepthCopies = false;
|
2019-04-15 11:55:26 +00:00
|
|
|
g_Config.backend_info.bSupportsShaderBinaries = false;
|
|
|
|
g_Config.backend_info.bSupportsPipelineCacheData = false;
|
2021-11-14 04:10:20 +00:00
|
|
|
g_Config.backend_info.bSupportsCoarseDerivatives = false;
|
2014-02-03 13:02:17 +00:00
|
|
|
|
|
|
|
// aamodes: We only support 1 sample, so no MSAA
|
2016-09-30 13:59:40 +00:00
|
|
|
g_Config.backend_info.Adapters.clear();
|
2014-02-03 13:02:17 +00:00
|
|
|
g_Config.backend_info.AAModes = {1};
|
|
|
|
}
|
|
|
|
|
2018-10-03 13:03:22 +00:00
|
|
|
bool VideoBackend::Initialize(const WindowSystemInfo& wsi)
|
2014-02-03 13:02:17 +00:00
|
|
|
{
|
|
|
|
InitializeShared();
|
|
|
|
|
|
|
|
g_renderer = std::make_unique<Renderer>();
|
|
|
|
g_vertex_manager = std::make_unique<VertexManager>();
|
|
|
|
g_perf_query = std::make_unique<PerfQuery>();
|
2019-02-15 01:59:50 +00:00
|
|
|
g_framebuffer_manager = std::make_unique<FramebufferManager>();
|
2014-02-03 13:02:17 +00:00
|
|
|
g_texture_cache = std::make_unique<TextureCache>();
|
2018-02-24 15:15:35 +00:00
|
|
|
g_shader_cache = std::make_unique<VideoCommon::ShaderCache>();
|
2019-02-15 01:59:50 +00:00
|
|
|
|
|
|
|
if (!g_vertex_manager->Initialize() || !g_shader_cache->Initialize() ||
|
|
|
|
!g_renderer->Initialize() || !g_framebuffer_manager->Initialize() ||
|
|
|
|
!g_texture_cache->Initialize())
|
|
|
|
{
|
2020-12-02 18:17:27 +00:00
|
|
|
PanicAlertFmt("Failed to initialize renderer classes");
|
2019-02-15 01:59:50 +00:00
|
|
|
Shutdown();
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
g_shader_cache->InitializeShaderCache();
|
|
|
|
return true;
|
2014-02-03 13:02:17 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void VideoBackend::Shutdown()
|
|
|
|
{
|
2018-02-24 15:15:35 +00:00
|
|
|
g_shader_cache->Shutdown();
|
2018-01-26 05:09:07 +00:00
|
|
|
g_renderer->Shutdown();
|
2014-02-03 13:02:17 +00:00
|
|
|
|
|
|
|
g_texture_cache.reset();
|
|
|
|
g_perf_query.reset();
|
|
|
|
g_vertex_manager.reset();
|
|
|
|
g_framebuffer_manager.reset();
|
|
|
|
g_renderer.reset();
|
2018-01-26 05:09:07 +00:00
|
|
|
|
|
|
|
ShutdownShared();
|
2014-02-03 13:02:17 +00:00
|
|
|
}
|
2019-07-27 19:50:41 +00:00
|
|
|
|
|
|
|
std::string VideoBackend::GetDisplayName() const
|
|
|
|
{
|
|
|
|
// i18n: Null is referring to the null video backend, which renders nothing
|
|
|
|
return _trans("Null");
|
|
|
|
}
|
2018-10-03 13:03:13 +00:00
|
|
|
} // namespace Null
|