From 26d81abf5207332a37e80c911fcecbc8fccf7d8e Mon Sep 17 00:00:00 2001 From: "Dr. Chat" Date: Fri, 21 Oct 2016 18:14:24 -0500 Subject: [PATCH] IssueDraw failing in the backend does not mean we need to stop processing commands --- src/xenia/gpu/command_processor.cc | 28 ++++++++++++++++++++++------ 1 file changed, 22 insertions(+), 6 deletions(-) diff --git a/src/xenia/gpu/command_processor.cc b/src/xenia/gpu/command_processor.cc index a801abe4e..150947c46 100644 --- a/src/xenia/gpu/command_processor.cc +++ b/src/xenia/gpu/command_processor.cc @@ -252,6 +252,7 @@ void CommandProcessor::WriteRegister(uint32_t index, uint32_t value) { return; } + // 0x1844 - pointer to frontbuffer regs->values[index].u32 = value; if (!regs->GetRegisterInfo(index)) { XELOGW("GPU: Write to unknown register (%.4X = %.8X)", index, value); @@ -290,8 +291,8 @@ void CommandProcessor::MakeCoherent() { RegisterFile* regs = register_file_; auto status_host = regs->values[XE_GPU_REG_COHER_STATUS_HOST].u32; - // auto base_host = regs->values[XE_GPU_REG_COHER_BASE_HOST].u32; - // auto size_host = regs->values[XE_GPU_REG_COHER_SIZE_HOST].u32; + auto base_host = regs->values[XE_GPU_REG_COHER_BASE_HOST].u32; + auto size_host = regs->values[XE_GPU_REG_COHER_SIZE_HOST].u32; if (!(status_host & 0x80000000ul)) { return; @@ -649,6 +650,7 @@ bool CommandProcessor::ExecutePacketType3(RingBuffer* reader, uint32_t packet) { default: XELOGGPU("Unimplemented GPU OPCODE: 0x%.2X\t\tCOUNT: %d\n", opcode, count); + assert_always(); reader->AdvanceRead(count * sizeof(uint32_t)); break; } @@ -741,7 +743,9 @@ bool CommandProcessor::ExecutePacketType3_INDIRECT_BUFFER(RingBuffer* reader, uint32_t count) { // indirect buffer dispatch uint32_t list_ptr = CpuToGpu(reader->Read(true)); - uint32_t list_length = reader->Read(true) & 0xFFFFF; + uint32_t list_length = reader->Read(true); + assert_zero(list_length & ~0xFFFFF); + list_length &= 0xFFFFF; ExecuteIndirectBuffer(GpuToCpu(list_ptr), list_length); return true; } @@ -1080,8 +1084,14 @@ bool CommandProcessor::ExecutePacketType3_DRAW_INDX(RingBuffer* reader, assert_always(); } - return IssueDraw(prim_type, index_count, - is_indexed ? &index_buffer_info : nullptr); + bool success = IssueDraw(prim_type, index_count, + is_indexed ? &index_buffer_info : nullptr); + if (!success) { + XELOGE("PM4_DRAW_INDX(%d, %d, %d): Failed in backend", index_count, + prim_type, src_sel); + } + + return true; } bool CommandProcessor::ExecutePacketType3_DRAW_INDX_2(RingBuffer* reader, @@ -1099,7 +1109,13 @@ bool CommandProcessor::ExecutePacketType3_DRAW_INDX_2(RingBuffer* reader, // uint32_t index_ptr = reader->ptr(); reader->AdvanceRead((count - 1) * sizeof(uint32_t)); - return IssueDraw(prim_type, index_count, nullptr); + bool success = IssueDraw(prim_type, index_count, nullptr); + if (!success) { + XELOGE("PM4_DRAW_INDX_IMM(%d, %d): Failed in backend", index_count, + prim_type); + } + + return true; } bool CommandProcessor::ExecutePacketType3_SET_CONSTANT(RingBuffer* reader,