NullBackend.cpp 3.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  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 "VideoBackends/Null/NullBoundingBox.h"
  9. #include "VideoBackends/Null/NullGfx.h"
  10. #include "VideoBackends/Null/NullVertexManager.h"
  11. #include "VideoBackends/Null/PerfQuery.h"
  12. #include "VideoBackends/Null/TextureCache.h"
  13. #include "VideoCommon/VideoCommon.h"
  14. #include "VideoCommon/VideoConfig.h"
  15. namespace Null
  16. {
  17. void VideoBackend::InitBackendInfo(const WindowSystemInfo& wsi)
  18. {
  19. g_backend_info.api_type = APIType::Nothing;
  20. g_backend_info.MaxTextureSize = 16384;
  21. g_backend_info.bSupportsExclusiveFullscreen = true;
  22. g_backend_info.bSupportsDualSourceBlend = true;
  23. g_backend_info.bSupportsPrimitiveRestart = true;
  24. g_backend_info.bSupportsGeometryShaders = true;
  25. g_backend_info.bSupportsComputeShaders = false;
  26. g_backend_info.bSupports3DVision = false;
  27. g_backend_info.bSupportsEarlyZ = true;
  28. g_backend_info.bSupportsBindingLayout = true;
  29. g_backend_info.bSupportsBBox = true;
  30. g_backend_info.bSupportsGSInstancing = true;
  31. g_backend_info.bSupportsPostProcessing = false;
  32. g_backend_info.bSupportsPaletteConversion = true;
  33. g_backend_info.bSupportsClipControl = true;
  34. g_backend_info.bSupportsSSAA = true;
  35. g_backend_info.bSupportsDepthClamp = true;
  36. g_backend_info.bSupportsReversedDepthRange = true;
  37. g_backend_info.bSupportsMultithreading = false;
  38. g_backend_info.bSupportsGPUTextureDecoding = false;
  39. g_backend_info.bSupportsST3CTextures = false;
  40. g_backend_info.bSupportsBPTCTextures = false;
  41. g_backend_info.bSupportsFramebufferFetch = false;
  42. g_backend_info.bSupportsBackgroundCompiling = false;
  43. g_backend_info.bSupportsLogicOp = false;
  44. g_backend_info.bSupportsLargePoints = false;
  45. g_backend_info.bSupportsDepthReadback = false;
  46. g_backend_info.bSupportsPartialDepthCopies = false;
  47. g_backend_info.bSupportsShaderBinaries = false;
  48. g_backend_info.bSupportsPipelineCacheData = false;
  49. g_backend_info.bSupportsCoarseDerivatives = false;
  50. g_backend_info.bSupportsTextureQueryLevels = false;
  51. g_backend_info.bSupportsLodBiasInSampler = false;
  52. g_backend_info.bSupportsSettingObjectNames = false;
  53. g_backend_info.bSupportsPartialMultisampleResolve = true;
  54. g_backend_info.bSupportsDynamicVertexLoader = false;
  55. // aamodes: We only support 1 sample, so no MSAA
  56. g_backend_info.Adapters.clear();
  57. g_backend_info.AAModes = {1};
  58. }
  59. bool VideoBackend::Initialize(const WindowSystemInfo& wsi)
  60. {
  61. return InitializeShared(std::make_unique<NullGfx>(), std::make_unique<VertexManager>(),
  62. std::make_unique<PerfQuery>(), std::make_unique<NullBoundingBox>(),
  63. std::make_unique<NullEFBInterface>(), std::make_unique<TextureCache>());
  64. }
  65. void VideoBackend::Shutdown()
  66. {
  67. ShutdownShared();
  68. }
  69. std::string VideoBackend::GetDisplayName() const
  70. {
  71. // i18n: Null is referring to the null video backend, which renders nothing
  72. return _trans("Null");
  73. }
  74. } // namespace Null