From e19daa58e3d7c3d8d2487472997ae490825a10fa Mon Sep 17 00:00:00 2001 From: Baldur Karlsson Date: Fri, 8 Aug 2014 11:15:16 +0100 Subject: [PATCH] Check bindpoint isn't -1 (for non-buffer-backed uniforms) --- renderdocui/Code/CommonPipelineState.cs | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/renderdocui/Code/CommonPipelineState.cs b/renderdocui/Code/CommonPipelineState.cs index 66d82b4b6..2b2461cc7 100644 --- a/renderdocui/Code/CommonPipelineState.cs +++ b/renderdocui/Code/CommonPipelineState.cs @@ -372,13 +372,17 @@ namespace renderdocui.Code if(s.ShaderDetails != null && BindPoint < s.ShaderDetails.ConstantBlocks.Length) { - var b = m_GL.UniformBuffers[s.ShaderDetails.ConstantBlocks[BindPoint].bindPoint]; + if(s.ShaderDetails.ConstantBlocks[BindPoint].bindPoint >= 0 && + s.ShaderDetails.ConstantBlocks[BindPoint].bindPoint < m_GL.UniformBuffers.Length) + { + var b = m_GL.UniformBuffers[s.ShaderDetails.ConstantBlocks[BindPoint].bindPoint]; - buf = b.Resource; - ByteOffset = (uint)b.Offset; - ByteSize = (uint)b.Size; + buf = b.Resource; + ByteOffset = (uint)b.Offset; + ByteSize = (uint)b.Size; - return; + return; + } } } }