mirror of
				https://git.zaroz.cloud/nintendo-back-up/yuzu/yuzu-mainline.git
				synced 2025-03-21 01:53:15 +00:00 
			
		
		
		
	shader_decompiler: Visit source nodes even when they assign to RZ
Some operations like atomicMin were ignored because they returned were being stored to RZ. This operations have a side effect and it was being ignored.
This commit is contained in:
		
							parent
							
								
									434856c636
								
							
						
					
					
						commit
						ed4e324991
					
				@ -1538,7 +1538,9 @@ private:
 | 
				
			|||||||
        Expression target;
 | 
					        Expression target;
 | 
				
			||||||
        if (const auto gpr = std::get_if<GprNode>(&*dest)) {
 | 
					        if (const auto gpr = std::get_if<GprNode>(&*dest)) {
 | 
				
			||||||
            if (gpr->GetIndex() == Register::ZeroIndex) {
 | 
					            if (gpr->GetIndex() == Register::ZeroIndex) {
 | 
				
			||||||
                // Writing to Register::ZeroIndex is a no op
 | 
					                // Writing to Register::ZeroIndex is a no op but we still have to visit the source
 | 
				
			||||||
 | 
					                // as it might have side effects.
 | 
				
			||||||
 | 
					                code.AddLine("{};", Visit(src).GetCode());
 | 
				
			||||||
                return {};
 | 
					                return {};
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
            target = {GetRegister(gpr->GetIndex()), Type::Float};
 | 
					            target = {GetRegister(gpr->GetIndex()), Type::Float};
 | 
				
			||||||
 | 
				
			|||||||
@ -1361,7 +1361,9 @@ private:
 | 
				
			|||||||
        Expression target{};
 | 
					        Expression target{};
 | 
				
			||||||
        if (const auto gpr = std::get_if<GprNode>(&*dest)) {
 | 
					        if (const auto gpr = std::get_if<GprNode>(&*dest)) {
 | 
				
			||||||
            if (gpr->GetIndex() == Register::ZeroIndex) {
 | 
					            if (gpr->GetIndex() == Register::ZeroIndex) {
 | 
				
			||||||
                // Writing to Register::ZeroIndex is a no op
 | 
					                // Writing to Register::ZeroIndex is a no op but we still have to visit its source
 | 
				
			||||||
 | 
					                // because it might have side effects.
 | 
				
			||||||
 | 
					                Visit(src);
 | 
				
			||||||
                return {};
 | 
					                return {};
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
            target = {registers.at(gpr->GetIndex()), Type::Float};
 | 
					            target = {registers.at(gpr->GetIndex()), Type::Float};
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
		Reference in New Issue
	
	Block a user