Add setting for ubershaders

This commit is contained in:
wheremyfoodat 2024-07-17 02:25:38 +03:00
parent a4ec770587
commit aad7bb817e
6 changed files with 15 additions and 1 deletions

View file

@ -13,8 +13,11 @@ struct EmulatorConfig {
static constexpr bool shaderJitDefault = false;
#endif
static constexpr bool ubershaderDefault = true;
bool shaderJitEnabled = shaderJitDefault;
bool discordRpcEnabled = false;
bool useUbershaders = ubershaderDefault;
bool accurateShaderMul = false;
RendererType rendererType = RendererType::OpenGL;
Audio::DSPCore::Type dspType = Audio::DSPCore::Type::Null;

View file

@ -74,6 +74,8 @@ class Renderer {
virtual std::string getUbershader() { return ""; }
virtual void setUbershader(const std::string& shader) {}
virtual void setUbershaderSetting(bool value) {}
// Functions for initializing the graphics context for the Qt frontend, where we don't have the convenience of SDL_Window
#ifdef PANDA3DS_FRONTEND_QT
virtual void initGraphicsContext(GL::Context* context) { Helpers::panic("Tried to initialize incompatible renderer with GL context"); }

View file

@ -30,6 +30,7 @@ class RendererGL final : public Renderer {
OpenGL::VertexArray vao;
OpenGL::VertexBuffer vbo;
bool usingUbershader = true;
// Data
struct {
@ -56,7 +57,6 @@ class RendererGL final : public Renderer {
SurfaceCache<DepthBuffer, 16, true> depthBufferCache;
SurfaceCache<ColourBuffer, 16, true> colourBufferCache;
SurfaceCache<Texture, 256, true> textureCache;
bool usingUbershader = false;
// Dummy VAO/VBO for blitting the final output
OpenGL::VertexArray dummyVAO;
@ -107,6 +107,8 @@ class RendererGL final : public Renderer {
virtual std::string getUbershader() override;
virtual void setUbershader(const std::string& shader) override;
virtual void setUbershaderSetting(bool value) override { usingUbershader = value; }
std::optional<ColourBuffer> getColourBuffer(u32 addr, PICA::ColorFmt format, u32 width, u32 height, bool createIfnotFound = true);
// Note: The caller is responsible for deleting the currently bound FBO before calling this