diff options
author | sergiuferentz <sergiuferentz@google.com> | 2023-07-21 09:26:20 +0000 |
---|---|---|
committer | Serdar Kocdemir <kocdemir@google.com> | 2023-07-21 19:59:30 +0000 |
commit | fcaca77d640e353d4a0a8738a667d2681f19bfba (patch) | |
tree | e99be00e8c5e890907613b77ce2134940bfbc3eb | |
parent | 6790218894b64ede4900f6b8f0d5ee7a7a908781 (diff) | |
parent | 83ae7545a47084160d6fec0443a111f944e1101e (diff) | |
download | deqp-fcaca77d640e353d4a0a8738a667d2681f19bfba.tar.gz |
RESTRICT AUTOMERGE: Merge branch 'khronos-1.3.1' into android13-tests-dev
This additionally includes changes to deDefs.h and define
DE_FENV_ACCESS_ON as empty for Android 13 CTS builds.
Bug: 291964918
Change-Id: I9eabdac6f6bd1f9cb8976e097f1eb0bf4bb8e6b8
20 files changed, 213 insertions, 130 deletions
diff --git a/android/cts/master/src/vk-test-issues.txt b/android/cts/master/src/vk-test-issues.txt index 3aa5b3765..5cd0847dc 100644 --- a/android/cts/master/src/vk-test-issues.txt +++ b/android/cts/master/src/vk-test-issues.txt @@ -15,7 +15,4 @@ dEQP-VK.ssbo.layout.random.scalar.75 dEQP-VK.ssbo.phys.layout.random.16bit.scalar.13 # b/247790961: Test violates VUID-VkRenderPassBeginInfo-framebuffer-03216 -dEQP-VK.renderpass2.depth_stencil_resolve.*separate_layouts.* - -# b/256522416: Previous test code is producing undefined behaviors, and latest test code is causing pixel6 to crash -dEQP-VK.memory.device_memory_report.vk_device_memory.allocation_failed
\ No newline at end of file +dEQP-VK.renderpass2.depth_stencil_resolve.*separate_layouts.*
\ No newline at end of file diff --git a/external/openglcts/modules/gl/gl4cGPUShaderFP64Tests.cpp b/external/openglcts/modules/gl/gl4cGPUShaderFP64Tests.cpp index 30471058c..eb02a7789 100644 --- a/external/openglcts/modules/gl/gl4cGPUShaderFP64Tests.cpp +++ b/external/openglcts/modules/gl/gl4cGPUShaderFP64Tests.cpp @@ -6933,9 +6933,6 @@ bool GPUShaderFP64Test4::verifyUniformValues() }; const unsigned int n_programs = sizeof(programs) / sizeof(programs[0]); - /* Set up rounding for the tests */ - deSetRoundingMode(DE_ROUNDINGMODE_TO_NEAREST_EVEN); - for (unsigned int n_program = 0; n_program < n_programs; ++n_program) { glw::GLuint po_id = programs[n_program]; diff --git a/external/openglcts/modules/glesext/gpu_shader5/esextcGPUShader5FmaPrecision.cpp b/external/openglcts/modules/glesext/gpu_shader5/esextcGPUShader5FmaPrecision.cpp index ca24177ab..5d8b1f3d8 100644 --- a/external/openglcts/modules/glesext/gpu_shader5/esextcGPUShader5FmaPrecision.cpp +++ b/external/openglcts/modules/glesext/gpu_shader5/esextcGPUShader5FmaPrecision.cpp @@ -268,6 +268,8 @@ void GPUShader5FmaPrecision<S>::initTest(void) template <INPUT_DATA_TYPE S> tcu::TestNode::IterateResult GPUShader5FmaPrecision<S>::iterate(void) { + DE_FENV_ACCESS_ON; + initTest(); const glw::Functions& gl = m_context.getRenderContext().getFunctions(); diff --git a/external/vulkancts/modules/vulkan/api/vktApiCommandBuffersTests.cpp b/external/vulkancts/modules/vulkan/api/vktApiCommandBuffersTests.cpp index 905533469..02648f8a9 100644 --- a/external/vulkancts/modules/vulkan/api/vktApiCommandBuffersTests.cpp +++ b/external/vulkancts/modules/vulkan/api/vktApiCommandBuffersTests.cpp @@ -4584,7 +4584,7 @@ tcu::TestCaseGroup* createCommandBuffersTests (tcu::TestContext& testCtx) { deUint32 seed = 1614182419u; const auto smallExtent = makeExtent3D(128u, 128u, 1u); - const auto largeExtent = makeExtent3D(512u, 512u, 1u); + const auto largeExtent = makeExtent3D(512u, 256u, 1u); commandBuffersTests->addChild(new ManyDrawsCase(testCtx, "record_many_draws_primary_1", "", ManyDrawsParams(VK_COMMAND_BUFFER_LEVEL_PRIMARY, smallExtent, seed++))); commandBuffersTests->addChild(new ManyDrawsCase(testCtx, "record_many_draws_primary_2", "", ManyDrawsParams(VK_COMMAND_BUFFER_LEVEL_PRIMARY, largeExtent, seed++))); diff --git a/external/vulkancts/modules/vulkan/api/vktApiCopiesAndBlittingTests.cpp b/external/vulkancts/modules/vulkan/api/vktApiCopiesAndBlittingTests.cpp index 3ab393dd8..78aa1f4a5 100644 --- a/external/vulkancts/modules/vulkan/api/vktApiCopiesAndBlittingTests.cpp +++ b/external/vulkancts/modules/vulkan/api/vktApiCopiesAndBlittingTests.cpp @@ -58,6 +58,7 @@ #include <array> #include <algorithm> #include <iterator> +#include <limits> #include <sstream> namespace vkt @@ -1126,9 +1127,14 @@ tcu::TestStatus CopyImageToImage::iterate (void) const deUint32 blockHeight = getBlockHeight(m_params.src.image.format); imageCopy.srcOffset.x *= blockWidth; - imageCopy.srcOffset.y *= blockHeight; imageCopy.extent.width *= blockWidth; - imageCopy.extent.height *= blockHeight; + + // VUID-vkCmdCopyImage-srcImage-00146 + if (m_params.src.image.imageType != vk::VK_IMAGE_TYPE_1D) + { + imageCopy.srcOffset.y *= blockHeight; + imageCopy.extent.height *= blockHeight; + } } if (dstCompressed) @@ -1137,7 +1143,12 @@ tcu::TestStatus CopyImageToImage::iterate (void) const deUint32 blockHeight = getBlockHeight(m_params.dst.image.format); imageCopy.dstOffset.x *= blockWidth; - imageCopy.dstOffset.y *= blockHeight; + + // VUID-vkCmdCopyImage-dstImage-00152 + if (m_params.dst.image.imageType != vk::VK_IMAGE_TYPE_1D) + { + imageCopy.dstOffset.y *= blockHeight; + } } if (m_params.extensionUse == EXTENSION_USE_NONE) @@ -3617,7 +3628,13 @@ bool BlittingImages::checkNonNearestFilteredResult (const tcu::ConstPixelBufferA const tcu::IVec4 dstBitDepth = tcu::getTextureFormatBitDepth(dstFormat); const tcu::IVec4 srcBitDepth = tcu::getTextureFormatBitDepth(srcFormat); for (deUint32 i = 0; i < 4; ++i) - threshold[i] = 1 + de::max( ( ( 1 << dstBitDepth[i] ) - 1 ) / de::clamp((1 << srcBitDepth[i]) - 1, 1, 256), 1); + { + DE_ASSERT(dstBitDepth[i] < std::numeric_limits<uint64_t>::digits); + DE_ASSERT(srcBitDepth[i] < std::numeric_limits<uint64_t>::digits); + deUint64 threshold64 = 1 + de::max( ( ( UINT64_C(1) << dstBitDepth[i] ) - 1 ) / de::clamp((UINT64_C(1) << srcBitDepth[i]) - 1, UINT64_C(1), UINT64_C(256)), UINT64_C(1)); + DE_ASSERT(threshold64 <= std::numeric_limits<uint32_t>::max()); + threshold[i] = static_cast<deUint32>(threshold64); + } isOk = tcu::intThresholdCompare(log, "Compare", "Result comparsion", clampedExpected, result, threshold, tcu::COMPARE_LOG_RESULT); log << tcu::TestLog::EndSection; @@ -5072,7 +5089,13 @@ bool BlittingMipmaps::checkNonNearestFilteredResult (void) const tcu::IVec4 dstBitDepth = tcu::getTextureFormatBitDepth(dstFormat); const tcu::IVec4 srcBitDepth = tcu::getTextureFormatBitDepth(srcFormat); for (deUint32 i = 0; i < 4; ++i) - threshold[i] = 1 + de::max(((1 << dstBitDepth[i]) - 1) / de::clamp((1 << srcBitDepth[i]) - 1, 1, 256), 1); + { + DE_ASSERT(dstBitDepth[i] < std::numeric_limits<uint64_t>::digits); + DE_ASSERT(srcBitDepth[i] < std::numeric_limits<uint64_t>::digits); + deUint64 threshold64 = 1 + de::max( ( ( UINT64_C(1) << dstBitDepth[i] ) - 1 ) / de::clamp((UINT64_C(1) << srcBitDepth[i]) - 1, UINT64_C(1), UINT64_C(256)), UINT64_C(1)); + DE_ASSERT(threshold64 <= std::numeric_limits<uint32_t>::max()); + threshold[i] = static_cast<deUint32>(threshold64); + } singleLevelOk = tcu::intThresholdCompare(log, "Compare", "Result comparsion", clampedLevel, result, threshold, tcu::COMPARE_LOG_RESULT); log << tcu::TestLog::EndSection; diff --git a/external/vulkancts/modules/vulkan/api/vktApiExternalMemoryTests.cpp b/external/vulkancts/modules/vulkan/api/vktApiExternalMemoryTests.cpp index acdc1abd3..5ffe5ea42 100644 --- a/external/vulkancts/modules/vulkan/api/vktApiExternalMemoryTests.cpp +++ b/external/vulkancts/modules/vulkan/api/vktApiExternalMemoryTests.cpp @@ -3321,7 +3321,7 @@ tcu::TestStatus testMemoryImportTwice (Context& context, MemoryTestConfig config // \note Buffer is only allocated to get memory requirements const vk::Unique<vk::VkBuffer> buffer (createExternalBuffer(vkd, *device, queueFamilyIndex, config.externalType, bufferSize, 0u, usage)); const vk::VkMemoryRequirements requirements (getBufferMemoryRequirements(vkd, *device, *buffer)); - const deUint32 exportedMemoryTypeIndex (getExportedMemoryTypeIndex(vki, physicalDevice, config.hostVisible, requirements.memoryTypeBits)); + deUint32 exportedMemoryTypeIndex (getExportedMemoryTypeIndex(vki, physicalDevice, config.hostVisible, requirements.memoryTypeBits)); const vk::Unique<vk::VkDeviceMemory> memory (allocateExportableMemory(vkd, *device, requirements.size, exportedMemoryTypeIndex, config.externalType, config.dedicated ? *buffer : (vk::VkBuffer)0)); NativeHandle handleA; @@ -3330,6 +3330,22 @@ tcu::TestStatus testMemoryImportTwice (Context& context, MemoryTestConfig config getMemoryNative(vkd, *device, *memory, config.externalType, handleA); + // Need to query again memory type index since we are forced to have same type bits as the ahb buffer + // Avoids VUID-VkMemoryAllocateInfo-memoryTypeIndex-02385 + if (config.externalType == vk::VK_EXTERNAL_MEMORY_HANDLE_TYPE_ANDROID_HARDWARE_BUFFER_BIT_ANDROID) + { + vk::VkAndroidHardwareBufferPropertiesANDROID ahbProperties = + { + vk::VK_STRUCTURE_TYPE_ANDROID_HARDWARE_BUFFER_PROPERTIES_ANDROID, // VkStructureType sType + DE_NULL, // void* pNext + 0u, // VkDeviceSize allocationSize + 0u // uint32_t memoryTypeBits + }; + vkd.getAndroidHardwareBufferPropertiesANDROID(device.get(), handleA.getAndroidHardwareBuffer(), &ahbProperties); + + exportedMemoryTypeIndex = chooseMemoryType(ahbProperties.memoryTypeBits); + } + { const vk::Unique<vk::VkBuffer> bufferA (createExternalBuffer(vkd, *device, queueFamilyIndex, config.externalType, bufferSize, 0u, usage)); const vk::Unique<vk::VkBuffer> bufferB (createExternalBuffer(vkd, *device, queueFamilyIndex, config.externalType, bufferSize, 0u, usage)); @@ -3378,12 +3394,28 @@ tcu::TestStatus testMemoryMultipleImports (Context& context, MemoryTestConfig co // \note Buffer is only allocated to get memory requirements const vk::Unique<vk::VkBuffer> buffer (createExternalBuffer(vkd, *device, queueFamilyIndex, config.externalType, bufferSize, 0u, usage)); const vk::VkMemoryRequirements requirements (getBufferMemoryRequirements(vkd, *device, *buffer)); - const deUint32 exportedMemoryTypeIndex (getExportedMemoryTypeIndex(vki, physicalDevice, config.hostVisible, requirements.memoryTypeBits)); + deUint32 exportedMemoryTypeIndex (getExportedMemoryTypeIndex(vki, physicalDevice, config.hostVisible, requirements.memoryTypeBits)); const vk::Unique<vk::VkDeviceMemory> memory (allocateExportableMemory(vkd, *device, requirements.size, exportedMemoryTypeIndex, config.externalType, config.dedicated ? *buffer : (vk::VkBuffer)0)); NativeHandle handleA; getMemoryNative(vkd, *device, *memory, config.externalType, handleA); + // Need to query again memory type index since we are forced to have same type bits as the ahb buffer + // Avoids VUID-VkMemoryAllocateInfo-memoryTypeIndex-02385 + if (config.externalType == vk::VK_EXTERNAL_MEMORY_HANDLE_TYPE_ANDROID_HARDWARE_BUFFER_BIT_ANDROID) + { + vk::VkAndroidHardwareBufferPropertiesANDROID ahbProperties = + { + vk::VK_STRUCTURE_TYPE_ANDROID_HARDWARE_BUFFER_PROPERTIES_ANDROID, // VkStructureType sType + DE_NULL, // void* pNext + 0u, // VkDeviceSize allocationSize + 0u // uint32_t memoryTypeBits + }; + vkd.getAndroidHardwareBufferPropertiesANDROID(device.get(), handleA.getAndroidHardwareBuffer(), &ahbProperties); + + exportedMemoryTypeIndex = chooseMemoryType(ahbProperties.memoryTypeBits); + } + for (size_t ndx = 0; ndx < count; ndx++) { const vk::Unique<vk::VkBuffer> bufferB (createExternalBuffer(vkd, *device, queueFamilyIndex, config.externalType, bufferSize, 0u, usage)); @@ -3837,7 +3869,7 @@ tcu::TestStatus testBufferBindExportImportBind (Context& context, // \note Buffer is only allocated to get memory requirements const vk::Unique<vk::VkBuffer> bufferA (createExternalBuffer(vkd, *device, queueFamilyIndex, config.externalType, bufferSize, 0u, usage)); const vk::VkMemoryRequirements requirements (getBufferMemoryRequirements(vkd, *device, *bufferA)); - const deUint32 exportedMemoryTypeIndex (chooseMemoryType(requirements.memoryTypeBits)); + deUint32 exportedMemoryTypeIndex (chooseMemoryType(requirements.memoryTypeBits)); const vk::Unique<vk::VkDeviceMemory> memoryA (allocateExportableMemory(vkd, *device, requirements.size, exportedMemoryTypeIndex, config.externalType, config.dedicated ? *bufferA : (vk::VkBuffer)0)); NativeHandle handle; @@ -3845,6 +3877,22 @@ tcu::TestStatus testBufferBindExportImportBind (Context& context, getMemoryNative(vkd, *device, *memoryA, config.externalType, handle); + // Need to query again memory type index since we are forced to have same type bits as the ahb buffer + // Avoids VUID-VkMemoryAllocateInfo-memoryTypeIndex-02385 + if (config.externalType == vk::VK_EXTERNAL_MEMORY_HANDLE_TYPE_ANDROID_HARDWARE_BUFFER_BIT_ANDROID) + { + vk::VkAndroidHardwareBufferPropertiesANDROID ahbProperties = + { + vk::VK_STRUCTURE_TYPE_ANDROID_HARDWARE_BUFFER_PROPERTIES_ANDROID, // VkStructureType sType + DE_NULL, // void* pNext + 0u, // VkDeviceSize allocationSize + 0u // uint32_t memoryTypeBits + }; + vkd.getAndroidHardwareBufferPropertiesANDROID(device.get(), handle.getAndroidHardwareBuffer(), &ahbProperties); + + exportedMemoryTypeIndex = chooseMemoryType(ahbProperties.memoryTypeBits); + } + { const vk::Unique<vk::VkBuffer> bufferB (createExternalBuffer(vkd, *device, queueFamilyIndex, config.externalType, bufferSize, 0u, usage)); const vk::Unique<vk::VkDeviceMemory> memoryB (config.dedicated @@ -3875,13 +3923,29 @@ tcu::TestStatus testBufferExportBindImportBind (Context& context, // \note Buffer is only allocated to get memory requirements const vk::Unique<vk::VkBuffer> bufferA (createExternalBuffer(vkd, *device, queueFamilyIndex, config.externalType, bufferSize, 0u, usage)); const vk::VkMemoryRequirements requirements (getBufferMemoryRequirements(vkd, *device, *bufferA)); - const deUint32 exportedMemoryTypeIndex (chooseMemoryType(requirements.memoryTypeBits)); + deUint32 exportedMemoryTypeIndex (chooseMemoryType(requirements.memoryTypeBits)); const vk::Unique<vk::VkDeviceMemory> memoryA (allocateExportableMemory(vkd, *device, requirements.size, exportedMemoryTypeIndex, config.externalType, config.dedicated ? *bufferA : (vk::VkBuffer)0)); NativeHandle handle; getMemoryNative(vkd, *device, *memoryA, config.externalType, handle); VK_CHECK(vkd.bindBufferMemory(*device, *bufferA, *memoryA, 0u)); + // Need to query again memory type index since we are forced to have same type bits as the ahb buffer + // Avoids VUID-VkMemoryAllocateInfo-memoryTypeIndex-02385 + if (config.externalType == vk::VK_EXTERNAL_MEMORY_HANDLE_TYPE_ANDROID_HARDWARE_BUFFER_BIT_ANDROID) + { + vk::VkAndroidHardwareBufferPropertiesANDROID ahbProperties = + { + vk::VK_STRUCTURE_TYPE_ANDROID_HARDWARE_BUFFER_PROPERTIES_ANDROID, // VkStructureType sType + DE_NULL, // void* pNext + 0u, // VkDeviceSize allocationSize + 0u // uint32_t memoryTypeBits + }; + vkd.getAndroidHardwareBufferPropertiesANDROID(device.get(), handle.getAndroidHardwareBuffer(), &ahbProperties); + + exportedMemoryTypeIndex = chooseMemoryType(ahbProperties.memoryTypeBits); + } + { const vk::Unique<vk::VkBuffer> bufferB (createExternalBuffer(vkd, *device, queueFamilyIndex, config.externalType, bufferSize, 0u, usage)); const vk::Unique<vk::VkDeviceMemory> memoryB (config.dedicated @@ -3912,12 +3976,28 @@ tcu::TestStatus testBufferExportImportBindBind (Context& context, // \note Buffer is only allocated to get memory requirements const vk::Unique<vk::VkBuffer> bufferA (createExternalBuffer(vkd, *device, queueFamilyIndex, config.externalType, bufferSize, 0u, usage)); const vk::VkMemoryRequirements requirements (getBufferMemoryRequirements(vkd, *device, *bufferA)); - const deUint32 exportedMemoryTypeIndex (chooseMemoryType(requirements.memoryTypeBits)); + deUint32 exportedMemoryTypeIndex (chooseMemoryType(requirements.memoryTypeBits)); const vk::Unique<vk::VkDeviceMemory> memoryA (allocateExportableMemory(vkd, *device, requirements.size, exportedMemoryTypeIndex, config.externalType, config.dedicated ? *bufferA : (vk::VkBuffer)0)); NativeHandle handle; getMemoryNative(vkd, *device, *memoryA, config.externalType, handle); + // Need to query again memory type index since we are forced to have same type bits as the ahb buffer + // Avoids VUID-VkMemoryAllocateInfo-memoryTypeIndex-02385 + if (config.externalType == vk::VK_EXTERNAL_MEMORY_HANDLE_TYPE_ANDROID_HARDWARE_BUFFER_BIT_ANDROID) + { + vk::VkAndroidHardwareBufferPropertiesANDROID ahbProperties = + { + vk::VK_STRUCTURE_TYPE_ANDROID_HARDWARE_BUFFER_PROPERTIES_ANDROID, // VkStructureType sType + DE_NULL, // void* pNext + 0u, // VkDeviceSize allocationSize + 0u // uint32_t memoryTypeBits + }; + vkd.getAndroidHardwareBufferPropertiesANDROID(device.get(), handle.getAndroidHardwareBuffer(), &ahbProperties); + + exportedMemoryTypeIndex = chooseMemoryType(ahbProperties.memoryTypeBits); + } + { const vk::Unique<vk::VkBuffer> bufferB (createExternalBuffer(vkd, *device, queueFamilyIndex, config.externalType, bufferSize, 0u, usage)); const vk::Unique<vk::VkDeviceMemory> memoryB (config.dedicated diff --git a/external/vulkancts/modules/vulkan/fragment_shading_rate/vktAttachmentRateTests.cpp b/external/vulkancts/modules/vulkan/fragment_shading_rate/vktAttachmentRateTests.cpp index 5af052ce7..389c4e522 100644 --- a/external/vulkancts/modules/vulkan/fragment_shading_rate/vktAttachmentRateTests.cpp +++ b/external/vulkancts/modules/vulkan/fragment_shading_rate/vktAttachmentRateTests.cpp @@ -924,8 +924,11 @@ bool AttachmentRateInstance::verifyUsingAtomicChecks(deUint32 tileWidth, deUint3 deUint32 triangleTopEdgeY = 0; // this method assumes that greatest angle in the triangle points to the top-left corner of FB; - // this vector will then store fragments on the right edge of triangle; vector index represents y coordinate and value is x + // these vectors will then store fragments on the right and bottom edges of triangle respectively; + // for the right edge vector, the index represents y coordinate and value is x; + // for the bottom edge vector, the index represents x coordinate and value is y std::vector<deUint32> fragmentsOnTheRightTriangleEdgeVect(m_cbHeight, 0); + std::vector<deUint32> fragmentsOnTheBottomTriangleEdgeVect(m_cbWidth, 0); tcu::clear(errorMaskAccess, tcu::Vec4(0.0f, 0.0f, 0.0f, 1.0)); @@ -949,6 +952,9 @@ bool AttachmentRateInstance::verifyUsingAtomicChecks(deUint32 tileWidth, deUint3 // constantly overwrite coordinate on right edge so that we are left with the farthest one fragmentsOnTheRightTriangleEdgeVect[cbFragmentY] = cbFragmentX; + // constantly overwrite coordinate on bottom edge so that we are left with the farthest one + fragmentsOnTheBottomTriangleEdgeVect[cbFragmentX] = cbFragmentY; + // make sure that fragment g and a components are 0 if ((fragmentColor[1] != 0) || (fragmentColor[3] != 0)) { @@ -1030,12 +1036,14 @@ bool AttachmentRateInstance::verifyUsingAtomicChecks(deUint32 tileWidth, deUint3 { const auto& topLeftFragment = fragmentSet[0]; deUint32 triangleRightEdgeX = fragmentsOnTheRightTriangleEdgeVect[topLeftFragment.y()]; + deUint32 triangleBottomEdgeY = fragmentsOnTheBottomTriangleEdgeVect[topLeftFragment.x()]; // we can only count this as an error if set is fully inside of triangle, sets on // edges may not have same number of fragments as sets fully located in the triangle if ((topLeftFragment.y() > (triangleTopEdgeY)) && (topLeftFragment.x() > (triangleLeftEdgeX)) && - (topLeftFragment.x() < (triangleRightEdgeX - rateWidth))) + (topLeftFragment.x() < (triangleRightEdgeX - rateWidth)) && + (topLeftFragment.y() < (triangleBottomEdgeY - rateHeight))) { wrongFragments += (deUint32)fragmentSet.size(); fragmentColor = tcu::Vec4(1.0f, 0.0f, 0.0f, 1.0f); diff --git a/external/vulkancts/modules/vulkan/image/vktImageCompressionTranscodingSupport.cpp b/external/vulkancts/modules/vulkan/image/vktImageCompressionTranscodingSupport.cpp index 17524cbcb..d367b9faf 100644 --- a/external/vulkancts/modules/vulkan/image/vktImageCompressionTranscodingSupport.cpp +++ b/external/vulkancts/modules/vulkan/image/vktImageCompressionTranscodingSupport.cpp @@ -1422,7 +1422,7 @@ void ImageStoreComputeTestInstance::executeShader (const VkCommandBuffer& cmdBu for (deUint32 imageNdx = 0u; imageNdx < imageData[1].getImagesCount(); ++imageNdx) { preShaderImageBarriers[imageNdx] = makeImageMemoryBarrier( - VK_ACCESS_TRANSFER_WRITE_BIT, VK_ACCESS_SHADER_WRITE_BIT, + VK_ACCESS_TRANSFER_WRITE_BIT, (VK_ACCESS_SHADER_READ_BIT|VK_ACCESS_SHADER_WRITE_BIT), VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL, VK_IMAGE_LAYOUT_GENERAL, imageData[1].getImage(imageNdx), uncompressedRange); @@ -1433,7 +1433,7 @@ void ImageStoreComputeTestInstance::executeShader (const VkCommandBuffer& cmdBu } preShaderImageBarriers[preShaderImageBarriers.size()-1] = makeImageMemoryBarrier( - VK_ACCESS_TRANSFER_WRITE_BIT, VK_ACCESS_SHADER_READ_BIT, + VK_ACCESS_TRANSFER_WRITE_BIT, (VK_ACCESS_SHADER_READ_BIT|VK_ACCESS_SHADER_WRITE_BIT), VK_IMAGE_LAYOUT_UNDEFINED, VK_IMAGE_LAYOUT_GENERAL, imageData[0].getImage(0u), compressedRange); @@ -2309,7 +2309,7 @@ void GraphicsTextureTestInstance::transcodeRead () const VkImageMemoryBarrier srcCopyImageBarrierPre = makeImageMemoryBarrier(0u, VK_ACCESS_TRANSFER_WRITE_BIT, VK_IMAGE_LAYOUT_UNDEFINED, VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL, srcImage->get(), srcSubresourceRange); const VkImageMemoryBarrier srcCopyImageBarrierPost = makeImageMemoryBarrier(VK_ACCESS_TRANSFER_WRITE_BIT, VK_ACCESS_SHADER_READ_BIT, VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL, VK_IMAGE_LAYOUT_GENERAL, srcImage->get(), srcSubresourceRange); const VkBufferImageCopy dstCopyRegion = makeBufferImageCopy(dstImageResolution.x(), dstImageResolution.y()); - const VkImageMemoryBarrier dstInitImageBarrier = makeImageMemoryBarrier(0u, VK_ACCESS_SHADER_READ_BIT, VK_IMAGE_LAYOUT_UNDEFINED, VK_IMAGE_LAYOUT_GENERAL, dstImage->get(), dstSubresourceRange); + const VkImageMemoryBarrier dstInitImageBarrier = makeImageMemoryBarrier(0u, (VK_ACCESS_SHADER_READ_BIT|VK_ACCESS_SHADER_WRITE_BIT), VK_IMAGE_LAYOUT_UNDEFINED, VK_IMAGE_LAYOUT_GENERAL, dstImage->get(), dstSubresourceRange); const VkExtent2D framebufferSize (makeExtent2D(dstImageResolution[0], dstImageResolution[1])); const Move<VkFramebuffer> framebuffer (makeFramebuffer(vk, device, *renderPass, 0, DE_NULL, framebufferSize.width, framebufferSize.height, SINGLE_LAYER)); diff --git a/external/vulkancts/modules/vulkan/memory/vktMemoryDeviceMemoryReportTests.cpp b/external/vulkancts/modules/vulkan/memory/vktMemoryDeviceMemoryReportTests.cpp index b6427134a..e72419d29 100644 --- a/external/vulkancts/modules/vulkan/memory/vktMemoryDeviceMemoryReportTests.cpp +++ b/external/vulkancts/modules/vulkan/memory/vktMemoryDeviceMemoryReportTests.cpp @@ -1820,99 +1820,6 @@ tcu::TestStatus vkDeviceMemoryAllocateAndFreeTest (Context& context) return tcu::TestStatus::pass("Ok"); } -tcu::TestStatus vkDeviceMemoryAllocationFailedTest (Context& context) -{ - CallbackRecorder recorder; - const PlatformInterface& vkp = context.getPlatformInterface(); - const VkInstance instance = context.getInstance(); - const InstanceInterface& vki = context.getInstanceInterface(); - const VkPhysicalDevice physicalDevice = context.getPhysicalDevice(); - const deUint32 queueFamilyIndex = context.getUniversalQueueFamilyIndex(); - const deBool isValidationEnabled = context.getTestContext().getCommandLine().isValidationEnabled(); - const Unique<VkDevice> device (createDeviceWithMemoryReport(isValidationEnabled, vkp, instance, vki, physicalDevice, queueFamilyIndex, &recorder)); - const DeviceDriver vkd (vkp, instance, *device); - const VkPhysicalDeviceMemoryProperties memoryProperties = getPhysicalDeviceMemoryProperties(vki, physicalDevice); - const deUint32 testTypeIndex = 0; - const deUint32 testHeapIndex = memoryProperties.memoryTypes[testTypeIndex].heapIndex; - const VkDeviceSize testSize = memoryProperties.memoryHeaps[testHeapIndex].size; - const deUint32 testNumAlloc = 10; - - { - recorder.setCallbackMarker(MARKER_UNKNOWN); - - std::vector<VkDeviceMemory> memories; - VkResult result = VK_SUCCESS; - VkMemoryAllocateInfo memoryAllocateInfo = - { - VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_INFO, // VkStructureType sType; - DE_NULL, // const void* pNext; - 128, // VkDeviceSize allocationSize; - testTypeIndex, // uint32_t memoryTypeIndex; - }; - - { - VkDeviceMemory memory = DE_NULL; - - // first do a small allocation to prevent LowMemoryKiller on android from culling this app - result = vkd.allocateMemory(*device, &memoryAllocateInfo, (const VkAllocationCallbacks*)DE_NULL, &memory); - if (result != VK_SUCCESS) - TCU_THROW(NotSupportedError, "Unable to do a small allocation"); - - memories.emplace_back(memory); - } - - // use heap size to trigger allocation failure (up to testNumAlloc times for overallocation) - memoryAllocateInfo.allocationSize = testSize; - // only mark the range that an allocation failure could occur - recorder.setCallbackMarker(MARKER_ALLOCATION_FAILED); - for (deUint32 i = 0; i < testNumAlloc; i++) - { - VkDeviceMemory memory = DE_NULL; - - result = vkd.allocateMemory(*device, &memoryAllocateInfo, (const VkAllocationCallbacks*)DE_NULL, &memory); - if (result != VK_SUCCESS) - { - break; - } - - memories.emplace_back(memory); - } - recorder.setCallbackMarker(MARKER_UNKNOWN); - - for (auto memory : memories) - { - vkd.freeMemory(*device, memory, DE_NULL); - } - - if (result == VK_SUCCESS) - { - return tcu::TestStatus::fail(std::string("Should not be able to allocate ") + std::to_string(testNumAlloc * testSize) + " bytes of memory"); - } - } - - deBool allocationFailedEvent = false; - - for (auto iter = recorder.getRecordsBegin(); iter != recorder.getRecordsEnd(); iter++) - { - const VkDeviceMemoryReportCallbackDataEXT& record = iter->first; - const CallbackMarker marker = iter->second; - - if (record.type == VK_DEVICE_MEMORY_REPORT_EVENT_TYPE_ALLOCATION_FAILED_EXT) - { - TCU_CHECK(marker == MARKER_ALLOCATION_FAILED); - TCU_CHECK(record.objectType == VK_OBJECT_TYPE_DEVICE_MEMORY); - TCU_CHECK_MSG(record.size >= testSize, ("record.size=" + de::toString(record.size) + ", testSize=" + de::toString(testSize)).c_str()); - TCU_CHECK(record.heapIndex == testHeapIndex); - - allocationFailedEvent = true; - } - } - - TCU_CHECK(allocationFailedEvent); - - return tcu::TestStatus::pass("Ok"); -} - static void checkSupport (Context& context) { context.requireDeviceFunctionality("VK_EXT_device_memory_report"); @@ -1923,7 +1830,6 @@ tcu::TestCaseGroup* createVkDeviceMemoryTestsGroup (tcu::TestContext& testCtx, c MovePtr<tcu::TestCaseGroup> group (new tcu::TestCaseGroup(testCtx, name, desc)); addFunctionCase(group.get(), "allocate_and_free", "", checkSupport, vkDeviceMemoryAllocateAndFreeTest); - addFunctionCase(group.get(), "allocation_failed", "", checkSupport, vkDeviceMemoryAllocationFailedTest); return group.release(); } diff --git a/external/vulkancts/modules/vulkan/memory/vktMemoryPipelineBarrierTests.cpp b/external/vulkancts/modules/vulkan/memory/vktMemoryPipelineBarrierTests.cpp index a25b3e462..27332c47f 100644 --- a/external/vulkancts/modules/vulkan/memory/vktMemoryPipelineBarrierTests.cpp +++ b/external/vulkancts/modules/vulkan/memory/vktMemoryPipelineBarrierTests.cpp @@ -9934,7 +9934,7 @@ struct AddPrograms const char* const vertexShader = "#version 450\n" "precision highp float;\n" - "layout(set=0, binding=0, rgba8) uniform image2D u_image;\n" + "layout(set=0, binding=0, rgba8) uniform readonly image2D u_image;\n" "out gl_PerVertex {\n" "\tvec4 gl_Position;\n" "\tfloat gl_PointSize;\n" @@ -9959,7 +9959,7 @@ struct AddPrograms "#version 450\n" "#extension GL_EXT_texture_buffer : require\n" "precision highp float;\n" - "layout(set=0, binding=0, rgba8) uniform image2D u_image;\n" + "layout(set=0, binding=0, rgba8) uniform readonly image2D u_image;\n" "layout(location = 0) out highp vec4 o_color;\n" "void main (void) {\n" "\thighp uvec2 size = uvec2(imageSize(u_image).x, imageSize(u_image).y);\n" diff --git a/external/vulkancts/modules/vulkan/multiview/vktMultiViewRenderTests.cpp b/external/vulkancts/modules/vulkan/multiview/vktMultiViewRenderTests.cpp index 22381533a..9e4a07f1e 100644 --- a/external/vulkancts/modules/vulkan/multiview/vktMultiViewRenderTests.cpp +++ b/external/vulkancts/modules/vulkan/multiview/vktMultiViewRenderTests.cpp @@ -3944,6 +3944,9 @@ private: context.requireDeviceFunctionality("VK_KHR_multiview"); if (m_parameters.viewIndex == TEST_TYPE_DEPTH_DIFFERENT_RANGES) context.requireDeviceFunctionality("VK_EXT_depth_range_unrestricted"); + + if (m_parameters.viewIndex == TEST_TYPE_QUERIES) + context.requireDeviceCoreFeature(DEVICE_CORE_FEATURE_OCCLUSION_QUERY_PRECISE); } void initPrograms (SourceCollections& programCollection) const diff --git a/external/vulkancts/modules/vulkan/subgroups/vktSubgroupsQuadTests.cpp b/external/vulkancts/modules/vulkan/subgroups/vktSubgroupsQuadTests.cpp index 6d97d884e..cd84482c4 100755 --- a/external/vulkancts/modules/vulkan/subgroups/vktSubgroupsQuadTests.cpp +++ b/external/vulkancts/modules/vulkan/subgroups/vktSubgroupsQuadTests.cpp @@ -204,8 +204,8 @@ void supportedCheck (Context& context, CaseDefinition caseDef) if (!subgroups::isSubgroupSupported(context)) TCU_THROW(NotSupportedError, "Subgroup operations are not supported"); - if (!subgroups::isSubgroupFeatureSupportedForDevice(context, VK_SUBGROUP_FEATURE_QUAD_BIT)) - TCU_THROW(NotSupportedError, "Device does not support subgroup quad operations"); + if (!subgroups::areQuadOperationsSupportedForStages(context, caseDef.shaderStage)) + TCU_THROW(NotSupportedError, "Device does not support subgroup quad operations in this shader stage"); if (!subgroups::isFormatSupportedForDevice(context, caseDef.format)) TCU_THROW(NotSupportedError, "Device does not support the specified format in subgroup operations"); diff --git a/external/vulkancts/modules/vulkan/subgroups/vktSubgroupsShapeTests.cpp b/external/vulkancts/modules/vulkan/subgroups/vktSubgroupsShapeTests.cpp index 8297b7b39..4ee6a6ad2 100755 --- a/external/vulkancts/modules/vulkan/subgroups/vktSubgroupsShapeTests.cpp +++ b/external/vulkancts/modules/vulkan/subgroups/vktSubgroupsShapeTests.cpp @@ -233,15 +233,15 @@ void supportedCheck (Context& context, CaseDefinition caseDef) { if (!subgroups::isSubgroupFeatureSupportedForDevice(context, VK_SUBGROUP_FEATURE_CLUSTERED_BIT)) { - TCU_THROW(NotSupportedError, "Subgroup shape tests require that clustered operations are supported!"); + TCU_THROW(NotSupportedError, "Test requires that clustered operations are supported!"); } } if (OPTYPE_QUAD == caseDef.opType) { - if (!subgroups::isSubgroupFeatureSupportedForDevice(context, VK_SUBGROUP_FEATURE_QUAD_BIT)) + if (!subgroups::areQuadOperationsSupportedForStages(context, caseDef.shaderStage)) { - TCU_THROW(NotSupportedError, "Subgroup shape tests require that quad operations are supported!"); + TCU_THROW(NotSupportedError, "Test requires that quad operations are supported!"); } } diff --git a/external/vulkancts/modules/vulkan/subgroups/vktSubgroupsTestsUtils.cpp b/external/vulkancts/modules/vulkan/subgroups/vktSubgroupsTestsUtils.cpp index d94e868d7..117304108 100644 --- a/external/vulkancts/modules/vulkan/subgroups/vktSubgroupsTestsUtils.cpp +++ b/external/vulkancts/modules/vulkan/subgroups/vktSubgroupsTestsUtils.cpp @@ -1663,6 +1663,21 @@ bool vkt::subgroups::isSubgroupFeatureSupportedForDevice (Context& context, VkSu return (bit & (context.getSubgroupProperties().supportedOperations)) ? true : false; } +bool vkt::subgroups::areQuadOperationsSupportedForStages (Context& context, const VkShaderStageFlags stages) +{ + // Check general quad feature support first. + if (!isSubgroupFeatureSupportedForDevice(context, VK_SUBGROUP_FEATURE_QUAD_BIT)) + return false; + + if (context.getSubgroupProperties().quadOperationsInAllStages == VK_TRUE) + return true; // No problem, any stage works. + + // Only frag and compute are supported. + const VkShaderStageFlags fragCompute = (VK_SHADER_STAGE_FRAGMENT_BIT | VK_SHADER_STAGE_COMPUTE_BIT); + const VkShaderStageFlags otherStages = ~fragCompute; + return ((stages & otherStages) == 0u); +} + bool vkt::subgroups::isFragmentSSBOSupportedForDevice (Context& context) { return context.getDeviceFeatures().fragmentStoresAndAtomics ? true : false; diff --git a/external/vulkancts/modules/vulkan/subgroups/vktSubgroupsTestsUtils.hpp b/external/vulkancts/modules/vulkan/subgroups/vktSubgroupsTestsUtils.hpp index 166a9e766..55295f601 100644 --- a/external/vulkancts/modules/vulkan/subgroups/vktSubgroupsTestsUtils.hpp +++ b/external/vulkancts/modules/vulkan/subgroups/vktSubgroupsTestsUtils.hpp @@ -154,6 +154,8 @@ bool areSubgroupOperationsSupportedForStage (Context& context, vk::VkShaderStage bool isSubgroupFeatureSupportedForDevice (Context& context, vk::VkSubgroupFeatureFlagBits bit); +bool areQuadOperationsSupportedForStages (Context& context, const vk::VkShaderStageFlags stages); + bool isFragmentSSBOSupportedForDevice (Context& context); bool isVertexSSBOSupportedForDevice (Context& context); diff --git a/external/vulkancts/modules/vulkan/texture/vktTextureShadowTests.cpp b/external/vulkancts/modules/vulkan/texture/vktTextureShadowTests.cpp index 225cd1b60..7f8fd27e4 100644 --- a/external/vulkancts/modules/vulkan/texture/vktTextureShadowTests.cpp +++ b/external/vulkancts/modules/vulkan/texture/vktTextureShadowTests.cpp @@ -38,6 +38,7 @@ #include "tcuTexVerifierUtil.hpp" #include "tcuTexture.hpp" #include "tcuTextureUtil.hpp" +#include "tcuVectorUtil.hpp" #include "vkImageUtil.hpp" #include "vkTypeUtil.hpp" #include "vktTestGroupUtil.hpp" @@ -158,11 +159,12 @@ bool verifyTexCompareResult (tcu::TestContext& testCtx, const tcu::LodPrecision& lodPrec, const tcu::PixelFormat& pixelFormat) { - tcu::TestLog& log = testCtx.getLog(); - tcu::Surface reference (result.getWidth(), result.getHeight()); - tcu::Surface errorMask (result.getWidth(), result.getHeight()); - const tcu::Vec3 nonShadowThreshold = tcu::computeFixedPointThreshold(getBitsVec(pixelFormat)-1).swizzle(1,2,3); - int numFailedPixels; + tcu::TestLog& log = testCtx.getLog(); + tcu::Surface reference (result.getWidth(), result.getHeight()); + tcu::Surface errorMask (result.getWidth(), result.getHeight()); + const tcu::IVec4 nonShadowBits = tcu::max(getBitsVec(pixelFormat)-1, tcu::IVec4(0)); + const tcu::Vec3 nonShadowThreshold = tcu::computeFixedPointThreshold(nonShadowBits).swizzle(1,2,3); + int numFailedPixels; // sampleTexture() expects source image to be the same state as it would be in a GL implementation, that is // the floating point depth values should be in [0, 1] range as data is clamped during texture upload. Since diff --git a/external/vulkancts/mustpass/master/vk-default/memory.txt b/external/vulkancts/mustpass/master/vk-default/memory.txt index fc1b8fc6c..6b538edec 100644 --- a/external/vulkancts/mustpass/master/vk-default/memory.txt +++ b/external/vulkancts/mustpass/master/vk-default/memory.txt @@ -3197,7 +3197,6 @@ dEQP-VK.memory.device_memory_report.create_and_destroy_object.command_pool_trans dEQP-VK.memory.device_memory_report.create_and_destroy_object.command_buffer_primary dEQP-VK.memory.device_memory_report.create_and_destroy_object.command_buffer_secondary dEQP-VK.memory.device_memory_report.vk_device_memory.allocate_and_free -dEQP-VK.memory.device_memory_report.vk_device_memory.allocation_failed dEQP-VK.memory.device_memory_report.external_memory.import_and_unimport_opaque_fd dEQP-VK.memory.device_memory_report.external_memory.import_and_unimport_opaque_win32 dEQP-VK.memory.device_memory_report.external_memory.import_and_unimport_opaque_win32_kmt diff --git a/framework/common/tcuInterval.hpp b/framework/common/tcuInterval.hpp index f5cf640f1..dada74db9 100644 --- a/framework/common/tcuInterval.hpp +++ b/framework/common/tcuInterval.hpp @@ -231,6 +231,7 @@ std::ostream& operator<< (std::ostream& os, const Interval& interval); #define TCU_SET_INTERVAL_BOUNDS(DST, VAR, SETLOW, SETHIGH) do \ { \ + DE_FENV_ACCESS_ON \ ::tcu::ScopedRoundingMode VAR##_ctx_; \ ::tcu::Interval& VAR##_dst_ = (DST); \ ::tcu::Interval VAR##_lo_; \ diff --git a/framework/delibs/cmake/Defs.cmake b/framework/delibs/cmake/Defs.cmake index c1da84b46..6eccf49ea 100644 --- a/framework/delibs/cmake/Defs.cmake +++ b/framework/delibs/cmake/Defs.cmake @@ -178,6 +178,41 @@ add_definitions("-DDE_CPU=${DE_CPU}") add_definitions("-DDE_PTR_SIZE=${DE_PTR_SIZE}") add_definitions("-DDE_MINGW=${DE_MINGW}") + +include(CheckCSourceCompiles) +set(FENV_ACCESS_PRAGMA "") + +macro(check_fenv_access_support PRAGMA) + if (DE_COMPILER_IS_CLANG OR DE_COMPILER_IS_GCC) + set(CMAKE_REQUIRED_FLAGS "-Wall") + endif () + check_c_source_compiles(" +#include <fenv.h> +${PRAGMA} +int main() { +#ifdef FE_INEXACT + return 0; +#else + #error \"FENV_ACCESS not available\" +#endif +}" HAVE_FENV_ACCESS FAIL_REGEX "unknown-pragmas") + if (HAVE_FENV_ACCESS) + set(FENV_ACCESS_PRAGMA ${PRAGMA}) + endif() +endmacro() + +if (DE_COMPILER_IS_MSC) + check_fenv_access_support("__pragma(fenv_access (on))") +elseif (DE_COMPILER_IS_CLANG OR DE_COMPILER_IS_GCC) + # Note that GCC does not provide a way to inform the implementation of FP environment access. https://gcc.gnu.org/bugzilla/show_bug.cgi?id=34678. + # Until that is implemented this check will never enable the FENV_ACCESS pragma. + check_fenv_access_support("_Pragma(\"STDC FENV_ACCESS ON\")") +else () + message(FATAL_ERROR "Unsupported compiler!") +endif () + +add_definitions("-DDE_FENV_ACCESS_ON=${FENV_ACCESS_PRAGMA}") + if (DE_OS_IS_ANDROID) add_definitions("-DDE_ANDROID_API=${DE_ANDROID_API}") endif () diff --git a/framework/delibs/debase/deDefs.h b/framework/delibs/debase/deDefs.h index 80b240a07..360fd28cd 100644 --- a/framework/delibs/debase/deDefs.h +++ b/framework/delibs/debase/deDefs.h @@ -358,6 +358,19 @@ DE_INLINE deBool deGetTrue (void) { return DE_TRUE; } # define DE_PTR_SIZE 4 /* default to 32-bit */ #endif +/* Floating-point environment flag. */ +#if defined(DE_FENV_ACCESS_ON) + /* Already defined */ +#elif (DE_OS == DE_OS_ANDROID) +# define DE_FENV_ACCESS_ON /* not supported on 13*/ +#elif (DE_COMPILER == DE_COMPILER_CLANG) && (DE_CPU != DE_CPU_ARM) +# define DE_FENV_ACCESS_ON _Pragma("STDC FENV_ACCESS ON") +#elif (DE_COMPILER == DE_COMPILER_MSC) +# define DE_FENV_ACCESS_ON __pragma(fenv_access (on)) +#else +# define DE_FENV_ACCESS_ON /* not supported */ +#endif + /** Unreferenced variable silencing. */ #define DE_UNREF(VAR) ((void)(VAR)) |