mirror of
https://github.com/wheremyfoodat/Panda3DS.git
synced 2025-04-21 21:05:50 +12:00
Actually implement the damn thing
This commit is contained in:
parent
c396b3f225
commit
67069a8826
7 changed files with 274 additions and 21 deletions
|
@ -23,6 +23,15 @@
|
|||
// More circular dependencies!
|
||||
class GPU;
|
||||
|
||||
// Cached recompiled fragment shader
|
||||
struct CachedProgram {
|
||||
OpenGL::Program program;
|
||||
std::atomic_bool compiling = false;
|
||||
bool needsInitialization = true;
|
||||
};
|
||||
|
||||
struct AsyncCompilerThread;
|
||||
|
||||
class RendererGL final : public Renderer {
|
||||
GLStateManager gl = {};
|
||||
|
||||
|
@ -72,12 +81,10 @@ class RendererGL final : public Renderer {
|
|||
OpenGL::Shader defaultShadergenVs;
|
||||
GLuint shadergenFragmentUBO;
|
||||
|
||||
// Cached recompiled fragment shader
|
||||
struct CachedProgram {
|
||||
OpenGL::Program program;
|
||||
};
|
||||
std::unordered_map<PICA::FragmentConfig, CachedProgram> shaderCache;
|
||||
|
||||
AsyncCompilerThread* asyncCompiler = nullptr;
|
||||
|
||||
OpenGL::Framebuffer getColourFBO();
|
||||
OpenGL::Texture getTexture(Texture& tex);
|
||||
OpenGL::Program& getSpecializedShader();
|
||||
|
@ -101,7 +108,6 @@ class RendererGL final : public Renderer {
|
|||
|
||||
void reset() override;
|
||||
void display() override; // Display the 3DS screen contents to the window
|
||||
void initGraphicsContext(SDL_Window* window) override; // Initialize graphics context
|
||||
void clearBuffer(u32 startAddress, u32 endAddress, u32 value, u32 control) override; // Clear a GPU buffer in VRAM
|
||||
void displayTransfer(u32 inputAddr, u32 outputAddr, u32 inputSize, u32 outputSize, u32 flags) override; // Perform display transfer
|
||||
void textureCopy(u32 inputAddr, u32 outputAddr, u32 totalBytes, u32 inputSize, u32 outputSize, u32 flags) override;
|
||||
|
@ -123,7 +129,9 @@ class RendererGL final : public Renderer {
|
|||
void initUbershader(OpenGL::Program& program);
|
||||
|
||||
#ifdef PANDA3DS_FRONTEND_QT
|
||||
virtual void initGraphicsContext([[maybe_unused]] GL::Context* context) override { initGraphicsContextInternal(); }
|
||||
virtual void initGraphicsContext(GL::Context* context) override;
|
||||
#elif defined(PANDA3DS_FRONTEND_SDL)
|
||||
virtual void initGraphicsContext(SDL_Window* window) override;
|
||||
#endif
|
||||
|
||||
// Take a screenshot of the screen and store it in a file
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue