mirror of
				https://git.suyu.dev/suyu/suyu
				synced 2025-11-03 16:39:01 -06:00 
			
		
		
		
	GPU: Implement predicated exit instructions in the shader programs.
This commit is contained in:
		@@ -1093,9 +1093,6 @@ private:
 | 
				
			|||||||
        default: {
 | 
					        default: {
 | 
				
			||||||
            switch (opcode->GetId()) {
 | 
					            switch (opcode->GetId()) {
 | 
				
			||||||
            case OpCode::Id::EXIT: {
 | 
					            case OpCode::Id::EXIT: {
 | 
				
			||||||
                ASSERT_MSG(instr.pred.pred_index == static_cast<u64>(Pred::UnusedIndex),
 | 
					 | 
				
			||||||
                           "Predicated exits not implemented");
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
                // Final color output is currently hardcoded to GPR0-3 for fragment shaders
 | 
					                // Final color output is currently hardcoded to GPR0-3 for fragment shaders
 | 
				
			||||||
                if (stage == Maxwell3D::Regs::ShaderStage::Fragment) {
 | 
					                if (stage == Maxwell3D::Regs::ShaderStage::Fragment) {
 | 
				
			||||||
                    shader.AddLine("color.r = " + regs.GetRegisterAsFloat(0) + ';');
 | 
					                    shader.AddLine("color.r = " + regs.GetRegisterAsFloat(0) + ';');
 | 
				
			||||||
@@ -1105,7 +1102,12 @@ private:
 | 
				
			|||||||
                }
 | 
					                }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                shader.AddLine("return true;");
 | 
					                shader.AddLine("return true;");
 | 
				
			||||||
                offset = PROGRAM_END - 1;
 | 
					                if (instr.pred.pred_index == static_cast<u64>(Pred::UnusedIndex)) {
 | 
				
			||||||
 | 
					                    // If this is an unconditional exit then just end processing here, otherwise we
 | 
				
			||||||
 | 
					                    // have to account for the possibility of the condition not being met, so
 | 
				
			||||||
 | 
					                    // continue processing the next instruction.
 | 
				
			||||||
 | 
					                    offset = PROGRAM_END - 1;
 | 
				
			||||||
 | 
					                }
 | 
				
			||||||
                break;
 | 
					                break;
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
            case OpCode::Id::KIL: {
 | 
					            case OpCode::Id::KIL: {
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user