mirror of
				https://github.com/PabloMK7/citra.git
				synced 2025-10-30 21:30:04 +00:00 
			
		
		
		
	Merge pull request #5247 from lioncash/copy3
swrasterizer/proctex: Take regs by const reference
This commit is contained in:
		
						commit
						77ffe37c46
					
				
					 2 changed files with 5 additions and 5 deletions
				
			
		|  | @ -45,7 +45,7 @@ static float NoiseRand2D(unsigned int x, unsigned int y) { | ||||||
|     return -1.0f + v2 * 2.0f / 15.0f; |     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_u = float16::FromRaw(regs.proctex_noise_frequency.u).ToFloat32(); | ||||||
|     const float freq_v = float16::FromRaw(regs.proctex_noise_frequency.v).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(); |     const float phase_u = float16::FromRaw(regs.proctex_noise_u.phase).ToFloat32(); | ||||||
|  | @ -112,8 +112,8 @@ 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) { |                            const std::array<State::ProcTex::ValueEntry, 128>& map_table) { | ||||||
|     float f; |     float f; | ||||||
|     switch (combiner) { |     switch (combiner) { | ||||||
|     case ProcTexCombiner::U: |     case ProcTexCombiner::U: | ||||||
|  | @ -154,7 +154,7 @@ float CombineAndMap(float u, float v, ProcTexCombiner combiner, | ||||||
|     return LookupLUT(map_table, f); |     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); |     u = std::abs(u); | ||||||
|     v = std::abs(v); |     v = std::abs(v); | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -11,6 +11,6 @@ | ||||||
| namespace Pica::Rasterizer { | namespace Pica::Rasterizer { | ||||||
| 
 | 
 | ||||||
| /// Generates procedural texture color for the given coordinates
 | /// 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
 | } // namespace Pica::Rasterizer
 | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue