mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-23 14:19:46 -06:00
VideoBackends: Add AbstractShader and AbstractPipeline classes
This commit is contained in:
@ -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<AbstractShader>
|
||||
SWRenderer::CreateShaderFromSource(ShaderStage stage, const char* source, size_t length)
|
||||
{
|
||||
return std::make_unique<SWShader>(stage);
|
||||
}
|
||||
|
||||
std::unique_ptr<AbstractShader> SWRenderer::CreateShaderFromBinary(ShaderStage stage,
|
||||
const void* data, size_t length)
|
||||
{
|
||||
return std::make_unique<SWShader>(stage);
|
||||
}
|
||||
|
||||
class SWPipeline final : public AbstractPipeline
|
||||
{
|
||||
public:
|
||||
SWPipeline() : AbstractPipeline() {}
|
||||
~SWPipeline() override = default;
|
||||
};
|
||||
|
||||
std::unique_ptr<AbstractPipeline> SWRenderer::CreatePipeline(const AbstractPipelineConfig& config)
|
||||
{
|
||||
return std::make_unique<SWPipeline>();
|
||||
}
|
||||
|
||||
// Called on the GPU thread
|
||||
void SWRenderer::SwapImpl(AbstractTexture* texture, const EFBRectangle& xfb_region, u64 ticks,
|
||||
float Gamma)
|
||||
|
@ -17,6 +17,12 @@ public:
|
||||
std::unique_ptr<AbstractStagingTexture>
|
||||
CreateStagingTexture(StagingTextureType type, const TextureConfig& config) override;
|
||||
|
||||
std::unique_ptr<AbstractShader> CreateShaderFromSource(ShaderStage stage, const char* source,
|
||||
size_t length) override;
|
||||
std::unique_ptr<AbstractShader> CreateShaderFromBinary(ShaderStage stage, const void* data,
|
||||
size_t length) override;
|
||||
std::unique_ptr<AbstractPipeline> CreatePipeline(const AbstractPipelineConfig& config) override;
|
||||
|
||||
void RenderText(const std::string& pstr, int left, int top, u32 color) override;
|
||||
u32 AccessEFB(EFBAccessType type, u32 x, u32 y, u32 poke_data) override;
|
||||
void PokeEFB(EFBAccessType type, const EfbPokeData* points, size_t num_points) override {}
|
||||
|
Reference in New Issue
Block a user