Fix handling of primitive restart in qrenderdoc's BufferViewer

This commit is contained in:
baldurk
2017-04-20 16:08:15 +01:00
parent 1002742a14
commit 2632638615
3 changed files with 48 additions and 37 deletions
@@ -554,14 +554,14 @@ bool CommonPipelineState::IsStripRestartEnabled()
return false;
}
uint32_t CommonPipelineState::GetStripRestartIndex(uint32_t indexByteWidth)
uint32_t CommonPipelineState::GetStripRestartIndex()
{
if(LogLoaded())
{
if(IsLogD3D11() || IsLogVK())
{
// D3D11 or Vulkan this is always '-1' in whichever size of index we're using
return indexByteWidth == 2 ? UINT16_MAX : UINT32_MAX;
// D3D11 or Vulkan this is always '-1'
return UINT32_MAX;
}
else if(IsLogD3D12())
{
@@ -569,12 +569,7 @@ uint32_t CommonPipelineState::GetStripRestartIndex(uint32_t indexByteWidth)
}
else if(IsLogGL())
{
uint32_t maxval = UINT32_MAX;
if(indexByteWidth == 2)
maxval = UINT16_MAX;
else if(indexByteWidth == 1)
maxval = 0xff;
return qMin(maxval, m_GL->m_VtxIn.restartIndex);
return qMin(UINT32_MAX, m_GL->m_VtxIn.restartIndex);
}
}
@@ -364,7 +364,7 @@ Typically this is ``glsl`` or ``hlsl``.
:return: The index value that represents a strip restart not a real index.
:rtype: ``int``
)");
uint32_t GetStripRestartIndex(uint32_t indexByteWidth);
uint32_t GetStripRestartIndex();
DOCUMENT(R"(Retrieves the currently bound vertex buffers.