start the shader decompiler

This commit is contained in:
Samuliak 2024-07-26 11:42:18 +02:00
parent 46981d7b03
commit 69597166f3
7 changed files with 5088 additions and 8 deletions

View file

@ -47,7 +47,7 @@ struct LatteDecompilerTEXInstruction
sint32 dstGpr;
sint8 dstSel[4];
// texture fetch
struct
struct
{
sint32 textureIndex{};
sint32 samplerIndex{};
@ -216,7 +216,7 @@ struct LatteDecompilerShaderContext
bool genIntReg; // if set, generate R*i register variables
bool useArrayGPRs; // if set, an array is used to represent GPRs instead of individual variables
}typeTracker;
// analyzer
// analyzer
struct
{
// general
@ -268,9 +268,10 @@ struct LatteDecompilerShaderContext
void LatteDecompiler_analyze(LatteDecompilerShaderContext* shaderContext, LatteDecompilerShader* shader);
void LatteDecompiler_analyzeDataTypes(LatteDecompilerShaderContext* shaderContext);
void LatteDecompiler_emitGLSLShader(LatteDecompilerShaderContext* shaderContext, LatteDecompilerShader* shader);
void LatteDecompiler_emitMSLShader(LatteDecompilerShaderContext* shaderContext, LatteDecompilerShader* shader);
void LatteDecompiler_cleanup(LatteDecompilerShaderContext* shaderContext);
// helper functions
sint32 LatteDecompiler_getColorOutputIndexFromExportIndex(LatteDecompilerShaderContext* shaderContext, sint32 exportIndex);
sint32 LatteDecompiler_getColorOutputIndexFromExportIndex(LatteDecompilerShaderContext* shaderContext, sint32 exportIndex);