NullBackend.cpp 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. // Copyright 2015 Dolphin Emulator Project
  2. // SPDX-License-Identifier: GPL-2.0-or-later
  3. // Null Backend Documentation
  4. // This backend tries not to do anything in the backend,
  5. // but everything in VideoCommon.
  6. #include "VideoBackends/Null/VideoBackend.h"
  7. #include "Common/Common.h"
  8. #include "Common/MsgHandler.h"
  9. #include "VideoBackends/Null/NullBoundingBox.h"
  10. #include "VideoBackends/Null/NullGfx.h"
  11. #include "VideoBackends/Null/NullVertexManager.h"
  12. #include "VideoBackends/Null/PerfQuery.h"
  13. #include "VideoBackends/Null/TextureCache.h"
  14. #include "VideoCommon/FramebufferManager.h"
  15. #include "VideoCommon/Present.h"
  16. #include "VideoCommon/VideoBackendBase.h"
  17. #include "VideoCommon/VideoCommon.h"
  18. #include "VideoCommon/VideoConfig.h"
  19. namespace Null
  20. {
  21. void VideoBackend::InitBackendInfo(const WindowSystemInfo& wsi)
  22. {
  23. g_Config.backend_info.api_type = APIType::Nothing;
  24. g_Config.backend_info.MaxTextureSize = 16384;
  25. g_Config.backend_info.bSupportsExclusiveFullscreen = true;
  26. g_Config.backend_info.bSupportsDualSourceBlend = true;
  27. g_Config.backend_info.bSupportsPrimitiveRestart = true;
  28. g_Config.backend_info.bSupportsGeometryShaders = true;
  29. g_Config.backend_info.bSupportsComputeShaders = false;
  30. g_Config.backend_info.bSupports3DVision = false;
  31. g_Config.backend_info.bSupportsEarlyZ = true;
  32. g_Config.backend_info.bSupportsBindingLayout = true;
  33. g_Config.backend_info.bSupportsBBox = true;
  34. g_Config.backend_info.bSupportsGSInstancing = true;
  35. g_Config.backend_info.bSupportsPostProcessing = false;
  36. g_Config.backend_info.bSupportsPaletteConversion = true;
  37. g_Config.backend_info.bSupportsClipControl = true;
  38. g_Config.backend_info.bSupportsSSAA = true;
  39. g_Config.backend_info.bSupportsDepthClamp = true;
  40. g_Config.backend_info.bSupportsReversedDepthRange = true;
  41. g_Config.backend_info.bSupportsMultithreading = false;
  42. g_Config.backend_info.bSupportsGPUTextureDecoding = false;
  43. g_Config.backend_info.bSupportsST3CTextures = false;
  44. g_Config.backend_info.bSupportsBPTCTextures = false;
  45. g_Config.backend_info.bSupportsFramebufferFetch = false;
  46. g_Config.backend_info.bSupportsBackgroundCompiling = false;
  47. g_Config.backend_info.bSupportsLogicOp = false;
  48. g_Config.backend_info.bSupportsLargePoints = false;
  49. g_Config.backend_info.bSupportsDepthReadback = false;
  50. g_Config.backend_info.bSupportsPartialDepthCopies = false;
  51. g_Config.backend_info.bSupportsShaderBinaries = false;
  52. g_Config.backend_info.bSupportsPipelineCacheData = false;
  53. g_Config.backend_info.bSupportsCoarseDerivatives = false;
  54. g_Config.backend_info.bSupportsTextureQueryLevels = false;
  55. g_Config.backend_info.bSupportsLodBiasInSampler = false;
  56. g_Config.backend_info.bSupportsSettingObjectNames = false;
  57. g_Config.backend_info.bSupportsPartialMultisampleResolve = true;
  58. g_Config.backend_info.bSupportsDynamicVertexLoader = false;
  59. // aamodes: We only support 1 sample, so no MSAA
  60. g_Config.backend_info.Adapters.clear();
  61. g_Config.backend_info.AAModes = {1};
  62. }
  63. bool VideoBackend::Initialize(const WindowSystemInfo& wsi)
  64. {
  65. return InitializeShared(std::make_unique<NullGfx>(), std::make_unique<VertexManager>(),
  66. std::make_unique<PerfQuery>(), std::make_unique<NullBoundingBox>(),
  67. std::make_unique<NullRenderer>(), std::make_unique<TextureCache>());
  68. }
  69. void VideoBackend::Shutdown()
  70. {
  71. ShutdownShared();
  72. }
  73. std::string VideoBackend::GetDisplayName() const
  74. {
  75. // i18n: Null is referring to the null video backend, which renders nothing
  76. return _trans("Null");
  77. }
  78. } // namespace Null