stop using fixed size buffers based on scale factor in shaders

this makes shader compile times tolerable on Wintel
- beginning of the shader cache
- increase size of tile idx in workdesc to 20 bits
This commit is contained in:
RSDuck
2023-05-08 19:34:05 +02:00
parent 2272a8a974
commit e7168ac563
7 changed files with 550 additions and 291 deletions

View File

@ -74,7 +74,17 @@ private:
GLuint XSpanSetupMemory;
GLuint BinResultMemory;
GLuint RenderPolygonMemory;
GLuint TileMemory;
GLuint WorkDescMemory;
enum
{
tilememoryLayer_Color,
tilememoryLayer_Depth,
tilememoryLayer_Attr,
tilememoryLayer_Num,
};
GLuint TileMemory[tilememoryLayer_Num];
GLuint FinalTileMemory;
u32 DummyLine[256] = {};
@ -102,7 +112,7 @@ private:
s32 DxInitial;
s32 XCovIncr;
u32 IsDummy, __pad1;
u32 IsDummy;
};
struct SpanSetupX
{
@ -138,7 +148,6 @@ private:
u32 Attr;
float TextureLayer;
u32 __pad0, __pad1;
};
static constexpr int TileSize = 8;
@ -233,7 +242,7 @@ private:
void SetupYSpan(RenderPolygon* rp, SpanSetupY* span, Polygon* poly, int from, int to, int side, s32 positions[10][2]);
void SetupYSpanDummy(RenderPolygon* rp, SpanSetupY* span, Polygon* poly, int vertex, int side, s32 positions[10][2]);
bool CompileShader(GLuint& shader, const char* source, const std::initializer_list<const char*>& defines);
bool CompileShader(GLuint& shader, const std::string& source, const std::initializer_list<const char*>& defines);
};
}