[Vulkan] Add a few size checks on vertex bindings (max across all cards is 32)

This commit is contained in:
DrChat
2018-01-03 16:40:31 -06:00
parent 10f74fc45a
commit 3e157972cc
3 changed files with 18 additions and 2 deletions

View File

@@ -827,6 +827,12 @@ bool VulkanCommandProcessor::PopulateVertexBuffers(
VkDeviceSize all_buffer_offsets[32];
uint32_t buffer_index = 0;
if (vertex_bindings.size() >= xe::countof(all_buffers)) {
XELOGE("PopulateVertexBuffers failed: Too many bindings! (%zd >= %zd)",
vertex_bindings.size(), xe::countof(all_buffers));
return false;
}
for (const auto& vertex_binding : vertex_bindings) {
int r = XE_GPU_REG_SHADER_CONSTANT_FETCH_00_0 +
(vertex_binding.fetch_constant / 3) * 6;