From: Marcin Rogucki Date: Tue, 10 Oct 2017 09:04:05 +0000 (+0200) Subject: Dispatch base test does not enable pipeline flag X-Git-Tag: upstream/1.3.5~2565^2~6^2~80 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=b8fedc1584751f778286b94ccc1ca6c4a8653d87;p=platform%2Fupstream%2FVK-GL-CTS.git Dispatch base test does not enable pipeline flag dEQP-VK.compute.device_group.dispatch_base does not enable pipeline flag which violates valid usage rule: If any of baseGroupX, baseGroupY, or baseGroupZ are not zero, then the currently bound compute pipeline must have been created with the VK_PIPELINE_CREATE_DISPATCH_BASE flag. An overloaded method vktComputeTestsUtil.cpp::makeComputePipeline was added that allows to pass additional parameters: - flags for pipeline creation - flags for compute shader creation Old method redirected to call a new one with flags set to zero. A method vktComputeTestsUtil.cpp::makePipelineLayout no longer takes useDeviceGroups parameter and always sets pipeline layout flags to 0. New method used in test with proper flags passed in. Component: Vulkan VK-GL-CTS issue: 760 Affects: dEQP-VK.compute.device_group.dispatch_base Change-Id: I2c7400a55809b28bb7096dcdfeba2095c1541e1b --- diff --git a/external/vulkancts/modules/vulkan/compute/vktComputeBasicComputeShaderTests.cpp b/external/vulkancts/modules/vulkan/compute/vktComputeBasicComputeShaderTests.cpp index 2af2713..3961e32 100644 --- a/external/vulkancts/modules/vulkan/compute/vktComputeBasicComputeShaderTests.cpp +++ b/external/vulkancts/modules/vulkan/compute/vktComputeBasicComputeShaderTests.cpp @@ -2654,8 +2654,8 @@ tcu::TestStatus DispatchBaseTestInstance::iterate (void) .update(vk, device); const Unique shaderModule(createShaderModule(vk, device, m_context.getBinaryCollection().get("comp"), 0u)); - const Unique pipelineLayout(makePipelineLayout(vk, device, *descriptorSetLayout, true)); - const Unique pipeline(makeComputePipeline(vk, device, *pipelineLayout, *shaderModule)); + const Unique pipelineLayout(makePipelineLayout(vk, device, *descriptorSetLayout)); + const Unique pipeline(makeComputePipeline(vk, device, *pipelineLayout, static_cast(VK_PIPELINE_CREATE_DISPATCH_BASE), *shaderModule, static_cast(0u))); const VkBufferMemoryBarrier hostWriteBarrier = makeBufferMemoryBarrier(VK_ACCESS_HOST_WRITE_BIT, VK_ACCESS_SHADER_READ_BIT, *buffer, 0ull, bufferSizeBytes); const VkBufferMemoryBarrier hostUniformWriteBarrier = makeBufferMemoryBarrier(VK_ACCESS_HOST_WRITE_BIT, VK_ACCESS_UNIFORM_READ_BIT, *uniformBuffer, 0ull, uniformBufferSizeBytes); @@ -2922,7 +2922,7 @@ tcu::TestStatus DeviceIndexTestInstance::iterate (void) .update(vk, device); const Unique shaderModule(createShaderModule(vk, device, m_context.getBinaryCollection().get("comp"), 0u)); - const Unique pipelineLayout(makePipelineLayout(vk, device, *descriptorSetLayout, true)); + const Unique pipelineLayout(makePipelineLayout(vk, device, *descriptorSetLayout)); const Unique pipeline(makeComputePipeline(vk, device, *pipelineLayout, *shaderModule)); const VkBufferMemoryBarrier hostUniformWriteBarrier = makeBufferMemoryBarrier(VK_ACCESS_HOST_WRITE_BIT, VK_ACCESS_UNIFORM_READ_BIT, *uniformBuffer, 0ull, uniformBufferSizeBytes); diff --git a/external/vulkancts/modules/vulkan/compute/vktComputeTestsUtil.cpp b/external/vulkancts/modules/vulkan/compute/vktComputeTestsUtil.cpp index 3e8066d..d08c58e 100644 --- a/external/vulkancts/modules/vulkan/compute/vktComputeTestsUtil.cpp +++ b/external/vulkancts/modules/vulkan/compute/vktComputeTestsUtil.cpp @@ -105,7 +105,7 @@ Move makePipelineLayout (const DeviceInterface& vk, { VK_STRUCTURE_TYPE_PIPELINE_LAYOUT_CREATE_INFO, // VkStructureType sType; DE_NULL, // const void* pNext; - 0u, // VkPipelineLayoutCreateFlags flags; + static_cast(0u), // VkPipelineLayoutCreateFlags flags; 0u, // deUint32 setLayoutCount; DE_NULL, // const VkDescriptorSetLayout* pSetLayouts; 0u, // deUint32 pushConstantRangeCount; @@ -116,33 +116,33 @@ Move makePipelineLayout (const DeviceInterface& vk, Move makePipelineLayout (const DeviceInterface& vk, const VkDevice device, - const VkDescriptorSetLayout descriptorSetLayout, - const bool useDeviceGroups) + const VkDescriptorSetLayout descriptorSetLayout) { const VkPipelineLayoutCreateInfo pipelineLayoutParams = { - VK_STRUCTURE_TYPE_PIPELINE_LAYOUT_CREATE_INFO, // VkStructureType sType; - DE_NULL, // const void* pNext; - useDeviceGroups ? VK_PIPELINE_CREATE_DISPATCH_BASE_KHR : - (VkPipelineCreateFlagBits)0u, // VkPipelineLayoutCreateFlags flags; - 1u, // deUint32 setLayoutCount; - &descriptorSetLayout, // const VkDescriptorSetLayout* pSetLayouts; - 0u, // deUint32 pushConstantRangeCount; - DE_NULL, // const VkPushConstantRange* pPushConstantRanges; + VK_STRUCTURE_TYPE_PIPELINE_LAYOUT_CREATE_INFO, // VkStructureType sType; + DE_NULL, // const void* pNext; + static_cast(0u), // VkPipelineLayoutCreateFlags flags; + 1u, // deUint32 setLayoutCount; + &descriptorSetLayout, // const VkDescriptorSetLayout* pSetLayouts; + 0u, // deUint32 pushConstantRangeCount; + DE_NULL, // const VkPushConstantRange* pPushConstantRanges; }; return createPipelineLayout(vk, device, &pipelineLayoutParams); } -Move makeComputePipeline (const DeviceInterface& vk, - const VkDevice device, - const VkPipelineLayout pipelineLayout, - const VkShaderModule shaderModule) +Move makeComputePipeline (const DeviceInterface& vk, + const VkDevice device, + const VkPipelineLayout pipelineLayout, + const VkPipelineCreateFlags pipelineFlags, + const VkShaderModule shaderModule, + const VkPipelineShaderStageCreateFlags shaderFlags) { const VkPipelineShaderStageCreateInfo pipelineShaderStageParams = { VK_STRUCTURE_TYPE_PIPELINE_SHADER_STAGE_CREATE_INFO, // VkStructureType sType; DE_NULL, // const void* pNext; - 0u, // VkPipelineShaderStageCreateFlags flags; + shaderFlags, // VkPipelineShaderStageCreateFlags flags; VK_SHADER_STAGE_COMPUTE_BIT, // VkShaderStageFlagBits stage; shaderModule, // VkShaderModule module; "main", // const char* pName; @@ -152,7 +152,7 @@ Move makeComputePipeline (const DeviceInterface& vk, { VK_STRUCTURE_TYPE_COMPUTE_PIPELINE_CREATE_INFO, // VkStructureType sType; DE_NULL, // const void* pNext; - 0u, // VkPipelineCreateFlags flags; + pipelineFlags, // VkPipelineCreateFlags flags; pipelineShaderStageParams, // VkPipelineShaderStageCreateInfo stage; pipelineLayout, // VkPipelineLayout layout; DE_NULL, // VkPipeline basePipelineHandle; @@ -161,6 +161,14 @@ Move makeComputePipeline (const DeviceInterface& vk, return createComputePipeline(vk, device, DE_NULL , &pipelineCreateInfo); } +Move makeComputePipeline (const DeviceInterface& vk, + const VkDevice device, + const VkPipelineLayout pipelineLayout, + const VkShaderModule shaderModule) +{ + return makeComputePipeline(vk, device, pipelineLayout, static_cast(0u), shaderModule, static_cast(0u)); +} + Move makeBufferView (const DeviceInterface& vk, const VkDevice vkDevice, const VkBuffer buffer, diff --git a/external/vulkancts/modules/vulkan/compute/vktComputeTestsUtil.hpp b/external/vulkancts/modules/vulkan/compute/vktComputeTestsUtil.hpp index 5188ae9..8d78451 100644 --- a/external/vulkancts/modules/vulkan/compute/vktComputeTestsUtil.hpp +++ b/external/vulkancts/modules/vulkan/compute/vktComputeTestsUtil.hpp @@ -78,73 +78,79 @@ private: Image& operator= (const Image&); }; -vk::Move makeCommandPool (const vk::DeviceInterface& vk, - const vk::VkDevice device, - const deUint32 queueFamilyIndex); - -vk::Move makePipelineLayout (const vk::DeviceInterface& vk, - const vk::VkDevice device); - -vk::Move makePipelineLayout (const vk::DeviceInterface& vk, - const vk::VkDevice device, - const vk::VkDescriptorSetLayout descriptorSetLayout, - const bool useDeviceGroups = false); - -vk::Move makeComputePipeline (const vk::DeviceInterface& vk, - const vk::VkDevice device, - const vk::VkPipelineLayout pipelineLayout, - const vk::VkShaderModule shaderModule); - -vk::Move makeBufferView (const vk::DeviceInterface& vk, - const vk::VkDevice device, - const vk::VkBuffer buffer, - const vk::VkFormat format, - const vk::VkDeviceSize offset, - const vk::VkDeviceSize size); - -vk::Move makeImageView (const vk::DeviceInterface& vk, - const vk::VkDevice device, - const vk::VkImage image, - const vk::VkImageViewType imageViewType, - const vk::VkFormat format, - const vk::VkImageSubresourceRange subresourceRange); - -vk::Move makeDescriptorSet (const vk::DeviceInterface& vk, - const vk::VkDevice device, - const vk::VkDescriptorPool descriptorPool, - const vk::VkDescriptorSetLayout setLayout); - -vk::VkBufferCreateInfo makeBufferCreateInfo (const vk::VkDeviceSize bufferSize, - const vk::VkBufferUsageFlags usage); - -vk::VkBufferImageCopy makeBufferImageCopy (const vk::VkExtent3D extent, - const deUint32 arraySize); - -vk::VkBufferMemoryBarrier makeBufferMemoryBarrier (const vk::VkAccessFlags srcAccessMask, - const vk::VkAccessFlags dstAccessMask, - const vk::VkBuffer buffer, - const vk::VkDeviceSize offset, - const vk::VkDeviceSize bufferSizeBytes); - -vk::VkImageMemoryBarrier makeImageMemoryBarrier (const vk::VkAccessFlags srcAccessMask, - const vk::VkAccessFlags dstAccessMask, - const vk::VkImageLayout oldLayout, - const vk::VkImageLayout newLayout, - const vk::VkImage image, - const vk::VkImageSubresourceRange subresourceRange); - -void beginCommandBuffer (const vk::DeviceInterface& vk, - const vk::VkCommandBuffer cmdBuffer); - -void endCommandBuffer (const vk::DeviceInterface& vk, - const vk::VkCommandBuffer cmdBuffer); - -void submitCommandsAndWait (const vk::DeviceInterface& vk, - const vk::VkDevice device, - const vk::VkQueue queue, - const vk::VkCommandBuffer cmdBuffer, - const bool useDeviceGroups = false, - const deUint32 deviceMask = 1); +vk::Move makeCommandPool (const vk::DeviceInterface& vk, + const vk::VkDevice device, + const deUint32 queueFamilyIndex); + +vk::Move makePipelineLayout (const vk::DeviceInterface& vk, + const vk::VkDevice device); + +vk::Move makePipelineLayout (const vk::DeviceInterface& vk, + const vk::VkDevice device, + const vk::VkDescriptorSetLayout descriptorSetLayout); + +vk::Move makeComputePipeline (const vk::DeviceInterface& vk, + const vk::VkDevice device, + const vk::VkPipelineLayout pipelineLayout, + const vk::VkShaderModule shaderModule); + +vk::Move makeComputePipeline (const vk::DeviceInterface& vk, + const vk::VkDevice device, + const vk::VkPipelineLayout pipelineLayout, + const vk::VkPipelineCreateFlags pipelineFlags, + const vk::VkShaderModule shaderModule, + const vk::VkPipelineShaderStageCreateFlags shaderFlags); + +vk::Move makeBufferView (const vk::DeviceInterface& vk, + const vk::VkDevice device, + const vk::VkBuffer buffer, + const vk::VkFormat format, + const vk::VkDeviceSize offset, + const vk::VkDeviceSize size); + +vk::Move makeImageView (const vk::DeviceInterface& vk, + const vk::VkDevice device, + const vk::VkImage image, + const vk::VkImageViewType imageViewType, + const vk::VkFormat format, + const vk::VkImageSubresourceRange subresourceRange); + +vk::Move makeDescriptorSet (const vk::DeviceInterface& vk, + const vk::VkDevice device, + const vk::VkDescriptorPool descriptorPool, + const vk::VkDescriptorSetLayout setLayout); + +vk::VkBufferCreateInfo makeBufferCreateInfo (const vk::VkDeviceSize bufferSize, + const vk::VkBufferUsageFlags usage); + +vk::VkBufferImageCopy makeBufferImageCopy (const vk::VkExtent3D extent, + const deUint32 arraySize); + +vk::VkBufferMemoryBarrier makeBufferMemoryBarrier (const vk::VkAccessFlags srcAccessMask, + const vk::VkAccessFlags dstAccessMask, + const vk::VkBuffer buffer, + const vk::VkDeviceSize offset, + const vk::VkDeviceSize bufferSizeBytes); + +vk::VkImageMemoryBarrier makeImageMemoryBarrier (const vk::VkAccessFlags srcAccessMask, + const vk::VkAccessFlags dstAccessMask, + const vk::VkImageLayout oldLayout, + const vk::VkImageLayout newLayout, + const vk::VkImage image, + const vk::VkImageSubresourceRange subresourceRange); + +void beginCommandBuffer (const vk::DeviceInterface& vk, + const vk::VkCommandBuffer cmdBuffer); + +void endCommandBuffer (const vk::DeviceInterface& vk, + const vk::VkCommandBuffer cmdBuffer); + +void submitCommandsAndWait (const vk::DeviceInterface& vk, + const vk::VkDevice device, + const vk::VkQueue queue, + const vk::VkCommandBuffer cmdBuffer, + const bool useDeviceGroups = false, + const deUint32 deviceMask = 1); inline vk::VkExtent3D makeExtent3D (const tcu::IVec3& vec) {