summaryrefslogtreecommitdiff
path: root/Source/Core/VideoBackends/Null/Render.cpp
diff options
context:
space:
mode:
authorStenzek <stenzek@gmail.com>2017-09-08 19:42:56 +1000
committerStenzek <stenzek@gmail.com>2018-02-22 22:02:34 +1000
commitfec6bb4d5676de8834c90d93127c1459f46f8dcb (patch)
treef484dbc96cc5bdc49282a63b973c98e93ec2bfad /Source/Core/VideoBackends/Null/Render.cpp
parent31111ef1432bc5d6d653fbef175e8ca3ac2c152d (diff)
VideoBackends: Add AbstractShader and AbstractPipeline classes
Diffstat (limited to 'Source/Core/VideoBackends/Null/Render.cpp')
-rw-r--r--Source/Core/VideoBackends/Null/Render.cpp36
1 files changed, 36 insertions, 0 deletions
diff --git a/Source/Core/VideoBackends/Null/Render.cpp b/Source/Core/VideoBackends/Null/Render.cpp
index c589c8278f..6c804bd346 100644
--- a/Source/Core/VideoBackends/Null/Render.cpp
+++ b/Source/Core/VideoBackends/Null/Render.cpp
@@ -7,6 +7,8 @@
#include "VideoBackends/Null/NullTexture.h"
#include "VideoBackends/Null/Render.h"
+#include "VideoCommon/AbstractPipeline.h"
+#include "VideoCommon/AbstractShader.h"
#include "VideoCommon/VideoConfig.h"
namespace Null
@@ -33,6 +35,40 @@ std::unique_ptr<AbstractStagingTexture> Renderer::CreateStagingTexture(StagingTe
return std::make_unique<NullStagingTexture>(type, config);
}
+class NullShader final : public AbstractShader
+{
+public:
+ explicit NullShader(ShaderStage stage) : AbstractShader(stage) {}
+ ~NullShader() = default;
+
+ bool HasBinary() const override { return false; }
+ BinaryData GetBinary() const override { return {}; }
+};
+
+std::unique_ptr<AbstractShader> Renderer::CreateShaderFromSource(ShaderStage stage,
+ const char* source, size_t length)
+{
+ return std::make_unique<NullShader>(stage);
+}
+
+std::unique_ptr<AbstractShader> Renderer::CreateShaderFromBinary(ShaderStage stage,
+ const void* data, size_t length)
+{
+ return std::make_unique<NullShader>(stage);
+}
+
+class NullPipeline final : public AbstractPipeline
+{
+public:
+ NullPipeline() : AbstractPipeline() {}
+ ~NullPipeline() override = default;
+};
+
+std::unique_ptr<AbstractPipeline> Renderer::CreatePipeline(const AbstractPipelineConfig& config)
+{
+ return std::make_unique<NullPipeline>();
+}
+
void Renderer::RenderText(const std::string& text, int left, int top, u32 color)
{
NOTICE_LOG(VIDEO, "RenderText: %s", text.c_str());