forked from eden-emu/eden
		
	Pica: Replace logic in shader.cpp with loop
This commit is contained in:
		
							parent
							
								
									7c323c6408
								
							
						
					
					
						commit
						22426f3e89
					
				
					 1 changed files with 4 additions and 34 deletions
				
			
		|  | @ -74,24 +74,8 @@ OutputVertex Run(UnitState<false>& state, const InputVertex& input, int num_attr | ||||||
|     // Setup input register table
 |     // Setup input register table
 | ||||||
|     const auto& attribute_register_map = config.input_register_map; |     const auto& attribute_register_map = config.input_register_map; | ||||||
| 
 | 
 | ||||||
|     // TODO: Instead of this cumbersome logic, just load the input data directly like
 |     for (unsigned i = 0; i < num_attributes; i++) | ||||||
|     // for (int attr = 0; attr < num_attributes; ++attr) { input_attr[0] = state.registers.input[attribute_register_map.attribute0_register]; }
 |          state.registers.input[attribute_register_map.GetRegisterForAttribute(i)] = input.attr[i]; | ||||||
|     if (num_attributes > 0) state.registers.input[attribute_register_map.attribute0_register] = input.attr[0]; |  | ||||||
|     if (num_attributes > 1) state.registers.input[attribute_register_map.attribute1_register] = input.attr[1]; |  | ||||||
|     if (num_attributes > 2) state.registers.input[attribute_register_map.attribute2_register] = input.attr[2]; |  | ||||||
|     if (num_attributes > 3) state.registers.input[attribute_register_map.attribute3_register] = input.attr[3]; |  | ||||||
|     if (num_attributes > 4) state.registers.input[attribute_register_map.attribute4_register] = input.attr[4]; |  | ||||||
|     if (num_attributes > 5) state.registers.input[attribute_register_map.attribute5_register] = input.attr[5]; |  | ||||||
|     if (num_attributes > 6) state.registers.input[attribute_register_map.attribute6_register] = input.attr[6]; |  | ||||||
|     if (num_attributes > 7) state.registers.input[attribute_register_map.attribute7_register] = input.attr[7]; |  | ||||||
|     if (num_attributes > 8) state.registers.input[attribute_register_map.attribute8_register] = input.attr[8]; |  | ||||||
|     if (num_attributes > 9) state.registers.input[attribute_register_map.attribute9_register] = input.attr[9]; |  | ||||||
|     if (num_attributes > 10) state.registers.input[attribute_register_map.attribute10_register] = input.attr[10]; |  | ||||||
|     if (num_attributes > 11) state.registers.input[attribute_register_map.attribute11_register] = input.attr[11]; |  | ||||||
|     if (num_attributes > 12) state.registers.input[attribute_register_map.attribute12_register] = input.attr[12]; |  | ||||||
|     if (num_attributes > 13) state.registers.input[attribute_register_map.attribute13_register] = input.attr[13]; |  | ||||||
|     if (num_attributes > 14) state.registers.input[attribute_register_map.attribute14_register] = input.attr[14]; |  | ||||||
|     if (num_attributes > 15) state.registers.input[attribute_register_map.attribute15_register] = input.attr[15]; |  | ||||||
| 
 | 
 | ||||||
|     state.conditional_code[0] = false; |     state.conditional_code[0] = false; | ||||||
|     state.conditional_code[1] = false; |     state.conditional_code[1] = false; | ||||||
|  | @ -168,22 +152,8 @@ DebugData<true> ProduceDebugInfo(const InputVertex& input, int num_attributes, c | ||||||
|     float24 dummy_register; |     float24 dummy_register; | ||||||
|     boost::fill(state.registers.input, &dummy_register); |     boost::fill(state.registers.input, &dummy_register); | ||||||
| 
 | 
 | ||||||
|     if (num_attributes > 0) state.registers.input[attribute_register_map.attribute0_register] = &input.attr[0].x; |     for (unsigned i = 0; i < num_attributes; i++) | ||||||
|     if (num_attributes > 1) state.registers.input[attribute_register_map.attribute1_register] = &input.attr[1].x; |          state.registers.input[attribute_register_map.GetRegisterForAttribute(i)] = input.attr[i]; | ||||||
|     if (num_attributes > 2) state.registers.input[attribute_register_map.attribute2_register] = &input.attr[2].x; |  | ||||||
|     if (num_attributes > 3) state.registers.input[attribute_register_map.attribute3_register] = &input.attr[3].x; |  | ||||||
|     if (num_attributes > 4) state.registers.input[attribute_register_map.attribute4_register] = &input.attr[4].x; |  | ||||||
|     if (num_attributes > 5) state.registers.input[attribute_register_map.attribute5_register] = &input.attr[5].x; |  | ||||||
|     if (num_attributes > 6) state.registers.input[attribute_register_map.attribute6_register] = &input.attr[6].x; |  | ||||||
|     if (num_attributes > 7) state.registers.input[attribute_register_map.attribute7_register] = &input.attr[7].x; |  | ||||||
|     if (num_attributes > 8) state.registers.input[attribute_register_map.attribute8_register] = &input.attr[8].x; |  | ||||||
|     if (num_attributes > 9) state.registers.input[attribute_register_map.attribute9_register] = &input.attr[9].x; |  | ||||||
|     if (num_attributes > 10) state.registers.input[attribute_register_map.attribute10_register] = &input.attr[10].x; |  | ||||||
|     if (num_attributes > 11) state.registers.input[attribute_register_map.attribute11_register] = &input.attr[11].x; |  | ||||||
|     if (num_attributes > 12) state.registers.input[attribute_register_map.attribute12_register] = &input.attr[12].x; |  | ||||||
|     if (num_attributes > 13) state.registers.input[attribute_register_map.attribute13_register] = &input.attr[13].x; |  | ||||||
|     if (num_attributes > 14) state.registers.input[attribute_register_map.attribute14_register] = &input.attr[14].x; |  | ||||||
|     if (num_attributes > 15) state.registers.input[attribute_register_map.attribute15_register] = &input.attr[15].x; |  | ||||||
| 
 | 
 | ||||||
|     state.conditional_code[0] = false; |     state.conditional_code[0] = false; | ||||||
|     state.conditional_code[1] = false; |     state.conditional_code[1] = false; | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Jannik Vogel
						Jannik Vogel