From 087a17d48fa667b3e7e4dcfd8871bcfc2764e359 Mon Sep 17 00:00:00 2001 From: Piotr Byszewski Date: Thu, 25 Oct 2018 16:50:20 +0200 Subject: [PATCH] Correct vertex input tests on null driver On Null driver all features are enabled and this triggered execution of tests for 128 vertex attributes that are not commonly supported. Tests allocate buffer for verification which is not big enough for 128 attributes. This causes memory corruption and crash. This change resolves those issues. Components: Vulkan VK-GL-CTS issue: 1443 Affects: dEQP-VK.pipeline.vertex_input.* Change-Id: I9a89cc62fdd34f9da40ebf9d84e6cf5b5aed07d5 --- .../modules/vulkan/pipeline/vktPipelineVertexInputTests.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/external/vulkancts/modules/vulkan/pipeline/vktPipelineVertexInputTests.cpp b/external/vulkancts/modules/vulkan/pipeline/vktPipelineVertexInputTests.cpp index eda5fef..2fe9f5b 100644 --- a/external/vulkancts/modules/vulkan/pipeline/vktPipelineVertexInputTests.cpp +++ b/external/vulkancts/modules/vulkan/pipeline/vktPipelineVertexInputTests.cpp @@ -1031,12 +1031,17 @@ VertexInputInstance::VertexInputInstance (Context& context, // Create vertex buffer { + // calculate buffer size + // 32 is maximal attribute size (4*sizeof(double)), + // 8 maximal vertex count used in writeVertexInputData + VkDeviceSize bufferSize = 32 * 8 * attributeDescriptions.size(); + const VkBufferCreateInfo vertexBufferParams = { VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO, // VkStructureType sType; DE_NULL, // const void* pNext; 0u, // VkBufferCreateFlags flags; - 4096u, // VkDeviceSize size; + bufferSize, // VkDeviceSize size; VK_BUFFER_USAGE_VERTEX_BUFFER_BIT, // VkBufferUsageFlags usage; VK_SHARING_MODE_EXCLUSIVE, // VkSharingMode sharingMode; 1u, // deUint32 queueFamilyIndexCount; -- 2.7.4