Prevent buffer overrun
This commit is contained in:
parent
e6f0fec1b8
commit
6bdc1d44b4
1 changed files with 7 additions and 0 deletions
|
|
@ -248,6 +248,13 @@ void VkLightmap::Render()
|
|||
drawindexed.Constants[drawindexed.Pos] = pc;
|
||||
drawindexed.Commands[drawindexed.Pos] = cmd;
|
||||
drawindexed.Pos++;
|
||||
|
||||
if (drawindexed.Pos == drawindexed.BufferSize)
|
||||
{
|
||||
// Our indirect draw buffer is full. Postpone the rest.
|
||||
buffersFull = true;
|
||||
break;
|
||||
}
|
||||
#else
|
||||
cmdbuffer->pushConstants(raytrace.pipelineLayout.get(), VK_SHADER_STAGE_VERTEX_BIT | VK_SHADER_STAGE_FRAGMENT_BIT, 0, sizeof(LightmapRaytracePC), &pc);
|
||||
cmdbuffer->drawIndexed(surface->numElements, 1, surface->startElementIndex, 0, 0);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue