mirror of
				https://git.zaroz.cloud/nintendo-back-up/yuzu/yuzu-mainline.git
				synced 2025-03-21 01:53:15 +00:00 
			
		
		
		
	Merge pull request #2317 from yuriks/vertex-copy
VideoCore: Eliminate an unnecessary copy in the drawcall loop
This commit is contained in:
		
						commit
						ec9130de8d
					
				@ -251,7 +251,6 @@ static void WritePicaReg(u32 id, u32 value, u32 mask) {
 | 
			
		||||
            ASSERT(vertex != -1);
 | 
			
		||||
 | 
			
		||||
            bool vertex_cache_hit = false;
 | 
			
		||||
            Shader::OutputRegisters output_registers;
 | 
			
		||||
 | 
			
		||||
            if (is_indexed) {
 | 
			
		||||
                if (g_debug_context && Pica::g_debug_context->recorder) {
 | 
			
		||||
@ -279,10 +278,9 @@ static void WritePicaReg(u32 id, u32 value, u32 mask) {
 | 
			
		||||
                    g_debug_context->OnEvent(DebugContext::Event::VertexShaderInvocation,
 | 
			
		||||
                                             (void*)&input);
 | 
			
		||||
                g_state.vs.Run(shader_unit, input, loader.GetNumTotalAttributes());
 | 
			
		||||
                output_registers = shader_unit.output_registers;
 | 
			
		||||
 | 
			
		||||
                // Retrieve vertex from register data
 | 
			
		||||
                output_vertex = output_registers.ToVertex(regs.vs);
 | 
			
		||||
                output_vertex = shader_unit.output_registers.ToVertex(regs.vs);
 | 
			
		||||
 | 
			
		||||
                if (is_indexed) {
 | 
			
		||||
                    vertex_cache[vertex_cache_pos] = output_vertex;
 | 
			
		||||
 | 
			
		||||
@ -25,7 +25,7 @@ namespace Pica {
 | 
			
		||||
 | 
			
		||||
namespace Shader {
 | 
			
		||||
 | 
			
		||||
OutputVertex OutputRegisters::ToVertex(const Regs::ShaderConfig& config) {
 | 
			
		||||
OutputVertex OutputRegisters::ToVertex(const Regs::ShaderConfig& config) const {
 | 
			
		||||
    // Setup output data
 | 
			
		||||
    OutputVertex ret;
 | 
			
		||||
    // TODO(neobrain): Under some circumstances, up to 16 attributes may be output. We need to
 | 
			
		||||
 | 
			
		||||
@ -85,7 +85,7 @@ struct OutputRegisters {
 | 
			
		||||
 | 
			
		||||
    alignas(16) Math::Vec4<float24> value[16];
 | 
			
		||||
 | 
			
		||||
    OutputVertex ToVertex(const Regs::ShaderConfig& config);
 | 
			
		||||
    OutputVertex ToVertex(const Regs::ShaderConfig& config) const;
 | 
			
		||||
};
 | 
			
		||||
static_assert(std::is_pod<OutputRegisters>::value, "Structure is not POD");
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
		Loading…
	
		Reference in New Issue
	
	Block a user