mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-08-08 00:59:44 +00:00
LightingShaderGen: Use a float4 array for lights instead of a struct (uniform management in the non-UBO path is a mess otherwise).
Also fix a small bug (cf. revision 154c533e76
).
This commit is contained in:
parent
fab4f1d0a5
commit
abde070f63
4 changed files with 14 additions and 16 deletions
|
@ -24,36 +24,36 @@
|
|||
|
||||
static const char* LightCol(const char* lightsName, unsigned int index, const char* swizzle)
|
||||
{
|
||||
static char result[16];
|
||||
snprintf(result, sizeof(result), "%s[%d].col.%s", lightsName, index, swizzle);
|
||||
static char result[32];
|
||||
snprintf(result, sizeof(result), "%s[5*%d].%s", lightsName, index, swizzle);
|
||||
return result;
|
||||
}
|
||||
|
||||
static const char* LightCosAtt(const char* lightsName, unsigned int index)
|
||||
{
|
||||
static char result[16];
|
||||
snprintf(result, sizeof(result), "%s[%d].cosatt", lightsName, index);
|
||||
static char result[32];
|
||||
snprintf(result, sizeof(result), "%s[5*%d+1]", lightsName, index);
|
||||
return result;
|
||||
}
|
||||
|
||||
static const char* LightDistAtt(const char* lightsName, unsigned int index)
|
||||
{
|
||||
static char result[16];
|
||||
snprintf(result, sizeof(result), "%s[%d].distatt", lightsName, index);
|
||||
static char result[32];
|
||||
snprintf(result, sizeof(result), "%s[5*%d+2]", lightsName, index);
|
||||
return result;
|
||||
}
|
||||
|
||||
static const char* LightPos(const char* lightsName, unsigned int index)
|
||||
{
|
||||
static char result[16];
|
||||
snprintf(result, sizeof(result), "%s[%d].pos", lightsName, index);
|
||||
static char result[32];
|
||||
snprintf(result, sizeof(result), "%s[5*%d+3]", lightsName, index);
|
||||
return result;
|
||||
}
|
||||
|
||||
static const char* LightDir(const char* lightsName, unsigned int index)
|
||||
{
|
||||
static char result[16];
|
||||
snprintf(result, sizeof(result), "%s[%d].dir", lightsName, index);
|
||||
static char result[32];
|
||||
snprintf(result, sizeof(result), "%s[5*%d+4]", lightsName, index);
|
||||
return result;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue