From fec6bb4d5676de8834c90d93127c1459f46f8dcb Mon Sep 17 00:00:00 2001 From: Stenzek Date: Fri, 8 Sep 2017 19:42:56 +1000 Subject: VideoBackends: Add AbstractShader and AbstractPipeline classes --- Source/Core/VideoBackends/Software/SWRenderer.cpp | 36 +++++++++++++++++++++++ 1 file changed, 36 insertions(+) (limited to 'Source/Core/VideoBackends/Software/SWRenderer.cpp') diff --git a/Source/Core/VideoBackends/Software/SWRenderer.cpp b/Source/Core/VideoBackends/Software/SWRenderer.cpp index 28bd57557e..cde52b4449 100644 --- a/Source/Core/VideoBackends/Software/SWRenderer.cpp +++ b/Source/Core/VideoBackends/Software/SWRenderer.cpp @@ -16,6 +16,8 @@ #include "VideoBackends/Software/SWOGLWindow.h" #include "VideoBackends/Software/SWTexture.h" +#include "VideoCommon/AbstractPipeline.h" +#include "VideoCommon/AbstractShader.h" #include "VideoCommon/BoundingBox.h" #include "VideoCommon/OnScreenDisplay.h" #include "VideoCommon/VideoBackendBase.h" @@ -42,6 +44,40 @@ void SWRenderer::RenderText(const std::string& pstr, int left, int top, u32 colo SWOGLWindow::s_instance->PrintText(pstr, left, top, color); } +class SWShader final : public AbstractShader +{ +public: + explicit SWShader(ShaderStage stage) : AbstractShader(stage) {} + ~SWShader() = default; + + bool HasBinary() const override { return false; } + BinaryData GetBinary() const override { return {}; } +}; + +std::unique_ptr +SWRenderer::CreateShaderFromSource(ShaderStage stage, const char* source, size_t length) +{ + return std::make_unique(stage); +} + +std::unique_ptr SWRenderer::CreateShaderFromBinary(ShaderStage stage, + const void* data, size_t length) +{ + return std::make_unique(stage); +} + +class SWPipeline final : public AbstractPipeline +{ +public: + SWPipeline() : AbstractPipeline() {} + ~SWPipeline() override = default; +}; + +std::unique_ptr SWRenderer::CreatePipeline(const AbstractPipelineConfig& config) +{ + return std::make_unique(); +} + // Called on the GPU thread void SWRenderer::SwapImpl(AbstractTexture* texture, const EFBRectangle& xfb_region, u64 ticks, float Gamma) -- cgit v1.2.3