mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-25 07:09:48 -06:00
ShaderGen: Store light color uniforms as integers.
This commit is contained in:
@ -294,7 +294,8 @@ static inline void GeneratePixelShader(T& out, DSTALPHA_MODE dstAlphaMode, API_T
|
||||
DeclareUniform(out, ApiType, C_FOG, "float4", I_FOG"[2]");
|
||||
|
||||
// For pixel lighting - TODO: Should only be defined when per pixel lighting is enabled!
|
||||
DeclareUniform(out, ApiType, C_PLIGHTS, "float4", I_PLIGHTS"[40]");
|
||||
DeclareUniform(out, ApiType, C_PLIGHT_COLORS, "int4", I_PLIGHT_COLORS"[8]");
|
||||
DeclareUniform(out, ApiType, C_PLIGHTS, "float4", I_PLIGHTS"[32]");
|
||||
DeclareUniform(out, ApiType, C_PMATERIALS, "float4", I_PMATERIALS"[4]");
|
||||
|
||||
if (ApiType == API_OPENGL)
|
||||
@ -416,10 +417,11 @@ static inline void GeneratePixelShader(T& out, DSTALPHA_MODE dstAlphaMode, API_T
|
||||
"\tfloat3 ldir, h;\n"
|
||||
"\tfloat dist, dist2, attn;\n");
|
||||
|
||||
out.SetConstantsUsed(C_PLIGHTS, C_PLIGHTS+39); // TODO: Can be optimized further
|
||||
out.SetConstantsUsed(C_PLIGHT_COLORS, C_PLIGHT_COLORS+7); // TODO: Can be optimized further
|
||||
out.SetConstantsUsed(C_PLIGHTS, C_PLIGHTS+31); // TODO: Can be optimized further
|
||||
out.SetConstantsUsed(C_PMATERIALS, C_PMATERIALS+3);
|
||||
uid_data.components = components;
|
||||
GenerateLightingShader<T>(out, uid_data.lighting, components, I_PMATERIALS, I_PLIGHTS, "colors_", "colors_");
|
||||
GenerateLightingShader<T>(out, uid_data.lighting, components, I_PMATERIALS, I_PLIGHT_COLORS, I_PLIGHTS, "colors_", "colors_");
|
||||
}
|
||||
|
||||
out.Write("\tclipPos = float4(rawpos.x, rawpos.y, clipPos.z, clipPos.w);\n");
|
||||
|
Reference in New Issue
Block a user