aco: fix assertion fail when program contains empty block
radeonsi may generate empty main shader or an empty exit block for p_end_with_regs to jump to. Reviewed-by: Rhys Perry <pendingchaos02@gmail.com> Signed-off-by: Qiang Yu <yuq825@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24973>
This commit is contained in:
@@ -345,7 +345,7 @@ print_asm_llvm(Program* program, std::vector<uint32_t>& binary, unsigned exec_si
|
||||
unsigned prev_size = 0;
|
||||
unsigned prev_pos = 0;
|
||||
unsigned repeat_count = 0;
|
||||
while (pos < exec_size) {
|
||||
while (pos <= exec_size) {
|
||||
bool new_block =
|
||||
next_block < program->blocks.size() && pos == program->blocks[next_block].offset;
|
||||
if (pos + prev_size <= exec_size && prev_pos != pos && !new_block &&
|
||||
@@ -361,6 +361,10 @@ print_asm_llvm(Program* program, std::vector<uint32_t>& binary, unsigned exec_si
|
||||
|
||||
print_block_markers(output, program, referenced_blocks, &next_block, pos);
|
||||
|
||||
/* For empty last block, only print block marker. */
|
||||
if (pos == exec_size)
|
||||
break;
|
||||
|
||||
char outline[1024];
|
||||
std::pair<bool, size_t> res = disasm_instr(program->gfx_level, disasm, binary.data(),
|
||||
exec_size, pos, outline, sizeof(outline));
|
||||
|
||||
Reference in New Issue
Block a user