From ef70fe05bfae4e47f4acb40756d16de0ef1dd259 Mon Sep 17 00:00:00 2001 From: Shawn Hoffman Date: Tue, 15 Sep 2020 05:24:28 -0700 Subject: normalize common filenames in VideoBackends/Null --- Source/Core/VideoBackends/Null/NullRender.cpp | 84 +++++++++++++++++++++++++++ 1 file changed, 84 insertions(+) create mode 100644 Source/Core/VideoBackends/Null/NullRender.cpp (limited to 'Source/Core/VideoBackends/Null/NullRender.cpp') diff --git a/Source/Core/VideoBackends/Null/NullRender.cpp b/Source/Core/VideoBackends/Null/NullRender.cpp new file mode 100644 index 0000000000..df99931908 --- /dev/null +++ b/Source/Core/VideoBackends/Null/NullRender.cpp @@ -0,0 +1,84 @@ +// Copyright 2015 Dolphin Emulator Project +// Licensed under GPLv2+ +// Refer to the license.txt file included. + +#include "VideoBackends/Null/NullRender.h" + +#include "VideoBackends/Null/NullTexture.h" + +#include "VideoCommon/AbstractPipeline.h" +#include "VideoCommon/AbstractShader.h" +#include "VideoCommon/NativeVertexFormat.h" +#include "VideoCommon/VideoConfig.h" + +namespace Null +{ +// Init functions +Renderer::Renderer() : ::Renderer(1, 1, 1.0f, AbstractTextureFormat::RGBA8) +{ + UpdateActiveConfig(); +} + +Renderer::~Renderer() +{ + UpdateActiveConfig(); +} + +bool Renderer::IsHeadless() const +{ + return true; +} + +std::unique_ptr Renderer::CreateTexture(const TextureConfig& config) +{ + return std::make_unique(config); +} + +std::unique_ptr Renderer::CreateStagingTexture(StagingTextureType type, + const TextureConfig& config) +{ + return std::make_unique(type, config); +} + +class NullShader final : public AbstractShader +{ +public: + explicit NullShader(ShaderStage stage) : AbstractShader(stage) {} +}; + +std::unique_ptr +Renderer::CreateShaderFromSource(ShaderStage stage, [[maybe_unused]] std::string_view source) +{ + return std::make_unique(stage); +} + +std::unique_ptr Renderer::CreateShaderFromBinary(ShaderStage stage, + const void* data, size_t length) +{ + return std::make_unique(stage); +} + +class NullPipeline final : public AbstractPipeline +{ +}; + +std::unique_ptr Renderer::CreatePipeline(const AbstractPipelineConfig& config, + const void* cache_data, + size_t cache_data_length) +{ + return std::make_unique(); +} + +std::unique_ptr Renderer::CreateFramebuffer(AbstractTexture* color_attachment, + AbstractTexture* depth_attachment) +{ + return NullFramebuffer::Create(static_cast(color_attachment), + static_cast(depth_attachment)); +} + +std::unique_ptr +Renderer::CreateNativeVertexFormat(const PortableVertexDeclaration& vtx_decl) +{ + return std::make_unique(vtx_decl); +} +} // namespace Null -- cgit v1.2.3