Supermodel/Src/Graphics/FBO.h
Ian Curtis c6ea81d996 Emulate the entire tilegen chip in a GLSL shader. (This is now possible with opengl 3+). The tilegen drawing was emulated on the CPU, but was one of the most expensive functions in the emulator according to a profiler. On a modern GPU it's pretty much free, because a GPU is a massive SIMD monster.
Tilegen shaders are mapped to uniforms, and the vram and palette are mapped to two textures.

TODO rip out the redundant code in the tilegen class. We don't need to pre-calculate palettes anymore. etc

The tilegen code supports has a start/end line so we can emulate as many lines as we want in a chunk, which will come in later as some games update the tilegen immediately after the ping_pong bit has flipped ~ 66% of the frame.

The scud rolling start tilegen bug is probably actually a bug in the original h/w implementation, that ends up looking correct on original h/w but not for us. Need hardware testing to confirm what it's actually doing.
2023-09-23 15:27:04 +01:00

28 lines
373 B
C++

#ifndef _FBO_H_
#define _FBO_H_
#include <GL/glew.h>
class FBO
{
public:
FBO();
bool Create(int width, int height);
void Destroy();
void BindTexture();
void Set();
void Disable();
GLuint GetFBOID();
GLuint GetTextureID();
private:
void CreateTexture(int width, int height);
GLuint m_frameBufferID;
GLuint m_textureID;
};
#endif