mirror of
				https://github.com/PabloMK7/citra.git
				synced 2025-10-30 21:30:04 +00:00 
			
		
		
		
	Shader: implement DPH/DPHI in interpreter
Tests revealed that the component with w=1 is SRC1 and not SRC2, it is now fixed on 3dbrew.
This commit is contained in:
		
							parent
							
								
									d8908aef63
								
							
						
					
					
						commit
						2e7cf2f6cf
					
				
					 1 changed files with 8 additions and 1 deletions
				
			
		|  | @ -197,12 +197,19 @@ void RunInterpreter(UnitState<Debug>& state) { | ||||||
| 
 | 
 | ||||||
|             case OpCode::Id::DP3: |             case OpCode::Id::DP3: | ||||||
|             case OpCode::Id::DP4: |             case OpCode::Id::DP4: | ||||||
|  |             case OpCode::Id::DPH: | ||||||
|  |             case OpCode::Id::DPHI: | ||||||
|             { |             { | ||||||
|                 Record<DebugDataRecord::SRC1>(state.debug, iteration, src1); |                 Record<DebugDataRecord::SRC1>(state.debug, iteration, src1); | ||||||
|                 Record<DebugDataRecord::SRC2>(state.debug, iteration, src2); |                 Record<DebugDataRecord::SRC2>(state.debug, iteration, src2); | ||||||
|                 Record<DebugDataRecord::DEST_IN>(state.debug, iteration, dest); |                 Record<DebugDataRecord::DEST_IN>(state.debug, iteration, dest); | ||||||
|  | 
 | ||||||
|  |                 OpCode::Id opcode = instr.opcode.Value().EffectiveOpCode(); | ||||||
|  |                 if (opcode == OpCode::Id::DPH || opcode == OpCode::Id::DPHI) | ||||||
|  |                     src1[3] = float24::FromFloat32(1.0f); | ||||||
|  | 
 | ||||||
|                 float24 dot = float24::FromFloat32(0.f); |                 float24 dot = float24::FromFloat32(0.f); | ||||||
|                 int num_components = (instr.opcode.Value() == OpCode::Id::DP3) ? 3 : 4; |                 int num_components = (opcode == OpCode::Id::DP3) ? 3 : 4; | ||||||
|                 for (int i = 0; i < num_components; ++i) |                 for (int i = 0; i < num_components; ++i) | ||||||
|                     dot = dot + src1[i] * src2[i]; |                     dot = dot + src1[i] * src2[i]; | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue