mirror of
				https://github.com/hedge-dev/XenosRecomp.git
				synced 2025-10-30 07:12:17 +00:00 
			
		
		
		
	Compare commits
	
		
			4 commits
		
	
	
		
			995d2889d4
			...
			6c7c8fa87d
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
|   | 6c7c8fa87d | ||
|   | 790c8be91b | ||
|   | 2d9e24c52f | ||
|   | 9112665766 | 
					 2 changed files with 19 additions and 6 deletions
				
			
		|  | @ -168,6 +168,12 @@ float rcp(T a) | |||
| { | ||||
|     return 1.0 / a; | ||||
| } | ||||
| 
 | ||||
| template<typename T> | ||||
| float4x4 mul(T a, T b) | ||||
| { | ||||
|     a * b; | ||||
| } | ||||
| #endif | ||||
| 
 | ||||
| #ifdef __air__ | ||||
|  |  | |||
|  | @ -1360,13 +1360,15 @@ void ShaderRecompiler::recompile(const uint8_t* shaderData, const std::string_vi | |||
| 
 | ||||
|     out += "#if __air__\n"; | ||||
| 
 | ||||
|     out += "struct StageIn\n"; | ||||
|     out += "{\n"; | ||||
|     if (isPixelShader) { | ||||
|         out += "struct StageIn\n"; | ||||
|         out += "{\n"; | ||||
| 
 | ||||
|     for (auto& [usage, usageIndex] : INTERPOLATORS) | ||||
|         println("\tfloat4 i{}{};", USAGE_VARIABLES[uint32_t(usage)], usageIndex); | ||||
|         for (auto& [usage, usageIndex] : INTERPOLATORS) | ||||
|             println("\tfloat4 i{}{};", USAGE_VARIABLES[uint32_t(usage)], usageIndex); | ||||
| 
 | ||||
|     out += "};\n"; | ||||
|         out += "};\n"; | ||||
|     } | ||||
| 
 | ||||
|     if (isPixelShader) | ||||
|         out += "[[fragment]]\n"; | ||||
|  | @ -1479,8 +1481,13 @@ void ShaderRecompiler::recompile(const uint8_t* shaderData, const std::string_vi | |||
|     #ifdef UNLEASHED_RECOMP | ||||
|         if (hasIndexCount) | ||||
|         { | ||||
|             out += "#ifdef __air__\n"; | ||||
|             out += "\tuint iVertexId [[vertex_id]],\n"; | ||||
|             out += "\tuint iInstanceId [[instance_id]],\n"; | ||||
|             out += "#else\n"; | ||||
|             out += "\tin uint iVertexId : SV_VertexID,\n"; | ||||
|             out += "\tin uint iInstanceId : SV_InstanceID,\n"; | ||||
|             out += "#endif\n"; | ||||
|         } | ||||
|     #endif | ||||
| 
 | ||||
|  | @ -1503,7 +1510,7 @@ void ShaderRecompiler::recompile(const uint8_t* shaderData, const std::string_vi | |||
|         out += "\tfloat4x4 mtxProjection = float4x4(g_MtxProjection(0), g_MtxProjection(1), g_MtxProjection(2), g_MtxProjection(3));\n"; | ||||
|         out += "\tfloat4x4 mtxProjectionReverseZ = mul(mtxProjection, float4x4(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, -1, 0, 0, 0, 1, 1));\n"; | ||||
| 
 | ||||
|         out += "\t[unroll] for (int iterationIndex = 0; iterationIndex < 2; iterationIndex++)\n"; | ||||
|         out += "\tUNROLL for (int iterationIndex = 0; iterationIndex < 2; iterationIndex++)\n"; | ||||
|         out += "\t{\n"; | ||||
|     } | ||||
| #endif | ||||
|  |  | |||
		Loading…
	
	Add table
		
		Reference in a new issue