OpenGL: Add an assert to catch a class of crash bugs early. Also assorted paranoia.

This commit is contained in:
Henrik Rydgård 2023-05-01 11:56:26 +02:00
parent a41fc74dba
commit d4249c1d73
4 changed files with 13 additions and 0 deletions

View file

@ -1487,6 +1487,11 @@ void VKContext::DrawIndexed(int vertexCount, int offset) {
}
void VKContext::DrawUP(const void *vdata, int vertexCount) {
_dbg_assert_(vertexCount >= 0);
if (vertexCount <= 0) {
return;
}
VkBuffer vulkanVbuf, vulkanUBObuf;
size_t vbBindOffset = push_->Push(vdata, vertexCount * curPipeline_->stride[0], 4, &vulkanVbuf);
uint32_t ubo_offset = (uint32_t)curPipeline_->PushUBO(push_, vulkan_, &vulkanUBObuf);