From: Samuel Iglesias Gonsálvez Date: Fri, 27 Sep 2019 09:43:10 +0000 (+0200) Subject: Add pipeline derivatives to compute subgroup tests X-Git-Tag: upstream/1.3.5~1817 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=366892585b96fa2d9de7bec37a3389fd97178030;p=platform%2Fupstream%2FVK-GL-CTS.git Add pipeline derivatives to compute subgroup tests Affected tests: dEQP-VK.subgroups.*compute* Components: Vulkan VK-GL-CTS issue: 2019 Change-Id: I8b4b52945e32d488fc986687e0ba4d6d5676d584 Change-Id: Ib9aadba5d74daea5f9679b006ec1efa093174dd8 --- diff --git a/external/vulkancts/modules/vulkan/subgroups/vktSubgroupsTestsUtils.cpp b/external/vulkancts/modules/vulkan/subgroups/vktSubgroupsTestsUtils.cpp index ea3b3fb..96b67f8 100644 --- a/external/vulkancts/modules/vulkan/subgroups/vktSubgroupsTestsUtils.cpp +++ b/external/vulkancts/modules/vulkan/subgroups/vktSubgroupsTestsUtils.cpp @@ -267,6 +267,7 @@ Move makeGraphicsPipeline(Context& context, Move makeComputePipeline(Context& context, const VkPipelineLayout pipelineLayout, const VkShaderModule shaderModule, + const deUint32 pipelineCreateFlags, VkPipeline basePipelineHandle, deUint32 localSizeX, deUint32 localSizeY, deUint32 localSizeZ) { const deUint32 localSize[3] = {localSizeX, localSizeY, localSizeZ}; @@ -288,24 +289,24 @@ Move makeComputePipeline(Context& context, const vk::VkPipelineShaderStageCreateInfo pipelineShaderStageParams = { - VK_STRUCTURE_TYPE_PIPELINE_SHADER_STAGE_CREATE_INFO, // VkStructureType sType; - DE_NULL, // const void* pNext; - 0u, // VkPipelineShaderStageCreateFlags flags; - VK_SHADER_STAGE_COMPUTE_BIT, // VkShaderStageFlagBits stage; - shaderModule, // VkShaderModule module; - "main", // const char* pName; - &info, // const VkSpecializationInfo* pSpecializationInfo; + VK_STRUCTURE_TYPE_PIPELINE_SHADER_STAGE_CREATE_INFO, // VkStructureType sType; + DE_NULL, // const void* pNext; + 0u, // VkPipelineShaderStageCreateFlags flags; + VK_SHADER_STAGE_COMPUTE_BIT, // VkShaderStageFlagBits stage; + shaderModule, // VkShaderModule module; + "main", // const char* pName; + &info, // const VkSpecializationInfo* pSpecializationInfo; }; const vk::VkComputePipelineCreateInfo pipelineCreateInfo = { VK_STRUCTURE_TYPE_COMPUTE_PIPELINE_CREATE_INFO, // VkStructureType sType; DE_NULL, // const void* pNext; - 0u, // VkPipelineCreateFlags flags; + pipelineCreateFlags, // VkPipelineCreateFlags flags; pipelineShaderStageParams, // VkPipelineShaderStageCreateInfo stage; pipelineLayout, // VkPipelineLayout layout; - DE_NULL, // VkPipeline basePipelineHandle; - 0, // deInt32 basePipelineIndex; + basePipelineHandle, // VkPipeline basePipelineHandle; + -1, // deInt32 basePipelineIndex; }; return createComputePipeline(context.getDeviceInterface(), @@ -3152,22 +3153,33 @@ tcu::TestStatus vkt::subgroups::makeComputeTest( {1, 1, 1} // Isn't used, just here to make double buffering checks easier }; - Move lastPipeline( + Move pipelines[localSizesToTestCount - 1]; + pipelines[0] = makeComputePipeline(context, *pipelineLayout, *shaderModule, - localSizesToTest[0][0], localSizesToTest[0][1], localSizesToTest[0][2])); + VK_PIPELINE_CREATE_ALLOW_DERIVATIVES_BIT, (VkPipeline) DE_NULL, + localSizesToTest[0][0], localSizesToTest[0][1], localSizesToTest[0][2]); + + for (deUint32 index = 1; index < (localSizesToTestCount - 1); index++) + { + const deUint32 nextX = localSizesToTest[index][0]; + const deUint32 nextY = localSizesToTest[index][1]; + const deUint32 nextZ = localSizesToTest[index][2]; + + pipelines[index] = + makeComputePipeline(context, *pipelineLayout, *shaderModule, + VK_PIPELINE_CREATE_DERIVATIVE_BIT, *pipelines[0], + nextX, nextY, nextZ); + } for (deUint32 index = 0; index < (localSizesToTestCount - 1); index++) { - const deUint32 nextX = localSizesToTest[index + 1][0]; - const deUint32 nextY = localSizesToTest[index + 1][1]; - const deUint32 nextZ = localSizesToTest[index + 1][2]; // we are running one test totalIterations++; beginCommandBuffer(vk, *cmdBuffer); - vk.cmdBindPipeline(*cmdBuffer, VK_PIPELINE_BIND_POINT_COMPUTE, *lastPipeline); + vk.cmdBindPipeline(*cmdBuffer, VK_PIPELINE_BIND_POINT_COMPUTE, *pipelines[index]); vk.cmdBindDescriptorSets(*cmdBuffer, VK_PIPELINE_BIND_POINT_COMPUTE, *pipelineLayout, 0u, 1u, @@ -3177,10 +3189,6 @@ tcu::TestStatus vkt::subgroups::makeComputeTest( endCommandBuffer(vk, *cmdBuffer); - Move nextPipeline( - makeComputePipeline(context, *pipelineLayout, *shaderModule, - nextX, nextY, nextZ)); - submitCommandsAndWait(vk, device, queue, *cmdBuffer); std::vector datas; @@ -3211,8 +3219,6 @@ tcu::TestStatus vkt::subgroups::makeComputeTest( } vk.resetCommandBuffer(*cmdBuffer, 0); - - lastPipeline = nextPipeline; } if (0 < failedIterations)