mirror of
https://github.com/Lime3DS/Lime3DS.git
synced 2024-12-17 21:41:49 +01:00
SwRasterizer/Lighting: Do not use global registers state in ComputeFragmentsColors.
This commit is contained in:
parent
7bc467e872
commit
b8229a7684
@ -129,8 +129,8 @@ static float LookupLightingLut(const Pica::State::Lighting& lighting, size_t lut
|
|||||||
}
|
}
|
||||||
|
|
||||||
std::tuple<Math::Vec4<u8>, Math::Vec4<u8>> ComputeFragmentsColors(
|
std::tuple<Math::Vec4<u8>, Math::Vec4<u8>> ComputeFragmentsColors(
|
||||||
const Math::Quaternion<float>& normquat, const Math::Vec3<float>& view) {
|
const Pica::LightingRegs& lighting, const Math::Quaternion<float>& normquat,
|
||||||
const auto& lighting = g_state.regs.lighting;
|
const Math::Vec3<float>& view) {
|
||||||
|
|
||||||
if (lighting.disable)
|
if (lighting.disable)
|
||||||
return {Math::MakeVec<u8>(0, 0, 0, 0), Math::MakeVec<u8>(0, 0, 0, 0)};
|
return {Math::MakeVec<u8>(0, 0, 0, 0), Math::MakeVec<u8>(0, 0, 0, 0)};
|
||||||
@ -732,7 +732,7 @@ static void ProcessTriangleInternal(const Vertex& v0, const Vertex& v1, const Ve
|
|||||||
Math::Vec4<u8> secondary_fragment_color;
|
Math::Vec4<u8> secondary_fragment_color;
|
||||||
|
|
||||||
std::tie(primary_fragment_color, secondary_fragment_color) =
|
std::tie(primary_fragment_color, secondary_fragment_color) =
|
||||||
ComputeFragmentsColors(normquat, fragment_position);
|
ComputeFragmentsColors(g_state.regs.lighting, normquat, fragment_position);
|
||||||
|
|
||||||
for (unsigned tev_stage_index = 0; tev_stage_index < tev_stages.size();
|
for (unsigned tev_stage_index = 0; tev_stage_index < tev_stages.size();
|
||||||
++tev_stage_index) {
|
++tev_stage_index) {
|
||||||
|
Loading…
Reference in New Issue
Block a user