mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-22 13:49:53 -06:00
yay, UBOs work 100% now.
This commit is contained in:

committed by
Sonicadvance1

parent
1f75ee49bf
commit
d4a80ca3ec
@ -166,12 +166,6 @@ char* GenerateVSOutputStruct(char* p, u32 components, API_TYPE ApiType)
|
||||
extern const char* WriteRegister(API_TYPE ApiType, const char *prefix, const u32 num);
|
||||
extern const char* WriteBinding(API_TYPE ApiType, const u32 num);
|
||||
const char *WriteLocation(API_TYPE ApiType);
|
||||
const char *WriteLocation2(API_TYPE ApiType)
|
||||
{
|
||||
static char result[64];
|
||||
sprintf(result, "uniform ");
|
||||
return result;
|
||||
}
|
||||
|
||||
const char *GenerateVertexShaderCode(u32 components, API_TYPE ApiType)
|
||||
{
|
||||
@ -222,20 +216,21 @@ const char *GenerateVertexShaderCode(u32 components, API_TYPE ApiType)
|
||||
}
|
||||
|
||||
// uniforms
|
||||
//if(ApiType == API_GLSL && g_ActiveConfig.backend_info.bSupportsGLSLUBO)
|
||||
//WRITE(p, "layout(std140, binding = 2) uniform VSBlock {\n");
|
||||
if(ApiType == API_GLSL && g_ActiveConfig.backend_info.bSupportsGLSLUBO)
|
||||
WRITE(p, "layout(std140, binding = 2) uniform VSBlock {\n");
|
||||
|
||||
WRITE(p, "%sfloat4 "I_POSNORMALMATRIX"[6] %s;\n", WriteLocation2(ApiType), WriteRegister(ApiType, "c", C_POSNORMALMATRIX));
|
||||
//if(ApiType == API_GLSL && g_ActiveConfig.backend_info.bSupportsGLSLUBO)
|
||||
//WRITE(p, "};\n");
|
||||
WRITE(p, "%sfloat4 "I_PROJECTION"[4] %s;\n", WriteLocation2(ApiType), WriteRegister(ApiType, "c", C_PROJECTION));
|
||||
WRITE(p, "%sfloat4 "I_MATERIALS"[4] %s;\n", WriteLocation2(ApiType), WriteRegister(ApiType, "c", C_MATERIALS));
|
||||
WRITE(p, "%sfloat4 "I_LIGHTS"[40] %s;\n", WriteLocation2(ApiType), WriteRegister(ApiType, "c", C_LIGHTS));
|
||||
WRITE(p, "%sfloat4 "I_TEXMATRICES"[24] %s;\n", WriteLocation2(ApiType), WriteRegister(ApiType, "c", C_TEXMATRICES)); // also using tex matrices
|
||||
WRITE(p, "%sfloat4 "I_TRANSFORMMATRICES"[64] %s;\n", WriteLocation2(ApiType), WriteRegister(ApiType, "c", C_TRANSFORMMATRICES));
|
||||
WRITE(p, "%sfloat4 "I_NORMALMATRICES"[32] %s;\n", WriteLocation2(ApiType), WriteRegister(ApiType, "c", C_NORMALMATRICES));
|
||||
WRITE(p, "%sfloat4 "I_POSTTRANSFORMMATRICES"[64] %s;\n", WriteLocation2(ApiType), WriteRegister(ApiType, "c", C_POSTTRANSFORMMATRICES));
|
||||
WRITE(p, "%sfloat4 "I_DEPTHPARAMS" %s;\n", WriteLocation2(ApiType), WriteRegister(ApiType, "c", C_DEPTHPARAMS));
|
||||
WRITE(p, "%sfloat4 "I_POSNORMALMATRIX"[6] %s;\n", WriteLocation(ApiType), WriteRegister(ApiType, "c", C_POSNORMALMATRIX));
|
||||
WRITE(p, "%sfloat4 "I_PROJECTION"[4] %s;\n", WriteLocation(ApiType), WriteRegister(ApiType, "c", C_PROJECTION));
|
||||
WRITE(p, "%sfloat4 "I_MATERIALS"[4] %s;\n", WriteLocation(ApiType), WriteRegister(ApiType, "c", C_MATERIALS));
|
||||
WRITE(p, "%sfloat4 "I_LIGHTS"[40] %s;\n", WriteLocation(ApiType), WriteRegister(ApiType, "c", C_LIGHTS));
|
||||
WRITE(p, "%sfloat4 "I_TEXMATRICES"[24] %s;\n", WriteLocation(ApiType), WriteRegister(ApiType, "c", C_TEXMATRICES)); // also using tex matrices
|
||||
WRITE(p, "%sfloat4 "I_TRANSFORMMATRICES"[64] %s;\n", WriteLocation(ApiType),WriteRegister(ApiType, "c", C_TRANSFORMMATRICES));
|
||||
WRITE(p, "%sfloat4 "I_NORMALMATRICES"[32] %s;\n", WriteLocation(ApiType), WriteRegister(ApiType, "c", C_NORMALMATRICES));
|
||||
WRITE(p, "%sfloat4 "I_POSTTRANSFORMMATRICES"[64] %s;\n", WriteLocation(ApiType), WriteRegister(ApiType, "c", C_POSTTRANSFORMMATRICES));
|
||||
WRITE(p, "%sfloat4 "I_DEPTHPARAMS" %s;\n", WriteLocation(ApiType), WriteRegister(ApiType, "c", C_DEPTHPARAMS));
|
||||
|
||||
if(ApiType == API_GLSL && g_ActiveConfig.backend_info.bSupportsGLSLUBO)
|
||||
WRITE(p, "};\n");
|
||||
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user