Move LightingUidData to the LightingShaderGen header
This commit is contained in:
parent
30da36dd1e
commit
175707739e
|
@ -25,6 +25,19 @@
|
||||||
#define LIGHT_DIR "%s[5*%d+4]"
|
#define LIGHT_DIR "%s[5*%d+4]"
|
||||||
#define LIGHT_DIR_PARAMS(lightsName, index) (lightsName), (index)
|
#define LIGHT_DIR_PARAMS(lightsName, index) (lightsName), (index)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Common uid data used for shader generators that use lighting calculations.
|
||||||
|
*/
|
||||||
|
struct LightingUidData
|
||||||
|
{
|
||||||
|
u32 matsource : 4; // 4x1 bit
|
||||||
|
u32 enablelighting : 4; // 4x1 bit
|
||||||
|
u32 ambsource : 4; // 4x1 bit
|
||||||
|
u32 diffusefunc : 8; // 4x2 bits
|
||||||
|
u32 attnfunc : 8; // 4x2 bits
|
||||||
|
u32 light_mask : 32; // 4x8 bits
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
template<class T>
|
template<class T>
|
||||||
static void GenerateLightShader(T& object, LightingUidData& uid_data, int index, int litchan_index, const char* lightsName, int coloralpha)
|
static void GenerateLightShader(T& object, LightingUidData& uid_data, int index, int litchan_index, const char* lightsName, int coloralpha)
|
||||||
|
|
|
@ -8,6 +8,7 @@
|
||||||
#include "VideoCommon.h"
|
#include "VideoCommon.h"
|
||||||
#include "ShaderGenCommon.h"
|
#include "ShaderGenCommon.h"
|
||||||
#include "BPMemory.h"
|
#include "BPMemory.h"
|
||||||
|
#include "LightingShaderGen.h"
|
||||||
|
|
||||||
#define I_COLORS "color"
|
#define I_COLORS "color"
|
||||||
#define I_KCOLORS "k"
|
#define I_KCOLORS "k"
|
||||||
|
|
|
@ -199,23 +199,6 @@ static inline void DeclareUniform(T& object, API_TYPE api_type, bool using_ubos,
|
||||||
object.Write(";\n");
|
object.Write(";\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
#pragma pack(1)
|
|
||||||
/**
|
|
||||||
* Common uid data used for shader generators that use lighting calculations.
|
|
||||||
*/
|
|
||||||
struct LightingUidData
|
|
||||||
{
|
|
||||||
u32 matsource : 4; // 4x1 bit
|
|
||||||
u32 enablelighting : 4; // 4x1 bit
|
|
||||||
u32 ambsource : 4; // 4x1 bit
|
|
||||||
u32 diffusefunc : 8; // 4x2 bits
|
|
||||||
u32 attnfunc : 8; // 4x2 bits
|
|
||||||
u32 light_mask : 32; // 4x8 bits
|
|
||||||
|
|
||||||
u32 NumValues() const { return sizeof(LightingUidData); }
|
|
||||||
};
|
|
||||||
#pragma pack()
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Checks if there has been
|
* Checks if there has been
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -9,6 +9,7 @@
|
||||||
#include "XFMemory.h"
|
#include "XFMemory.h"
|
||||||
#include "VideoCommon.h"
|
#include "VideoCommon.h"
|
||||||
#include "ShaderGenCommon.h"
|
#include "ShaderGenCommon.h"
|
||||||
|
#include "LightingShaderGen.h"
|
||||||
|
|
||||||
// TODO should be reordered
|
// TODO should be reordered
|
||||||
#define SHADER_POSITION_ATTRIB 0
|
#define SHADER_POSITION_ATTRIB 0
|
||||||
|
|
Loading…
Reference in New Issue