mirror of
https://github.com/Lime3DS/Lime3DS.git
synced 2024-11-11 04:35:05 +01:00
Merge pull request #5247 from lioncash/copy3
swrasterizer/proctex: Take regs by const reference
This commit is contained in:
commit
77ffe37c46
@ -45,7 +45,7 @@ static float NoiseRand2D(unsigned int x, unsigned int y) {
|
||||
return -1.0f + v2 * 2.0f / 15.0f;
|
||||
}
|
||||
|
||||
static float NoiseCoef(float u, float v, TexturingRegs regs, State::ProcTex state) {
|
||||
static float NoiseCoef(float u, float v, const TexturingRegs& regs, const State::ProcTex& state) {
|
||||
const float freq_u = float16::FromRaw(regs.proctex_noise_frequency.u).ToFloat32();
|
||||
const float freq_v = float16::FromRaw(regs.proctex_noise_frequency.v).ToFloat32();
|
||||
const float phase_u = float16::FromRaw(regs.proctex_noise_u.phase).ToFloat32();
|
||||
@ -112,7 +112,7 @@ static void ClampCoord(float& coord, ProcTexClamp mode) {
|
||||
}
|
||||
}
|
||||
|
||||
float CombineAndMap(float u, float v, ProcTexCombiner combiner,
|
||||
static float CombineAndMap(float u, float v, ProcTexCombiner combiner,
|
||||
const std::array<State::ProcTex::ValueEntry, 128>& map_table) {
|
||||
float f;
|
||||
switch (combiner) {
|
||||
@ -154,7 +154,7 @@ float CombineAndMap(float u, float v, ProcTexCombiner combiner,
|
||||
return LookupLUT(map_table, f);
|
||||
}
|
||||
|
||||
Common::Vec4<u8> ProcTex(float u, float v, TexturingRegs regs, State::ProcTex state) {
|
||||
Common::Vec4<u8> ProcTex(float u, float v, const TexturingRegs& regs, const State::ProcTex& state) {
|
||||
u = std::abs(u);
|
||||
v = std::abs(v);
|
||||
|
||||
|
@ -11,6 +11,6 @@
|
||||
namespace Pica::Rasterizer {
|
||||
|
||||
/// Generates procedural texture color for the given coordinates
|
||||
Common::Vec4<u8> ProcTex(float u, float v, TexturingRegs regs, State::ProcTex state);
|
||||
Common::Vec4<u8> ProcTex(float u, float v, const TexturingRegs& regs, const State::ProcTex& state);
|
||||
|
||||
} // namespace Pica::Rasterizer
|
||||
|
Loading…
Reference in New Issue
Block a user