mirror of
				https://github.com/hedge-dev/XenosRecomp.git
				synced 2025-10-30 07:12:17 +00:00 
			
		
		
		
	Implement svPos register.
This commit is contained in:
		
							parent
							
								
									a3e36719e7
								
							
						
					
					
						commit
						c0bafdb37f
					
				
					 2 changed files with 12 additions and 2 deletions
				
			
		|  | @ -31,7 +31,7 @@ struct Shader | |||
|     be<uint32_t> physicalOffset; | ||||
|     be<uint32_t> size; | ||||
|     be<uint32_t> field8; | ||||
|     be<uint32_t> fieldC; | ||||
|     be<uint32_t> fieldC; // svPos register: (fieldC >> 8) & 0xFF
 | ||||
|     be<uint32_t> field10; | ||||
|     be<uint32_t> interpolatorInfo; // interpolator count: (interpolatorInfo >> 5) & 0x1F
 | ||||
| }; | ||||
|  |  | |||
|  | @ -1099,7 +1099,17 @@ void ShaderRecompiler::recompile(const uint8_t* shaderData) | |||
|     for (size_t i = 0; i < 32; i++) | ||||
|     { | ||||
|         if (!printedRegisters[i]) | ||||
|             println("\tfloat4 r{} = 0.0;", i); | ||||
|         { | ||||
|             print("\tfloat4 r{} = ", i); | ||||
|             if (isPixelShader && i == ((shader->fieldC >> 8) & 0xFF)) | ||||
|             { | ||||
|                 out += "float4((iPos.xy - 0.5) * float2(iFace ? 1.0 : -1.0, 1.0), 0.0, 0.0);\n"; | ||||
|             } | ||||
|             else | ||||
|             { | ||||
|                 out += "0.0;\n"; | ||||
|             } | ||||
|         } | ||||
|     } | ||||
| 
 | ||||
|     out += "\tint a0 = 0;\n"; | ||||
|  |  | |||
		Loading…
	
	Add table
		
		Reference in a new issue
	
	 Skyth
						Skyth