From ac55f93ff648357aaa5f3cf6f11b494347ffbb7d Mon Sep 17 00:00:00 2001 From: baldurk Date: Fri, 10 Jul 2015 23:55:32 +0200 Subject: [PATCH] Fix matching ifs to endifs on d3d11 shader debugging --- renderdoc/driver/shaders/dxbc/dxbc_debug.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/renderdoc/driver/shaders/dxbc/dxbc_debug.cpp b/renderdoc/driver/shaders/dxbc/dxbc_debug.cpp index d0e2448e1..1c3229a88 100644 --- a/renderdoc/driver/shaders/dxbc/dxbc_debug.cpp +++ b/renderdoc/driver/shaders/dxbc/dxbc_debug.cpp @@ -4219,7 +4219,8 @@ State State::GetNext(GlobalState &global, State quad[4]) const { if(s.dxbc->m_Instructions[s.nextInstruction].operation == OPCODE_IF) depth++; - if(s.dxbc->m_Instructions[s.nextInstruction].operation == OPCODE_ELSE) + // only step out on an else if it's the matching depth to our starting if (depth == 1) + if(depth == 1 && s.dxbc->m_Instructions[s.nextInstruction].operation == OPCODE_ELSE) depth--; if(s.dxbc->m_Instructions[s.nextInstruction].operation == OPCODE_ENDIF) depth--;