mirror of
https://git.suyu.dev/suyu/suyu.git
synced 2024-11-27 01:02:48 +01:00
SwRasterizer/Lighting: get rid of nested return
This commit is contained in:
parent
c6d1472513
commit
e415558a4f
1 changed files with 11 additions and 10 deletions
|
@ -340,16 +340,17 @@ std::tuple<Math::Vec4<u8>, Math::Vec4<u8>> ComputeFragmentsColors(
|
||||||
|
|
||||||
diffuse_sum += Math::MakeVec(lighting.global_ambient.ToVec3f(), 0.0f);
|
diffuse_sum += Math::MakeVec(lighting.global_ambient.ToVec3f(), 0.0f);
|
||||||
|
|
||||||
return {Math::MakeVec<float>(MathUtil::Clamp(diffuse_sum.x, 0.0f, 1.0f) * 255,
|
auto diffuse = Math::MakeVec<float>(MathUtil::Clamp(diffuse_sum.x, 0.0f, 1.0f) * 255,
|
||||||
MathUtil::Clamp(diffuse_sum.y, 0.0f, 1.0f) * 255,
|
MathUtil::Clamp(diffuse_sum.y, 0.0f, 1.0f) * 255,
|
||||||
MathUtil::Clamp(diffuse_sum.z, 0.0f, 1.0f) * 255,
|
MathUtil::Clamp(diffuse_sum.z, 0.0f, 1.0f) * 255,
|
||||||
MathUtil::Clamp(diffuse_sum.w, 0.0f, 1.0f) * 255)
|
MathUtil::Clamp(diffuse_sum.w, 0.0f, 1.0f) * 255)
|
||||||
.Cast<u8>(),
|
.Cast<u8>();
|
||||||
Math::MakeVec<float>(MathUtil::Clamp(specular_sum.x, 0.0f, 1.0f) * 255,
|
auto specular = Math::MakeVec<float>(MathUtil::Clamp(specular_sum.x, 0.0f, 1.0f) * 255,
|
||||||
MathUtil::Clamp(specular_sum.y, 0.0f, 1.0f) * 255,
|
MathUtil::Clamp(specular_sum.y, 0.0f, 1.0f) * 255,
|
||||||
MathUtil::Clamp(specular_sum.z, 0.0f, 1.0f) * 255,
|
MathUtil::Clamp(specular_sum.z, 0.0f, 1.0f) * 255,
|
||||||
MathUtil::Clamp(specular_sum.w, 0.0f, 1.0f) * 255)
|
MathUtil::Clamp(specular_sum.w, 0.0f, 1.0f) * 255)
|
||||||
.Cast<u8>()};
|
.Cast<u8>();
|
||||||
|
return {diffuse, specular};
|
||||||
}
|
}
|
||||||
|
|
||||||
MICROPROFILE_DEFINE(GPU_Rasterization, "GPU", "Rasterization", MP_RGB(50, 50, 240));
|
MICROPROFILE_DEFINE(GPU_Rasterization, "GPU", "Rasterization", MP_RGB(50, 50, 240));
|
||||||
|
|
Loading…
Reference in a new issue