From c141137a5944429c9d32067f839e2a1647ea4f36 Mon Sep 17 00:00:00 2001 From: baldurk Date: Tue, 21 Feb 2017 11:03:52 +0000 Subject: [PATCH] Fix max index of buffer lookup component being applied to the wrong idx * The component must be clamped (ie if the stride is 8 bytes, .z is not valid) rather than the place of the component (.xxxy is fine - even if .y is in the 'w' place) --- renderdoc/driver/shaders/dxbc/dxbc_debug.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/renderdoc/driver/shaders/dxbc/dxbc_debug.cpp b/renderdoc/driver/shaders/dxbc/dxbc_debug.cpp index 72360b7df..48564f427 100644 --- a/renderdoc/driver/shaders/dxbc/dxbc_debug.cpp +++ b/renderdoc/driver/shaders/dxbc/dxbc_debug.cpp @@ -2601,7 +2601,7 @@ State State::GetNext(GlobalState &global, State quad[4]) const for(int i = 0; i < 4; i++) { uint8_t comp = op.operands[srcIdx + 1].comps[i]; - if(op.operands[srcIdx + 1].comps[i] == 0xff || i >= maxIndex) + if(op.operands[srcIdx + 1].comps[i] == 0xff || comp >= maxIndex) comp = 0; fetch.value.uv[i] = datau32[comp]; @@ -2622,7 +2622,7 @@ State State::GetNext(GlobalState &global, State quad[4]) const { uint8_t comp = op.operands[0].comps[i]; // masks must be contiguous from x, if we reach the 'end' we're done - if(comp == 0xff || i >= maxIndex) + if(comp == 0xff || comp >= maxIndex) break; datau32[i] = srcOpers[srcIdx].value.uv[i];