diff options
Diffstat (limited to 'src/libANGLE/renderer/vulkan/vk_renderer.cpp')
-rw-r--r-- | src/libANGLE/renderer/vulkan/vk_renderer.cpp | 585 |
1 files changed, 351 insertions, 234 deletions
diff --git a/src/libANGLE/renderer/vulkan/vk_renderer.cpp b/src/libANGLE/renderer/vulkan/vk_renderer.cpp index 4c4a49d719..219c62ff6c 100644 --- a/src/libANGLE/renderer/vulkan/vk_renderer.cpp +++ b/src/libANGLE/renderer/vulkan/vk_renderer.cpp @@ -115,18 +115,6 @@ bool IsRADV(uint32_t vendorId, uint32_t driverId, const char *deviceName) return IsAMD(vendorId) && strstr(deviceName, "RADV") != nullptr; } -bool IsVenus(uint32_t driverId, const char *deviceName) -{ - // Where driver id is available, check against Venus driver id: - if (driverId != 0) - { - return driverId == VK_DRIVER_ID_MESA_VENUS; - } - - // Otherwise, look for Venus in the device name. - return strstr(deviceName, "Venus") != nullptr; -} - bool IsQualcommOpenSource(uint32_t vendorId, uint32_t driverId, const char *deviceName) { if (!IsQualcomm(vendorId)) @@ -192,15 +180,15 @@ VkResult VerifyExtensionsPresent(const vk::ExtensionNameList &haystack, // Array of Validation error/warning messages that will be ignored, should include bugID constexpr const char *kSkippedMessages[] = { - // http://anglebug.com/8401 + // http://anglebug.com/42266825 "Undefined-Value-ShaderOutputNotConsumed", "Undefined-Value-ShaderInputNotProduced", - // http://anglebug.com/5304 + // http://anglebug.com/42263850 "VUID-vkCmdDraw-magFilter-04553", "VUID-vkCmdDrawIndexed-magFilter-04553", - // http://anglebug.com/5912 + // http://anglebug.com/42264452 "VUID-VkImageViewCreateInfo-pNext-01585", - // http://anglebug.com/6514 + // http://anglebug.com/42265014 "vkEnumeratePhysicalDevices: One or more layers modified physical devices", // When using Vulkan secondary command buffers, the command buffer is begun with the current // framebuffer specified in pInheritanceInfo::framebuffer. If the framebuffer is multisampled @@ -209,48 +197,48 @@ constexpr const char *kSkippedMessages[] = { // used to start the render pass and the one specified in pInheritanceInfo::framebuffer must be // equal, which is not true in that case. In practice, this is benign, as the part of the // framebuffer that's accessed by the command buffer is identically laid out. - // http://anglebug.com/6811 + // http://anglebug.com/42265307 "VUID-vkCmdExecuteCommands-pCommandBuffers-00099", - // http://anglebug.com/7325 + // http://anglebug.com/42265797 "VUID-vkCmdBindVertexBuffers2-pStrides-06209", - // http://anglebug.com/7729 + // http://anglebug.com/42266199 "VUID-vkDestroySemaphore-semaphore-01137", "VUID-vkDestroySemaphore-semaphore-05149", // https://issuetracker.google.com/303219657 "VUID-VkGraphicsPipelineCreateInfo-pStages-00738", - // http://anglebug.com/7861 + // http://anglebug.com/42266334 "VUID-vkCmdDraw-None-06887", "VUID-vkCmdDraw-None-06886", "VUID-vkCmdDrawIndexed-None-06887", - // http://anglebug.com/8394 + // http://anglebug.com/42266819 "VUID-vkCmdDraw-None-09000", "VUID-vkCmdDrawIndexed-None-09002", - // http://anglebug.com/7865 + // http://anglebug.com/40644894 "VUID-VkDescriptorImageInfo-imageView-06711", "VUID-VkDescriptorImageInfo-descriptorType-06713", // http://crbug.com/1412096 "VUID-VkImageCreateInfo-pNext-00990", - // http://anglebug.com/8119 + // http://anglebug.com/42266565 "VUID-VkGraphicsPipelineCreateInfo-Input-07904", "VUID-VkGraphicsPipelineCreateInfo-Input-07905", "VUID-vkCmdDrawIndexed-None-07835", "VUID-VkGraphicsPipelineCreateInfo-Input-08733", "VUID-vkCmdDraw-Input-08734", - // https://anglebug.com/8128#c3 + // https://anglebug.com/42266575#comment4 "VUID-VkBufferViewCreateInfo-format-08779", - // https://anglebug.com/8203 + // https://anglebug.com/42266639 "VUID-VkVertexInputBindingDivisorDescriptionEXT-divisor-01870", - // https://anglebug.com/8454 + // https://anglebug.com/42266877 "VUID-VkVertexInputBindingDivisorDescriptionKHR-divisor-01870", - // https://anglebug.com/8237 + // https://anglebug.com/42266675 "VUID-VkGraphicsPipelineCreateInfo-topology-08773", - // https://anglebug.com/7291 + // https://anglebug.com/42265766 "VUID-vkCmdBlitImage-srcImage-00240", - // https://anglebug.com/8242 + // https://anglebug.com/42266678 // VVL bug: https://github.com/KhronosGroup/Vulkan-ValidationLayers/issues/7858 "VUID-vkCmdDraw-None-08608", "VUID-vkCmdDrawIndexed-None-08608", - // https://anglebug.com/8242 + // https://anglebug.com/42266678 // Invalid feedback loop caused by the application "VUID-vkCmdDraw-None-09000", "VUID-vkCmdDrawIndexed-None-09000", @@ -258,22 +246,22 @@ constexpr const char *kSkippedMessages[] = { "VUID-vkCmdDrawIndexed-None-09002", "VUID-vkCmdDraw-None-09003", "VUID-vkCmdDrawIndexed-None-09003", - // https://anglebug.com/8334 + // https://anglebug.com/42266764 "VUID-VkDescriptorImageInfo-imageView-07796", // https://issuetracker.google.com/303441816 "VUID-VkRenderPassBeginInfo-renderPass-00904", - // http://anglebug.com/8466 + // http://anglebug.com/42266888 "VUID-VkMemoryAllocateInfo-allocationSize-01742", "VUID-VkMemoryDedicatedAllocateInfo-image-01878", - // http://anglebug.com/8468 + // http://anglebug.com/42266890 "VUID-vkCmdDraw-pNext-09461", - // http://anglebug.com/8470 + // http://anglebug.com/42266893 "VUID-VkImportMemoryFdInfoKHR-handleType-00667", - // http://anglebug.com/8482 + // http://anglebug.com/42266904 "VUID-VkImportMemoryWin32HandleInfoKHR-handleType-00658", - // https://anglebug.com/8497 + // https://anglebug.com/42266920 "VUID-vkCmdEndDebugUtilsLabelEXT-commandBuffer-01912", - // https://anglebug.com/8522 + // https://anglebug.com/42266947 "VUID-VkPipelineVertexInputStateCreateInfo-pNext-pNext", // https://issuetracker.google.com/319228278 "VUID-vkCmdDrawIndexed-format-07753", @@ -284,21 +272,29 @@ constexpr const char *kSkippedMessages[] = { // https://issuetracker.google.com/336847261 "VUID-VkImageCreateInfo-pNext-02397", "VUID-vkCmdDraw-None-06550", + // https://anglebug.com/345304850 + "WARNING-Shader-OutputNotConsumed", }; // Validation messages that should be ignored only when VK_EXT_primitive_topology_list_restart is // not present. constexpr const char *kNoListRestartSkippedMessages[] = { - // http://anglebug.com/3832 + // http://anglebug.com/42262476 "VUID-VkPipelineInputAssemblyStateCreateInfo-topology-06252", }; +// VVL appears has a bug tracking stageMask on VkEvent with secondary command buffer. +// https://github.com/KhronosGroup/Vulkan-ValidationLayers/issues/7849 +constexpr const char *kSkippedMessagesWithVulkanSecondaryCommandBuffer[] = { + "VUID-vkCmdWaitEvents-srcStageMask-parameter", +}; + // Some syncval errors are resolved in the presence of the NONE load or store render pass ops. For // those, ANGLE makes no further attempt to resolve them and expects vendor support for the // extensions instead. The list of skipped messages is split based on this support. constexpr vk::SkippedSyncvalMessage kSkippedSyncvalMessages[] = { - // http://anglebug.com/6416 - // http://anglebug.com/6421 + // http://anglebug.com/42264929 + // http://anglebug.com/42264934 { "SYNC-HAZARD-WRITE-AFTER-WRITE", "Access info (usage: SYNC_IMAGE_LAYOUT_TRANSITION, prior_usage: " @@ -307,8 +303,8 @@ constexpr vk::SkippedSyncvalMessage kSkippedSyncvalMessages[] = { }, // These errors are caused by a feedback loop tests that don't produce correct Vulkan to begin // with. - // http://anglebug.com/6417 - // http://anglebug.com/7070 + // http://anglebug.com/42264930 + // http://anglebug.com/42265542 // // Occassionally, this is due to VVL's lack of support for some extensions. For example, // syncval doesn't properly account for VK_EXT_fragment_shader_interlock, which gives @@ -319,7 +315,7 @@ constexpr vk::SkippedSyncvalMessage kSkippedSyncvalMessages[] = { "imageLayout: VK_IMAGE_LAYOUT_GENERAL", "usage: SYNC_FRAGMENT_SHADER_SHADER_", }, - // http://anglebug.com/6551 + // http://anglebug.com/42265049 { "SYNC-HAZARD-WRITE-AFTER-WRITE", "Access info (usage: SYNC_IMAGE_LAYOUT_TRANSITION, prior_usage: " @@ -339,7 +335,7 @@ constexpr vk::SkippedSyncvalMessage kSkippedSyncvalMessages[] = { }, // From: TraceTest.manhattan_31 with SwiftShader and // VulkanPerformanceCounterTest.NewTextureDoesNotBreakRenderPass for both depth and stencil - // aspect. http://anglebug.com/6701. + // aspect. http://anglebug.com/42265196. // Additionally hit in the asphalt_9 trace // https://issuetracker.google.com/316337308 { @@ -350,7 +346,7 @@ constexpr vk::SkippedSyncvalMessage kSkippedSyncvalMessages[] = { "SYNC_IMAGE_LAYOUT_TRANSITION", }, // From various tests. The validation layer does not calculate the exact vertexCounts that's - // being accessed. http://anglebug.com/6725 + // being accessed. http://anglebug.com/42265220 { "SYNC-HAZARD-READ-AFTER-WRITE", "Hazard READ_AFTER_WRITE for vertex", @@ -379,7 +375,7 @@ constexpr vk::SkippedSyncvalMessage kSkippedSyncvalMessages[] = { "Access info (usage: SYNC_COMPUTE_SHADER_SHADER_STORAGE_WRITE, prior_usage: " "SYNC_VERTEX_ATTRIBUTE_INPUT_VERTEX_ATTRIBUTE_READ", }, - // From: MultisampledRenderToTextureES3Test.TransformFeedbackTest. http://anglebug.com/6725 + // From: MultisampledRenderToTextureES3Test.TransformFeedbackTest. http://anglebug.com/42265220 { "SYNC-HAZARD-WRITE-AFTER-WRITE", "vkCmdBeginRenderPass: Hazard WRITE_AFTER_WRITE in subpass", @@ -388,7 +384,7 @@ constexpr vk::SkippedSyncvalMessage kSkippedSyncvalMessages[] = { "EXT_" "TRANSFORM_FEEDBACK_COUNTER_WRITE_EXT", }, - // http://anglebug.com/8054 (VkNonDispatchableHandle on x86 bots) + // http://anglebug.com/42266506 (VkNonDispatchableHandle on x86 bots) { "SYNC-HAZARD-READ-AFTER-WRITE", "Hazard READ_AFTER_WRITE for VkBuffer", @@ -402,7 +398,7 @@ constexpr vk::SkippedSyncvalMessage kSkippedSyncvalMessages[] = { // From: TraceTest.manhattan_31 with SwiftShader. These failures appears related to // dynamic uniform buffers. The failures are gone if I force mUniformBufferDescriptorType to // VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER. My guess is that syncval is not doing a fine grain enough - // range tracking with dynamic uniform buffers. http://anglebug.com/6725 + // range tracking with dynamic uniform buffers. http://anglebug.com/42265220 { "SYNC-HAZARD-WRITE-AFTER-READ", "usage: SYNC_VERTEX_SHADER_UNIFORM_READ", @@ -422,7 +418,7 @@ constexpr vk::SkippedSyncvalMessage kSkippedSyncvalMessages[] = { // Coherent framebuffer fetch is enabled on some platforms that are known a priori to have the // needed behavior, even though this is not specified in the Vulkan spec. These generate // syncval errors that are benign on those platforms. - // http://anglebug.com/6870 + // http://anglebug.com/42265363 // From: TraceTest.dead_by_daylight // From: TraceTest.genshin_impact {"SYNC-HAZARD-READ-AFTER-WRITE", @@ -437,47 +433,47 @@ constexpr vk::SkippedSyncvalMessage kSkippedSyncvalMessages[] = { "VK_IMAGE_LAYOUT_GENERAL). Access info (usage: SYNC_IMAGE_LAYOUT_TRANSITION, prior_usage: " "SYNC_COLOR_ATTACHMENT_OUTPUT_COLOR_ATTACHMENT_WRITE, write_barriers:", true}, - // From: TraceTest.special_forces_group_2 http://anglebug.com/5592 + // From: TraceTest.special_forces_group_2 http://anglebug.com/42264123 { "SYNC-HAZARD-WRITE-AFTER-READ", "Access info (usage: SYNC_IMAGE_LAYOUT_TRANSITION, prior_usage: " "SYNC_FRAGMENT_SHADER_SHADER_", }, - // http://anglebug.com/7031 + // http://anglebug.com/42265504 {"SYNC-HAZARD-READ-AFTER-WRITE", "type: VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER, imageLayout: " "VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL, binding #0, index 0. Access info (usage: " "SYNC_COMPUTE_SHADER_SHADER_", "", false}, - // http://anglebug.com/7456 + // http://anglebug.com/42265925 { "SYNC-HAZARD-READ-AFTER-WRITE", "type: VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER, " "imageLayout: VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL", "Access info (usage: SYNC_FRAGMENT_SHADER_SHADER_", }, - // From: TraceTest.life_is_strange http://anglebug.com/7711 + // From: TraceTest.life_is_strange http://anglebug.com/42266180 {"SYNC-HAZARD-WRITE-AFTER-READ", "vkCmdEndRenderPass(): Hazard WRITE_AFTER_READ in subpass 0 for attachment 1 " "depth aspect during store with storeOp VK_ATTACHMENT_STORE_OP_DONT_CARE. " "Access info (usage: SYNC_LATE_FRAGMENT_TESTS_DEPTH_STENCIL_ATTACHMENT_WRITE, " "prior_usage: SYNC_FRAGMENT_SHADER_SHADER_"}, - // From: TraceTest.life_is_strange http://anglebug.com/7711 + // From: TraceTest.life_is_strange http://anglebug.com/42266180 {"SYNC-HAZARD-READ-AFTER-WRITE", "type: VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER, " "imageLayout: VK_IMAGE_LAYOUT_DEPTH_STENCIL_READ_ONLY_OPTIMAL", "usage: SYNC_FRAGMENT_SHADER_SHADER_"}, - // From: TraceTest.diablo_immortal http://anglebug.com/7837 + // From: TraceTest.diablo_immortal http://anglebug.com/42266309 {"SYNC-HAZARD-WRITE-AFTER-WRITE", "Hazard WRITE_AFTER_WRITE for VkImageView ", "Subpass #0, and pColorAttachments #0. Access info (usage: " "SYNC_COLOR_ATTACHMENT_OUTPUT_COLOR_ATTACHMENT_WRITE, prior_usage: " "SYNC_IMAGE_LAYOUT_TRANSITION, write_barriers: 0, command: vkCmdEndRenderPass"}, - // From: TraceTest.diablo_immortal http://anglebug.com/7837 + // From: TraceTest.diablo_immortal http://anglebug.com/42266309 {"SYNC-HAZARD-WRITE-AFTER-READ", "load with loadOp VK_ATTACHMENT_LOAD_OP_DONT_CARE. Access info (usage: " "SYNC_EARLY_FRAGMENT_TESTS_DEPTH_STENCIL_ATTACHMENT_WRITE, prior_usage: " "SYNC_FRAGMENT_SHADER_SHADER_"}, - // From: TraceTest.catalyst_black http://anglebug.com/7924 + // From: TraceTest.catalyst_black http://anglebug.com/42266390 {"SYNC-HAZARD-WRITE-AFTER-READ", "store with storeOp VK_ATTACHMENT_STORE_OP_STORE. Access info (usage: " "SYNC_LATE_FRAGMENT_TESTS_DEPTH_STENCIL_ATTACHMENT_WRITE, prior_usage: " @@ -496,7 +492,7 @@ constexpr vk::SkippedSyncvalMessage kSkippedSyncvalMessagesWithoutStoreOpNone[] // With storeOp=NONE, there is another bug where a depth/stencil attachment may use storeOp=NONE // for depth while storeOp=DONT_CARE for stencil, and the latter causes a synchronization error // (similarly to the previous case as DONT_CARE is also a write operation). - // http://anglebug.com/5962 + // http://anglebug.com/42264496 { "SYNC-HAZARD-WRITE-AFTER-READ", "depth aspect during store with storeOp VK_ATTACHMENT_STORE_OP_STORE. Access info (usage: " @@ -514,7 +510,7 @@ constexpr vk::SkippedSyncvalMessage kSkippedSyncvalMessagesWithoutStoreOpNone[] "imageLayout: VK_IMAGE_LAYOUT_DEPTH_STENCIL_READ_ONLY_OPTIMAL", "usage: SYNC_FRAGMENT_SHADER_SHADER_", }, - // From: TraceTest.antutu_refinery http://anglebug.com/6663 + // From: TraceTest.antutu_refinery http://anglebug.com/42265159 { "SYNC-HAZARD-READ-AFTER-WRITE", "imageLayout: VK_IMAGE_LAYOUT_DEPTH_STENCIL_READ_ONLY_OPTIMAL", @@ -527,16 +523,16 @@ constexpr vk::SkippedSyncvalMessage kSkippedSyncvalMessagesWithoutStoreOpNone[] constexpr vk::SkippedSyncvalMessage kSkippedSyncvalMessagesWithoutLoadStoreOpNone[] = { // This error is generated for multiple reasons: // - // - http://anglebug.com/6411 - // - http://anglebug.com/5371: This is resolved with storeOp=NONE + // - http://anglebug.com/42264926 + // - http://anglebug.com/42263911: This is resolved with storeOp=NONE { "SYNC-HAZARD-WRITE-AFTER-WRITE", "Access info (usage: SYNC_IMAGE_LAYOUT_TRANSITION, prior_usage: " "SYNC_LATE_FRAGMENT_TESTS_DEPTH_STENCIL_ATTACHMENT_WRITE, write_barriers: 0, command: " "vkCmdEndRenderPass", }, - // http://anglebug.com/6411 - // http://anglebug.com/6584 + // http://anglebug.com/42264926 + // http://anglebug.com/42265079 { "SYNC-HAZARD-WRITE-AFTER-WRITE", "aspect depth during load with loadOp VK_ATTACHMENT_LOAD_OP_DONT_CARE. Access info (usage: " @@ -549,7 +545,7 @@ constexpr vk::SkippedSyncvalMessage kSkippedSyncvalMessagesWithoutLoadStoreOpNon "(usage: " "SYNC_EARLY_FRAGMENT_TESTS_DEPTH_STENCIL_ATTACHMENT_WRITE", }, - // http://anglebug.com/5962 + // http://anglebug.com/42264496 { "SYNC-HAZARD-WRITE-AFTER-WRITE", "aspect stencil during load with loadOp VK_ATTACHMENT_LOAD_OP_DONT_CARE. Access info " @@ -1033,7 +1029,7 @@ void CompressAndStorePipelineCacheVk(VkPhysicalDeviceProperties physicalDevicePr // handle big pipeline cache when android will reject it finally. if (cacheData.size() >= maxTotalSize) { - // TODO: handle the big pipeline cache. http://anglebug.com/4722 + // TODO: handle the big pipeline cache. http://anglebug.com/42263322 ANGLE_PERF_WARNING(contextVk->getDebug(), GL_DEBUG_SEVERITY_LOW, "Skip syncing pipeline cache data when it's larger than maxTotalSize."); return; @@ -1465,9 +1461,10 @@ Renderer::Renderer() mPipelineCacheInitialized(false), mValidationMessageCount(0), mCommandProcessor(this, &mCommandQueue), - mSupportedVulkanPipelineStageMask(0), + mSupportedBufferWritePipelineStageMask(0), mSupportedVulkanShaderStageMask(0), - mMemoryAllocationTracker(MemoryAllocationTracker(this)) + mMemoryAllocationTracker(MemoryAllocationTracker(this)), + mPlaceHolderDescriptorSetLayout(nullptr) { VkFormatProperties invalid = {0, 0, kInvalidFormatFeatureFlags}; mFormatProperties.fill(invalid); @@ -1494,8 +1491,7 @@ Renderer::~Renderer() {} bool Renderer::hasSharedGarbage() { - return !mSharedGarbageList.empty() || !mSuballocationGarbageList.empty() || - !mRefCountedEventGarbageList.empty(); + return !mSharedGarbageList.empty() || !mSuballocationGarbageList.empty(); } void Renderer::onDestroy(vk::Context *context) @@ -1505,6 +1501,13 @@ void Renderer::onDestroy(vk::Context *context) handleDeviceLost(); } + if (mPlaceHolderDescriptorSetLayout && mPlaceHolderDescriptorSetLayout->get().valid()) + { + ASSERT(!mPlaceHolderDescriptorSetLayout->isReferenced()); + mPlaceHolderDescriptorSetLayout->get().destroy(getDevice()); + SafeDelete(mPlaceHolderDescriptorSetLayout); + } + mCommandProcessor.destroy(context); mCommandQueue.destroy(context); @@ -1513,6 +1516,8 @@ void Renderer::onDestroy(vk::Context *context) ASSERT(!hasSharedGarbage()); ASSERT(mOrphanedBufferBlockList.empty()); + mRefCountedEventRecycler.destroy(mDevice); + for (OneOffCommandPool &oneOffCommandPool : mOneOffCommandPoolMap) { oneOffCommandPool.destroy(mDevice); @@ -1664,7 +1669,7 @@ angle::Result Renderer::enableInstanceExtensions(vk::Context *context, useVulkanSwapchain == UseVulkanSwapchain::Yes); // TODO: Validation layer has a bug when vkGetPhysicalDeviceSurfaceFormats2KHR is called - // on Mock ICD with surface handle set as VK_NULL_HANDLE. http://anglebug.com/7631 + // on Mock ICD with surface handle set as VK_NULL_HANDLE. http://anglebug.com/42266098 // b/267953710: VK_GOOGLE_surfaceless_query isn't working on some Samsung Xclipse builds ANGLE_FEATURE_CONDITION( &mFeatures, supportsSurfacelessQueryExtension, @@ -1806,6 +1811,9 @@ angle::Result Renderer::initialize(vk::Context *context, } VulkanLayerVector enabledInstanceLayerNames; +#if defined(ANGLE_ENABLE_VULKAN_API_DUMP_LAYER) + enabledInstanceLayerNames.push_back("VK_LAYER_LUNARG_api_dump"); +#endif if (mEnableValidationLayers) { const bool layersRequested = useValidationLayers == UseValidationLayers::Yes; @@ -1884,9 +1892,12 @@ angle::Result Renderer::initialize(vk::Context *context, // Fine grain control of validation layer features const char *name = "VK_LAYER_KHRONOS_validation"; const VkBool32 setting_validate_core = VK_TRUE; + // SyncVal is very slow (https://github.com/KhronosGroup/Vulkan-ValidationLayers/issues/7285) + // for VkEvent which causes a few tests fail on the bots. Disable syncVal if VkEvent is enabled + // for now. const VkBool32 setting_validate_sync = IsAndroid() ? VK_FALSE : VK_TRUE; const VkBool32 setting_thread_safety = VK_TRUE; - // http://anglebug.com/7050 - Shader validation caching is broken on Android + // http://anglebug.com/42265520 - Shader validation caching is broken on Android const VkBool32 setting_check_shaders = IsAndroid() ? VK_FALSE : VK_TRUE; // http://b/316013423 Disable QueueSubmit Synchronization Validation. Lots of failures and some // test timeout due to https://github.com/KhronosGroup/Vulkan-ValidationLayers/issues/7285 @@ -2034,6 +2045,20 @@ angle::Result Renderer::initialize(vk::Context *context, mOneOffCommandPoolMap[protectionType].init(protectionType); } + // Initialize place holder descriptor set layout for empty DescriptorSetLayoutDesc + ASSERT(mPlaceHolderDescriptorSetLayout == nullptr); + VkDescriptorSetLayoutCreateInfo createInfo = {}; + createInfo.sType = VK_STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_CREATE_INFO; + createInfo.flags = 0; + createInfo.bindingCount = 0; + createInfo.pBindings = nullptr; + + vk::DescriptorSetLayout newLayout; + ANGLE_VK_TRY(context, newLayout.init(context->getDevice(), createInfo)); + + mPlaceHolderDescriptorSetLayout = new vk::RefCountedDescriptorSetLayout(std::move(newLayout)); + ASSERT(mPlaceHolderDescriptorSetLayout && mPlaceHolderDescriptorSetLayout->get().valid()); + return angle::Result::Continue; } @@ -2097,8 +2122,8 @@ angle::Result Renderer::initializeMemoryAllocator(vk::Context *context) // Cached coherent staging buffer. Note coherent is preferred but not required, which means we // may get non-coherent memory type. - requiredFlags = VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT; - preferredFlags = VK_MEMORY_PROPERTY_HOST_CACHED_BIT | VK_MEMORY_PROPERTY_HOST_COHERENT_BIT; + requiredFlags = VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT | VK_MEMORY_PROPERTY_HOST_CACHED_BIT; + preferredFlags = VK_MEMORY_PROPERTY_HOST_COHERENT_BIT; ANGLE_VK_TRY(context, mAllocator.findMemoryTypeIndexForBufferInfo( createInfo, requiredFlags, preferredFlags, persistentlyMapped, @@ -2168,8 +2193,7 @@ angle::Result Renderer::initializeMemoryAllocator(vk::Context *context) // geometryStreams (feature) // - VK_EXT_index_type_uint8: indexTypeUint8 (feature) // - VK_EXT_device_memory_report: deviceMemoryReport (feature) -// - VK_EXT_multisampled_render_to_single_sampled or -// VK_GOOGLEX_multisampled_render_to_single_sampled: multisampledRenderToSingleSampled (feature) +// - VK_EXT_multisampled_render_to_single_sampled: multisampledRenderToSingleSampled (feature) // - VK_EXT_image_2d_view_of_3d: image2DViewOf3D (feature) // sampler2DViewOf3D (feature) // - VK_EXT_custom_border_color: customBorderColors (feature) @@ -2199,6 +2223,7 @@ angle::Result Renderer::initializeMemoryAllocator(vk::Context *context) // identicalMemoryTypeRequirements (property) // - VK_ANDROID_external_format_resolve: externalFormatResolve (feature) // - VK_EXT_vertex_input_dynamic_state: vertexInputDynamicState (feature) +// - VK_KHR_dynamic_rendering_local_read: dynamicRenderingLocalRead (feature) // void Renderer::appendDeviceExtensionFeaturesNotPromoted( const vk::ExtensionNameList &deviceExtensionNames, @@ -2241,11 +2266,6 @@ void Renderer::appendDeviceExtensionFeaturesNotPromoted( { vk::AddToPNextChain(deviceFeatures, &mMultisampledRenderToSingleSampledFeatures); } - else if (ExtensionFound(VK_GOOGLEX_MULTISAMPLED_RENDER_TO_SINGLE_SAMPLED_EXTENSION_NAME, - deviceExtensionNames)) - { - vk::AddToPNextChain(deviceFeatures, &mMultisampledRenderToSingleSampledFeaturesGOOGLEX); - } if (ExtensionFound(VK_EXT_IMAGE_2D_VIEW_OF_3D_EXTENSION_NAME, deviceExtensionNames)) { @@ -2362,6 +2382,16 @@ void Renderer::appendDeviceExtensionFeaturesNotPromoted( vk::AddToPNextChain(deviceProperties, &mExternalFormatResolveProperties); } #endif + + if (ExtensionFound(VK_KHR_DYNAMIC_RENDERING_LOCAL_READ_EXTENSION_NAME, deviceExtensionNames)) + { + vk::AddToPNextChain(deviceFeatures, &mDynamicRenderingLocalReadFeatures); + } + + if (ExtensionFound(VK_EXT_BLEND_OPERATION_ADVANCED_EXTENSION_NAME, deviceExtensionNames)) + { + vk::AddToPNextChain(deviceFeatures, &mBlendOperationAdvancedFeatures); + } } // The following features and properties used by ANGLE have been promoted to Vulkan 1.1: @@ -2472,10 +2502,12 @@ void Renderer::appendDeviceExtensionFeaturesPromotedTo12( // The following features and properties used by ANGLE have been promoted to Vulkan 1.3: // -// - VK_EXT_pipeline_creation_cache_control: pipelineCreationCacheControl (feature) // - VK_EXT_extended_dynamic_state: extendedDynamicState (feature) // - VK_EXT_extended_dynamic_state2: extendedDynamicState2 (feature), // extendedDynamicState2LogicOp (feature) +// - VK_KHR_synchronization2: synchronization2 (feature) +// - VK_KHR_dynamic_rendering: dynamicRendering (feature) +// - VK_KHR_maintenance5: maintenance5 (feature) // // Note that VK_EXT_extended_dynamic_state2 is partially promoted to Vulkan 1.3. If ANGLE creates a // Vulkan 1.3 device, it would still need to enable this extension separately for @@ -2500,6 +2532,16 @@ void Renderer::appendDeviceExtensionFeaturesPromotedTo13( { vk::AddToPNextChain(deviceFeatures, &mSynchronization2Features); } + + if (ExtensionFound(VK_KHR_DYNAMIC_RENDERING_EXTENSION_NAME, deviceExtensionNames)) + { + vk::AddToPNextChain(deviceFeatures, &mDynamicRenderingFeatures); + } + + if (ExtensionFound(VK_KHR_MAINTENANCE_5_EXTENSION_NAME, deviceExtensionNames)) + { + vk::AddToPNextChain(deviceFeatures, &mMaintenance5Features); + } } void Renderer::queryDeviceExtensionFeatures(const vk::ExtensionNameList &deviceExtensionNames) @@ -2561,10 +2603,6 @@ void Renderer::queryDeviceExtensionFeatures(const vk::ExtensionNameList &deviceE mMultisampledRenderToSingleSampledFeatures.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTISAMPLED_RENDER_TO_SINGLE_SAMPLED_FEATURES_EXT; - mMultisampledRenderToSingleSampledFeaturesGOOGLEX = {}; - mMultisampledRenderToSingleSampledFeaturesGOOGLEX.sType = - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTISAMPLED_RENDER_TO_SINGLE_SAMPLED_FEATURES_GOOGLEX; - mImage2dViewOf3dFeatures = {}; mImage2dViewOf3dFeatures.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_2D_VIEW_OF_3D_FEATURES_EXT; @@ -2624,6 +2662,14 @@ void Renderer::queryDeviceExtensionFeatures(const vk::ExtensionNameList &deviceE mVertexInputDynamicStateFeatures.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VERTEX_INPUT_DYNAMIC_STATE_FEATURES_EXT; + mDynamicRenderingFeatures = {}; + mDynamicRenderingFeatures.sType = + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DYNAMIC_RENDERING_FEATURES_KHR; + + mDynamicRenderingLocalReadFeatures = {}; + mDynamicRenderingLocalReadFeatures.sType = + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DYNAMIC_RENDERING_LOCAL_READ_FEATURES_KHR; + mFragmentShadingRateFeatures = {}; mFragmentShadingRateFeatures.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADING_RATE_FEATURES_KHR; @@ -2652,6 +2698,9 @@ void Renderer::queryDeviceExtensionFeatures(const vk::ExtensionNameList &deviceE mRasterizationOrderAttachmentAccessFeatures.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RASTERIZATION_ORDER_ATTACHMENT_ACCESS_FEATURES_EXT; + mMaintenance5Features = {}; + mMaintenance5Features.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_5_FEATURES_KHR; + mSwapchainMaintenance1Features = {}; mSwapchainMaintenance1Features.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SWAPCHAIN_MAINTENANCE_1_FEATURES_EXT; @@ -2682,6 +2731,10 @@ void Renderer::queryDeviceExtensionFeatures(const vk::ExtensionNameList &deviceE mSynchronization2Features = {}; mSynchronization2Features.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SYNCHRONIZATION_2_FEATURES; + mBlendOperationAdvancedFeatures = {}; + mBlendOperationAdvancedFeatures.sType = + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_BLEND_OPERATION_ADVANCED_FEATURES_EXT; + #if defined(ANGLE_PLATFORM_ANDROID) mExternalFormatResolveFeatures = {}; mExternalFormatResolveFeatures.sType = @@ -2712,53 +2765,56 @@ void Renderer::queryDeviceExtensionFeatures(const vk::ExtensionNameList &deviceE vkGetPhysicalDeviceProperties2(mPhysicalDevice, &deviceProperties); // Clean up pNext chains - mPhysicalDevice11Properties.pNext = nullptr; - mPhysicalDevice11Features.pNext = nullptr; - mLineRasterizationFeatures.pNext = nullptr; - mMemoryReportFeatures.pNext = nullptr; - mProvokingVertexFeatures.pNext = nullptr; - mVertexAttributeDivisorFeatures.pNext = nullptr; - mVertexAttributeDivisorProperties.pNext = nullptr; - mTransformFeedbackFeatures.pNext = nullptr; - mIndexTypeUint8Features.pNext = nullptr; - mSubgroupProperties.pNext = nullptr; - mSubgroupExtendedTypesFeatures.pNext = nullptr; - mCustomBorderColorFeatures.pNext = nullptr; - mShaderFloat16Int8Features.pNext = nullptr; - mDepthStencilResolveProperties.pNext = nullptr; - mMultisampledRenderToSingleSampledFeatures.pNext = nullptr; - mMultisampledRenderToSingleSampledFeaturesGOOGLEX.pNext = nullptr; - mImage2dViewOf3dFeatures.pNext = nullptr; - mMultiviewFeatures.pNext = nullptr; - mMultiviewProperties.pNext = nullptr; - mDriverProperties.pNext = nullptr; - mSamplerYcbcrConversionFeatures.pNext = nullptr; - mProtectedMemoryFeatures.pNext = nullptr; - mHostQueryResetFeatures.pNext = nullptr; - mDepthClampZeroOneFeatures.pNext = nullptr; - mDepthClipControlFeatures.pNext = nullptr; - mPrimitivesGeneratedQueryFeatures.pNext = nullptr; - mPrimitiveTopologyListRestartFeatures.pNext = nullptr; - mExtendedDynamicStateFeatures.pNext = nullptr; - mExtendedDynamicState2Features.pNext = nullptr; - mGraphicsPipelineLibraryFeatures.pNext = nullptr; - mGraphicsPipelineLibraryProperties.pNext = nullptr; - mVertexInputDynamicStateFeatures.pNext = nullptr; - mFragmentShadingRateFeatures.pNext = nullptr; - mFragmentShaderInterlockFeatures.pNext = nullptr; - mImagelessFramebufferFeatures.pNext = nullptr; - mPipelineRobustnessFeatures.pNext = nullptr; - mPipelineProtectedAccessFeatures.pNext = nullptr; - mRasterizationOrderAttachmentAccessFeatures.pNext = nullptr; - mSwapchainMaintenance1Features.pNext = nullptr; - mDitheringFeatures.pNext = nullptr; - mDrmProperties.pNext = nullptr; - mTimelineSemaphoreFeatures.pNext = nullptr; - mHostImageCopyFeatures.pNext = nullptr; - mHostImageCopyProperties.pNext = nullptr; - m8BitStorageFeatures.pNext = nullptr; - m16BitStorageFeatures.pNext = nullptr; - mSynchronization2Features.pNext = nullptr; + mPhysicalDevice11Properties.pNext = nullptr; + mPhysicalDevice11Features.pNext = nullptr; + mLineRasterizationFeatures.pNext = nullptr; + mMemoryReportFeatures.pNext = nullptr; + mProvokingVertexFeatures.pNext = nullptr; + mVertexAttributeDivisorFeatures.pNext = nullptr; + mVertexAttributeDivisorProperties.pNext = nullptr; + mTransformFeedbackFeatures.pNext = nullptr; + mIndexTypeUint8Features.pNext = nullptr; + mSubgroupProperties.pNext = nullptr; + mSubgroupExtendedTypesFeatures.pNext = nullptr; + mCustomBorderColorFeatures.pNext = nullptr; + mShaderFloat16Int8Features.pNext = nullptr; + mDepthStencilResolveProperties.pNext = nullptr; + mMultisampledRenderToSingleSampledFeatures.pNext = nullptr; + mImage2dViewOf3dFeatures.pNext = nullptr; + mMultiviewFeatures.pNext = nullptr; + mMultiviewProperties.pNext = nullptr; + mDriverProperties.pNext = nullptr; + mSamplerYcbcrConversionFeatures.pNext = nullptr; + mProtectedMemoryFeatures.pNext = nullptr; + mHostQueryResetFeatures.pNext = nullptr; + mDepthClampZeroOneFeatures.pNext = nullptr; + mDepthClipControlFeatures.pNext = nullptr; + mPrimitivesGeneratedQueryFeatures.pNext = nullptr; + mPrimitiveTopologyListRestartFeatures.pNext = nullptr; + mExtendedDynamicStateFeatures.pNext = nullptr; + mExtendedDynamicState2Features.pNext = nullptr; + mGraphicsPipelineLibraryFeatures.pNext = nullptr; + mGraphicsPipelineLibraryProperties.pNext = nullptr; + mVertexInputDynamicStateFeatures.pNext = nullptr; + mDynamicRenderingFeatures.pNext = nullptr; + mDynamicRenderingLocalReadFeatures.pNext = nullptr; + mFragmentShadingRateFeatures.pNext = nullptr; + mFragmentShaderInterlockFeatures.pNext = nullptr; + mImagelessFramebufferFeatures.pNext = nullptr; + mPipelineRobustnessFeatures.pNext = nullptr; + mPipelineProtectedAccessFeatures.pNext = nullptr; + mRasterizationOrderAttachmentAccessFeatures.pNext = nullptr; + mMaintenance5Features.pNext = nullptr; + mSwapchainMaintenance1Features.pNext = nullptr; + mDitheringFeatures.pNext = nullptr; + mDrmProperties.pNext = nullptr; + mTimelineSemaphoreFeatures.pNext = nullptr; + mHostImageCopyFeatures.pNext = nullptr; + mHostImageCopyProperties.pNext = nullptr; + m8BitStorageFeatures.pNext = nullptr; + m16BitStorageFeatures.pNext = nullptr; + mSynchronization2Features.pNext = nullptr; + mBlendOperationAdvancedFeatures.pNext = nullptr; #if defined(ANGLE_PLATFORM_ANDROID) mExternalFormatResolveFeatures.pNext = nullptr; mExternalFormatResolveProperties.pNext = nullptr; @@ -2924,14 +2980,6 @@ void Renderer::enableDeviceExtensionsNotPromoted(const vk::ExtensionNameList &de vk::AddToPNextChain(&mEnabledFeatures, &mMultisampledRenderToSingleSampledFeatures); } - if (mFeatures.supportsMultisampledRenderToSingleSampledGOOGLEX.enabled) - { - ASSERT(!mFeatures.supportsMultisampledRenderToSingleSampled.enabled); - mEnabledDeviceExtensions.push_back( - VK_GOOGLEX_MULTISAMPLED_RENDER_TO_SINGLE_SAMPLED_EXTENSION_NAME); - vk::AddToPNextChain(&mEnabledFeatures, &mMultisampledRenderToSingleSampledFeaturesGOOGLEX); - } - if (mFeatures.logMemoryReportCallbacks.enabled || mFeatures.logMemoryReportStats.enabled) { ASSERT(mMemoryReportFeatures.deviceMemoryReport); @@ -2965,6 +3013,7 @@ void Renderer::enableDeviceExtensionsNotPromoted(const vk::ExtensionNameList &de if (mFeatures.supportsBlendOperationAdvanced.enabled) { mEnabledDeviceExtensions.push_back(VK_EXT_BLEND_OPERATION_ADVANCED_EXTENSION_NAME); + vk::AddToPNextChain(&mEnabledFeatures, &mBlendOperationAdvancedFeatures); } if (mFeatures.supportsGraphicsPipelineLibrary.enabled) @@ -3060,6 +3109,12 @@ void Renderer::enableDeviceExtensionsNotPromoted(const vk::ExtensionNameList &de vk::AddToPNextChain(&mEnabledFeatures, &mVertexInputDynamicStateFeatures); } + if (getFeatures().supportsDynamicRenderingLocalRead.enabled) + { + mEnabledDeviceExtensions.push_back(VK_KHR_DYNAMIC_RENDERING_LOCAL_READ_EXTENSION_NAME); + vk::AddToPNextChain(&mEnabledFeatures, &mDynamicRenderingLocalReadFeatures); + } + #if defined(ANGLE_PLATFORM_WINDOWS) // We only need the VK_EXT_full_screen_exclusive extension if we are opting // out of it via VK_FULL_SCREEN_EXCLUSIVE_DISALLOWED_EXT (i.e. working @@ -3148,6 +3203,12 @@ void Renderer::enableDeviceExtensionsPromotedTo12(const vk::ExtensionNameList &d mEnabledDeviceExtensions.push_back(VK_KHR_IMAGE_FORMAT_LIST_EXTENSION_NAME); } + if (mFeatures.supportsSPIRV14.enabled) + { + mEnabledDeviceExtensions.push_back(VK_KHR_SHADER_FLOAT_CONTROLS_EXTENSION_NAME); + mEnabledDeviceExtensions.push_back(VK_KHR_SPIRV_1_4_EXTENSION_NAME); + } + if (mFeatures.supportsSamplerMirrorClampToEdge.enabled) { mEnabledDeviceExtensions.push_back(VK_KHR_SAMPLER_MIRROR_CLAMP_TO_EDGE_EXTENSION_NAME); @@ -3222,6 +3283,18 @@ void Renderer::enableDeviceExtensionsPromotedTo13(const vk::ExtensionNameList &d mEnabledDeviceExtensions.push_back(VK_KHR_SYNCHRONIZATION_2_EXTENSION_NAME); vk::AddToPNextChain(&mEnabledFeatures, &mSynchronization2Features); } + + if (getFeatures().supportsDynamicRendering.enabled) + { + mEnabledDeviceExtensions.push_back(VK_KHR_DYNAMIC_RENDERING_EXTENSION_NAME); + vk::AddToPNextChain(&mEnabledFeatures, &mDynamicRenderingFeatures); + } + + if (getFeatures().supportsMaintenance5.enabled) + { + mEnabledDeviceExtensions.push_back(VK_KHR_MAINTENANCE_5_EXTENSION_NAME); + vk::AddToPNextChain(&mEnabledFeatures, &mMaintenance5Features); + } } angle::Result Renderer::enableDeviceExtensions(vk::Context *context, @@ -3239,7 +3312,7 @@ angle::Result Renderer::enableDeviceExtensions(vk::Context *context, // the second call to vkEnumerateDeviceExtensionProperties to have an additional extension. In // that case, the second call will return VK_INCOMPLETE. To work-around that, add 1 to // deviceExtensionCount and ask for one more extension property than the first call said there - // were. See: http://anglebug.com/6715 and internal-to-Google bug: b/206733351. + // were. See: http://anglebug.com/42265209 and internal-to-Google bug: b/206733351. deviceExtensionCount++; std::vector<VkExtensionProperties> deviceExtensionProps(deviceExtensionCount); ANGLE_VK_TRY(context, @@ -3361,6 +3434,10 @@ void Renderer::initDeviceExtensionEntryPoints() { InitVertexInputDynamicStateEXTFunctions(mDevice); } + if (mFeatures.supportsDynamicRenderingLocalRead.enabled) + { + InitDynamicRenderingLocalReadFunctions(mDevice); + } // Extensions promoted to Vulkan 1.2 { if (mFeatures.supportsHostQueryReset.enabled) @@ -3382,6 +3459,10 @@ void Renderer::initDeviceExtensionEntryPoints() { InitExtendedDynamicState2EXTFunctions(mDevice); } + if (mFeatures.supportsDynamicRendering.enabled) + { + InitDynamicRenderingFunctions(mDevice); + } } #endif // !defined(ANGLE_SHARED_LIBVULKAN) @@ -3450,10 +3531,10 @@ angle::Result Renderer::setupDevice(vk::Context *context, mFeatures.supportsPipelineStatisticsQuery.enabled; // Used to support geometry shaders: mEnabledFeatures.features.geometryShader = mPhysicalDeviceFeatures.geometryShader; - // Used to support EXT_gpu_shader5: + // Used to support EXT/OES_gpu_shader5: mEnabledFeatures.features.shaderImageGatherExtended = mPhysicalDeviceFeatures.shaderImageGatherExtended; - // Used to support EXT_gpu_shader5: + // Used to support EXT/OES_gpu_shader5: mEnabledFeatures.features.shaderUniformBufferArrayDynamicIndexing = mPhysicalDeviceFeatures.shaderUniformBufferArrayDynamicIndexing; mEnabledFeatures.features.shaderSampledImageArrayDynamicIndexing = @@ -3559,10 +3640,7 @@ angle::Result Renderer::createDeviceAndQueue(vk::Context *context, uint32_t queu initDeviceExtensionEntryPoints(); - vk::DeviceQueueMap graphicsQueueMap = - queueFamily.initializeQueueMap(mDevice, enableProtectedContent, 0, queueCount); - - ANGLE_TRY(mCommandQueue.init(context, graphicsQueueMap)); + ANGLE_TRY(mCommandQueue.init(context, queueFamily, enableProtectedContent, queueCount)); ANGLE_TRY(mCommandProcessor.init()); if (mFeatures.forceMaxUniformBufferSize16KB.enabled) @@ -3582,6 +3660,10 @@ angle::Result Renderer::createDeviceAndQueue(vk::Context *context, uint32_t queu VkPipelineStageFlags unsupportedStages = 0; mSupportedVulkanShaderStageMask = VK_SHADER_STAGE_VERTEX_BIT | VK_SHADER_STAGE_FRAGMENT_BIT | VK_SHADER_STAGE_COMPUTE_BIT; + mSupportedBufferWritePipelineStageMask = + VK_PIPELINE_STAGE_TRANSFER_BIT | VK_PIPELINE_STAGE_VERTEX_SHADER_BIT | + VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT | VK_PIPELINE_STAGE_COMPUTE_SHADER_BIT; + if (!mPhysicalDeviceFeatures.tessellationShader) { unsupportedStages |= VK_PIPELINE_STAGE_TESSELLATION_CONTROL_SHADER_BIT | @@ -3591,6 +3673,9 @@ angle::Result Renderer::createDeviceAndQueue(vk::Context *context, uint32_t queu { mSupportedVulkanShaderStageMask |= VK_SHADER_STAGE_TESSELLATION_CONTROL_BIT | VK_SHADER_STAGE_TESSELLATION_EVALUATION_BIT; + mSupportedBufferWritePipelineStageMask |= + VK_PIPELINE_STAGE_TESSELLATION_CONTROL_SHADER_BIT | + VK_PIPELINE_STAGE_TESSELLATION_EVALUATION_SHADER_BIT; } if (!mPhysicalDeviceFeatures.geometryShader) { @@ -3599,8 +3684,22 @@ angle::Result Renderer::createDeviceAndQueue(vk::Context *context, uint32_t queu else { mSupportedVulkanShaderStageMask |= VK_SHADER_STAGE_GEOMETRY_BIT; + mSupportedBufferWritePipelineStageMask |= VK_PIPELINE_STAGE_GEOMETRY_SHADER_BIT; + } + + if (getFeatures().supportsTransformFeedbackExtension.enabled) + { + mSupportedBufferWritePipelineStageMask |= VK_PIPELINE_STAGE_TRANSFORM_FEEDBACK_BIT_EXT; } - mSupportedVulkanPipelineStageMask = ~unsupportedStages; + + // Initialize the barrierData tables by removing unsupported pipeline stage bits + InitializeEventAndPipelineStagesMap(&mEventStageAndPipelineStageFlagsMap, ~unsupportedStages); + InitializeImageLayoutAndMemoryBarrierDataMap(&mImageLayoutAndMemoryBarrierDataMap, + ~unsupportedStages); + // mEventStageAndPipelineStageFlagsMap supposedly should match the value in dstStageMask of + // mImageLayoutAndMemoryBarrierData + ASSERT(EventAndPipelineBarrierHaveMatchingStageFlags(mEventStageAndPipelineStageFlagsMap, + mImageLayoutAndMemoryBarrierDataMap)); ANGLE_TRY(initializeMemoryAllocator(context)); @@ -3645,6 +3744,16 @@ void Renderer::initializeValidationMessageSuppressions() kNoListRestartSkippedMessages + ArraySize(kNoListRestartSkippedMessages)); } + if (getFeatures().useVkEventForImageBarrier.enabled && + (!vk::OutsideRenderPassCommandBuffer::ExecutesInline() || + !vk::RenderPassCommandBuffer::ExecutesInline())) + { + mSkippedValidationMessages.insert( + mSkippedValidationMessages.end(), kSkippedMessagesWithVulkanSecondaryCommandBuffer, + kSkippedMessagesWithVulkanSecondaryCommandBuffer + + ArraySize(kSkippedMessagesWithVulkanSecondaryCommandBuffer)); + } + // Build the list of syncval errors that are currently expected and should be skipped. mSkippedSyncvalMessages.insert(mSkippedSyncvalMessages.end(), kSkippedSyncvalMessages, kSkippedSyncvalMessages + ArraySize(kSkippedSyncvalMessages)); @@ -3715,7 +3824,7 @@ std::string Renderer::getRendererDescription() const // In the case of NVIDIA, deviceName does not necessarily contain "NVIDIA". Add "NVIDIA" so that // Vulkan end2end tests can be selectively disabled on NVIDIA. TODO(jmadill): should not be - // needed after http://anglebug.com/1874 is fixed and end2end_tests use more sophisticated + // needed after http://anglebug.com/40096421 is fixed and end2end_tests use more sophisticated // driver detection. if (mPhysicalDeviceProperties.vendorID == VENDOR_ID_NVIDIA) { @@ -3788,14 +3897,9 @@ gl::Version Renderer::getMaxSupportedESVersion() const } // Limit to ES3.1 if there are any blockers for 3.2. - if (!vk::CanSupportGPUShader5EXT(mPhysicalDeviceFeatures) && - !mFeatures.exposeNonConformantExtensionsAndVersions.enabled) - { - maxVersion = LimitVersionTo(maxVersion, {3, 1}); - } - - // TODO: more extension checks for 3.2. http://anglebug.com/5366 - if (!mFeatures.exposeNonConformantExtensionsAndVersions.enabled) + ensureCapsInitialized(); + if (!mFeatures.exposeNonConformantExtensionsAndVersions.enabled && + !CanSupportGLES32(mNativeExtensions)) { maxVersion = LimitVersionTo(maxVersion, {3, 1}); } @@ -3829,7 +3933,7 @@ gl::Version Renderer::getMaxSupportedESVersion() const } // Limit to ES2.0 if there are any blockers for 3.0. - // TODO: http://anglebug.com/3972 Limit to GLES 2.0 if flat shading can't be emulated + // TODO: http://anglebug.com/42262611 Limit to GLES 2.0 if flat shading can't be emulated // Multisample textures (ES3.1) and multisample renderbuffers (ES3.0) require the Vulkan driver // to support the standard sample locations (in order to pass dEQP tests that check these @@ -3887,7 +3991,7 @@ gl::Version Renderer::getMaxConformantESVersion() const { const gl::Version maxSupportedESVersion = getMaxSupportedESVersion(); const bool hasGeometryAndTessSupport = - getNativeExtensions().geometryShaderAny() && getNativeExtensions().tessellationShaderEXT; + getNativeExtensions().geometryShaderAny() && getNativeExtensions().tessellationShaderAny(); if (!hasGeometryAndTessSupport || !mFeatures.exposeNonConformantExtensionsAndVersions.enabled) { @@ -4046,9 +4150,6 @@ void Renderer::initFeatures(const vk::ExtensionNameList &deviceExtensionNames, return; } - constexpr uint32_t kPixel2DriverWithRelaxedPrecision = 0x801EA000; - constexpr uint32_t kPixel4DriverWithWorkingSpecConstSupport = 0x80201000; - const bool isAMD = IsAMD(mPhysicalDeviceProperties.vendorID); const bool isApple = IsAppleGPU(mPhysicalDeviceProperties.vendorID); const bool isARM = IsARM(mPhysicalDeviceProperties.vendorID); @@ -4061,9 +4162,6 @@ void Renderer::initFeatures(const vk::ExtensionNameList &deviceExtensionNames, const bool isSwiftShader = IsSwiftshader(mPhysicalDeviceProperties.vendorID, mPhysicalDeviceProperties.deviceID); - // MESA Virtio-GPU Venus driver: https://docs.mesa3d.org/drivers/venus.html - const bool isVenus = IsVenus(mDriverProperties.driverID, mPhysicalDeviceProperties.deviceName); - const bool isGalaxyS23 = IsGalaxyS23(mPhysicalDeviceProperties.vendorID, mPhysicalDeviceProperties.deviceID); @@ -4080,7 +4178,11 @@ void Renderer::initFeatures(const vk::ExtensionNameList &deviceExtensionNames, isARM && getPhysicalDeviceProperties().limits.maxDrawIndirectCount <= 1; // Parse the ARM driver version to be readable/comparable const ARMDriverVersion armDriverVersion = - ParseARMDriverVersion(mPhysicalDeviceProperties.driverVersion); + ParseARMVulkanDriverVersion(mPhysicalDeviceProperties.driverVersion); + + // Parse the Qualcomm driver version. + const QualcommDriverVersion qualcommDriverVersion = + ParseQualcommVulkanDriverVersion(mPhysicalDeviceProperties.driverVersion); // Parse the Intel driver version. (Currently it only supports the Windows driver.) const IntelDriverVersion intelDriverVersion = @@ -4141,7 +4243,7 @@ void Renderer::initFeatures(const vk::ExtensionNameList &deviceExtensionNames, // excessive load/store unit activity when this extension is enabled, even if not been used. // Disable this extension on older ARM platforms that don't support // VK_EXT_pipeline_protected_access. - // http://anglebug.com/7714 + // http://anglebug.com/42266183 ANGLE_FEATURE_CONDITION( &mFeatures, supportsProtectedMemory, mProtectedMemoryFeatures.protectedMemory == VK_TRUE && @@ -4171,7 +4273,7 @@ void Renderer::initFeatures(const vk::ExtensionNameList &deviceExtensionNames, ANGLE_FEATURE_CONDITION(&mFeatures, supportsSurfaceProtectedSwapchains, IsAndroid()); // Work around incorrect NVIDIA point size range clamping. - // http://anglebug.com/2970#c10 + // http://anglebug.com/40644663#comment11 // Clamp if driver version is: // < 430 on Windows // < 421 otherwise @@ -4287,9 +4389,11 @@ void Renderer::initFeatures(const vk::ExtensionNameList &deviceExtensionNames, } #endif // defined(ANGLE_PLATFORM_ANDROID) || defined(ANGLE_PLATFORM_LINUX) + // Disabled on SwiftShader due to http://crbug.com/40942995 ANGLE_FEATURE_CONDITION( &mFeatures, supportsShaderStencilExport, - ExtensionFound(VK_EXT_SHADER_STENCIL_EXPORT_EXTENSION_NAME, deviceExtensionNames)); + ExtensionFound(VK_EXT_SHADER_STENCIL_EXPORT_EXTENSION_NAME, deviceExtensionNames) && + !isSwiftShader); ANGLE_FEATURE_CONDITION( &mFeatures, supportsRenderPassLoadStoreOpNone, @@ -4345,8 +4449,8 @@ void Renderer::initFeatures(const vk::ExtensionNameList &deviceExtensionNames, mDepthStencilResolveProperties.independentResolveNone); // Disable optimizing depth/stencil resolve through glBlitFramebuffer for buggy drivers: // - // - Nvidia: http://anglebug.com/8658 - // - Pixel4: http://anglebug.com/8659 + // - Nvidia: http://anglebug.com/42267095 + // - Pixel4: http://anglebug.com/42267096 // ANGLE_FEATURE_CONDITION(&mFeatures, disableDepthStencilResolveThroughAttachment, isNvidia || isQualcommProprietary); @@ -4357,14 +4461,6 @@ void Renderer::initFeatures(const vk::ExtensionNameList &deviceExtensionNames, mMultisampledRenderToSingleSampledFeatures.multisampledRenderToSingleSampled == VK_TRUE); - ANGLE_FEATURE_CONDITION( - &mFeatures, supportsMultisampledRenderToSingleSampledGOOGLEX, - !mFeatures.supportsMultisampledRenderToSingleSampled.enabled && - mFeatures.supportsRenderpass2.enabled && - mFeatures.supportsDepthStencilResolve.enabled && - mMultisampledRenderToSingleSampledFeaturesGOOGLEX.multisampledRenderToSingleSampled == - VK_TRUE); - // Preferring the MSRTSS flag is for texture initialization. If the MSRTSS is not used at first, // it will be used (if available) when recreating the image if it is bound to an MSRTT // framebuffer. @@ -4383,7 +4479,7 @@ void Renderer::initFeatures(const vk::ExtensionNameList &deviceExtensionNames, ANGLE_FEATURE_CONDITION(&mFeatures, supportsMultiview, mMultiviewFeatures.multiview == VK_TRUE); - // TODO: http://anglebug.com/5927 - drop dependency on customBorderColorWithoutFormat. + // TODO: http://anglebug.com/42264464 - drop dependency on customBorderColorWithoutFormat. ANGLE_FEATURE_CONDITION( &mFeatures, supportsCustomBorderColor, mCustomBorderColorFeatures.customBorderColors == VK_TRUE && @@ -4434,14 +4530,15 @@ void Renderer::initFeatures(const vk::ExtensionNameList &deviceExtensionNames, // Android pre-rotation support can be disabled. ANGLE_FEATURE_CONDITION(&mFeatures, enablePreRotateSurfaces, IsAndroid()); - // http://anglebug.com/3078 + // http://anglebug.com/42261756 + // Precision qualifiers are disabled for Pixel 2 before the driver included relaxed precision. ANGLE_FEATURE_CONDITION( &mFeatures, enablePrecisionQualifiers, !(IsPixel2(mPhysicalDeviceProperties.vendorID, mPhysicalDeviceProperties.deviceID) && - (mPhysicalDeviceProperties.driverVersion < kPixel2DriverWithRelaxedPrecision)) && + (qualcommDriverVersion < QualcommDriverVersion(512, 490, 0))) && !IsPixel4(mPhysicalDeviceProperties.vendorID, mPhysicalDeviceProperties.deviceID)); - // http://anglebug.com/7488 + // http://anglebug.com/42265957 ANGLE_FEATURE_CONDITION(&mFeatures, varyingsRequireMatchingPrecisionInSpirv, isPowerVR); // IMR devices are less sensitive to the src/dst stage masks in barriers, and behave more @@ -4455,7 +4552,7 @@ void Renderer::initFeatures(const vk::ExtensionNameList &deviceExtensionNames, ANGLE_FEATURE_CONDITION(&mFeatures, preferSkippingInvalidateForEmulatedFormats, isImmediateModeRenderer); - // Currently disabled by default: http://anglebug.com/4324 + // Currently disabled by default: http://anglebug.com/42262955 ANGLE_FEATURE_CONDITION(&mFeatures, asyncCommandQueue, false); ANGLE_FEATURE_CONDITION(&mFeatures, asyncCommandBufferReset, true); @@ -4468,7 +4565,7 @@ void Renderer::initFeatures(const vk::ExtensionNameList &deviceExtensionNames, // Prefer driver uniforms over specialization constants in the following: // - // - Older Qualcomm drivers where specialization constants severly degrade the performance of + // - Older Qualcomm drivers where specialization constants severely degrade the performance of // pipeline creation. http://issuetracker.google.com/173636783 // - ARM hardware // - Imagination hardware @@ -4476,8 +4573,7 @@ void Renderer::initFeatures(const vk::ExtensionNameList &deviceExtensionNames, // ANGLE_FEATURE_CONDITION( &mFeatures, preferDriverUniformOverSpecConst, - (isQualcommProprietary && - mPhysicalDeviceProperties.driverVersion < kPixel4DriverWithWorkingSpecConstSupport) || + (isQualcommProprietary && qualcommDriverVersion < QualcommDriverVersion(512, 513, 0)) || isARM || isPowerVR || isSwiftShader); // The compute shader used to generate mipmaps needs - @@ -4527,50 +4623,44 @@ void Renderer::initFeatures(const vk::ExtensionNameList &deviceExtensionNames, // During testing, it was also discovered that emulation triggers bugs on some platforms: // // - Swiftshader: - // * Failure on mac: http://anglebug.com/4937 + // * Failure on mac: http://anglebug.com/40644747 // * OOM: http://crbug.com/1263046 - // - Intel on windows: http://anglebug.com/5032 + // - Intel on windows: http://anglebug.com/42263602 // - AMD on windows: http://crbug.com/1132366 // - Old ARM drivers on Android fail multiple tests, though newer drivers don't (although they // support MSRTSS and emulation is unnecessary) // ANGLE_FEATURE_CONDITION(&mFeatures, allowMultisampledRenderToTextureEmulation, (isTileBasedRenderer && !isARM) || isSamsung); - ANGLE_FEATURE_CONDITION( - &mFeatures, enableMultisampledRenderToTexture, - mFeatures.supportsMultisampledRenderToSingleSampled.enabled || - mFeatures.supportsMultisampledRenderToSingleSampledGOOGLEX.enabled || - (mFeatures.supportsDepthStencilResolve.enabled && - mFeatures.allowMultisampledRenderToTextureEmulation.enabled)); + ANGLE_FEATURE_CONDITION(&mFeatures, enableMultisampledRenderToTexture, + mFeatures.supportsMultisampledRenderToSingleSampled.enabled || + (mFeatures.supportsDepthStencilResolve.enabled && + mFeatures.allowMultisampledRenderToTextureEmulation.enabled)); // Currently we enable cube map arrays based on the imageCubeArray Vk feature. - // TODO: Check device caps for full cube map array support. http://anglebug.com/5143 + // TODO: Check device caps for full cube map array support. http://anglebug.com/42263705 ANGLE_FEATURE_CONDITION(&mFeatures, supportsImageCubeArray, mPhysicalDeviceFeatures.imageCubeArray == VK_TRUE); ANGLE_FEATURE_CONDITION(&mFeatures, supportsPipelineStatisticsQuery, mPhysicalDeviceFeatures.pipelineStatisticsQuery == VK_TRUE); - // Defer glFLush call causes manhattan 3.0 perf regression. Let Qualcomm driver opt out from - // this optimization. - ANGLE_FEATURE_CONDITION(&mFeatures, deferFlushUntilEndRenderPass, !isQualcommProprietary); - // Android mistakenly destroys the old swapchain when creating a new one. ANGLE_FEATURE_CONDITION(&mFeatures, waitIdleBeforeSwapchainRecreation, IsAndroid() && isARM); // vkCmdClearAttachments races with draw calls on Qualcomm hardware as observed on Pixel2 and // Pixel4. https://issuetracker.google.com/issues/166809097 - ANGLE_FEATURE_CONDITION(&mFeatures, preferDrawClearOverVkCmdClearAttachments, - isQualcommProprietary); + ANGLE_FEATURE_CONDITION( + &mFeatures, preferDrawClearOverVkCmdClearAttachments, + isQualcommProprietary && qualcommDriverVersion < QualcommDriverVersion(512, 762, 12)); // r32f image emulation is done unconditionally so VK_FORMAT_FEATURE_STORAGE_*_ATOMIC_BIT is not // required. ANGLE_FEATURE_CONDITION(&mFeatures, emulateR32fImageAtomicExchange, true); - // Whether non-conformant configurations and extensions should be exposed. Always disable for - // MESA Virtio-GPU Venus driver for production purpose. + // Whether non-conformant configurations and extensions should be exposed. ANGLE_FEATURE_CONDITION(&mFeatures, exposeNonConformantExtensionsAndVersions, - kExposeNonConformantExtensionsAndVersions && !isVenus); + kExposeNonConformantExtensionsAndVersions); ANGLE_FEATURE_CONDITION( &mFeatures, supportsMemoryBudget, @@ -4589,7 +4679,7 @@ void Renderer::initFeatures(const vk::ExtensionNameList &deviceExtensionNames, // descriptor counts for such immutable samplers ANGLE_FEATURE_CONDITION(&mFeatures, useMultipleDescriptorsForExternalFormats, true); - // http://anglebug.com/6651 + // http://anglebug.com/42265147 // When creating a surface with the format GL_RGB8, override the format to be GL_RGBA8, since // Android prevents creating swapchain images with VK_FORMAT_R8G8B8_UNORM. // Do this for all platforms, since few (none?) IHVs support 24-bit formats with their HW @@ -4641,7 +4731,7 @@ void Renderer::initFeatures(const vk::ExtensionNameList &deviceExtensionNames, ANGLE_FEATURE_CONDITION(&mFeatures, adjustClearColorPrecision, IsAndroid() && mFeatures.supportsLegacyDithering.enabled && isARM); - // http://anglebug.com/6872 + // http://anglebug.com/42265365 // On ARM hardware, framebuffer-fetch-like behavior on Vulkan is already coherent, so we can // expose the coherent version of the GL extension despite unofficial Vulkan support. ANGLE_FEATURE_CONDITION( @@ -4650,10 +4740,10 @@ void Renderer::initFeatures(const vk::ExtensionNameList &deviceExtensionNames, // Important games are not checking supported extensions properly, and are confusing the // GL_EXT_shader_framebuffer_fetch_non_coherent as the GL_EXT_shader_framebuffer_fetch - // extension. Therefore, don't enable the extension on Arm and Qualcomm by default. + // extension. Therefore, don't enable the extension on Android by default. // https://issuetracker.google.com/issues/186643966 - ANGLE_FEATURE_CONDITION(&mFeatures, supportsShaderFramebufferFetchNonCoherent, - (IsAndroid() && !(isARM || isQualcomm)) || isSwiftShader); + // https://issuetracker.google.com/issues/340665604 + ANGLE_FEATURE_CONDITION(&mFeatures, supportsShaderFramebufferFetchNonCoherent, isSwiftShader); // On tile-based renderers, breaking the render pass is costly. Changing into and out of // framebuffer fetch causes the render pass to break so that the layout of the color attachments @@ -4665,7 +4755,7 @@ void Renderer::initFeatures(const vk::ExtensionNameList &deviceExtensionNames, // Support EGL_KHR_lock_surface3 extension. ANGLE_FEATURE_CONDITION(&mFeatures, supportsLockSurfaceExtension, IsAndroid()); - // http://anglebug.com/6878 + // http://anglebug.com/42265370 // Android needs swapbuffers to update image and present to display. ANGLE_FEATURE_CONDITION(&mFeatures, swapbuffersOnFlushOrFinishWithSingleBuffer, IsAndroid()); @@ -4676,17 +4766,24 @@ void Renderer::initFeatures(const vk::ExtensionNameList &deviceExtensionNames, // usable. Additionally, the following platforms don't support INPUT_ATTACHMENT usage for the // swapchain, so they are excluded: // - // - Intel - // - // The above platforms are not excluded if behind MESA Virtio-GPU Venus driver since WSI is - // implemented with external memory there. + // - Intel on windows + // - Intel on Linux before mesa 22.0 // // Without VK_GOOGLE_surfaceless_query, there is no way to automatically deduce this support. + const bool isMesaAtLeast22_0_0 = mesaVersion.major >= 22; ANGLE_FEATURE_CONDITION( &mFeatures, emulateAdvancedBlendEquations, - !mFeatures.supportsBlendOperationAdvanced.enabled && (isVenus || !isIntel)); + !mFeatures.supportsBlendOperationAdvanced.enabled && + (IsAndroid() || !isIntel || (isIntel && IsLinux() && isMesaAtLeast22_0_0))); + + // GL_KHR_blend_equation_advanced_coherent ensures that the blending operations are performed in + // API primitive order. + ANGLE_FEATURE_CONDITION( + &mFeatures, supportsBlendOperationAdvancedCoherent, + mFeatures.supportsBlendOperationAdvanced.enabled && + mBlendOperationAdvancedFeatures.advancedBlendCoherentOperations == VK_TRUE); - // http://anglebug.com/6933 + // http://anglebug.com/42265410 // Android expects VkPresentRegionsKHR rectangles with a bottom-left origin, while spec // states they should have a top-left origin. ANGLE_FEATURE_CONDITION(&mFeatures, bottomLeftOriginPresentRegionRectangles, IsAndroid()); @@ -4694,6 +4791,20 @@ void Renderer::initFeatures(const vk::ExtensionNameList &deviceExtensionNames, // Use VMA for image suballocation. ANGLE_FEATURE_CONDITION(&mFeatures, useVmaForImageSuballocation, true); + // Emit SPIR-V 1.4 when supported. The following old drivers have various bugs with SPIR-V 1.4: + // + // - Nvidia drivers - Crashes when creating pipelines, not using any SPIR-V 1.4 features. Known + // good since at least version 525. http://anglebug.com/343249127 + // - Qualcomm drivers - Crashes when creating pipelines in the presence of OpCopyLogical with + // some types. http://anglebug.com/343218484 + // - ARM drivers - Fail tests when OpSelect uses a scalar to select between vectors. Known good + // since at least version 47. http://anglebug.com/343218491 + ANGLE_FEATURE_CONDITION(&mFeatures, supportsSPIRV14, + ExtensionFound(VK_KHR_SPIRV_1_4_EXTENSION_NAME, deviceExtensionNames) && + !(isNvidia && nvidiaVersion.major < 525) && + !isQualcommProprietary && + !(isARM && armDriverVersion < ARMDriverVersion(47, 0, 0))); + // Retain debug info in SPIR-V blob. ANGLE_FEATURE_CONDITION(&mFeatures, retainSPIRVDebugInfo, getEnableValidationLayers()); @@ -4722,7 +4833,7 @@ void Renderer::initFeatures(const vk::ExtensionNameList &deviceExtensionNames, IsWindows() && isIntel && intelDriverVersion < IntelDriverVersion(100, 9684); // Intel driver has issues with VK_EXT_vertex_input_dynamic_state - // http://anglebug.com/7162#c8 + // http://anglebug.com/42265637#comment9 ANGLE_FEATURE_CONDITION(&mFeatures, supportsVertexInputDynamicState, mVertexInputDynamicStateFeatures.vertexInputDynamicState == VK_TRUE && !(IsWindows() && isIntel)); @@ -4820,16 +4931,13 @@ void Renderer::initFeatures(const vk::ExtensionNameList &deviceExtensionNames, // VK_EXT_graphics_pipeline_library is available on NVIDIA drivers earlier // than version 531, but there are transient visual glitches with rendering - // on those earlier versions. http://anglebug.com/8218 + // on those earlier versions. http://anglebug.com/42266655 // // On RADV, creating graphics pipeline can crash in the driver. http://crbug.com/1497512 ANGLE_FEATURE_CONDITION(&mFeatures, supportsGraphicsPipelineLibrary, mGraphicsPipelineLibraryFeatures.graphicsPipelineLibrary == VK_TRUE && (!isNvidia || nvidiaVersion.major >= 531) && !isRADV); - // By default all shaders are compiled into the same pipeline library - ANGLE_FEATURE_CONDITION(&mFeatures, combineAllShadersInPipelineLibrary, true); - // The following drivers are known to key the pipeline cache blobs with vertex input and // fragment output state, causing draw-time pipeline creation to miss the cache regardless of // warmup: @@ -4959,7 +5067,10 @@ void Renderer::initFeatures(const vk::ExtensionNameList &deviceExtensionNames, kRequiredSubgroupOp && (limitsVk.maxTexelBufferElements >= kMaxTexelBufferSize)); - // http://anglebug.com/7308 + // Limit GL_MAX_SHADER_STORAGE_BLOCK_SIZE to 256MB on older ARM hardware. + ANGLE_FEATURE_CONDITION(&mFeatures, limitMaxStorageBufferSize, isMaliJobManagerBasedGPU); + + // http://anglebug.com/42265782 // Flushing mutable textures causes flakes in perf tests using Windows/Intel GPU. Failures are // due to lost context/device. // http://b/278600575 @@ -4992,7 +5103,7 @@ void Renderer::initFeatures(const vk::ExtensionNameList &deviceExtensionNames, // // Workaround for nvidia earlier version driver which appears having a bug that On older nvidia // driver, vkGetQueryPoolResult() with VK_QUERY_RESULT_WAIT_BIT may result in incorrect result. - // In that case we force into CPU wait for submission to complete. http://anglebug.com/6692 + // In that case we force into CPU wait for submission to complete. http://anglebug.com/42265186 ANGLE_FEATURE_CONDITION(&mFeatures, forceWaitForSubmissionToCompleteForQueryResult, isARM || (isNvidia && nvidiaVersion.major < 470u)); @@ -5000,10 +5111,6 @@ void Renderer::initFeatures(const vk::ExtensionNameList &deviceExtensionNames, // VK_COMMAND_POOL_CREATE_RESET_COMMAND_BUFFER_BIT flag. ANGLE_FEATURE_CONDITION(&mFeatures, useResetCommandBufferBitForSecondaryPools, isARM); - // Required to pass android.media.cts.DecodeAccuracyTest with MESA Virtio-GPU Venus driver in - // virtualized environment. https://issuetracker.google.com/246378938 - ANGLE_FEATURE_CONDITION(&mFeatures, preferLinearFilterForYUV, isVenus); - // Intel and AMD mesa drivers need depthBiasConstantFactor to be doubled to align with GL. ANGLE_FEATURE_CONDITION(&mFeatures, doubleDepthBiasConstantFactor, (isIntel && !IsWindows()) || isRADV || isNvidia); @@ -5049,10 +5156,20 @@ void Renderer::initFeatures(const vk::ExtensionNameList &deviceExtensionNames, ANGLE_FEATURE_CONDITION(&mFeatures, supportsExternalFormatResolve, false); #endif - // Disable use of VkCmdWaitEvent for image barriers for now. - // https://issuetracker.google.com/336844257 ANGLE_FEATURE_CONDITION(&mFeatures, useVkEventForImageBarrier, false); + ANGLE_FEATURE_CONDITION(&mFeatures, supportsMaintenance5, + mMaintenance5Features.maintenance5 == VK_TRUE); + + ANGLE_FEATURE_CONDITION(&mFeatures, supportsDynamicRendering, + mDynamicRenderingFeatures.dynamicRendering == VK_TRUE); + ANGLE_FEATURE_CONDITION( + &mFeatures, supportsDynamicRenderingLocalRead, + mDynamicRenderingLocalReadFeatures.dynamicRenderingLocalRead == VK_TRUE); + + // Dynamic rendering usage is not yet implemented. + ANGLE_FEATURE_CONDITION(&mFeatures, preferDynamicRendering, false); + // Disable memory report feature overrides if extension is not supported. if ((mFeatures.logMemoryReportCallbacks.enabled || mFeatures.logMemoryReportStats.enabled) && !mMemoryReportFeatures.deviceMemoryReport) @@ -5506,8 +5623,8 @@ void Renderer::cleanupGarbage() // Note: do this after clean up mSuballocationGarbageList so that we will have more chances to // find orphaned blocks being empty. mOrphanedBufferBlockList.pruneEmptyBufferBlocks(this); - // Clean up event garbages - mRefCountedEventGarbageList.cleanupSubmittedGarbage(this); + // Clean up RefCountedEvent that are done resetting + mRefCountedEventRecycler.cleanupResettingEvents(this); } void Renderer::cleanupPendingSubmissionGarbage() @@ -5515,7 +5632,6 @@ void Renderer::cleanupPendingSubmissionGarbage() // Check if pending garbage is still pending. If not, move them to the garbage list. mSharedGarbageList.cleanupUnsubmittedGarbage(this); mSuballocationGarbageList.cleanupUnsubmittedGarbage(this); - mRefCountedEventGarbageList.cleanupUnsubmittedGarbage(this); } void Renderer::onNewValidationMessage(const std::string &message) @@ -5958,7 +6074,8 @@ angle::Result Renderer::getFormatDescriptorCountForExternalFormat(vk::Context *c { ASSERT(descriptorCountOut); - // TODO: need to query for external formats as well once spec is fixed. http://anglebug.com/6141 + // TODO: need to query for external formats as well once spec is fixed. + // http://anglebug.com/42264669 ANGLE_VK_CHECK(context, getFeatures().useMultipleDescriptorsForExternalFormats.enabled, VK_ERROR_INCOMPATIBLE_DRIVER); |