From 3d8e6ee58a6f3a7701a3e6cdc4ba9fb14b162410 Mon Sep 17 00:00:00 2001 From: Pyry Haulos Date: Thu, 19 May 2016 15:03:59 -0700 Subject: [PATCH] Merge bug fixes from Khronos CTS release branch This includes fixes available in Vulkan CTS 1.0.0.3 RC1: 8d6a75b Fix test copying zero sized regions 4d12ac5 Update sample conformance statement with latest release tag 2659c92 Remove use of non-standard strnlen() fd6bbe6 Validation fix dEQP-VK.binding_model 8c019df Validation fix for dEQP-VK.ssbo 02bc895 Remove dEQP-VK.glsl.linkage.varying.rules.fragment_declare 0f75056 Validation fixes for dEQP-VK.renderpass 0619614 Validation fixes for dEQP-VK.glsl 2df3edd dEQP-VK.binding_model validation fixes 50664eb Removed not needed reading of image ce3f36a Bug Fix: Corrected barriers in the tests dEQP-VK.query_pool 6d286f8 Validation fixes for dEQP-VK.api d02ea76 dEQP-VK.api.info.device.properties struct offsets d488796 Bug Fix: Corrected barriers in the tests dEQP-VK.dynamic_state. a4f96c9 Turn on well defined signed integer overflow ba9a6b8 Add Android NDK r11 toolchain as new default 355e4f8 Update glslang to (7b3096a) to include bitfield functions precision fix cbba646 Fix Pipeline barrier test 6eaa4ce Update glslang to (af4592) - include proper RelaxedPrecision handling f89b81f Remove instances of pDynamicState->dynamicStateCount = 0 989ae48 ShaderRender tests: do not use images in UNDEFINED layout ed92247 Revert to original boilerplate in Vulkan CTS license appendix 0b834b7 Validation fixes in dEQP-VK.pipeline 92728bd Bug Fix: Corrected barriers in the tests dEQP-VK.compute ad4a38e Bug Fix: Corrected barrier in the tests dEQP-VK.ubo 750f819 Fix unused parameter warning in vktDrawIndirectTest.cpp 7df90ed deqp-vk-draw: split indirect_draw tests into groups depending on `drawIndirectFirstInstance` optional feature 9025139 Remove initialization check for deviceName 9312e31 Fix VkPhysicalDeviceProperties init validation 4803b08 Fix a few issues in tessellation shader executors As well as following cherry-picks: b215306 Fix various compiler warnings fad252e vktWsiSurfaceTests: fixed bug in surface capabilities validation where surface's height was tested with respect to width's limits. 4a57a13 vktWsiSwapchainTests: remove redundant barrier (already realised by subpass dependencies) 8a07cbb vktWsiSwapchainTests: remove incorrect barrier (COLOR_ATTACHMENT_OPT -> PRESENT_SRC), while image is already in PRESENT_SRC layout 9b48af0 vktWsiSwapchainTests: fixes for swapchain parameters fb3fd80 WSI: depthClamp is an optional feature, disable it Bug: 28911346 Change-Id: I124cdecdc5472e5889d40ae5b66baffa074df7ca --- android/cts/master/com.drawelements.deqp.vk.xml | 45 ++-- android/cts/master/vk-master.txt | 11 +- external/vulkancts/LICENSE | 2 +- external/vulkancts/README.md | 2 +- .../data/vulkan/draw/VertexFetchInstanced.vert | 14 ++ ...vert => VertexFetchInstancedFirstInstance.vert} | 0 .../vulkancts/data/vulkan/glsl/es310/linkage.test | 26 --- .../vulkan/api/vktApiCopiesAndBlittingTests.cpp | 104 ++++----- .../modules/vulkan/api/vktApiFeatureInfo.cpp | 235 +++++++++++---------- .../vulkan/api/vktApiObjectManagementTests.cpp | 4 +- .../modules/vulkan/api/vktApiSmokeTests.cpp | 4 +- .../binding_model/vktBindingShaderAccessTests.cpp | 62 ++---- .../compute/vktComputeBasicComputeShaderTests.cpp | 9 +- .../modules/vulkan/draw/vktDrawIndexedTest.cpp | 2 +- .../modules/vulkan/draw/vktDrawIndirectTest.cpp | 90 +++++--- .../modules/vulkan/draw/vktDrawSimpleTest.cpp | 2 +- .../memory/vktMemoryPipelineBarrierTests.cpp | 2 +- .../vulkan/pipeline/vktPipelineBlendTests.cpp | 23 +- .../vulkan/pipeline/vktPipelineDepthTests.cpp | 46 +++- .../pipeline/vktPipelineImageSamplingInstance.cpp | 22 +- .../vulkan/pipeline/vktPipelineImageUtil.cpp | 2 +- .../pipeline/vktPipelineInputAssemblyTests.cpp | 22 +- .../pipeline/vktPipelineMultisampleTests.cpp | 38 +++- .../pipeline/vktPipelinePushConstantTests.cpp | 22 +- .../vulkan/pipeline/vktPipelineStencilTests.cpp | 46 +++- .../vulkan/pipeline/vktPipelineTimestampTests.cpp | 51 ++++- .../pipeline/vktPipelineVertexInputTests.cpp | 22 +- .../query_pool/vktQueryPoolImageObjectUtil.cpp | 50 ++--- .../query_pool/vktQueryPoolImageObjectUtil.hpp | 19 +- .../query_pool/vktQueryPoolOcclusionTests.cpp | 38 +--- .../vulkan/shaderexecutor/vktShaderExecutor.cpp | 33 +-- .../vulkan/shaderrender/vktShaderRender.cpp | 8 +- .../modules/vulkan/ssbo/vktSSBOLayoutCase.cpp | 21 +- .../modules/vulkan/ubo/vktUniformBlockCase.cpp | 28 +++ .../modules/vulkan/vktRenderPassTests.cpp | 120 ++++++----- .../vulkancts/modules/vulkan/vktShaderLibrary.cpp | 10 +- .../modules/vulkan/wsi/vktWsiSurfaceTests.cpp | 2 +- .../modules/vulkan/wsi/vktWsiSwapchainTests.cpp | 73 +------ external/vulkancts/mustpass/1.0.0/vk-default.txt | 11 +- framework/delibs/debase/deString.c | 13 +- framework/delibs/debase/deString.h | 1 + 41 files changed, 788 insertions(+), 547 deletions(-) create mode 100644 external/vulkancts/data/vulkan/draw/VertexFetchInstanced.vert rename external/vulkancts/data/vulkan/draw/{VertexFetchWithInstance.vert => VertexFetchInstancedFirstInstance.vert} (100%) diff --git a/android/cts/master/com.drawelements.deqp.vk.xml b/android/cts/master/com.drawelements.deqp.vk.xml index 9a3bec3..1a42095 100644 --- a/android/cts/master/com.drawelements.deqp.vk.xml +++ b/android/cts/master/com.drawelements.deqp.vk.xml @@ -207532,9 +207532,6 @@ - - - @@ -257564,20 +257561,34 @@ - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/android/cts/master/vk-master.txt b/android/cts/master/vk-master.txt index 03e31f3..df1b257 100644 --- a/android/cts/master/vk-master.txt +++ b/android/cts/master/vk-master.txt @@ -63839,7 +63839,6 @@ dEQP-VK.glsl.functions.misc.argument_eval_order_1_vertex dEQP-VK.glsl.functions.misc.argument_eval_order_1_fragment dEQP-VK.glsl.functions.misc.argument_eval_order_2_vertex dEQP-VK.glsl.functions.misc.argument_eval_order_2_fragment -dEQP-VK.glsl.linkage.varying.rules.fragment_declare dEQP-VK.glsl.linkage.varying.rules.vertex_declare dEQP-VK.glsl.linkage.varying.rules.both_declare dEQP-VK.glsl.linkage.varying.rules.vertex_declare_fragment_use @@ -79904,10 +79903,12 @@ dEQP-VK.draw.indexed_draw.draw_indexed_triangle_list dEQP-VK.draw.indexed_draw.draw_indexed_triangle_strip dEQP-VK.draw.indexed_draw.draw_instanced_indexed_triangle_list dEQP-VK.draw.indexed_draw.draw_instanced_indexed_triangle_strip -dEQP-VK.draw.indirect_draw.indirect_draw_triangle_list -dEQP-VK.draw.indirect_draw.indirect_draw_triangle_strip -dEQP-VK.draw.indirect_draw.indirect_draw_instanced_triangle_list -dEQP-VK.draw.indirect_draw.indirect_draw_instanced_triangle_strip +dEQP-VK.draw.indirect_draw.indirect_draw.triangle_list +dEQP-VK.draw.indirect_draw.indirect_draw.triangle_strip +dEQP-VK.draw.indirect_draw.indirect_draw_instanced.no_first_instance.triangle_list +dEQP-VK.draw.indirect_draw.indirect_draw_instanced.no_first_instance.triangle_strip +dEQP-VK.draw.indirect_draw.indirect_draw_instanced.first_instance.triangle_list +dEQP-VK.draw.indirect_draw.indirect_draw_instanced.first_instance.triangle_strip dEQP-VK.compute.basic.empty_shader dEQP-VK.compute.basic.ubo_to_ssbo_single_invocation dEQP-VK.compute.basic.ubo_to_ssbo_single_group diff --git a/external/vulkancts/LICENSE b/external/vulkancts/LICENSE index 0a93ef7..d645695 100644 --- a/external/vulkancts/LICENSE +++ b/external/vulkancts/LICENSE @@ -187,7 +187,7 @@ same "printed page" as the copyright notice for easier identification within third-party archives. - Copyright 2014 The Android Open Source Project + Copyright [yyyy] [name of copyright owner] Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/external/vulkancts/README.md b/external/vulkancts/README.md index 8e854bf..e088a5a 100644 --- a/external/vulkancts/README.md +++ b/external/vulkancts/README.md @@ -218,7 +218,7 @@ if `vk::Platform::describePlatform()` is implemented. If the submission package covers multiple products, you can list them by appending additional `PRODUCT:` lines to the conformance statement. For example: - CONFORM_VERSION: vulkan-cts-1.0.0-internal + CONFORM_VERSION: vulkan-cts-1.0.0.2 PRODUCT: Product A PRODUCT: Product B ... diff --git a/external/vulkancts/data/vulkan/draw/VertexFetchInstanced.vert b/external/vulkancts/data/vulkan/draw/VertexFetchInstanced.vert new file mode 100644 index 0000000..e694f60 --- /dev/null +++ b/external/vulkancts/data/vulkan/draw/VertexFetchInstanced.vert @@ -0,0 +1,14 @@ +#version 430 + +layout(location = 0) in vec4 in_position; +layout(location = 1) in vec4 in_color; + +layout(location = 0) out vec4 out_color; + +void main() { + vec2 perVertex = vec2(in_position.x, in_position.y); + vec2 perInstance[6] = vec2[6](vec2(0.0, 0.0), vec2(0.3, 0.0), vec2(0.0, -0.3),vec2(0.3, -0.3), vec2(0.7, -0.7), vec2(-0.75, 0.8)); + + gl_Position = vec4(perVertex + perInstance[gl_InstanceIndex], 0.0, 1.0); + out_color = in_color; +} \ No newline at end of file diff --git a/external/vulkancts/data/vulkan/draw/VertexFetchWithInstance.vert b/external/vulkancts/data/vulkan/draw/VertexFetchInstancedFirstInstance.vert similarity index 100% rename from external/vulkancts/data/vulkan/draw/VertexFetchWithInstance.vert rename to external/vulkancts/data/vulkan/draw/VertexFetchInstancedFirstInstance.vert diff --git a/external/vulkancts/data/vulkan/glsl/es310/linkage.test b/external/vulkancts/data/vulkan/glsl/es310/linkage.test index 21c62b0..d463062 100644 --- a/external/vulkancts/data/vulkan/glsl/es310/linkage.test +++ b/external/vulkancts/data/vulkan/glsl/es310/linkage.test @@ -4,32 +4,6 @@ group varying "Varying linkage" # Linking rules group rules "Varying linking rules" - # not declared in vertex shader, declared in fragment shader - case fragment_declare - version 310 es - desc "varying declared in fragment shader, no reference in vertex shader" - values { output float out0 = 1.0; } - vertex "" - #version 310 es - ${VERTEX_DECLARATIONS} - void main() - { - ${VERTEX_OUTPUT} - } - "" - fragment "" - #version 310 es - precision mediump float; - layout(location = 0) in mediump float var; - ${FRAGMENT_DECLARATIONS} - void main() - { - out0 = 1.0; - ${FRAGMENT_OUTPUT} - } - "" - end - # declared in vertex shader, no reference in frag shader case vertex_declare version 310 es diff --git a/external/vulkancts/modules/vulkan/api/vktApiCopiesAndBlittingTests.cpp b/external/vulkancts/modules/vulkan/api/vktApiCopiesAndBlittingTests.cpp index 1dda81a..43bd8a9 100644 --- a/external/vulkancts/modules/vulkan/api/vktApiCopiesAndBlittingTests.cpp +++ b/external/vulkancts/modules/vulkan/api/vktApiCopiesAndBlittingTests.cpp @@ -296,7 +296,7 @@ void CopiesAndBlittingTestInstance::uploadImage(tcu::ConstPixelBufferAccess imag VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER, // VkStructureType sType; DE_NULL, // const void* pNext; 0u, // VkAccessFlags srcAccessMask; - 0u, // VkAccessFlags dstAccessMask; + VK_ACCESS_TRANSFER_WRITE_BIT, // VkAccessFlags dstAccessMask; VK_IMAGE_LAYOUT_UNDEFINED, // VkImageLayout oldLayout; VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL, // VkImageLayout newLayout; VK_QUEUE_FAMILY_IGNORED, // deUint32 srcQueueFamilyIndex; @@ -705,45 +705,46 @@ tcu::TestStatus CopyImageToImage::iterate() for (deUint32 i = 0; i < m_params.regions.size(); i++) imageCopies[i] = m_params.regions[i].imageCopy; - // Barriers for copying image to buffer - const VkImageMemoryBarrier srcImageBarrier = - { - VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER, // VkStructureType sType; - DE_NULL, // const void* pNext; - VK_ACCESS_TRANSFER_WRITE_BIT, // VkAccessFlags srcAccessMask; - VK_ACCESS_TRANSFER_READ_BIT, // VkAccessFlags dstAccessMask; - VK_IMAGE_LAYOUT_GENERAL, // VkImageLayout oldLayout; - VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL, // VkImageLayout newLayout; - VK_QUEUE_FAMILY_IGNORED, // deUint32 srcQueueFamilyIndex; - VK_QUEUE_FAMILY_IGNORED, // deUint32 dstQueueFamilyIndex; - m_source.get(), // VkImage image; - { // VkImageSubresourceRange subresourceRange; - getAspectFlag(srcTcuFormat), // VkImageAspectFlags aspectMask; - 0u, // deUint32 baseMipLevel; - 1u, // deUint32 mipLevels; - 0u, // deUint32 baseArraySlice; - 1u // deUint32 arraySize; - } - }; - - const VkImageMemoryBarrier dstImageBarrier = + const VkImageMemoryBarrier imageBarriers[] = { - VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER, // VkStructureType sType; - DE_NULL, // const void* pNext; - VK_ACCESS_TRANSFER_WRITE_BIT, // VkAccessFlags srcAccessMask; - VK_ACCESS_TRANSFER_READ_BIT, // VkAccessFlags dstAccessMask; - VK_IMAGE_LAYOUT_GENERAL, // VkImageLayout oldLayout; - VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL, // VkImageLayout newLayout; - VK_QUEUE_FAMILY_IGNORED, // deUint32 srcQueueFamilyIndex; - VK_QUEUE_FAMILY_IGNORED, // deUint32 dstQueueFamilyIndex; - m_destination.get(), // VkImage image; - { // VkImageSubresourceRange subresourceRange; - getAspectFlag(dstTcuFormat), // VkImageAspectFlags aspectMask; - 0u, // deUint32 baseMipLevel; - 1u, // deUint32 mipLevels; - 0u, // deUint32 baseArraySlice; - 1u // deUint32 arraySize; - } + // source image + { + VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER, // VkStructureType sType; + DE_NULL, // const void* pNext; + VK_ACCESS_TRANSFER_WRITE_BIT, // VkAccessFlags srcAccessMask; + VK_ACCESS_TRANSFER_READ_BIT, // VkAccessFlags dstAccessMask; + VK_IMAGE_LAYOUT_GENERAL, // VkImageLayout oldLayout; + VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL, // VkImageLayout newLayout; + VK_QUEUE_FAMILY_IGNORED, // deUint32 srcQueueFamilyIndex; + VK_QUEUE_FAMILY_IGNORED, // deUint32 dstQueueFamilyIndex; + m_source.get(), // VkImage image; + { // VkImageSubresourceRange subresourceRange; + getAspectFlag(srcTcuFormat), // VkImageAspectFlags aspectMask; + 0u, // deUint32 baseMipLevel; + 1u, // deUint32 mipLevels; + 0u, // deUint32 baseArraySlice; + 1u // deUint32 arraySize; + } + }, + // destination image + { + VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER, // VkStructureType sType; + DE_NULL, // const void* pNext; + VK_ACCESS_TRANSFER_WRITE_BIT, // VkAccessFlags srcAccessMask; + VK_ACCESS_TRANSFER_WRITE_BIT, // VkAccessFlags dstAccessMask; + VK_IMAGE_LAYOUT_GENERAL, // VkImageLayout oldLayout; + VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL, // VkImageLayout newLayout; + VK_QUEUE_FAMILY_IGNORED, // deUint32 srcQueueFamilyIndex; + VK_QUEUE_FAMILY_IGNORED, // deUint32 dstQueueFamilyIndex; + m_destination.get(), // VkImage image; + { // VkImageSubresourceRange subresourceRange; + getAspectFlag(dstTcuFormat), // VkImageAspectFlags aspectMask; + 0u, // deUint32 baseMipLevel; + 1u, // deUint32 mipLevels; + 0u, // deUint32 baseArraySlice; + 1u // deUint32 arraySize; + } + }, }; const VkCommandBufferBeginInfo cmdBufferBeginInfo = @@ -755,9 +756,8 @@ tcu::TestStatus CopyImageToImage::iterate() }; VK_CHECK(vk.beginCommandBuffer(*m_cmdBuffer, &cmdBufferBeginInfo)); - vk.cmdPipelineBarrier(*m_cmdBuffer, VK_PIPELINE_STAGE_TRANSFER_BIT, VK_PIPELINE_STAGE_TRANSFER_BIT, (VkDependencyFlags)0, 0, (const VkMemoryBarrier*)DE_NULL, 0, (const VkBufferMemoryBarrier*)DE_NULL, 1, &srcImageBarrier); + vk.cmdPipelineBarrier(*m_cmdBuffer, VK_PIPELINE_STAGE_TRANSFER_BIT, VK_PIPELINE_STAGE_TRANSFER_BIT, (VkDependencyFlags)0, 0, (const VkMemoryBarrier*)DE_NULL, 0, (const VkBufferMemoryBarrier*)DE_NULL, DE_LENGTH_OF_ARRAY(imageBarriers), imageBarriers); vk.cmdCopyImage(*m_cmdBuffer, m_source.get(), VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL, m_destination.get(), VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL, (deUint32)m_params.regions.size(), imageCopies); - vk.cmdPipelineBarrier(*m_cmdBuffer, VK_PIPELINE_STAGE_TRANSFER_BIT, VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT, (VkDependencyFlags)0, 0, (const VkMemoryBarrier*)DE_NULL, 0, (const VkBufferMemoryBarrier*)DE_NULL, 1, &dstImageBarrier); VK_CHECK(vk.endCommandBuffer(*m_cmdBuffer)); const VkSubmitInfo submitInfo = @@ -1320,28 +1320,14 @@ tcu::TestStatus CopyBufferToImage::iterate() const VkQueue queue = m_context.getUniversalQueue(); SimpleAllocator memAlloc (vk, vkDevice, getPhysicalDeviceMemoryProperties(m_context.getInstanceInterface(), m_context.getPhysicalDevice())); - // Barriers for copying image to buffer - const VkBufferMemoryBarrier bufferBarrier = - { - VK_STRUCTURE_TYPE_BUFFER_MEMORY_BARRIER, // VkStructureType sType; - DE_NULL, // const void* pNext; - VK_ACCESS_TRANSFER_WRITE_BIT, // VkAccessFlags srcAccessMask; - VK_ACCESS_HOST_READ_BIT, // VkAccessFlags dstAccessMask; - VK_QUEUE_FAMILY_IGNORED, // deUint32 srcQueueFamilyIndex; - VK_QUEUE_FAMILY_IGNORED, // deUint32 dstQueueFamilyIndex; - *m_source, // VkBuffer buffer; - 0u, // VkDeviceSize offset; - m_bufferSize // VkDeviceSize size; - }; - const VkImageMemoryBarrier imageBarrier = { VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER, // VkStructureType sType; DE_NULL, // const void* pNext; VK_ACCESS_TRANSFER_WRITE_BIT, // VkAccessFlags srcAccessMask; - VK_ACCESS_TRANSFER_READ_BIT, // VkAccessFlags dstAccessMask; + VK_ACCESS_TRANSFER_WRITE_BIT, // VkAccessFlags dstAccessMask; VK_IMAGE_LAYOUT_GENERAL, // VkImageLayout oldLayout; - VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL, // VkImageLayout newLayout; + VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL, // VkImageLayout newLayout; VK_QUEUE_FAMILY_IGNORED, // deUint32 srcQueueFamilyIndex; VK_QUEUE_FAMILY_IGNORED, // deUint32 dstQueueFamilyIndex; *m_destination, // VkImage image; @@ -1368,9 +1354,8 @@ tcu::TestStatus CopyBufferToImage::iterate() }; VK_CHECK(vk.beginCommandBuffer(*m_cmdBuffer, &cmdBufferBeginInfo)); - vk.cmdPipelineBarrier(*m_cmdBuffer, VK_PIPELINE_STAGE_TRANSFER_BIT, VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT, (VkDependencyFlags)0, 0, (const VkMemoryBarrier*)DE_NULL, 1, &bufferBarrier, 0, (const VkImageMemoryBarrier*)DE_NULL); - vk.cmdCopyBufferToImage(*m_cmdBuffer, m_source.get(), m_destination.get(), VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL, (deUint32)m_params.regions.size(), bufferImageCopies); vk.cmdPipelineBarrier(*m_cmdBuffer, VK_PIPELINE_STAGE_TRANSFER_BIT, VK_PIPELINE_STAGE_TRANSFER_BIT, (VkDependencyFlags)0, 0, (const VkMemoryBarrier*)DE_NULL, 0, (const VkBufferMemoryBarrier*)DE_NULL, 1, &imageBarrier); + vk.cmdCopyBufferToImage(*m_cmdBuffer, m_source.get(), m_destination.get(), VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL, (deUint32)m_params.regions.size(), bufferImageCopies); VK_CHECK(vk.endCommandBuffer(*m_cmdBuffer)); const VkSubmitInfo submitInfo = @@ -1390,7 +1375,6 @@ tcu::TestStatus CopyBufferToImage::iterate() VK_CHECK(vk.queueSubmit(queue, 1, &submitInfo, *m_fence)); VK_CHECK(vk.waitForFences(vkDevice, 1, &m_fence.get(), true, ~(0ull) /* infinity */)); - // Read buffer data de::MovePtr resultLevel = readImage(vk, vkDevice, queue, memAlloc, *m_destination, m_params.dst.image.format, m_params.dst.image.extent); deFree(bufferImageCopies); diff --git a/external/vulkancts/modules/vulkan/api/vktApiFeatureInfo.cpp b/external/vulkancts/modules/vulkan/api/vktApiFeatureInfo.cpp index 41a9633..35c735f 100644 --- a/external/vulkancts/modules/vulkan/api/vktApiFeatureInfo.cpp +++ b/external/vulkancts/modules/vulkan/api/vktApiFeatureInfo.cpp @@ -40,6 +40,7 @@ #include "tcuResultCollector.hpp" #include "deUniquePtr.hpp" +#include "deString.h" #include "deStringUtil.hpp" #include "deSTLUtil.hpp" #include "deMemory.h" @@ -673,114 +674,125 @@ tcu::TestStatus deviceProperties (Context& context) VkPhysicalDeviceFeatures features; deUint8 buffer[sizeof(VkPhysicalDeviceProperties) + GUARD_SIZE]; - const QueryMemberTableEntry limitOffsetTable[] = + const QueryMemberTableEntry physicalDevicePropertiesOffsetTable[] = { - OFFSET_TABLE_ENTRY(VkPhysicalDeviceLimits, maxImageDimension1D), - OFFSET_TABLE_ENTRY(VkPhysicalDeviceLimits, maxImageDimension2D), - OFFSET_TABLE_ENTRY(VkPhysicalDeviceLimits, maxImageDimension3D), - OFFSET_TABLE_ENTRY(VkPhysicalDeviceLimits, maxImageDimensionCube), - OFFSET_TABLE_ENTRY(VkPhysicalDeviceLimits, maxImageArrayLayers), - OFFSET_TABLE_ENTRY(VkPhysicalDeviceLimits, maxTexelBufferElements), - OFFSET_TABLE_ENTRY(VkPhysicalDeviceLimits, maxUniformBufferRange), - OFFSET_TABLE_ENTRY(VkPhysicalDeviceLimits, maxStorageBufferRange), - OFFSET_TABLE_ENTRY(VkPhysicalDeviceLimits, maxPushConstantsSize), - OFFSET_TABLE_ENTRY(VkPhysicalDeviceLimits, maxMemoryAllocationCount), - OFFSET_TABLE_ENTRY(VkPhysicalDeviceLimits, maxSamplerAllocationCount), - OFFSET_TABLE_ENTRY(VkPhysicalDeviceLimits, bufferImageGranularity), - OFFSET_TABLE_ENTRY(VkPhysicalDeviceLimits, sparseAddressSpaceSize), - OFFSET_TABLE_ENTRY(VkPhysicalDeviceLimits, maxBoundDescriptorSets), - OFFSET_TABLE_ENTRY(VkPhysicalDeviceLimits, maxPerStageDescriptorSamplers), - OFFSET_TABLE_ENTRY(VkPhysicalDeviceLimits, maxPerStageDescriptorUniformBuffers), - OFFSET_TABLE_ENTRY(VkPhysicalDeviceLimits, maxPerStageDescriptorStorageBuffers), - OFFSET_TABLE_ENTRY(VkPhysicalDeviceLimits, maxPerStageDescriptorSampledImages), - OFFSET_TABLE_ENTRY(VkPhysicalDeviceLimits, maxPerStageDescriptorStorageImages), - OFFSET_TABLE_ENTRY(VkPhysicalDeviceLimits, maxPerStageDescriptorInputAttachments), - OFFSET_TABLE_ENTRY(VkPhysicalDeviceLimits, maxPerStageResources), - OFFSET_TABLE_ENTRY(VkPhysicalDeviceLimits, maxDescriptorSetSamplers), - OFFSET_TABLE_ENTRY(VkPhysicalDeviceLimits, maxDescriptorSetUniformBuffers), - OFFSET_TABLE_ENTRY(VkPhysicalDeviceLimits, maxDescriptorSetUniformBuffersDynamic), - OFFSET_TABLE_ENTRY(VkPhysicalDeviceLimits, maxDescriptorSetStorageBuffers), - OFFSET_TABLE_ENTRY(VkPhysicalDeviceLimits, maxDescriptorSetStorageBuffersDynamic), - OFFSET_TABLE_ENTRY(VkPhysicalDeviceLimits, maxDescriptorSetSampledImages), - OFFSET_TABLE_ENTRY(VkPhysicalDeviceLimits, maxDescriptorSetStorageImages), - OFFSET_TABLE_ENTRY(VkPhysicalDeviceLimits, maxDescriptorSetInputAttachments), - OFFSET_TABLE_ENTRY(VkPhysicalDeviceLimits, maxVertexInputAttributes), - OFFSET_TABLE_ENTRY(VkPhysicalDeviceLimits, maxVertexInputBindings), - OFFSET_TABLE_ENTRY(VkPhysicalDeviceLimits, maxVertexInputAttributeOffset), - OFFSET_TABLE_ENTRY(VkPhysicalDeviceLimits, maxVertexInputBindingStride), - OFFSET_TABLE_ENTRY(VkPhysicalDeviceLimits, maxVertexOutputComponents), - OFFSET_TABLE_ENTRY(VkPhysicalDeviceLimits, maxTessellationGenerationLevel), - OFFSET_TABLE_ENTRY(VkPhysicalDeviceLimits, maxTessellationPatchSize), - OFFSET_TABLE_ENTRY(VkPhysicalDeviceLimits, maxTessellationControlPerVertexInputComponents), - OFFSET_TABLE_ENTRY(VkPhysicalDeviceLimits, maxTessellationControlPerVertexOutputComponents), - OFFSET_TABLE_ENTRY(VkPhysicalDeviceLimits, maxTessellationControlPerPatchOutputComponents), - OFFSET_TABLE_ENTRY(VkPhysicalDeviceLimits, maxTessellationControlTotalOutputComponents), - OFFSET_TABLE_ENTRY(VkPhysicalDeviceLimits, maxTessellationEvaluationInputComponents), - OFFSET_TABLE_ENTRY(VkPhysicalDeviceLimits, maxTessellationEvaluationOutputComponents), - OFFSET_TABLE_ENTRY(VkPhysicalDeviceLimits, maxGeometryShaderInvocations), - OFFSET_TABLE_ENTRY(VkPhysicalDeviceLimits, maxGeometryInputComponents), - OFFSET_TABLE_ENTRY(VkPhysicalDeviceLimits, maxGeometryOutputComponents), - OFFSET_TABLE_ENTRY(VkPhysicalDeviceLimits, maxGeometryOutputVertices), - OFFSET_TABLE_ENTRY(VkPhysicalDeviceLimits, maxGeometryTotalOutputComponents), - OFFSET_TABLE_ENTRY(VkPhysicalDeviceLimits, maxFragmentInputComponents), - OFFSET_TABLE_ENTRY(VkPhysicalDeviceLimits, maxFragmentOutputAttachments), - OFFSET_TABLE_ENTRY(VkPhysicalDeviceLimits, maxFragmentDualSrcAttachments), - OFFSET_TABLE_ENTRY(VkPhysicalDeviceLimits, maxFragmentCombinedOutputResources), - OFFSET_TABLE_ENTRY(VkPhysicalDeviceLimits, maxComputeSharedMemorySize), - OFFSET_TABLE_ENTRY(VkPhysicalDeviceLimits, maxComputeWorkGroupCount[3]), - OFFSET_TABLE_ENTRY(VkPhysicalDeviceLimits, maxComputeWorkGroupInvocations), - OFFSET_TABLE_ENTRY(VkPhysicalDeviceLimits, maxComputeWorkGroupSize[3]), - OFFSET_TABLE_ENTRY(VkPhysicalDeviceLimits, subPixelPrecisionBits), - OFFSET_TABLE_ENTRY(VkPhysicalDeviceLimits, subTexelPrecisionBits), - OFFSET_TABLE_ENTRY(VkPhysicalDeviceLimits, mipmapPrecisionBits), - OFFSET_TABLE_ENTRY(VkPhysicalDeviceLimits, maxDrawIndexedIndexValue), - OFFSET_TABLE_ENTRY(VkPhysicalDeviceLimits, maxDrawIndirectCount), - OFFSET_TABLE_ENTRY(VkPhysicalDeviceLimits, maxSamplerLodBias), - OFFSET_TABLE_ENTRY(VkPhysicalDeviceLimits, maxSamplerAnisotropy), - OFFSET_TABLE_ENTRY(VkPhysicalDeviceLimits, maxViewports), - OFFSET_TABLE_ENTRY(VkPhysicalDeviceLimits, maxViewportDimensions[2]), - OFFSET_TABLE_ENTRY(VkPhysicalDeviceLimits, viewportBoundsRange[2]), - OFFSET_TABLE_ENTRY(VkPhysicalDeviceLimits, viewportSubPixelBits), - OFFSET_TABLE_ENTRY(VkPhysicalDeviceLimits, minMemoryMapAlignment), - OFFSET_TABLE_ENTRY(VkPhysicalDeviceLimits, minTexelBufferOffsetAlignment), - OFFSET_TABLE_ENTRY(VkPhysicalDeviceLimits, minUniformBufferOffsetAlignment), - OFFSET_TABLE_ENTRY(VkPhysicalDeviceLimits, minStorageBufferOffsetAlignment), - OFFSET_TABLE_ENTRY(VkPhysicalDeviceLimits, minTexelOffset), - OFFSET_TABLE_ENTRY(VkPhysicalDeviceLimits, maxTexelOffset), - OFFSET_TABLE_ENTRY(VkPhysicalDeviceLimits, minTexelGatherOffset), - OFFSET_TABLE_ENTRY(VkPhysicalDeviceLimits, maxTexelGatherOffset), - OFFSET_TABLE_ENTRY(VkPhysicalDeviceLimits, minInterpolationOffset), - OFFSET_TABLE_ENTRY(VkPhysicalDeviceLimits, maxInterpolationOffset), - OFFSET_TABLE_ENTRY(VkPhysicalDeviceLimits, subPixelInterpolationOffsetBits), - OFFSET_TABLE_ENTRY(VkPhysicalDeviceLimits, maxFramebufferWidth), - OFFSET_TABLE_ENTRY(VkPhysicalDeviceLimits, maxFramebufferHeight), - OFFSET_TABLE_ENTRY(VkPhysicalDeviceLimits, maxFramebufferLayers), - OFFSET_TABLE_ENTRY(VkPhysicalDeviceLimits, framebufferColorSampleCounts), - OFFSET_TABLE_ENTRY(VkPhysicalDeviceLimits, framebufferDepthSampleCounts), - OFFSET_TABLE_ENTRY(VkPhysicalDeviceLimits, framebufferStencilSampleCounts), - OFFSET_TABLE_ENTRY(VkPhysicalDeviceLimits, framebufferNoAttachmentsSampleCounts), - OFFSET_TABLE_ENTRY(VkPhysicalDeviceLimits, maxColorAttachments), - OFFSET_TABLE_ENTRY(VkPhysicalDeviceLimits, sampledImageColorSampleCounts), - OFFSET_TABLE_ENTRY(VkPhysicalDeviceLimits, sampledImageIntegerSampleCounts), - OFFSET_TABLE_ENTRY(VkPhysicalDeviceLimits, sampledImageDepthSampleCounts), - OFFSET_TABLE_ENTRY(VkPhysicalDeviceLimits, sampledImageStencilSampleCounts), - OFFSET_TABLE_ENTRY(VkPhysicalDeviceLimits, storageImageSampleCounts), - OFFSET_TABLE_ENTRY(VkPhysicalDeviceLimits, maxSampleMaskWords), - OFFSET_TABLE_ENTRY(VkPhysicalDeviceLimits, timestampComputeAndGraphics), - OFFSET_TABLE_ENTRY(VkPhysicalDeviceLimits, timestampPeriod), - OFFSET_TABLE_ENTRY(VkPhysicalDeviceLimits, maxClipDistances), - OFFSET_TABLE_ENTRY(VkPhysicalDeviceLimits, maxCullDistances), - OFFSET_TABLE_ENTRY(VkPhysicalDeviceLimits, maxCombinedClipAndCullDistances), - OFFSET_TABLE_ENTRY(VkPhysicalDeviceLimits, discreteQueuePriorities), - OFFSET_TABLE_ENTRY(VkPhysicalDeviceLimits, pointSizeRange[2]), - OFFSET_TABLE_ENTRY(VkPhysicalDeviceLimits, lineWidthRange[2]), - OFFSET_TABLE_ENTRY(VkPhysicalDeviceLimits, pointSizeGranularity), - OFFSET_TABLE_ENTRY(VkPhysicalDeviceLimits, lineWidthGranularity), - OFFSET_TABLE_ENTRY(VkPhysicalDeviceLimits, strictLines), - OFFSET_TABLE_ENTRY(VkPhysicalDeviceLimits, standardSampleLocations), - OFFSET_TABLE_ENTRY(VkPhysicalDeviceLimits, optimalBufferCopyOffsetAlignment), - OFFSET_TABLE_ENTRY(VkPhysicalDeviceLimits, optimalBufferCopyRowPitchAlignment), - OFFSET_TABLE_ENTRY(VkPhysicalDeviceLimits, nonCoherentAtomSize), + OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, apiVersion), + OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, driverVersion), + OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, vendorID), + OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, deviceID), + OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, deviceType), + OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, pipelineCacheUUID), + OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.maxImageDimension1D), + OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.maxImageDimension2D), + OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.maxImageDimension3D), + OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.maxImageDimensionCube), + OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.maxImageArrayLayers), + OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.maxTexelBufferElements), + OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.maxUniformBufferRange), + OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.maxStorageBufferRange), + OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.maxPushConstantsSize), + OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.maxMemoryAllocationCount), + OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.maxSamplerAllocationCount), + OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.bufferImageGranularity), + OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.sparseAddressSpaceSize), + OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.maxBoundDescriptorSets), + OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.maxPerStageDescriptorSamplers), + OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.maxPerStageDescriptorUniformBuffers), + OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.maxPerStageDescriptorStorageBuffers), + OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.maxPerStageDescriptorSampledImages), + OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.maxPerStageDescriptorStorageImages), + OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.maxPerStageDescriptorInputAttachments), + OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.maxPerStageResources), + OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.maxDescriptorSetSamplers), + OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.maxDescriptorSetUniformBuffers), + OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.maxDescriptorSetUniformBuffersDynamic), + OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.maxDescriptorSetStorageBuffers), + OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.maxDescriptorSetStorageBuffersDynamic), + OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.maxDescriptorSetSampledImages), + OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.maxDescriptorSetStorageImages), + OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.maxDescriptorSetInputAttachments), + OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.maxVertexInputAttributes), + OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.maxVertexInputBindings), + OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.maxVertexInputAttributeOffset), + OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.maxVertexInputBindingStride), + OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.maxVertexOutputComponents), + OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.maxTessellationGenerationLevel), + OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.maxTessellationPatchSize), + OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.maxTessellationControlPerVertexInputComponents), + OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.maxTessellationControlPerVertexOutputComponents), + OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.maxTessellationControlPerPatchOutputComponents), + OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.maxTessellationControlTotalOutputComponents), + OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.maxTessellationEvaluationInputComponents), + OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.maxTessellationEvaluationOutputComponents), + OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.maxGeometryShaderInvocations), + OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.maxGeometryInputComponents), + OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.maxGeometryOutputComponents), + OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.maxGeometryOutputVertices), + OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.maxGeometryTotalOutputComponents), + OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.maxFragmentInputComponents), + OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.maxFragmentOutputAttachments), + OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.maxFragmentDualSrcAttachments), + OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.maxFragmentCombinedOutputResources), + OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.maxComputeSharedMemorySize), + OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.maxComputeWorkGroupCount[3]), + OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.maxComputeWorkGroupInvocations), + OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.maxComputeWorkGroupSize[3]), + OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.subPixelPrecisionBits), + OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.subTexelPrecisionBits), + OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.mipmapPrecisionBits), + OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.maxDrawIndexedIndexValue), + OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.maxDrawIndirectCount), + OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.maxSamplerLodBias), + OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.maxSamplerAnisotropy), + OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.maxViewports), + OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.maxViewportDimensions[2]), + OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.viewportBoundsRange[2]), + OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.viewportSubPixelBits), + OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.minMemoryMapAlignment), + OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.minTexelBufferOffsetAlignment), + OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.minUniformBufferOffsetAlignment), + OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.minStorageBufferOffsetAlignment), + OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.minTexelOffset), + OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.maxTexelOffset), + OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.minTexelGatherOffset), + OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.maxTexelGatherOffset), + OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.minInterpolationOffset), + OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.maxInterpolationOffset), + OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.subPixelInterpolationOffsetBits), + OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.maxFramebufferWidth), + OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.maxFramebufferHeight), + OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.maxFramebufferLayers), + OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.framebufferColorSampleCounts), + OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.framebufferDepthSampleCounts), + OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.framebufferStencilSampleCounts), + OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.framebufferNoAttachmentsSampleCounts), + OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.maxColorAttachments), + OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.sampledImageColorSampleCounts), + OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.sampledImageIntegerSampleCounts), + OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.sampledImageDepthSampleCounts), + OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.sampledImageStencilSampleCounts), + OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.storageImageSampleCounts), + OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.maxSampleMaskWords), + OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.timestampComputeAndGraphics), + OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.timestampPeriod), + OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.maxClipDistances), + OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.maxCullDistances), + OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.maxCombinedClipAndCullDistances), + OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.discreteQueuePriorities), + OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.pointSizeRange[2]), + OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.lineWidthRange[2]), + OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.pointSizeGranularity), + OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.lineWidthGranularity), + OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.strictLines), + OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.standardSampleLocations), + OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.optimalBufferCopyOffsetAlignment), + OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.optimalBufferCopyRowPitchAlignment), + OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, limits.nonCoherentAtomSize), + OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, sparseProperties.residencyStandard2DBlockShape), + OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, sparseProperties.residencyStandard2DMultisampleBlockShape), + OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, sparseProperties.residencyStandard3DBlockShape), + OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, sparseProperties.residencyAlignedMipSize), + OFFSET_TABLE_ENTRY(VkPhysicalDeviceProperties, sparseProperties.residencyNonResidentStrict), { 0, 0 } }; @@ -805,12 +817,19 @@ tcu::TestStatus deviceProperties (Context& context) } } - if (!validateInitComplete(context.getPhysicalDevice(), &InstanceInterface::getPhysicalDeviceProperties, context.getInstanceInterface(), limitOffsetTable)) + if (!validateInitComplete(context.getPhysicalDevice(), &InstanceInterface::getPhysicalDeviceProperties, context.getInstanceInterface(), physicalDevicePropertiesOffsetTable)) { log << TestLog::Message << "deviceProperties - VkPhysicalDeviceProperties not completely initialized" << TestLog::EndMessage; return tcu::TestStatus::fail("deviceProperties incomplete initialization"); } + // Check if deviceName string is properly terminated. + if (deStrnlen(props->deviceName, VK_MAX_PHYSICAL_DEVICE_NAME_SIZE) == VK_MAX_PHYSICAL_DEVICE_NAME_SIZE) + { + log << TestLog::Message << "deviceProperties - VkPhysicalDeviceProperties deviceName not properly initialized" << TestLog::EndMessage; + return tcu::TestStatus::fail("deviceProperties incomplete initialization"); + } + { const ApiVersion deviceVersion = unpackVersion(props->apiVersion); const ApiVersion deqpVersion = unpackVersion(VK_API_VERSION); diff --git a/external/vulkancts/modules/vulkan/api/vktApiObjectManagementTests.cpp b/external/vulkancts/modules/vulkan/api/vktApiObjectManagementTests.cpp index e86d42a..5336d44 100644 --- a/external/vulkancts/modules/vulkan/api/vktApiObjectManagementTests.cpp +++ b/external/vulkancts/modules/vulkan/api/vktApiObjectManagementTests.cpp @@ -1645,8 +1645,8 @@ struct GraphicsPipeline VK_FALSE, // stencilTestEnable { VK_STENCIL_OP_KEEP, VK_STENCIL_OP_KEEP, VK_STENCIL_OP_KEEP, VK_COMPARE_OP_ALWAYS, 0u, 0u, 0u }, { VK_STENCIL_OP_KEEP, VK_STENCIL_OP_KEEP, VK_STENCIL_OP_KEEP, VK_COMPARE_OP_ALWAYS, 0u, 0u, 0u }, - -1.0f, // minDepthBounds - +1.0f, // maxDepthBounds + 0.0f, // minDepthBounds + 1.0f, // maxDepthBounds }; const VkPipelineColorBlendAttachmentState colorBlendAttState[]= { diff --git a/external/vulkancts/modules/vulkan/api/vktApiSmokeTests.cpp b/external/vulkancts/modules/vulkan/api/vktApiSmokeTests.cpp index e1985bd..e4a4826 100644 --- a/external/vulkancts/modules/vulkan/api/vktApiSmokeTests.cpp +++ b/external/vulkancts/modules/vulkan/api/vktApiSmokeTests.cpp @@ -473,8 +473,8 @@ tcu::TestStatus renderTriangleTest (Context& context) 0u, // writeMask 0u, // reference }, // back; - -1.0f, // float minDepthBounds; - +1.0f, // float maxDepthBounds; + 0.0f, // float minDepthBounds; + 1.0f, // float maxDepthBounds; }; const VkViewport viewport0 = { diff --git a/external/vulkancts/modules/vulkan/binding_model/vktBindingShaderAccessTests.cpp b/external/vulkancts/modules/vulkan/binding_model/vktBindingShaderAccessTests.cpp index b7773a0..270f2fb 100644 --- a/external/vulkancts/modules/vulkan/binding_model/vktBindingShaderAccessTests.cpp +++ b/external/vulkancts/modules/vulkan/binding_model/vktBindingShaderAccessTests.cpp @@ -676,8 +676,16 @@ tcu::TestStatus SingleTargetRenderInstance::iterate (void) vk::VK_COMMAND_BUFFER_USAGE_ONE_TIME_SUBMIT_BIT, // flags (const vk::VkCommandBufferInheritanceInfo*)DE_NULL, }; + const vk::VkFenceCreateInfo fenceCreateInfo = + { + vk::VK_STRUCTURE_TYPE_FENCE_CREATE_INFO, + DE_NULL, + (vk::VkFenceCreateFlags)0, + }; const vk::Unique cmd (vk::allocateCommandBuffer(m_vki, m_device, &cmdBufAllocInfo)); + const vk::Unique fence (vk::createFence(m_vki, m_device, &fenceCreateInfo)); + const deUint64 infiniteTimeout = ~(deUint64)0u; VK_CHECK(m_vki.beginCommandBuffer(*cmd, &cmdBufBeginInfo)); m_vki.cmdPipelineBarrier(*cmd, vk::VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT, vk::VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT, (vk::VkDependencyFlags)0, @@ -700,8 +708,9 @@ tcu::TestStatus SingleTargetRenderInstance::iterate (void) (const vk::VkSemaphore*)0, }; - VK_CHECK(m_vki.queueSubmit(m_queue, 1, &submitInfo, (vk::VkFence)0)); + VK_CHECK(m_vki.queueSubmit(m_queue, 1u, &submitInfo, *fence)); } + VK_CHECK(m_vki.waitForFences(m_device, 1u, &fence.get(), vk::VK_TRUE, infiniteTimeout)); // and then render to renderToTarget(); @@ -1290,6 +1299,8 @@ vk::Move BufferRenderInstance::createSourceBuffer (const vk::Devic flushMappedMemoryRange(vki, device, bufferMemory->getMemory(), bufferMemory->getOffset(), bufferSize); + // Flushed host-visible memory is automatically made available to the GPU, no barrier is needed. + *outMemory = bufferMemory; return buffer; } @@ -1457,8 +1468,6 @@ vk::VkPipelineLayout BufferRenderInstance::getPipelineLayout (void) const void BufferRenderInstance::writeDrawCmdBuffer (vk::VkCommandBuffer cmd) const { - const bool isUniformBuffer = isUniformDescriptorType(m_descriptorType); - // \note dynamic offset replaces the view offset, i.e. it is not offset relative to the view offset const deUint32 dynamicOffsets[] = { @@ -1468,40 +1477,7 @@ void BufferRenderInstance::writeDrawCmdBuffer (vk::VkCommandBuffer cmd) const const deUint32 numOffsets = (!m_setDynamicOffset) ? (0u) : (getInterfaceNumResources(m_shaderInterface)); const deUint32* const dynamicOffsetPtr = (!m_setDynamicOffset) ? (DE_NULL) : (dynamicOffsets); - // make host writes device-visible - const vk::VkAccessFlags inputBit = (isUniformBuffer) ? (vk::VK_ACCESS_UNIFORM_READ_BIT) : (vk::VK_ACCESS_SHADER_READ_BIT); - const vk::VkBufferMemoryBarrier memoryBarriers[] = - { - { - vk::VK_STRUCTURE_TYPE_BUFFER_MEMORY_BARRIER, - DE_NULL, - vk::VK_ACCESS_HOST_WRITE_BIT, // outputMask - inputBit, // inputMask - vk::VK_QUEUE_FAMILY_IGNORED, // srcQueueFamilyIndex - vk::VK_QUEUE_FAMILY_IGNORED, // destQueueFamilyIndex - *m_sourceBufferA, // buffer - 0u, // offset - (vk::VkDeviceSize)m_bufferSizeA, // size - }, - { - vk::VK_STRUCTURE_TYPE_BUFFER_MEMORY_BARRIER, - DE_NULL, - vk::VK_ACCESS_HOST_WRITE_BIT, // outputMask - inputBit, // inputMask - vk::VK_QUEUE_FAMILY_IGNORED, // srcQueueFamilyIndex - vk::VK_QUEUE_FAMILY_IGNORED, // destQueueFamilyIndex - *m_sourceBufferB, // buffer - 0u, // offset - (vk::VkDeviceSize)m_bufferSizeB, // size - } - }; - const deUint32 numMemoryBarriers = getInterfaceNumResources(m_shaderInterface); - m_vki.cmdBindDescriptorSets(cmd, vk::VK_PIPELINE_BIND_POINT_GRAPHICS, getPipelineLayout(), 0, 1, &m_descriptorSet.get(), numOffsets, dynamicOffsetPtr); - m_vki.cmdPipelineBarrier(cmd, 0u, vk::VK_PIPELINE_STAGE_ALL_GRAPHICS_BIT, (vk::VkDependencyFlags)0, - 0, (const vk::VkMemoryBarrier*)DE_NULL, - numMemoryBarriers, memoryBarriers, - 0, (const vk::VkImageMemoryBarrier*)DE_NULL); m_vki.cmdDraw(cmd, 6 * 4, 1, 0, 0); // render four quads (two separate triangles) } @@ -1808,7 +1784,7 @@ void ComputeCommand::submitAndWait (deUint32 queueFamilyIndex, vk::VkQueue queue m_vki.cmdBindDescriptorSets(*cmd, vk::VK_PIPELINE_BIND_POINT_COMPUTE, m_pipelineLayout, 0, m_numDescriptorSets, m_descriptorSets, m_numDynamicOffsets, m_dynamicOffsets); if (m_numPreBarriers) - m_vki.cmdPipelineBarrier(*cmd, 0u, vk::VK_PIPELINE_STAGE_COMPUTE_SHADER_BIT, (vk::VkDependencyFlags)0, + m_vki.cmdPipelineBarrier(*cmd, vk::VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT, vk::VK_PIPELINE_STAGE_COMPUTE_SHADER_BIT, (vk::VkDependencyFlags)0, 0, (const vk::VkMemoryBarrier*)DE_NULL, m_numPreBarriers, m_preBarriers, 0, (const vk::VkImageMemoryBarrier*)DE_NULL); @@ -2263,19 +2239,21 @@ std::string QuadrantRendederCase::genVertexSource (void) const if ((m_activeStages & vk::VK_SHADER_STAGE_VERTEX_BIT) != 0u) { + const bool onlyVS = (m_activeStages == vk::VK_SHADER_STAGE_VERTEX_BIT); + // active vertex shader buf << versionDecl << "\n" << genExtensionDeclarations(vk::VK_SHADER_STAGE_VERTEX_BIT) << genResourceDeclarations(vk::VK_SHADER_STAGE_VERTEX_BIT, 0) << "layout(location = 0) out highp vec4 " << nextStageName << "_color;\n" - << "layout(location = 1) flat out highp int " << nextStageName << "_quadrant_id;\n" + << (onlyVS ? "" : "layout(location = 1) flat out highp int " + de::toString(nextStageName) + "_quadrant_id;\n") << "void main (void)\n" << "{\n" << " highp vec4 result_position;\n" << " highp int quadrant_id;\n" << s_quadrantGenVertexPosSource << " gl_Position = result_position;\n" - << " " << nextStageName << "_quadrant_id = quadrant_id;\n" + << (onlyVS ? "" : "\t" + de::toString(nextStageName) + "_quadrant_id = quadrant_id;\n") << "\n" << " highp vec4 result_color;\n" << genResourceAccessSource(vk::VK_SHADER_STAGE_VERTEX_BIT) @@ -2580,7 +2558,7 @@ std::string QuadrantRendederCase::genComputeSource (void) const << "{\n" << " highp vec4 read_colors[4];\n" << "} b_out;\n" - << "void main(void)\n" + << "void main (void)\n" << "{\n" << " highp int quadrant_id = int(gl_WorkGroupID.x);\n" << " highp vec4 result_color;\n" @@ -3084,7 +3062,7 @@ void ImageInstanceImages::uploadImage (const vk::DeviceInterface& vki, vk::VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER, DE_NULL, 0u, // outputMask - 0u, // inputMask + vk::VK_ACCESS_TRANSFER_WRITE_BIT, // inputMask vk::VK_IMAGE_LAYOUT_UNDEFINED, // oldLayout vk::VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL, // newLayout vk::VK_QUEUE_FAMILY_IGNORED, // srcQueueFamilyIndex @@ -3140,7 +3118,7 @@ void ImageInstanceImages::uploadImage (const vk::DeviceInterface& vki, // record command buffer VK_CHECK(vki.beginCommandBuffer(*cmd, &cmdBufBeginInfo)); - vki.cmdPipelineBarrier(*cmd, 0u, vk::VK_PIPELINE_STAGE_TRANSFER_BIT, (vk::VkDependencyFlags)0, + vki.cmdPipelineBarrier(*cmd, vk::VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT, vk::VK_PIPELINE_STAGE_TRANSFER_BIT, (vk::VkDependencyFlags)0, 0, (const vk::VkMemoryBarrier*)DE_NULL, 1, &preMemoryBarrier, 1, &preImageBarrier); diff --git a/external/vulkancts/modules/vulkan/compute/vktComputeBasicComputeShaderTests.cpp b/external/vulkancts/modules/vulkan/compute/vktComputeBasicComputeShaderTests.cpp index 28ef574..0c46806 100644 --- a/external/vulkancts/modules/vulkan/compute/vktComputeBasicComputeShaderTests.cpp +++ b/external/vulkancts/modules/vulkan/compute/vktComputeBasicComputeShaderTests.cpp @@ -766,7 +766,7 @@ tcu::TestStatus CopyImageToSSBOTestInstance::iterate (void) const VkBufferMemoryBarrier stagingBufferPostHostWriteBarrier = makeBufferMemoryBarrier(VK_ACCESS_HOST_WRITE_BIT, VK_ACCESS_TRANSFER_READ_BIT, *stagingBuffer, 0ull, bufferSizeBytes); const VkImageMemoryBarrier imagePreCopyBarrier = makeImageMemoryBarrier( - 0u, 0u, + 0u, VK_ACCESS_TRANSFER_WRITE_BIT, VK_IMAGE_LAYOUT_UNDEFINED, VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL, *image, subresourceRange); @@ -2067,6 +2067,11 @@ tcu::TestStatus ImageAtomicOpTestInstance::iterate (void) const VkBufferMemoryBarrier inputBufferPostHostWriteBarrier = makeBufferMemoryBarrier(VK_ACCESS_HOST_WRITE_BIT, VK_ACCESS_SHADER_READ_BIT, *inputBuffer, 0ull, inputBufferSizeBytes); + const VkImageMemoryBarrier imageLayoutBarrier = makeImageMemoryBarrier( + (VkAccessFlags)0, VK_ACCESS_SHADER_WRITE_BIT, + VK_IMAGE_LAYOUT_UNDEFINED, VK_IMAGE_LAYOUT_GENERAL, + *image, subresourceRange); + const VkImageMemoryBarrier imagePreCopyBarrier = makeImageMemoryBarrier( VK_ACCESS_SHADER_WRITE_BIT, VK_ACCESS_TRANSFER_READ_BIT, VK_IMAGE_LAYOUT_GENERAL, VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL, @@ -2088,7 +2093,7 @@ tcu::TestStatus ImageAtomicOpTestInstance::iterate (void) vk.cmdBindPipeline(*cmdBuffer, VK_PIPELINE_BIND_POINT_COMPUTE, *pipeline); vk.cmdBindDescriptorSets(*cmdBuffer, VK_PIPELINE_BIND_POINT_COMPUTE, *pipelineLayout, 0u, 1u, &descriptorSet.get(), 0u, DE_NULL); - vk.cmdPipelineBarrier(*cmdBuffer, VK_PIPELINE_STAGE_HOST_BIT, VK_PIPELINE_STAGE_COMPUTE_SHADER_BIT, (VkDependencyFlags)0, 0, (const VkMemoryBarrier*)DE_NULL, 1, &inputBufferPostHostWriteBarrier, 0, (const VkImageMemoryBarrier*)DE_NULL); + vk.cmdPipelineBarrier(*cmdBuffer, VK_PIPELINE_STAGE_HOST_BIT, VK_PIPELINE_STAGE_COMPUTE_SHADER_BIT, (VkDependencyFlags)0, 0, (const VkMemoryBarrier*)DE_NULL, 1, &inputBufferPostHostWriteBarrier, 1, &imageLayoutBarrier); vk.cmdDispatch(*cmdBuffer, m_imageSize.x(), m_imageSize.y(), 1u); vk.cmdPipelineBarrier(*cmdBuffer, VK_PIPELINE_STAGE_COMPUTE_SHADER_BIT, VK_PIPELINE_STAGE_TRANSFER_BIT, (VkDependencyFlags)0, 0, (const VkMemoryBarrier*)DE_NULL, 0, (const VkBufferMemoryBarrier*)DE_NULL, 1, &imagePreCopyBarrier); diff --git a/external/vulkancts/modules/vulkan/draw/vktDrawIndexedTest.cpp b/external/vulkancts/modules/vulkan/draw/vktDrawIndexedTest.cpp index 401187a..caa0344 100644 --- a/external/vulkancts/modules/vulkan/draw/vktDrawIndexedTest.cpp +++ b/external/vulkancts/modules/vulkan/draw/vktDrawIndexedTest.cpp @@ -353,7 +353,7 @@ void DrawIndexedTests::init (void) addChild(new InstanceFactory(m_testCtx, "draw_indexed_triangle_list", "Draws indexed triangle list", shaderPaths, vk::VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST)); addChild(new InstanceFactory(m_testCtx, "draw_indexed_triangle_strip", "Draws indexed triangle strip", shaderPaths, vk::VK_PRIMITIVE_TOPOLOGY_TRIANGLE_STRIP)); - shaderPaths[glu::SHADERTYPE_VERTEX] = "vulkan/draw/VertexFetchWithInstance.vert"; + shaderPaths[glu::SHADERTYPE_VERTEX] = "vulkan/draw/VertexFetchInstancedFirstInstance.vert"; shaderPaths[glu::SHADERTYPE_FRAGMENT] = "vulkan/draw/VertexFetch.frag"; addChild(new InstanceFactory(m_testCtx, "draw_instanced_indexed_triangle_list", "Draws indexed triangle list", shaderPaths, vk::VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST)); diff --git a/external/vulkancts/modules/vulkan/draw/vktDrawIndirectTest.cpp b/external/vulkancts/modules/vulkan/draw/vktDrawIndirectTest.cpp index 93e2c8f..ad0fbe4 100644 --- a/external/vulkancts/modules/vulkan/draw/vktDrawIndirectTest.cpp +++ b/external/vulkancts/modules/vulkan/draw/vktDrawIndirectTest.cpp @@ -71,6 +71,19 @@ protected: deUint32 m_drawIndirectMaxCount; }; +struct FirtsInstanceSupported +{ + static deUint32 getFirstInstance (void) { return 2; } + static bool isTestSupported (const vk::VkPhysicalDeviceFeatures& features) { return features.drawIndirectFirstInstance == vk::VK_TRUE; } +}; + +struct FirtsInstanceNotSupported +{ + static deUint32 getFirstInstance (void) { return 0; } + static bool isTestSupported (const vk::VkPhysicalDeviceFeatures&) { return true; } +}; + +template class IndirectDrawInstanced : public IndirectDraw { public: @@ -316,12 +329,18 @@ tcu::TestStatus IndirectDraw::iterate (void) } -IndirectDrawInstanced::IndirectDrawInstanced (Context &context, ShaderMap shaders, vk::VkPrimitiveTopology topology) +template +IndirectDrawInstanced::IndirectDrawInstanced (Context &context, ShaderMap shaders, vk::VkPrimitiveTopology topology) : IndirectDraw (context, shaders, topology) { + if (!FirstInstanceSupport::isTestSupported(m_context.getDeviceFeatures())) + { + throw tcu::NotSupportedError("Required 'drawIndirectFirstInstance' feature is not supported"); + } } -tcu::TestStatus IndirectDrawInstanced::iterate (void) +template +tcu::TestStatus IndirectDrawInstanced::iterate (void) { tcu::TestLog &log = m_context.getTestContext().getLog(); const vk::VkQueue queue = m_context.getUniversalQueue(); @@ -333,17 +352,17 @@ tcu::TestStatus IndirectDrawInstanced::iterate (void) vk::VkDrawIndirectCommand drawCmd[] = { { - 3, //vertexCount - 4, //instanceCount - 2, //firstVertex - 2 //firstInstance + 3, //vertexCount + 4, //instanceCount + 2, //firstVertex + FirstInstanceSupport::getFirstInstance() //firstInstance }, { (deUint32)-4, (deUint32)-2, (deUint32)-11, (deUint32)-9 }, // junk (stride) { - 3, //vertexCount - 4, //instanceCount - 5, //firstVertex - 2 //firstInstance + 3, //vertexCount + 4, //instanceCount + 5, //firstVertex + FirstInstanceSupport::getFirstInstance() //firstInstance } }; m_indirectDrawCmd.push_back(drawCmd[0]); @@ -356,17 +375,17 @@ tcu::TestStatus IndirectDrawInstanced::iterate (void) vk::VkDrawIndirectCommand drawCmd[] = { { - 4, //vertexCount - 4, //instanceCount - 2, //firstVertex - 2 //firstInstance + 4, //vertexCount + 4, //instanceCount + 2, //firstVertex + FirstInstanceSupport::getFirstInstance() //firstInstance }, { (deUint32)-4, (deUint32)-2, (deUint32)-11, (deUint32)-9 }, { - 4, //vertexCount - 4, //instanceCount - 6, //firstVertex - 2 //firstInstance + 4, //vertexCount + 4, //instanceCount + 6, //firstVertex + FirstInstanceSupport::getFirstInstance() //firstInstance } }; m_indirectDrawCmd.push_back(drawCmd[0]); @@ -511,16 +530,37 @@ void IndirectDrawTests::init (void) { ShaderMap shaderPaths; shaderPaths[glu::SHADERTYPE_VERTEX] = "vulkan/draw/VertexFetch.vert"; - shaderPaths[glu::SHADERTYPE_FRAGMENT] = "vulkan/draw/VertexFetch.frag"; + shaderPaths[glu::SHADERTYPE_FRAGMENT] = "vulkan/draw/VertexFetch.frag"; - addChild(new InstanceFactory(m_testCtx, "indirect_draw_triangle_list", "Draws triangle list", shaderPaths, vk::VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST)); - addChild(new InstanceFactory(m_testCtx, "indirect_draw_triangle_strip", "Draws triangle strip", shaderPaths, vk::VK_PRIMITIVE_TOPOLOGY_TRIANGLE_STRIP)); + tcu::TestCaseGroup* indirectDrawGroup = new tcu::TestCaseGroup(m_testCtx, "indirect_draw", "Draws geometry"); + { + indirectDrawGroup->addChild(new InstanceFactory(m_testCtx, "triangle_list", "Draws triangle list", shaderPaths, vk::VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST)); + indirectDrawGroup->addChild(new InstanceFactory(m_testCtx, "triangle_strip", "Draws triangle strip", shaderPaths, vk::VK_PRIMITIVE_TOPOLOGY_TRIANGLE_STRIP)); + } + addChild(indirectDrawGroup); - shaderPaths[glu::SHADERTYPE_VERTEX] = "vulkan/draw/VertexFetchWithInstance.vert"; - shaderPaths[glu::SHADERTYPE_FRAGMENT] = "vulkan/draw/VertexFetch.frag"; - addChild(new InstanceFactory(m_testCtx, "indirect_draw_instanced_triangle_list", "Draws an instanced triangle list", shaderPaths, vk::VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST)); - addChild(new InstanceFactory(m_testCtx, "indirect_draw_instanced_triangle_strip", "Draws an instanced triangle strip", shaderPaths, vk::VK_PRIMITIVE_TOPOLOGY_TRIANGLE_STRIP)); + tcu::TestCaseGroup* indirectDrawInstancedGroup = new tcu::TestCaseGroup(m_testCtx, "indirect_draw_instanced", "Draws an instanced geometry"); + { + tcu::TestCaseGroup* noFirstInstanceGroup = new tcu::TestCaseGroup(m_testCtx, "no_first_instance", "Use 0 as firstInstance"); + { + shaderPaths[glu::SHADERTYPE_VERTEX] = "vulkan/draw/VertexFetchInstanced.vert"; + + noFirstInstanceGroup->addChild(new InstanceFactory >(m_testCtx, "triangle_list", "Draws an instanced triangle list", shaderPaths, vk::VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST)); + noFirstInstanceGroup->addChild(new InstanceFactory >(m_testCtx, "triangle_strip", "Draws an instanced triangle strip", shaderPaths, vk::VK_PRIMITIVE_TOPOLOGY_TRIANGLE_STRIP)); + } + indirectDrawInstancedGroup->addChild(noFirstInstanceGroup); + + tcu::TestCaseGroup* firstInstanceGroup = new tcu::TestCaseGroup(m_testCtx, "first_instance", "Use drawIndirectFirstInstance optional feature"); + { + shaderPaths[glu::SHADERTYPE_VERTEX] = "vulkan/draw/VertexFetchInstancedFirstInstance.vert"; + + firstInstanceGroup->addChild(new InstanceFactory >(m_testCtx, "triangle_list", "Draws an instanced triangle list", shaderPaths, vk::VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST)); + firstInstanceGroup->addChild(new InstanceFactory >(m_testCtx, "triangle_strip", "Draws an instanced triangle strip", shaderPaths, vk::VK_PRIMITIVE_TOPOLOGY_TRIANGLE_STRIP)); + } + indirectDrawInstancedGroup->addChild(firstInstanceGroup); + } + addChild(indirectDrawInstancedGroup); } } // DrawTests diff --git a/external/vulkancts/modules/vulkan/draw/vktDrawSimpleTest.cpp b/external/vulkancts/modules/vulkan/draw/vktDrawSimpleTest.cpp index 0f5fbd9..cde11f5 100644 --- a/external/vulkancts/modules/vulkan/draw/vktDrawSimpleTest.cpp +++ b/external/vulkancts/modules/vulkan/draw/vktDrawSimpleTest.cpp @@ -332,7 +332,7 @@ void SimpleDrawTests::init (void) addChild(new InstanceFactory(m_testCtx, "simple_draw_triangle_list", "Draws triangle list", shaderPaths, vk::VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST)); addChild(new InstanceFactory(m_testCtx, "simple_draw_triangle_strip", "Draws triangle strip", shaderPaths, vk::VK_PRIMITIVE_TOPOLOGY_TRIANGLE_STRIP)); - shaderPaths[glu::SHADERTYPE_VERTEX] = "vulkan/draw/VertexFetchWithInstance.vert"; + shaderPaths[glu::SHADERTYPE_VERTEX] = "vulkan/draw/VertexFetchInstancedFirstInstance.vert"; shaderPaths[glu::SHADERTYPE_FRAGMENT] = "vulkan/draw/VertexFetch.frag"; addChild(new InstanceFactory(m_testCtx, "simple_draw_instanced_triangle_list", "Draws an instanced triangle list", shaderPaths, vk::VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST)); diff --git a/external/vulkancts/modules/vulkan/memory/vktMemoryPipelineBarrierTests.cpp b/external/vulkancts/modules/vulkan/memory/vktMemoryPipelineBarrierTests.cpp index af33845..4f3c823 100644 --- a/external/vulkancts/modules/vulkan/memory/vktMemoryPipelineBarrierTests.cpp +++ b/external/vulkancts/modules/vulkan/memory/vktMemoryPipelineBarrierTests.cpp @@ -4549,7 +4549,7 @@ void SubmitRenderPass::verify (VerifyContext& context, size_t commandIndex) vk::VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT, vk::VK_ACCESS_TRANSFER_READ_BIT, - vk::VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL, + vk::VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL, vk::VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL, vk::VK_QUEUE_FAMILY_IGNORED, diff --git a/external/vulkancts/modules/vulkan/pipeline/vktPipelineBlendTests.cpp b/external/vulkancts/modules/vulkan/pipeline/vktPipelineBlendTests.cpp index b92e355..93ca41b 100644 --- a/external/vulkancts/modules/vulkan/pipeline/vktPipelineBlendTests.cpp +++ b/external/vulkancts/modules/vulkan/pipeline/vktPipelineBlendTests.cpp @@ -594,8 +594,8 @@ BlendTestInstance::BlendTestInstance (Context& context, 0u, // deUint32 writeMask; 0u // deUint32 reference; }, - -1.0f, // float minDepthBounds; - +1.0f // float maxDepthBounds; + 0.0f, // float minDepthBounds; + 1.0f // float maxDepthBounds; }; // The color blend attachment will be set up before creating the graphics pipeline. @@ -735,9 +735,28 @@ BlendTestInstance::BlendTestInstance (Context& context, &attachmentClearValue // const VkClearValue* pClearValues; }; + // Color image layout transition + const VkImageMemoryBarrier imageLayoutBarrier = + { + VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER, // VkStructureType sType; + DE_NULL, // const void* pNext; + (VkAccessFlags)0, // VkAccessFlags srcAccessMask; + VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT, // VkAccessFlags dstAccessMask; + VK_IMAGE_LAYOUT_UNDEFINED, // VkImageLayout oldLayout; + VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL, // VkImageLayout newLayout; + VK_QUEUE_FAMILY_IGNORED, // uint32_t srcQueueFamilyIndex; + VK_QUEUE_FAMILY_IGNORED, // uint32_t dstQueueFamilyIndex; + *m_colorImage, // VkImage image; + { VK_IMAGE_ASPECT_COLOR_BIT, 0u, 1u, 0u, 1u } // VkImageSubresourceRange subresourceRange; + }; + m_cmdBuffer = allocateCommandBuffer(vk, vkDevice, &cmdBufferAllocateInfo); VK_CHECK(vk.beginCommandBuffer(*m_cmdBuffer, &cmdBufferBeginInfo)); + + vk.cmdPipelineBarrier(*m_cmdBuffer, VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT, VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT, (VkDependencyFlags)0, + 0u, DE_NULL, 0u, DE_NULL, 1u, &imageLayoutBarrier); + vk.cmdBeginRenderPass(*m_cmdBuffer, &renderPassBeginInfo, VK_SUBPASS_CONTENTS_INLINE); const VkDeviceSize quadOffset = (m_vertices.size() / BlendTest::QUAD_COUNT) * sizeof(Vertex4RGBA); diff --git a/external/vulkancts/modules/vulkan/pipeline/vktPipelineDepthTests.cpp b/external/vulkancts/modules/vulkan/pipeline/vktPipelineDepthTests.cpp index 4c50283..62b3012 100644 --- a/external/vulkancts/modules/vulkan/pipeline/vktPipelineDepthTests.cpp +++ b/external/vulkancts/modules/vulkan/pipeline/vktPipelineDepthTests.cpp @@ -35,6 +35,7 @@ #include "vkQueryUtil.hpp" #include "vkRef.hpp" #include "vkRefUtil.hpp" +#include "vkTypeUtil.hpp" #include "tcuImageCompare.hpp" #include "deUniquePtr.hpp" #include "deStringUtil.hpp" @@ -140,6 +141,7 @@ private: const tcu::UVec2 m_renderSize; const VkFormat m_colorFormat; const VkFormat m_depthFormat; + VkImageSubresourceRange m_depthImageSubresourceRange; Move m_colorImage; de::MovePtr m_colorImageAlloc; @@ -292,6 +294,10 @@ DepthTestInstance::DepthTestInstance (Context& context, // Allocate and bind depth image memory m_depthImageAlloc = memAlloc.allocate(getImageMemoryRequirements(vk, vkDevice, *m_depthImage), MemoryRequirement::Any); VK_CHECK(vk.bindImageMemory(vkDevice, *m_depthImage, m_depthImageAlloc->getMemory(), m_depthImageAlloc->getOffset())); + + const VkImageAspectFlags aspect = (mapVkFormat(m_depthFormat).order == tcu::TextureFormat::DS ? VK_IMAGE_ASPECT_DEPTH_BIT | VK_IMAGE_ASPECT_STENCIL_BIT + : VK_IMAGE_ASPECT_DEPTH_BIT); + m_depthImageSubresourceRange = makeImageSubresourceRange(aspect, 0u, depthImageParams.mipLevels, 0u, depthImageParams.arrayLayers); } // Create color attachment view @@ -322,7 +328,7 @@ DepthTestInstance::DepthTestInstance (Context& context, VK_IMAGE_VIEW_TYPE_2D, // VkImageViewType viewType; m_depthFormat, // VkFormat format; componentMappingRGBA, // VkComponentMapping components; - { VK_IMAGE_ASPECT_DEPTH_BIT, 0u, 1u, 0u, 1u } // VkImageSubresourceRange subresourceRange; + m_depthImageSubresourceRange, // VkImageSubresourceRange subresourceRange; }; m_depthAttachmentView = createImageView(vk, vkDevice, &depthAttachmentViewParams); @@ -624,8 +630,8 @@ DepthTestInstance::DepthTestInstance (Context& context, 0u, // deUint32 writeMask; 0u, // deUint32 reference; }, - -1.0f, // float minDepthBounds; - +1.0f, // float maxDepthBounds; + 0.0f, // float minDepthBounds; + 1.0f, // float maxDepthBounds; }; const VkGraphicsPipelineCreateInfo graphicsPipelineParams = @@ -737,9 +743,43 @@ DepthTestInstance::DepthTestInstance (Context& context, attachmentClearValues // const VkClearValue* pClearValues; }; + const VkImageMemoryBarrier imageLayoutBarriers[] = + { + // color image layout transition + { + VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER, // VkStructureType sType; + DE_NULL, // const void* pNext; + (VkAccessFlags)0, // VkAccessFlags srcAccessMask; + VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT, // VkAccessFlags dstAccessMask; + VK_IMAGE_LAYOUT_UNDEFINED, // VkImageLayout oldLayout; + VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL, // VkImageLayout newLayout; + VK_QUEUE_FAMILY_IGNORED, // uint32_t srcQueueFamilyIndex; + VK_QUEUE_FAMILY_IGNORED, // uint32_t dstQueueFamilyIndex; + *m_colorImage, // VkImage image; + { VK_IMAGE_ASPECT_COLOR_BIT, 0u, 1u, 0u, 1u } // VkImageSubresourceRange subresourceRange; + }, + // depth image layout transition + { + VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER, // VkStructureType sType; + DE_NULL, // const void* pNext; + (VkAccessFlags)0, // VkAccessFlags srcAccessMask; + VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_WRITE_BIT, // VkAccessFlags dstAccessMask; + VK_IMAGE_LAYOUT_UNDEFINED, // VkImageLayout oldLayout; + VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL, // VkImageLayout newLayout; + VK_QUEUE_FAMILY_IGNORED, // uint32_t srcQueueFamilyIndex; + VK_QUEUE_FAMILY_IGNORED, // uint32_t dstQueueFamilyIndex; + *m_depthImage, // VkImage image; + m_depthImageSubresourceRange, // VkImageSubresourceRange subresourceRange; + }, + }; + m_cmdBuffer = allocateCommandBuffer(vk, vkDevice, &cmdBufferAllocateInfo); VK_CHECK(vk.beginCommandBuffer(*m_cmdBuffer, &cmdBufferBeginInfo)); + + vk.cmdPipelineBarrier(*m_cmdBuffer, VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT, VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT, (VkDependencyFlags)0, + 0u, DE_NULL, 0u, DE_NULL, DE_LENGTH_OF_ARRAY(imageLayoutBarriers), imageLayoutBarriers); + vk.cmdBeginRenderPass(*m_cmdBuffer, &renderPassBeginInfo, VK_SUBPASS_CONTENTS_INLINE); const VkDeviceSize quadOffset = (m_vertices.size() / DepthTest::QUAD_COUNT) * sizeof(Vertex4RGBA); diff --git a/external/vulkancts/modules/vulkan/pipeline/vktPipelineImageSamplingInstance.cpp b/external/vulkancts/modules/vulkan/pipeline/vktPipelineImageSamplingInstance.cpp index 166b5e8..f7730a4 100644 --- a/external/vulkancts/modules/vulkan/pipeline/vktPipelineImageSamplingInstance.cpp +++ b/external/vulkancts/modules/vulkan/pipeline/vktPipelineImageSamplingInstance.cpp @@ -785,8 +785,8 @@ ImageSamplingInstance::ImageSamplingInstance (Context& context, 0u, // deUint32 writeMask; 0u // deUint32 reference; }, - -1.0f, // float minDepthBounds; - +1.0f // float maxDepthBounds; + 0.0f, // float minDepthBounds; + 1.0f // float maxDepthBounds; }; const VkGraphicsPipelineCreateInfo graphicsPipelineParams = @@ -890,9 +890,27 @@ ImageSamplingInstance::ImageSamplingInstance (Context& context, &attachmentClearValue // const VkClearValue* pClearValues; }; + const VkImageMemoryBarrier preAttachmentBarrier = + { + VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER, // VkStructureType sType; + DE_NULL, // const void* pNext; + 0u, // VkAccessFlags srcAccessMask; + VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT, // VkAccessFlags dstAccessMask; + VK_IMAGE_LAYOUT_UNDEFINED, // VkImageLayout oldLayout; + VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL, // VkImageLayout newLayout; + VK_QUEUE_FAMILY_IGNORED, // deUint32 srcQueueFamilyIndex; + VK_QUEUE_FAMILY_IGNORED, // deUint32 dstQueueFamilyIndex; + *m_colorImage, // VkImage image; + { VK_IMAGE_ASPECT_COLOR_BIT, 0u, 1u, 0u, 1u } // VkImageSubresourceRange subresourceRange; + }; + m_cmdBuffer = allocateCommandBuffer(vk, vkDevice, &cmdBufferAllocateInfo); VK_CHECK(vk.beginCommandBuffer(*m_cmdBuffer, &cmdBufferBeginInfo)); + + vk.cmdPipelineBarrier(*m_cmdBuffer, VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT, VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT, (VkDependencyFlags)0, + 0u, DE_NULL, 0u, DE_NULL, 1u, &preAttachmentBarrier); + vk.cmdBeginRenderPass(*m_cmdBuffer, &renderPassBeginInfo, VK_SUBPASS_CONTENTS_INLINE); vk.cmdBindPipeline(*m_cmdBuffer, VK_PIPELINE_BIND_POINT_GRAPHICS, *m_graphicsPipeline); diff --git a/external/vulkancts/modules/vulkan/pipeline/vktPipelineImageUtil.cpp b/external/vulkancts/modules/vulkan/pipeline/vktPipelineImageUtil.cpp index 5d473d9..2636258 100644 --- a/external/vulkancts/modules/vulkan/pipeline/vktPipelineImageUtil.cpp +++ b/external/vulkancts/modules/vulkan/pipeline/vktPipelineImageUtil.cpp @@ -414,7 +414,7 @@ void uploadTestTexture (const DeviceInterface& vk, VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER, // VkStructureType sType; DE_NULL, // const void* pNext; 0u, // VkAccessFlags srcAccessMask; - 0u, // VkAccessFlags dstAccessMask; + VK_ACCESS_TRANSFER_WRITE_BIT, // VkAccessFlags dstAccessMask; VK_IMAGE_LAYOUT_UNDEFINED, // VkImageLayout oldLayout; VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL, // VkImageLayout newLayout; VK_QUEUE_FAMILY_IGNORED, // deUint32 srcQueueFamilyIndex; diff --git a/external/vulkancts/modules/vulkan/pipeline/vktPipelineInputAssemblyTests.cpp b/external/vulkancts/modules/vulkan/pipeline/vktPipelineInputAssemblyTests.cpp index 8afbb5e..61f5e40 100644 --- a/external/vulkancts/modules/vulkan/pipeline/vktPipelineInputAssemblyTests.cpp +++ b/external/vulkancts/modules/vulkan/pipeline/vktPipelineInputAssemblyTests.cpp @@ -1253,8 +1253,8 @@ InputAssemblyInstance::InputAssemblyInstance (Context& context, 0u, // deUint32 writeMask; 0u, // deUint32 reference; }, - -1.0f, // float minDepthBounds; - +1.0f // float maxDepthBounds; + 0.0f, // float minDepthBounds; + 1.0f // float maxDepthBounds; }; const VkGraphicsPipelineCreateInfo graphicsPipelineParams = @@ -1399,9 +1399,27 @@ InputAssemblyInstance::InputAssemblyInstance (Context& context, &attachmentClearValue // const VkClearValue* pClearValues; }; + const VkImageMemoryBarrier attachmentLayoutBarrier = + { + VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER, // VkStructureType sType; + DE_NULL, // const void* pNext; + 0u, // VkAccessFlags srcAccessMask; + VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT, // VkAccessFlags dstAccessMask; + VK_IMAGE_LAYOUT_UNDEFINED, // VkImageLayout oldLayout; + VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL, // VkImageLayout newLayout; + VK_QUEUE_FAMILY_IGNORED, // deUint32 srcQueueFamilyIndex; + VK_QUEUE_FAMILY_IGNORED, // deUint32 dstQueueFamilyIndex; + *m_colorImage, // VkImage image; + { VK_IMAGE_ASPECT_COLOR_BIT, 0u, 1u, 0u, 1u }, // VkImageSubresourceRange subresourceRange; + }; + m_cmdBuffer = allocateCommandBuffer(vk, vkDevice, &cmdBufferAllocateInfo); VK_CHECK(vk.beginCommandBuffer(*m_cmdBuffer, &cmdBufferBeginInfo)); + + vk.cmdPipelineBarrier(*m_cmdBuffer, VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT, VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT, (VkDependencyFlags)0, + 0u, DE_NULL, 0u, DE_NULL, 1u, &attachmentLayoutBarrier); + vk.cmdBeginRenderPass(*m_cmdBuffer, &renderPassBeginInfo, VK_SUBPASS_CONTENTS_INLINE); const VkDeviceSize vertexBufferOffset = 0; diff --git a/external/vulkancts/modules/vulkan/pipeline/vktPipelineMultisampleTests.cpp b/external/vulkancts/modules/vulkan/pipeline/vktPipelineMultisampleTests.cpp index b744a4e..aadec96 100644 --- a/external/vulkancts/modules/vulkan/pipeline/vktPipelineMultisampleTests.cpp +++ b/external/vulkancts/modules/vulkan/pipeline/vktPipelineMultisampleTests.cpp @@ -1644,8 +1644,8 @@ MultisampleRenderer::MultisampleRenderer (Context& context, 0u, // deUint32 writeMask; 0u, // deUint32 reference; }, - -1.0f, // float minDepthBounds; - +1.0f, // float maxDepthBounds; + 0.0f, // float minDepthBounds; + 1.0f, // float maxDepthBounds; }; const VkGraphicsPipelineCreateInfo graphicsPipelineParams = @@ -1756,9 +1756,43 @@ MultisampleRenderer::MultisampleRenderer (Context& context, clearValues // const VkClearValue* pClearValues; }; + const VkImageMemoryBarrier imageLayoutBarriers[] = + { + // color attachment image + { + VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER, // VkStructureType sType; + DE_NULL, // const void* pNext; + 0u, // VkAccessFlags srcAccessMask; + VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT, // VkAccessFlags dstAccessMask; + VK_IMAGE_LAYOUT_UNDEFINED, // VkImageLayout oldLayout; + VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL, // VkImageLayout newLayout; + VK_QUEUE_FAMILY_IGNORED, // deUint32 srcQueueFamilyIndex; + VK_QUEUE_FAMILY_IGNORED, // deUint32 dstQueueFamilyIndex; + *m_colorImage, // VkImage image; + { VK_IMAGE_ASPECT_COLOR_BIT, 0u, 1u, 0u, 1u }, // VkImageSubresourceRange subresourceRange; + }, + // resolve attachment image + { + VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER, // VkStructureType sType; + DE_NULL, // const void* pNext; + 0u, // VkAccessFlags srcAccessMask; + VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT, // VkAccessFlags dstAccessMask; + VK_IMAGE_LAYOUT_UNDEFINED, // VkImageLayout oldLayout; + VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL, // VkImageLayout newLayout; + VK_QUEUE_FAMILY_IGNORED, // deUint32 srcQueueFamilyIndex; + VK_QUEUE_FAMILY_IGNORED, // deUint32 dstQueueFamilyIndex; + *m_resolveImage, // VkImage image; + { VK_IMAGE_ASPECT_COLOR_BIT, 0u, 1u, 0u, 1u }, // VkImageSubresourceRange subresourceRange; + }, + }; + m_cmdBuffer = allocateCommandBuffer(vk, vkDevice, &cmdBufferAllocateInfo); VK_CHECK(vk.beginCommandBuffer(*m_cmdBuffer, &cmdBufferBeginInfo)); + + vk.cmdPipelineBarrier(*m_cmdBuffer, VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT, VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT, (VkDependencyFlags)0, + 0u, DE_NULL, 0u, DE_NULL, DE_LENGTH_OF_ARRAY(imageLayoutBarriers), imageLayoutBarriers); + vk.cmdBeginRenderPass(*m_cmdBuffer, &renderPassBeginInfo, VK_SUBPASS_CONTENTS_INLINE); VkDeviceSize vertexBufferOffset = 0u; diff --git a/external/vulkancts/modules/vulkan/pipeline/vktPipelinePushConstantTests.cpp b/external/vulkancts/modules/vulkan/pipeline/vktPipelinePushConstantTests.cpp index 5b670b7..1e3e967 100644 --- a/external/vulkancts/modules/vulkan/pipeline/vktPipelinePushConstantTests.cpp +++ b/external/vulkancts/modules/vulkan/pipeline/vktPipelinePushConstantTests.cpp @@ -874,8 +874,8 @@ PushConstantGraphicsTestInstance::PushConstantGraphicsTestInstance (Context& 0u, // deUint32 stencilWriteMask; 0u, // deUint32 stencilReference; }, - -1.0f, // float minDepthBounds; - +1.0f, // float maxDepthBounds; + 0.0f, // float minDepthBounds; + 1.0f, // float maxDepthBounds; }; const VkPipelineTessellationStateCreateInfo tessellationStateParams = @@ -985,9 +985,27 @@ PushConstantGraphicsTestInstance::PushConstantGraphicsTestInstance (Context& attachmentClearValues // const VkClearValue* pClearValues; }; + const VkImageMemoryBarrier attachmentLayoutBarrier = + { + VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER, // VkStructureType sType; + DE_NULL, // const void* pNext; + 0u, // VkAccessFlags srcAccessMask; + VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT, // VkAccessFlags dstAccessMask; + VK_IMAGE_LAYOUT_UNDEFINED, // VkImageLayout oldLayout; + VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL, // VkImageLayout newLayout; + VK_QUEUE_FAMILY_IGNORED, // deUint32 srcQueueFamilyIndex; + VK_QUEUE_FAMILY_IGNORED, // deUint32 dstQueueFamilyIndex; + *m_colorImage, // VkImage image; + { VK_IMAGE_ASPECT_COLOR_BIT, 0u, 1u, 0u, 1u }, // VkImageSubresourceRange subresourceRange; + }; + m_cmdBuffer = allocateCommandBuffer(vk, vkDevice, &cmdBufferAllocateInfo); VK_CHECK(vk.beginCommandBuffer(*m_cmdBuffer, &cmdBufferBeginInfo)); + + vk.cmdPipelineBarrier(*m_cmdBuffer, VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT, VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT, (VkDependencyFlags)0, + 0u, DE_NULL, 0u, DE_NULL, 1u, &attachmentLayoutBarrier); + vk.cmdBeginRenderPass(*m_cmdBuffer, &renderPassBeginInfo, VK_SUBPASS_CONTENTS_INLINE); // update push constant diff --git a/external/vulkancts/modules/vulkan/pipeline/vktPipelineStencilTests.cpp b/external/vulkancts/modules/vulkan/pipeline/vktPipelineStencilTests.cpp index ef405e8..87a3a15 100644 --- a/external/vulkancts/modules/vulkan/pipeline/vktPipelineStencilTests.cpp +++ b/external/vulkancts/modules/vulkan/pipeline/vktPipelineStencilTests.cpp @@ -35,6 +35,7 @@ #include "vkQueryUtil.hpp" #include "vkRef.hpp" #include "vkRefUtil.hpp" +#include "vkTypeUtil.hpp" #include "tcuImageCompare.hpp" #include "deMemory.h" #include "deRandom.hpp" @@ -143,6 +144,7 @@ private: const tcu::UVec2 m_renderSize; const VkFormat m_colorFormat; const VkFormat m_stencilFormat; + VkImageSubresourceRange m_stencilImageSubresourceRange; VkImageCreateInfo m_colorImageCreateInfo; Move m_colorImage; @@ -379,6 +381,10 @@ StencilTestInstance::StencilTestInstance (Context& context, // Allocate and bind stencil image memory m_stencilImageAlloc = memAlloc.allocate(getImageMemoryRequirements(vk, vkDevice, *m_stencilImage), MemoryRequirement::Any); VK_CHECK(vk.bindImageMemory(vkDevice, *m_stencilImage, m_stencilImageAlloc->getMemory(), m_stencilImageAlloc->getOffset())); + + const VkImageAspectFlags aspect = (mapVkFormat(m_stencilFormat).order == tcu::TextureFormat::DS ? VK_IMAGE_ASPECT_STENCIL_BIT | VK_IMAGE_ASPECT_DEPTH_BIT + : VK_IMAGE_ASPECT_STENCIL_BIT); + m_stencilImageSubresourceRange = makeImageSubresourceRange(aspect, 0u, stencilImageParams.mipLevels, 0u, stencilImageParams.arrayLayers); } // Create color attachment view @@ -409,7 +415,7 @@ StencilTestInstance::StencilTestInstance (Context& context, VK_IMAGE_VIEW_TYPE_2D, // VkImageViewType viewType; m_stencilFormat, // VkFormat format; componentMappingRGBA, // VkComponentMapping components; - { VK_IMAGE_ASPECT_STENCIL_BIT, 0u, 1u, 0u, 1u }, // VkImageSubresourceRange subresourceRange; + m_stencilImageSubresourceRange, // VkImageSubresourceRange subresourceRange; }; m_stencilAttachmentView = createImageView(vk, vkDevice, &stencilAttachmentViewParams); @@ -689,8 +695,8 @@ StencilTestInstance::StencilTestInstance (Context& context, true, // VkBool32 stencilTestEnable; m_stencilOpStateFront, // VkStencilOpState front; m_stencilOpStateBack, // VkStencilOpState back; - -1.0f, // float minDepthBounds; - +1.0f // float maxDepthBounds; + 0.0f, // float minDepthBounds; + 1.0f // float maxDepthBounds; }; const VkGraphicsPipelineCreateInfo graphicsPipelineParams = @@ -825,9 +831,43 @@ StencilTestInstance::StencilTestInstance (Context& context, attachmentClearValues // const VkClearValue* pClearValues; }; + const VkImageMemoryBarrier imageLayoutBarriers[] = + { + // color image layout transition + { + VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER, // VkStructureType sType; + DE_NULL, // const void* pNext; + (VkAccessFlags)0, // VkAccessFlags srcAccessMask; + VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT, // VkAccessFlags dstAccessMask; + VK_IMAGE_LAYOUT_UNDEFINED, // VkImageLayout oldLayout; + VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL, // VkImageLayout newLayout; + VK_QUEUE_FAMILY_IGNORED, // uint32_t srcQueueFamilyIndex; + VK_QUEUE_FAMILY_IGNORED, // uint32_t dstQueueFamilyIndex; + *m_colorImage, // VkImage image; + { VK_IMAGE_ASPECT_COLOR_BIT, 0u, 1u, 0u, 1u } // VkImageSubresourceRange subresourceRange; + }, + // stencil image layout transition + { + VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER, // VkStructureType sType; + DE_NULL, // const void* pNext; + (VkAccessFlags)0, // VkAccessFlags srcAccessMask; + VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_WRITE_BIT, // VkAccessFlags dstAccessMask; + VK_IMAGE_LAYOUT_UNDEFINED, // VkImageLayout oldLayout; + VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL, // VkImageLayout newLayout; + VK_QUEUE_FAMILY_IGNORED, // uint32_t srcQueueFamilyIndex; + VK_QUEUE_FAMILY_IGNORED, // uint32_t dstQueueFamilyIndex; + *m_stencilImage, // VkImage image; + m_stencilImageSubresourceRange, // VkImageSubresourceRange subresourceRange; + }, + }; + m_cmdBuffer = allocateCommandBuffer(vk, vkDevice, &cmdBufferAllocateInfo); VK_CHECK(vk.beginCommandBuffer(*m_cmdBuffer, &cmdBufferBeginInfo)); + + vk.cmdPipelineBarrier(*m_cmdBuffer, VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT, VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT, (VkDependencyFlags)0, + 0u, DE_NULL, 0u, DE_NULL, DE_LENGTH_OF_ARRAY(imageLayoutBarriers), imageLayoutBarriers); + vk.cmdBeginRenderPass(*m_cmdBuffer, &renderPassBeginInfo, VK_SUBPASS_CONTENTS_INLINE); const VkDeviceSize quadOffset = (m_vertices.size() / StencilTest::QUAD_COUNT) * sizeof(Vertex4RGBA); diff --git a/external/vulkancts/modules/vulkan/pipeline/vktPipelineTimestampTests.cpp b/external/vulkancts/modules/vulkan/pipeline/vktPipelineTimestampTests.cpp index 53a6c27..744c84a 100644 --- a/external/vulkancts/modules/vulkan/pipeline/vktPipelineTimestampTests.cpp +++ b/external/vulkancts/modules/vulkan/pipeline/vktPipelineTimestampTests.cpp @@ -543,8 +543,8 @@ Move SimpleGraphicsPipelineBuilder::buildPipeline(tcu::UVec2 renderS 0u, // deUint32 writeMask; 0u, // deUint32 reference; }, - -1.0f, // float minDepthBounds; - +1.0f, // float maxDepthBounds; + 0.0f, // float minDepthBounds; + 1.0f, // float maxDepthBounds; }; const VkPipelineTessellationStateCreateInfo* pTessCreateInfo = DE_NULL; @@ -983,6 +983,7 @@ protected: Move m_depthAttachmentView; Move m_renderPass; Move m_framebuffer; + VkImageMemoryBarrier m_imageLayoutBarriers[2]; de::MovePtr m_vertexBufferAlloc; Move m_vertexBuffer; @@ -1145,6 +1146,39 @@ void BasicGraphicsTestInstance::buildFrameBuffer(tcu::UVec2 renderSize, VkFormat &m_depthImageAlloc); } + // Set up image layout transition barriers + { + const VkImageMemoryBarrier colorImageBarrier = + { + VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER, // VkStructureType sType; + DE_NULL, // const void* pNext; + 0u, // VkAccessFlags srcAccessMask; + VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT, // VkAccessFlags dstAccessMask; + VK_IMAGE_LAYOUT_UNDEFINED, // VkImageLayout oldLayout; + VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL, // VkImageLayout newLayout; + VK_QUEUE_FAMILY_IGNORED, // deUint32 srcQueueFamilyIndex; + VK_QUEUE_FAMILY_IGNORED, // deUint32 dstQueueFamilyIndex; + *m_colorImage, // VkImage image; + { VK_IMAGE_ASPECT_COLOR_BIT, 0u, 1u, 0u, 1u }, // VkImageSubresourceRange subresourceRange; + }; + const VkImageMemoryBarrier depthImageBarrier = + { + VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER, // VkStructureType sType; + DE_NULL, // const void* pNext; + 0u, // VkAccessFlags srcAccessMask; + VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_WRITE_BIT, // VkAccessFlags dstAccessMask; + VK_IMAGE_LAYOUT_UNDEFINED, // VkImageLayout oldLayout; + VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL, // VkImageLayout newLayout; + VK_QUEUE_FAMILY_IGNORED, // deUint32 srcQueueFamilyIndex; + VK_QUEUE_FAMILY_IGNORED, // deUint32 dstQueueFamilyIndex; + *m_depthImage, // VkImage image; + { VK_IMAGE_ASPECT_DEPTH_BIT, 0u, 1u, 0u, 1u }, // VkImageSubresourceRange subresourceRange; + }; + + m_imageLayoutBarriers[0] = colorImageBarrier; + m_imageLayoutBarriers[1] = depthImageBarrier; + } + // Create color attachment view { const VkImageViewCreateInfo colorAttachmentViewParams = @@ -1262,6 +1296,9 @@ void BasicGraphicsTestInstance::configCommandBuffer(void) VK_CHECK(vk.beginCommandBuffer(*m_cmdBuffer, &cmdBufferBeginInfo)); + vk.cmdPipelineBarrier(*m_cmdBuffer, VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT, VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT, (VkDependencyFlags)0, + 0u, DE_NULL, 0u, DE_NULL, DE_LENGTH_OF_ARRAY(m_imageLayoutBarriers), m_imageLayoutBarriers); + vk.cmdResetQueryPool(*m_cmdBuffer, *m_queryPool, 0u, TimestampTest::ENTRY_COUNT); vk.cmdBeginRenderPass(*m_cmdBuffer, &renderPassBeginInfo, VK_SUBPASS_CONTENTS_INLINE); @@ -1331,13 +1368,16 @@ void AdvGraphicsTest::initPrograms(SourceCollections& programCollection) const programCollection.glslSources.add("dummy_geo") << glu::GeometrySource( "#version 450 \n" - "layout (triangles) in;\n" - "layout (triangle_strip, max_vertices = 3) out;\n" + "layout(triangles) in;\n" + "layout(triangle_strip, max_vertices = 3) out;\n" + "layout(location = 0) in highp vec4 in_vtxColor[];\n" + "layout(location = 0) out highp vec4 vtxColor;\n" "void main (void)\n" "{\n" " for(int ndx=0; ndx<3; ndx++)\n" " {\n" " gl_Position = gl_in[ndx].gl_Position;\n" + " vtxColor = in_vtxColor[ndx];\n" " EmitVertex();\n" " }\n" " EndPrimitive();\n" @@ -1508,6 +1548,9 @@ void AdvGraphicsTestInstance::configCommandBuffer(void) VK_CHECK(vk.beginCommandBuffer(*m_cmdBuffer, &cmdBufferBeginInfo)); + vk.cmdPipelineBarrier(*m_cmdBuffer, VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT, VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT, (VkDependencyFlags)0, + 0u, DE_NULL, 0u, DE_NULL, DE_LENGTH_OF_ARRAY(m_imageLayoutBarriers), m_imageLayoutBarriers); + vk.cmdResetQueryPool(*m_cmdBuffer, *m_queryPool, 0u, TimestampTest::ENTRY_COUNT); vk.cmdBeginRenderPass(*m_cmdBuffer, &renderPassBeginInfo, VK_SUBPASS_CONTENTS_INLINE); diff --git a/external/vulkancts/modules/vulkan/pipeline/vktPipelineVertexInputTests.cpp b/external/vulkancts/modules/vulkan/pipeline/vktPipelineVertexInputTests.cpp index c5c2507..167860e 100644 --- a/external/vulkancts/modules/vulkan/pipeline/vktPipelineVertexInputTests.cpp +++ b/external/vulkancts/modules/vulkan/pipeline/vktPipelineVertexInputTests.cpp @@ -948,8 +948,8 @@ VertexInputInstance::VertexInputInstance (Context& context, 0u, // deUint32 writeMask; 0u, // deUint32 reference; }, - -1.0f, // float minDepthBounds; - +1.0f, // float maxDepthBounds; + 0.0f, // float minDepthBounds; + 1.0f, // float maxDepthBounds; }; const VkGraphicsPipelineCreateInfo graphicsPipelineParams = @@ -1053,9 +1053,27 @@ VertexInputInstance::VertexInputInstance (Context& context, &attachmentClearValue // const VkClearValue* pClearValues; }; + const VkImageMemoryBarrier attachmentLayoutBarrier = + { + VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER, // VkStructureType sType; + DE_NULL, // const void* pNext; + 0u, // VkAccessFlags srcAccessMask; + VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT, // VkAccessFlags dstAccessMask; + VK_IMAGE_LAYOUT_UNDEFINED, // VkImageLayout oldLayout; + VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL, // VkImageLayout newLayout; + VK_QUEUE_FAMILY_IGNORED, // deUint32 srcQueueFamilyIndex; + VK_QUEUE_FAMILY_IGNORED, // deUint32 dstQueueFamilyIndex; + *m_colorImage, // VkImage image; + { VK_IMAGE_ASPECT_COLOR_BIT, 0u, 1u, 0u, 1u }, // VkImageSubresourceRange subresourceRange; + }; + m_cmdBuffer = allocateCommandBuffer(vk, vkDevice, &cmdBufferAllocateInfo); VK_CHECK(vk.beginCommandBuffer(*m_cmdBuffer, &cmdBufferBeginInfo)); + + vk.cmdPipelineBarrier(*m_cmdBuffer, VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT, VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT, (VkDependencyFlags)0, + 0u, DE_NULL, 0u, DE_NULL, 1u, &attachmentLayoutBarrier); + vk.cmdBeginRenderPass(*m_cmdBuffer, &renderPassBeginInfo, VK_SUBPASS_CONTENTS_INLINE); vk.cmdBindPipeline(*m_cmdBuffer, VK_PIPELINE_BIND_POINT_GRAPHICS, *m_graphicsPipeline); diff --git a/external/vulkancts/modules/vulkan/query_pool/vktQueryPoolImageObjectUtil.cpp b/external/vulkancts/modules/vulkan/query_pool/vktQueryPoolImageObjectUtil.cpp index 8d60645..4b15ecf 100644 --- a/external/vulkancts/modules/vulkan/query_pool/vktQueryPoolImageObjectUtil.cpp +++ b/external/vulkancts/modules/vulkan/query_pool/vktQueryPoolImageObjectUtil.cpp @@ -162,30 +162,6 @@ Image::Image (const vk::DeviceInterface& vk, { } -tcu::ConstPixelBufferAccess Image::readSurface (vk::VkQueue queue, - vk::Allocator& allocator, - vk::VkImageLayout layout, - vk::VkOffset3D offset, - int width, - int height, - vk::VkImageAspectFlagBits aspect, - unsigned int mipLevel, - unsigned int arrayElement) -{ - m_pixelAccessData.resize(width * height * vk::mapVkFormat(m_format).getPixelSize()); - deMemset(m_pixelAccessData.data(), 0, m_pixelAccessData.size()); - if (aspect == vk::VK_IMAGE_ASPECT_COLOR_BIT) - { - read(queue, allocator, layout, offset, width, height, 1, mipLevel, arrayElement, aspect, vk::VK_IMAGE_TYPE_2D, - m_pixelAccessData.data()); - } - if (aspect == vk::VK_IMAGE_ASPECT_DEPTH_BIT || aspect == vk::VK_IMAGE_ASPECT_STENCIL_BIT) - { - readUsingBuffer(queue, allocator, layout, offset, width, height, 1, mipLevel, arrayElement, aspect, m_pixelAccessData.data()); - } - return tcu::ConstPixelBufferAccess(vk::mapVkFormat(m_format), width, height, 1, m_pixelAccessData.data()); -} - tcu::ConstPixelBufferAccess Image::readVolume (vk::VkQueue queue, vk::Allocator& allocator, vk::VkImageLayout layout, @@ -455,7 +431,7 @@ de::SharedPtr Image::copyToLinearImage (vk::VkQueue queue, CmdBufferBeginInfo beginInfo; VK_CHECK(m_vk.beginCommandBuffer(*copyCmdBuffer, &beginInfo)); - transition2DImage(m_vk, *copyCmdBuffer, stagingResource->object(), aspect, vk::VK_IMAGE_LAYOUT_UNDEFINED, vk::VK_IMAGE_LAYOUT_GENERAL); + transition2DImage(m_vk, *copyCmdBuffer, stagingResource->object(), aspect, vk::VK_IMAGE_LAYOUT_UNDEFINED, vk::VK_IMAGE_LAYOUT_GENERAL, 0, vk::VK_ACCESS_TRANSFER_WRITE_BIT); const vk::VkOffset3D zeroOffset = { 0, 0, 0 }; vk::VkImageCopy region = { {aspect, mipLevel, arrayElement, 1}, offset, {aspect, 0, 0, 1}, zeroOffset, {(deUint32)width, (deUint32)height, (deUint32)depth} }; @@ -879,22 +855,24 @@ de::SharedPtr Image::create(const vk::DeviceInterface& vk, } void transition2DImage (const vk::DeviceInterface& vk, - vk::VkCommandBuffer cmdBuffer, + vk::VkCommandBuffer cmdBuffer, vk::VkImage image, vk::VkImageAspectFlags aspectMask, vk::VkImageLayout oldLayout, - vk::VkImageLayout newLayout) + vk::VkImageLayout newLayout, + vk::VkAccessFlags srcAccessMask, + vk::VkAccessFlags dstAccessMask) { vk::VkImageMemoryBarrier barrier; - barrier.sType = vk::VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER; - barrier.pNext = DE_NULL; - barrier.srcAccessMask = 0; - barrier.dstAccessMask = 0; - barrier.oldLayout = oldLayout; - barrier.newLayout = newLayout; - barrier.srcQueueFamilyIndex = vk::VK_QUEUE_FAMILY_IGNORED; - barrier.dstQueueFamilyIndex = vk::VK_QUEUE_FAMILY_IGNORED; - barrier.image = image; + barrier.sType = vk::VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER; + barrier.pNext = DE_NULL; + barrier.srcAccessMask = srcAccessMask; + barrier.dstAccessMask = dstAccessMask; + barrier.oldLayout = oldLayout; + barrier.newLayout = newLayout; + barrier.srcQueueFamilyIndex = vk::VK_QUEUE_FAMILY_IGNORED; + barrier.dstQueueFamilyIndex = vk::VK_QUEUE_FAMILY_IGNORED; + barrier.image = image; barrier.subresourceRange.aspectMask = aspectMask; barrier.subresourceRange.baseMipLevel = 0; barrier.subresourceRange.levelCount = 1; diff --git a/external/vulkancts/modules/vulkan/query_pool/vktQueryPoolImageObjectUtil.hpp b/external/vulkancts/modules/vulkan/query_pool/vktQueryPoolImageObjectUtil.hpp index 72e7ef7..8e5871d 100644 --- a/external/vulkancts/modules/vulkan/query_pool/vktQueryPoolImageObjectUtil.hpp +++ b/external/vulkancts/modules/vulkan/query_pool/vktQueryPoolImageObjectUtil.hpp @@ -69,16 +69,6 @@ public: vk::Allocator& allocator, vk::MemoryRequirement memoryRequirement = vk::MemoryRequirement::Any); - tcu::ConstPixelBufferAccess readSurface (vk::VkQueue queue, - vk::Allocator& allocator, - vk::VkImageLayout layout, - vk::VkOffset3D offset, - int width, - int height, - vk::VkImageAspectFlagBits aspect, - unsigned int mipLevel = 0, - unsigned int arrayElement = 0); - tcu::ConstPixelBufferAccess readSurface1D (vk::VkQueue queue, vk::Allocator& allocator, vk::VkImageLayout layout, @@ -260,7 +250,14 @@ private: vk::VkDevice m_device; }; -void transition2DImage (const vk::DeviceInterface& vk, vk::VkCommandBuffer cmdBuffer, vk::VkImage image, vk::VkImageAspectFlags aspectMask, vk::VkImageLayout oldLayout, vk::VkImageLayout newLayout); +void transition2DImage (const vk::DeviceInterface& vk, + vk::VkCommandBuffer cmdBuffer, + vk::VkImage image, + vk::VkImageAspectFlags aspectMask, + vk::VkImageLayout oldLayout, + vk::VkImageLayout newLayout, + vk::VkAccessFlags srcAccessMask = 0, + vk::VkAccessFlags dstAccessMask = 0); void initialTransitionColor2DImage (const vk::DeviceInterface& vk, vk::VkCommandBuffer cmdBuffer, vk::VkImage image, vk::VkImageLayout layout); diff --git a/external/vulkancts/modules/vulkan/query_pool/vktQueryPoolOcclusionTests.cpp b/external/vulkancts/modules/vulkan/query_pool/vktQueryPoolOcclusionTests.cpp index 6b324e7..22feecc 100644 --- a/external/vulkancts/modules/vulkan/query_pool/vktQueryPoolOcclusionTests.cpp +++ b/external/vulkancts/modules/vulkan/query_pool/vktQueryPoolOcclusionTests.cpp @@ -374,8 +374,8 @@ tcu::TestStatus BasicOcclusionQueryTestInstance::iterate (void) vk.beginCommandBuffer(*cmdBuffer, &beginInfo); - transition2DImage(vk, *cmdBuffer, m_stateObjects->m_colorAttachmentImage->object(), vk::VK_IMAGE_ASPECT_COLOR_BIT, vk::VK_IMAGE_LAYOUT_UNDEFINED, vk::VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL); - transition2DImage(vk, *cmdBuffer, m_stateObjects->m_DepthImage->object(), vk::VK_IMAGE_ASPECT_DEPTH_BIT, vk::VK_IMAGE_LAYOUT_UNDEFINED, vk::VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL); + transition2DImage(vk, *cmdBuffer, m_stateObjects->m_colorAttachmentImage->object(), vk::VK_IMAGE_ASPECT_COLOR_BIT, vk::VK_IMAGE_LAYOUT_UNDEFINED, vk::VK_IMAGE_LAYOUT_GENERAL, 0, vk::VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT); + transition2DImage(vk, *cmdBuffer, m_stateObjects->m_DepthImage->object(), vk::VK_IMAGE_ASPECT_DEPTH_BIT, vk::VK_IMAGE_LAYOUT_UNDEFINED, vk::VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL, 0, vk::VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_WRITE_BIT); std::vector renderPassClearValues(2); deMemset(&renderPassClearValues[0], 0, static_cast(renderPassClearValues.size()) * sizeof(vk::VkClearValue)); @@ -407,7 +407,7 @@ tcu::TestStatus BasicOcclusionQueryTestInstance::iterate (void) vk.cmdEndRenderPass(*cmdBuffer); - transition2DImage(vk, *cmdBuffer, m_stateObjects->m_colorAttachmentImage->object(), vk::VK_IMAGE_ASPECT_COLOR_BIT, vk::VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL, vk::VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL); + transition2DImage(vk, *cmdBuffer, m_stateObjects->m_colorAttachmentImage->object(), vk::VK_IMAGE_ASPECT_COLOR_BIT, vk::VK_IMAGE_LAYOUT_GENERAL, vk::VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL, vk::VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT, vk::VK_ACCESS_TRANSFER_READ_BIT); vk.endCommandBuffer(*cmdBuffer); @@ -492,14 +492,6 @@ tcu::TestStatus BasicOcclusionQueryTestInstance::iterate (void) } log << tcu::TestLog::EndSection; - const vk::VkOffset3D zeroOffset = { 0, 0, 0 }; - - tcu::ConstPixelBufferAccess resultImageAccess = m_stateObjects->m_colorAttachmentImage->readSurface( - queue, m_context.getDefaultAllocator(), vk::VK_IMAGE_LAYOUT_GENERAL, - zeroOffset, StateObjects::HEIGHT, StateObjects::WIDTH, vk::VK_IMAGE_ASPECT_COLOR_BIT); - - log << tcu::TestLog::Image("Result", "Result", resultImageAccess); - if (passed) { return tcu::TestStatus(QP_TEST_RESULT_PASS, "Query result verification passed"); @@ -521,7 +513,6 @@ private: void captureResults (deUint64* retResults, deUint64* retAvailability, bool allowNotReady); void logResults (const deUint64* results, const deUint64* availability); bool validateResults (const deUint64* results, const deUint64* availability, bool allowUnavailable, vk::VkPrimitiveTopology primitiveTopology); - void logRenderTarget (void); enum { @@ -702,7 +693,10 @@ tcu::TestStatus OcclusionQueryTestInstance::iterate (void) log << tcu::TestLog::EndSection; - logRenderTarget(); + if (m_testVector.queryResultsMode != RESULTS_MODE_COPY) + { + VK_CHECK(vk.queueWaitIdle(queue)); + } if (passed) { @@ -729,8 +723,8 @@ vk::Move OcclusionQueryTestInstance::recordRender (vk::VkCo vk.beginCommandBuffer(*cmdBuffer, &beginInfo); - transition2DImage(vk, *cmdBuffer, m_stateObjects->m_colorAttachmentImage->object(), vk::VK_IMAGE_ASPECT_COLOR_BIT, vk::VK_IMAGE_LAYOUT_UNDEFINED, vk::VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL); - transition2DImage(vk, *cmdBuffer, m_stateObjects->m_DepthImage->object(), vk::VK_IMAGE_ASPECT_DEPTH_BIT, vk::VK_IMAGE_LAYOUT_UNDEFINED, vk::VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL); + transition2DImage(vk, *cmdBuffer, m_stateObjects->m_colorAttachmentImage->object(), vk::VK_IMAGE_ASPECT_COLOR_BIT, vk::VK_IMAGE_LAYOUT_UNDEFINED, vk::VK_IMAGE_LAYOUT_GENERAL, 0, vk::VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT); + transition2DImage(vk, *cmdBuffer, m_stateObjects->m_DepthImage->object(), vk::VK_IMAGE_ASPECT_DEPTH_BIT, vk::VK_IMAGE_LAYOUT_UNDEFINED, vk::VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL, 0, vk::VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_WRITE_BIT); std::vector renderPassClearValues(2); deMemset(&renderPassClearValues[0], 0, static_cast(renderPassClearValues.size()) * sizeof(vk::VkClearValue)); @@ -785,7 +779,7 @@ vk::Move OcclusionQueryTestInstance::recordRender (vk::VkCo } } - transition2DImage(vk, *cmdBuffer, m_stateObjects->m_colorAttachmentImage->object(), vk::VK_IMAGE_ASPECT_COLOR_BIT, vk::VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL, vk::VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL); + transition2DImage(vk, *cmdBuffer, m_stateObjects->m_colorAttachmentImage->object(), vk::VK_IMAGE_ASPECT_COLOR_BIT, vk::VK_IMAGE_LAYOUT_GENERAL, vk::VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL, vk::VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT, vk::VK_ACCESS_TRANSFER_READ_BIT); vk.endCommandBuffer(*cmdBuffer); @@ -986,18 +980,6 @@ bool OcclusionQueryTestInstance::validateResults (const deUint64* results , cons return passed; } -void OcclusionQueryTestInstance::logRenderTarget (void) -{ - tcu::TestLog& log = m_context.getTestContext().getLog(); - const vk::VkQueue queue = m_context.getUniversalQueue(); - const vk::VkOffset3D zeroOffset = { 0, 0, 0 }; - tcu::ConstPixelBufferAccess resultImageAccess = m_stateObjects->m_colorAttachmentImage->readSurface( - queue, m_context.getDefaultAllocator(), vk::VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL, - zeroOffset, StateObjects::HEIGHT, StateObjects::WIDTH, vk::VK_IMAGE_ASPECT_COLOR_BIT); - - log << tcu::TestLog::Image("Result", "Result", resultImageAccess); -} - template class QueryPoolOcclusionTest : public vkt::TestCase { diff --git a/external/vulkancts/modules/vulkan/shaderexecutor/vktShaderExecutor.cpp b/external/vulkancts/modules/vulkan/shaderexecutor/vktShaderExecutor.cpp index 12ce3ba..4302e28 100644 --- a/external/vulkancts/modules/vulkan/shaderexecutor/vktShaderExecutor.cpp +++ b/external/vulkancts/modules/vulkan/shaderexecutor/vktShaderExecutor.cpp @@ -764,9 +764,10 @@ void FragmentOutExecutor::execute (const Context& ctx, int numValues, const void for (int outNdx = 0; outNdx < (int)m_outputLayout.locationSymbols.size(); ++outNdx) { - bool isFloat = isDataTypeFloatOrVec(m_shaderSpec.outputs[outNdx].varType.getBasicType()); - bool isSigned = isDataTypeIntOrIVec(m_shaderSpec.outputs[outNdx].varType.getBasicType()); - VkFormat colorFormat = isFloat ? VK_FORMAT_R32G32B32A32_SFLOAT : (isSigned ? VK_FORMAT_R32G32B32A32_SINT : VK_FORMAT_R32G32B32A32_UINT); + const bool isFloat = isDataTypeFloatOrVec(m_shaderSpec.outputs[outNdx].varType.getBasicType()); + const bool isSigned = isDataTypeIntOrIVec (m_shaderSpec.outputs[outNdx].varType.getBasicType()); + const bool isBool = isDataTypeBoolOrBVec(m_shaderSpec.outputs[outNdx].varType.getBasicType()); + const VkFormat colorFormat = isFloat ? VK_FORMAT_R32G32B32A32_SFLOAT : (isSigned || isBool ? VK_FORMAT_R32G32B32A32_SINT : VK_FORMAT_R32G32B32A32_UINT); const VkImageCreateInfo colorImageParams = { @@ -2170,7 +2171,7 @@ public: TessellationExecutor (const ShaderSpec& shaderSpec, glu::ShaderType shaderType); virtual ~TessellationExecutor (void); - void renderTess (const Context& ctx, deUint32 vertexCount); + void renderTess (const Context& ctx, deUint32 numValues, deUint32 vertexCount, deUint32 patchControlPoints); }; TessellationExecutor::TessellationExecutor (const ShaderSpec& shaderSpec, glu::ShaderType shaderType) @@ -2182,9 +2183,9 @@ TessellationExecutor::~TessellationExecutor (void) { } -void TessellationExecutor::renderTess (const Context& ctx, deUint32 vertexCount) +void TessellationExecutor::renderTess (const Context& ctx, deUint32 numValues, deUint32 vertexCount, deUint32 patchControlPoints) { - const size_t inputBufferSize = (vertexCount/2) * getInputStride(); + const size_t inputBufferSize = numValues * getInputStride(); const VkDevice vkDevice = ctx.getDevice(); const DeviceInterface& vk = ctx.getDeviceInterface(); const VkQueue queue = ctx.getUniversalQueue(); @@ -2284,7 +2285,7 @@ void TessellationExecutor::renderTess (const Context& ctx, deUint32 vertexCount) VK_ATTACHMENT_STORE_OP_STORE, // VkAttachmentStoreOp storeOp; VK_ATTACHMENT_LOAD_OP_DONT_CARE, // VkAttachmentLoadOp stencilLoadOp; VK_ATTACHMENT_STORE_OP_DONT_CARE, // VkAttachmentStoreOp stencilStoreOp; - VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL, // VkImageLayout initialLayout; + VK_IMAGE_LAYOUT_UNDEFINED, // VkImageLayout initialLayout; VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL // VkImageLayout finalLayout }; @@ -2387,7 +2388,8 @@ void TessellationExecutor::renderTess (const Context& ctx, deUint32 vertexCount) 0u, // VkDeviceSize offset; VK_WHOLE_SIZE // VkDeviceSize range; }; - if (inputBufferSize) + + if (inputBufferSize > 0) { inputDescriptorBufferInfo.buffer = *m_inputBuffer; @@ -2491,7 +2493,7 @@ void TessellationExecutor::renderTess (const Context& ctx, deUint32 vertexCount) VK_STRUCTURE_TYPE_PIPELINE_TESSELLATION_STATE_CREATE_INFO, // VkStructureType sType; DE_NULL, // const void* pNext; (VkPipelineTessellationStateCreateFlags)0, // VkPipelineTessellationStateCreateFlags flags; - 1 // uint32_t patchControlPoints; + patchControlPoints // uint32_t patchControlPoints; }; const VkViewport viewport = @@ -2787,6 +2789,8 @@ void TessControlExecutor::setShaderSources (SourceCollections& programCollection void TessControlExecutor::execute (const Context& ctx, int numValues, const void* const* inputs, void* const* outputs) { + const deUint32 patchSize = 3; + checkSupported(ctx, m_shaderType); initBuffers(ctx, numValues); @@ -2794,7 +2798,7 @@ void TessControlExecutor::execute (const Context& ctx, int numValues, const void // Setup input buffer & copy data uploadInputBuffer(ctx, inputs, numValues); - renderTess(ctx, 3 * numValues); + renderTess(ctx, numValues, patchSize * numValues, patchSize); // Read back data readOutputBuffer(ctx, outputs, numValues); @@ -2865,7 +2869,7 @@ std::string TessEvaluationExecutor::generateTessEvalShader (const ShaderSpec& sh src << "void main (void)\n{\n" << "\tgl_Position = vec4(gl_TessCoord.x, 0.0, 0.0, 1.0);\n" - << "\thighp uint invocationId = uint(gl_PrimitiveID) + (gl_TessCoord.x > 0.5 ? 1u : 0u);\n"; + << "\thighp uint invocationId = uint(gl_PrimitiveID)*2u + (gl_TessCoord.x > 0.5 ? 1u : 0u);\n"; generateExecBufferIo(src, shaderSpec, "invocationId"); @@ -2886,7 +2890,8 @@ void TessEvaluationExecutor::execute (const Context& ctx, int numValues, const v { checkSupported(ctx, m_shaderType); - const int alignedValues = deAlign32(numValues, 2); + const int patchSize = 2; + const int alignedValues = deAlign32(numValues, patchSize); // Initialize buffers with aligned value count to make room for padding initBuffers(ctx, alignedValues); @@ -2894,7 +2899,7 @@ void TessEvaluationExecutor::execute (const Context& ctx, int numValues, const v // Setup input buffer & copy data uploadInputBuffer(ctx, inputs, numValues); - renderTess(ctx, 2 * numValues); + renderTess(ctx, (deUint32)alignedValues, (deUint32)alignedValues, (deUint32)patchSize); // Read back data readOutputBuffer(ctx, outputs, numValues); @@ -3230,7 +3235,7 @@ void ShaderExecutor::uploadImage (const VkDevice& vkDevice, VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER, // VkStructureType sType; DE_NULL, // const void* pNext; 0u, // VkAccessFlags srcAccessMask; - 0u, // VkAccessFlags dstAccessMask; + VK_ACCESS_TRANSFER_WRITE_BIT, // VkAccessFlags dstAccessMask; VK_IMAGE_LAYOUT_UNDEFINED, // VkImageLayout oldLayout; VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL, // VkImageLayout newLayout; VK_QUEUE_FAMILY_IGNORED, // deUint32 srcQueueFamilyIndex; diff --git a/external/vulkancts/modules/vulkan/shaderrender/vktShaderRender.cpp b/external/vulkancts/modules/vulkan/shaderrender/vktShaderRender.cpp index 1fdce58..37d526b 100644 --- a/external/vulkancts/modules/vulkan/shaderrender/vktShaderRender.cpp +++ b/external/vulkancts/modules/vulkan/shaderrender/vktShaderRender.cpp @@ -1171,7 +1171,7 @@ void ShaderRenderCaseInstance::render (tcu::Surface& result, const QuadGrid& qua VK_ATTACHMENT_STORE_OP_STORE, // VkAttachmentStoreOp storeOp; VK_ATTACHMENT_LOAD_OP_DONT_CARE, // VkAttachmentLoadOp stencilLoadOp; VK_ATTACHMENT_STORE_OP_DONT_CARE, // VkAttachmentStoreOp stencilStoreOp; - VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL, // VkImageLayout initialLayout; + VK_IMAGE_LAYOUT_UNDEFINED, // VkImageLayout initialLayout; VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL, // VkImageLayout finalLayout; }; @@ -1552,9 +1552,7 @@ void ShaderRenderCaseInstance::render (tcu::Surface& result, const QuadGrid& qua } const SamplerUniform* sampler = static_cast(uniformInfo); - - const VkAccessFlags outputMask = VK_ACCESS_HOST_WRITE_BIT | VK_ACCESS_TRANSFER_WRITE_BIT; - const VkImageMemoryBarrier textureBarrier = createImageMemoryBarrier(sampler->image->get(), outputMask, 0u, VK_IMAGE_LAYOUT_UNDEFINED, VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL); + const VkImageMemoryBarrier textureBarrier = createImageMemoryBarrier(sampler->image->get(), 0u, VK_ACCESS_SHADER_READ_BIT, VK_IMAGE_LAYOUT_UNDEFINED, VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL); barriers.push_back(textureBarrier); } @@ -1690,7 +1688,7 @@ void ShaderRenderCaseInstance::render (tcu::Surface& result, const QuadGrid& qua { VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER, // VkStructureType sType; DE_NULL, // const void* pNext; - VK_ACCESS_TRANSFER_WRITE_BIT, // VkAccessFlags srcAccessMask; + VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT, // VkAccessFlags srcAccessMask; VK_ACCESS_TRANSFER_READ_BIT, // VkAccessFlags dstAccessMask; VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL, // VkImageLayout oldLayout; VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL, // VkImageLayout newLayout; diff --git a/external/vulkancts/modules/vulkan/ssbo/vktSSBOLayoutCase.cpp b/external/vulkancts/modules/vulkan/ssbo/vktSSBOLayoutCase.cpp index ed1ca88..ca02de0 100644 --- a/external/vulkancts/modules/vulkan/ssbo/vktSSBOLayoutCase.cpp +++ b/external/vulkancts/modules/vulkan/ssbo/vktSSBOLayoutCase.cpp @@ -1925,9 +1925,6 @@ tcu::TestStatus SSBOLayoutCaseInstance::iterate (void) m_uniformBuffers.push_back(VkBufferSp(new vk::Unique(buffer))); m_uniformAllocs.push_back(AllocationSp(alloc.release())); } - - setUpdateBuilder.writeArray(*descriptorSet, vk::DescriptorSetUpdateBuilder::Location::binding(1), - vk::VK_DESCRIPTOR_TYPE_STORAGE_BUFFER, numBlocks, &descriptors[0]); } else { @@ -1963,13 +1960,25 @@ tcu::TestStatus SSBOLayoutCaseInstance::iterate (void) descriptors[blockNdx] = makeDescriptorBufferInfo(*buffer, offset, bufferSize); } - setUpdateBuilder.writeArray(*descriptorSet, vk::DescriptorSetUpdateBuilder::Location::binding(1), - vk::VK_DESCRIPTOR_TYPE_STORAGE_BUFFER, numBlocks, &descriptors[0]); - m_uniformBuffers.push_back(VkBufferSp(new vk::Unique(buffer))); m_uniformAllocs.push_back(AllocationSp(alloc.release())); } + // Update remaining bindings + { + int blockNdx = 0; + for (int bindingNdx = 0; bindingNdx < numBindings; ++bindingNdx) + { + const BufferBlock& block = m_interface.getBlock(bindingNdx); + const int numBlocksInBinding = (block.isArray() ? block.getArraySize() : 1); + + setUpdateBuilder.writeArray(*descriptorSet, vk::DescriptorSetUpdateBuilder::Location::binding(bindingNdx + 1), + vk::VK_DESCRIPTOR_TYPE_STORAGE_BUFFER, numBlocksInBinding, &descriptors[blockNdx]); + + blockNdx += numBlocksInBinding; + } + } + // Copy the initial data to the storage buffers { mappedBlockPtrs = blockLocationsToPtrs(m_refLayout, blockLocations, mapPtrs); diff --git a/external/vulkancts/modules/vulkan/ubo/vktUniformBlockCase.cpp b/external/vulkancts/modules/vulkan/ubo/vktUniformBlockCase.cpp index 2bde968..0313e56 100644 --- a/external/vulkancts/modules/vulkan/ubo/vktUniformBlockCase.cpp +++ b/external/vulkancts/modules/vulkan/ubo/vktUniformBlockCase.cpp @@ -1462,6 +1462,34 @@ tcu::TestStatus UniformBlockCaseInstance::iterate (void) &clearValue, // const VkClearValue* pClearValues; }; + // Add barrier for initializing image state + { + const vk::VkImageMemoryBarrier initializeBarrier = + { + vk::VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER, // VkStructureType sType; + DE_NULL, // const void* pNext + 0, // VVkAccessFlags srcAccessMask; + vk::VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT, // VkAccessFlags dstAccessMask; + vk::VK_IMAGE_LAYOUT_UNDEFINED, // VkImageLayout oldLayout; + vk::VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL, // VkImageLayout newLayout; + queueFamilyIndex, // deUint32 srcQueueFamilyIndex; + queueFamilyIndex, // deUint32 dstQueueFamilyIndex; + *colorImage, // VkImage image; + { + vk::VK_IMAGE_ASPECT_COLOR_BIT, // VkImageAspectFlags aspectMask; + 0u, // deUint32 baseMipLevel; + 1u, // deUint32 mipLevels; + 0u, // deUint32 baseArraySlice; + 1u, // deUint32 arraySize; + } // VkImageSubresourceRange subresourceRange + }; + + vk.cmdPipelineBarrier(*cmdBuffer, vk::VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT, vk::VK_PIPELINE_STAGE_ALL_GRAPHICS_BIT, (vk::VkDependencyFlags)0, + 0, (const vk::VkMemoryBarrier*)DE_NULL, + 0, (const vk::VkBufferMemoryBarrier*)DE_NULL, + 1, &initializeBarrier); + } + vk.cmdBeginRenderPass(*cmdBuffer, &passBeginInfo, vk::VK_SUBPASS_CONTENTS_INLINE); vk.cmdBindPipeline(*cmdBuffer, vk::VK_PIPELINE_BIND_POINT_GRAPHICS, *pipeline); diff --git a/external/vulkancts/modules/vulkan/vktRenderPassTests.cpp b/external/vulkancts/modules/vulkan/vktRenderPassTests.cpp index f562430..ca51dfb 100644 --- a/external/vulkancts/modules/vulkan/vktRenderPassTests.cpp +++ b/external/vulkancts/modules/vulkan/vktRenderPassTests.cpp @@ -372,6 +372,23 @@ VkAccessFlags getAllMemoryWriteFlags (void) | VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT; } +VkAccessFlags getMemoryFlagsForLayout (const VkImageLayout layout) +{ + switch (layout) + { + case VK_IMAGE_LAYOUT_GENERAL: return getAllMemoryReadFlags() | getAllMemoryWriteFlags(); + case VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL: return VK_ACCESS_COLOR_ATTACHMENT_READ_BIT | VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT; + case VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL: return VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_READ_BIT | VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_WRITE_BIT; + case VK_IMAGE_LAYOUT_DEPTH_STENCIL_READ_ONLY_OPTIMAL: return VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_READ_BIT; + case VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL: return VK_ACCESS_SHADER_READ_BIT; + case VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL: return VK_ACCESS_TRANSFER_READ_BIT; + case VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL: return VK_ACCESS_TRANSFER_WRITE_BIT; + + default: + return (VkAccessFlags)0; + } +} + VkPipelineStageFlags getAllPipelineStageFlags (void) { return VK_PIPELINE_STAGE_TESSELLATION_EVALUATION_SHADER_BIT @@ -1658,7 +1675,7 @@ Move createSubpassPipeline (const DeviceInterface& vk, STENCIL_VALUE // stencilReference }, // back - -1.0f, // minDepthBounds; + 0.0f, // minDepthBounds; 1.0f // maxDepthBounds; }; const VkPipelineColorBlendStateCreateInfo blendState = @@ -1861,25 +1878,25 @@ void pushImageInitializationCommands (const DeviceInterface& vk, const VkImageMemoryBarrier barrier = { - VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER, // sType; - DE_NULL, // pNext; + VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER, // sType; + DE_NULL, // pNext; - getAllMemoryWriteFlags(), // srcAccessMask - getAllMemoryReadFlags(), // dstAccessMask + (VkAccessFlags)0, // srcAccessMask + getAllMemoryReadFlags() | VK_ACCESS_TRANSFER_WRITE_BIT, // dstAccessMask - VK_IMAGE_LAYOUT_UNDEFINED, // oldLayout - VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL, // newLayout; + VK_IMAGE_LAYOUT_UNDEFINED, // oldLayout + VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL, // newLayout; - queueIndex, // srcQueueFamilyIndex; - queueIndex, // destQueueFamilyIndex; + queueIndex, // srcQueueFamilyIndex; + queueIndex, // destQueueFamilyIndex; - attachmentResources[attachmentNdx]->getImage(), // image; - { // subresourceRange; - getImageAspectFlags(attachmentInfo[attachmentNdx].getFormat()), // aspect; - 0, // baseMipLevel; - 1, // mipLevels; - 0, // baseArraySlice; - 1 // arraySize; + attachmentResources[attachmentNdx]->getImage(), // image; + { // subresourceRange; + getImageAspectFlags(attachmentInfo[attachmentNdx].getFormat()), // aspect; + 0, // baseMipLevel; + 1, // mipLevels; + 0, // baseArraySlice; + 1 // arraySize; } }; @@ -1944,30 +1961,28 @@ void pushImageInitializationCommands (const DeviceInterface& vk, for (size_t attachmentNdx = 0; attachmentNdx < attachmentInfo.size(); attachmentNdx++) { - const VkImageMemoryBarrier barrier = + const VkImageLayout oldLayout = clearValues[attachmentNdx] ? VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL : VK_IMAGE_LAYOUT_UNDEFINED; + const VkImageMemoryBarrier barrier = { - VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER, // sType; - DE_NULL, // pNext; - - getAllMemoryWriteFlags(), // srcAccessMask - getAllMemoryReadFlags(), // dstAccessMask + VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER, // sType; + DE_NULL, // pNext; - clearValues[attachmentNdx] ? - VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL - : VK_IMAGE_LAYOUT_UNDEFINED, // oldLayout + (oldLayout != VK_IMAGE_LAYOUT_UNDEFINED ? getAllMemoryWriteFlags() : (VkAccessFlags)0), // srcAccessMask + getAllMemoryReadFlags() | getMemoryFlagsForLayout(attachmentInfo[attachmentNdx].getInitialLayout()), // dstAccessMask - attachmentInfo[attachmentNdx].getInitialLayout(), // newLayout; + oldLayout, // oldLayout + attachmentInfo[attachmentNdx].getInitialLayout(), // newLayout; - queueIndex, // srcQueueFamilyIndex; - queueIndex, // destQueueFamilyIndex; + queueIndex, // srcQueueFamilyIndex; + queueIndex, // destQueueFamilyIndex; - attachmentResources[attachmentNdx]->getImage(), // image; - { // subresourceRange; - getImageAspectFlags(attachmentInfo[attachmentNdx].getFormat()), // aspect; - 0, // baseMipLevel; - 1, // mipLevels; - 0, // baseArraySlice; - 1 // arraySize; + attachmentResources[attachmentNdx]->getImage(), // image; + { // subresourceRange; + getImageAspectFlags(attachmentInfo[attachmentNdx].getFormat()), // aspect; + 0, // baseMipLevel; + 1, // mipLevels; + 0, // baseArraySlice; + 1 // arraySize; } }; @@ -2058,27 +2073,28 @@ void pushReadImagesToBuffers (const DeviceInterface& vk, if (isLazy[attachmentNdx]) continue; - const VkImageMemoryBarrier barrier = + const VkImageLayout oldLayout = attachmentInfo[attachmentNdx].getFinalLayout(); + const VkImageMemoryBarrier barrier = { - VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER, // sType - DE_NULL, // pNext + VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER, // sType + DE_NULL, // pNext - getAllMemoryWriteFlags(), // srcAccessMask - getAllMemoryReadFlags(), // dstAccessMask + getAllMemoryWriteFlags() | getMemoryFlagsForLayout(oldLayout), // srcAccessMask + getAllMemoryReadFlags(), // dstAccessMask - attachmentInfo[attachmentNdx].getFinalLayout(), // oldLayout - VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL, // newLayout + oldLayout, // oldLayout + VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL, // newLayout - queueIndex, // srcQueueFamilyIndex - queueIndex, // destQueueFamilyIndex + queueIndex, // srcQueueFamilyIndex + queueIndex, // destQueueFamilyIndex - attachmentResources[attachmentNdx]->getImage(), // image - { // subresourceRange - getImageAspectFlags(attachmentInfo[attachmentNdx].getFormat()), // aspect; - 0, // baseMipLevel - 1, // mipLevels - 0, // baseArraySlice - 1 // arraySize + attachmentResources[attachmentNdx]->getImage(), // image + { // subresourceRange + getImageAspectFlags(attachmentInfo[attachmentNdx].getFormat()), // aspect; + 0, // baseMipLevel + 1, // mipLevels + 0, // baseArraySlice + 1 // arraySize } }; @@ -2186,8 +2202,6 @@ void pushReadImagesToBuffers (const DeviceInterface& vk, bufferBarriers.push_back(secondaryBufferBarrier); } - - bufferBarriers.push_back(bufferBarrier); } if (!bufferBarriers.empty()) diff --git a/external/vulkancts/modules/vulkan/vktShaderLibrary.cpp b/external/vulkancts/modules/vulkan/vktShaderLibrary.cpp index 24b22a1..37a5b59 100644 --- a/external/vulkancts/modules/vulkan/vktShaderLibrary.cpp +++ b/external/vulkancts/modules/vulkan/vktShaderLibrary.cpp @@ -135,7 +135,7 @@ void declareUniforms (ostringstream& out, const ValueBlock& valueBlock) DataType getTransportType (DataType valueType) { if (isDataTypeBoolOrBVec(valueType)) - return glu::getDataTypeIntVec(getDataTypeScalarSize(valueType)); + return glu::getDataTypeUintVec(getDataTypeScalarSize(valueType)); else return valueType; } @@ -1162,7 +1162,7 @@ Move createPipeline (Context& context, vk::VK_STRUCTURE_TYPE_PIPELINE_VERTEX_INPUT_STATE_CREATE_INFO, // sType DE_NULL, // pNext (vk::VkPipelineVertexInputStateCreateFlags)0, - DE_LENGTH_OF_ARRAY(vertexBindings), // bindingCount + (inputValues.empty() ? 1u : 2u), // bindingCount vertexBindings, // pVertexBindingDescriptions (deUint32)vertexAttribParams.size(), // attributeCount &vertexAttribParams[0], // pVertexAttributeDescriptions @@ -1540,8 +1540,10 @@ ShaderCaseInstance::ShaderCaseInstance (Context& context, const ShaderCaseSpecif vkd.cmdBeginRenderPass(*m_cmdBuffer, &passBeginInfo, vk::VK_SUBPASS_CONTENTS_INLINE); } - vkd.cmdBindPipeline (*m_cmdBuffer, vk::VK_PIPELINE_BIND_POINT_GRAPHICS, *m_pipeline); - vkd.cmdBindDescriptorSets (*m_cmdBuffer, vk::VK_PIPELINE_BIND_POINT_GRAPHICS, *m_pipelineLayout, 0u, 1u, &*m_descriptorSet, 0u, DE_NULL); + vkd.cmdBindPipeline(*m_cmdBuffer, vk::VK_PIPELINE_BIND_POINT_GRAPHICS, *m_pipeline); + + if (!m_spec.values.uniforms.empty() || !m_spec.values.outputs.empty()) + vkd.cmdBindDescriptorSets(*m_cmdBuffer, vk::VK_PIPELINE_BIND_POINT_GRAPHICS, *m_pipelineLayout, 0u, 1u, &*m_descriptorSet, 0u, DE_NULL); { const vk::VkBuffer buffers[] = { *m_posNdxBuffer, *m_inputBuffer }; diff --git a/external/vulkancts/modules/vulkan/wsi/vktWsiSurfaceTests.cpp b/external/vulkancts/modules/vulkan/wsi/vktWsiSurfaceTests.cpp index 26208ef..66db6e6 100644 --- a/external/vulkancts/modules/vulkan/wsi/vktWsiSurfaceTests.cpp +++ b/external/vulkancts/modules/vulkan/wsi/vktWsiSurfaceTests.cpp @@ -356,7 +356,7 @@ void validateSurfaceCapabilities (tcu::ResultCollector& results, const VkSurface "currentExtent dimensions must be larger than 0"); results.check(de::inRange(capabilities.currentExtent.width, capabilities.minImageExtent.width, capabilities.maxImageExtent.width) && - de::inRange(capabilities.currentExtent.height, capabilities.minImageExtent.width, capabilities.maxImageExtent.width), + de::inRange(capabilities.currentExtent.height, capabilities.minImageExtent.height, capabilities.maxImageExtent.height), "currentExtent is not in supported extent limits"); } diff --git a/external/vulkancts/modules/vulkan/wsi/vktWsiSwapchainTests.cpp b/external/vulkancts/modules/vulkan/wsi/vktWsiSwapchainTests.cpp index e5f7754..12e2e86 100644 --- a/external/vulkancts/modules/vulkan/wsi/vktWsiSwapchainTests.cpp +++ b/external/vulkancts/modules/vulkan/wsi/vktWsiSwapchainTests.cpp @@ -341,6 +341,7 @@ vector generateSwapchainParameterCases (Type ws { const PlatformProperties& platformProperties = getPlatformProperties(wsiType); vector cases; + const VkSurfaceTransformFlagBitsKHR defaultTransform = (capabilities.supportedTransforms & VK_SURFACE_TRANSFORM_IDENTITY_BIT_KHR) ? VK_SURFACE_TRANSFORM_IDENTITY_BIT_KHR : capabilities.currentTransform; const VkSwapchainCreateInfoKHR baseParameters = { VK_STRUCTURE_TYPE_SWAPCHAIN_CREATE_INFO_KHR, @@ -357,7 +358,7 @@ vector generateSwapchainParameterCases (Type ws VK_SHARING_MODE_EXCLUSIVE, 0u, (const deUint32*)DE_NULL, - VK_SURFACE_TRANSFORM_IDENTITY_BIT_KHR, + defaultTransform, VK_COMPOSITE_ALPHA_OPAQUE_BIT_KHR, VK_PRESENT_MODE_FIFO_KHR, VK_FALSE, // clipped @@ -368,7 +369,7 @@ vector generateSwapchainParameterCases (Type ws { case TEST_DIMENSION_MIN_IMAGE_COUNT: { - const deUint32 maxImageCountToTest = de::clamp(16u, capabilities.minImageCount, capabilities.maxImageCount); + const deUint32 maxImageCountToTest = de::clamp(16u, capabilities.minImageCount, (capabilities.maxImageCount > 0) ? capabilities.maxImageCount : capabilities.minImageCount + 16u); for (deUint32 imageCount = capabilities.minImageCount; imageCount <= maxImageCountToTest; ++imageCount) { @@ -718,13 +719,14 @@ VkSwapchainCreateInfoKHR getBasicSwapchainParameters (Type wsiType, physicalDevice, surface); const PlatformProperties& platformProperties = getPlatformProperties(wsiType); + const VkSurfaceTransformFlagBitsKHR transform = (capabilities.supportedTransforms & VK_SURFACE_TRANSFORM_IDENTITY_BIT_KHR) ? VK_SURFACE_TRANSFORM_IDENTITY_BIT_KHR : capabilities.currentTransform; const VkSwapchainCreateInfoKHR parameters = { VK_STRUCTURE_TYPE_SWAPCHAIN_CREATE_INFO_KHR, DE_NULL, (VkSwapchainCreateFlagsKHR)0, surface, - de::clamp(desiredImageCount, capabilities.minImageCount, capabilities.maxImageCount), + de::clamp(desiredImageCount, capabilities.minImageCount, capabilities.maxImageCount > 0 ? capabilities.maxImageCount : capabilities.minImageCount + desiredImageCount), formats[0].format, formats[0].colorSpace, (platformProperties.swapchainExtent == PlatformProperties::SWAPCHAIN_EXTENT_MUST_MATCH_WINDOW_SIZE @@ -734,7 +736,7 @@ VkSwapchainCreateInfoKHR getBasicSwapchainParameters (Type wsiType, VK_SHARING_MODE_EXCLUSIVE, 0u, (const deUint32*)DE_NULL, - VK_SURFACE_TRANSFORM_IDENTITY_BIT_KHR, + transform, VK_COMPOSITE_ALPHA_OPAQUE_BIT_KHR, VK_PRESENT_MODE_FIFO_KHR, VK_FALSE, // clipped @@ -1017,7 +1019,7 @@ Move TriangleRenderer::createPipeline (const DeviceInterface& vkd, VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_STATE_CREATE_INFO, DE_NULL, (VkPipelineRasterizationStateCreateFlags)0, - VK_TRUE, // depthClampEnable + VK_FALSE, // depthClampEnable VK_FALSE, // rasterizerDiscardEnable VK_POLYGON_MODE_FILL, // polygonMode VK_CULL_MODE_NONE, // cullMode @@ -1236,7 +1238,6 @@ void TriangleRenderer::recordFrame (VkCommandBuffer cmdBuffer, deUint32 imageNdx, deUint32 frameNdx) const { - const VkImage curImage = m_swapchainImages[imageNdx]; const VkFramebuffer curFramebuffer = **m_framebuffers[imageNdx]; { @@ -1251,36 +1252,6 @@ void TriangleRenderer::recordFrame (VkCommandBuffer cmdBuffer, } { - const VkImageMemoryBarrier fromPresentationBarrier = - { - VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER, - DE_NULL, - VK_ACCESS_MEMORY_READ_BIT, - (VK_ACCESS_COLOR_ATTACHMENT_READ_BIT| - VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT), - VK_IMAGE_LAYOUT_UNDEFINED, - VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL, - VK_QUEUE_FAMILY_IGNORED, - VK_QUEUE_FAMILY_IGNORED, - curImage, - { - VK_IMAGE_ASPECT_COLOR_BIT, - 0u, // baseMipLevel - 1u, // levelCount - 0u, // baseArrayLayer - 1u, // layerCount - } - }; - m_vkd.cmdPipelineBarrier(cmdBuffer, - VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT, - VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT, - (VkDependencyFlags)0, - 0, (const VkMemoryBarrier*)DE_NULL, - 0, (const VkBufferMemoryBarrier*)DE_NULL, - 1, &fromPresentationBarrier); - } - - { const VkClearValue clearValue = makeClearValueColorF32(0.125f, 0.25f, 0.75f, 1.0f); const VkRenderPassBeginInfo passBeginParams = { @@ -1309,36 +1280,6 @@ void TriangleRenderer::recordFrame (VkCommandBuffer cmdBuffer, m_vkd.cmdDraw(cmdBuffer, 3u, 1u, 0u, 0u); m_vkd.cmdEndRenderPass(cmdBuffer); - { - const VkImageMemoryBarrier toPresentationBarrier = - { - VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER, - DE_NULL, - (VK_ACCESS_COLOR_ATTACHMENT_READ_BIT| - VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT), - VK_ACCESS_MEMORY_READ_BIT, - VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL, - VK_IMAGE_LAYOUT_PRESENT_SRC_KHR, - VK_QUEUE_FAMILY_IGNORED, - VK_QUEUE_FAMILY_IGNORED, - curImage, - { - VK_IMAGE_ASPECT_COLOR_BIT, - 0u, // baseMipLevel - 1u, // levelCount - 0u, // baseArrayLayer - 1u, // layerCount - } - }; - m_vkd.cmdPipelineBarrier(cmdBuffer, - VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT, - VK_PIPELINE_STAGE_BOTTOM_OF_PIPE_BIT, - (VkDependencyFlags)0, - 0, (const VkMemoryBarrier*)DE_NULL, - 0, (const VkBufferMemoryBarrier*)DE_NULL, - 1, &toPresentationBarrier); - } - VK_CHECK(m_vkd.endCommandBuffer(cmdBuffer)); } diff --git a/external/vulkancts/mustpass/1.0.0/vk-default.txt b/external/vulkancts/mustpass/1.0.0/vk-default.txt index 19fb5a0..f07b77f 100644 --- a/external/vulkancts/mustpass/1.0.0/vk-default.txt +++ b/external/vulkancts/mustpass/1.0.0/vk-default.txt @@ -63289,7 +63289,6 @@ dEQP-VK.glsl.functions.misc.argument_eval_order_1_vertex dEQP-VK.glsl.functions.misc.argument_eval_order_1_fragment dEQP-VK.glsl.functions.misc.argument_eval_order_2_vertex dEQP-VK.glsl.functions.misc.argument_eval_order_2_fragment -dEQP-VK.glsl.linkage.varying.rules.fragment_declare dEQP-VK.glsl.linkage.varying.rules.vertex_declare dEQP-VK.glsl.linkage.varying.rules.both_declare dEQP-VK.glsl.linkage.varying.rules.vertex_declare_fragment_use @@ -79355,10 +79354,12 @@ dEQP-VK.draw.indexed_draw.draw_indexed_triangle_list dEQP-VK.draw.indexed_draw.draw_indexed_triangle_strip dEQP-VK.draw.indexed_draw.draw_instanced_indexed_triangle_list dEQP-VK.draw.indexed_draw.draw_instanced_indexed_triangle_strip -dEQP-VK.draw.indirect_draw.indirect_draw_triangle_list -dEQP-VK.draw.indirect_draw.indirect_draw_triangle_strip -dEQP-VK.draw.indirect_draw.indirect_draw_instanced_triangle_list -dEQP-VK.draw.indirect_draw.indirect_draw_instanced_triangle_strip +dEQP-VK.draw.indirect_draw.indirect_draw.triangle_list +dEQP-VK.draw.indirect_draw.indirect_draw.triangle_strip +dEQP-VK.draw.indirect_draw.indirect_draw_instanced.no_first_instance.triangle_list +dEQP-VK.draw.indirect_draw.indirect_draw_instanced.no_first_instance.triangle_strip +dEQP-VK.draw.indirect_draw.indirect_draw_instanced.first_instance.triangle_list +dEQP-VK.draw.indirect_draw.indirect_draw_instanced.first_instance.triangle_strip dEQP-VK.compute.basic.empty_shader dEQP-VK.compute.basic.ubo_to_ssbo_single_invocation dEQP-VK.compute.basic.ubo_to_ssbo_single_group diff --git a/framework/delibs/debase/deString.c b/framework/delibs/debase/deString.c index f53657d..e6290f0 100644 --- a/framework/delibs/debase/deString.c +++ b/framework/delibs/debase/deString.c @@ -111,7 +111,6 @@ deBool deStringBeginsWith (const char* str, const char* lead) return DE_TRUE; } - int deVsprintf (char* string, size_t size, const char* format, va_list list) { int res; @@ -180,4 +179,16 @@ char* deStrcat (char* s1, size_t size, const char* s2) #endif } +size_t deStrnlen (const char* string, size_t maxSize) +{ +#if ((DE_COMPILER == DE_COMPILER_MSC) && (DE_OS != DE_OS_WINCE)) || (defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 201100L)) + return strnlen_s(string, maxSize); +#else + size_t len = 0; + while (len < maxSize || string[len] != 0) + ++len; + return len; +#endif +} + DE_END_EXTERN_C diff --git a/framework/delibs/debase/deString.h b/framework/delibs/debase/deString.h index 52e232a..cd45465 100644 --- a/framework/delibs/debase/deString.h +++ b/framework/delibs/debase/deString.h @@ -43,6 +43,7 @@ deInt32 deVsprintf (char* string, size_t size, const char* format, va_list a deInt32 deSprintf (char* string, size_t size, const char* format, ...) DE_PRINTF_FUNC_ATTR(3, 4); char* deStrcpy (char* dst, size_t size, const char* src); char* deStrcat (char* s1, size_t size, const char* s2); +size_t deStrnlen (const char* string, size_t maxSize); DE_END_EXTERN_C -- 2.7.4