Allow VK_PIPELINE_CACHE_CREATE_EXTERNALLY_SYNCHRONIZED_BIT

This CL allows the use of VK_PIPELINE_CACHE_CREATE_EXTERNALLY_SYNCHRONIZED_BIT.
When set, the implementation may skip any unnecessary processing needed
to support simultaneous modification from multiple threads where allowed.

This CL includes no optimization and simply allows the use of the bit as a noop.

Tested locally by applying the following change:
https://gerrit.khronos.org/c/vk-gl-cts/+/10186/2/external/vulkancts/modules/vulkan/pipeline/vktPipelineCacheTests.cpp

Of the new tests added, only a single test is actually supported at this point, but it now passes:
dEQP-VK.pipeline.monolithic.cache.graphics_tests.vertex_stage_fragment_stage_externally_synchronized

Tests: dEQP-VK.pipeline.*.cache.graphics_tests.vertex_stage_*_externally_synchronized
Bug: b/234439593
Change-Id: Ie89966e7bdbe6ae5fa41057edff3c163951ec81d
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/68149
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
Tested-by: Alexis Hétu <sugoi@google.com>
Kokoro-Result: kokoro <noreply+kokoro@google.com>
Presubmit-Ready: Alexis Hétu <sugoi@google.com>
Commit-Queue: Alexis Hétu <sugoi@google.com>
diff --git a/src/Vulkan/libVulkan.cpp b/src/Vulkan/libVulkan.cpp
index c1b8e63..cddc14d 100644
--- a/src/Vulkan/libVulkan.cpp
+++ b/src/Vulkan/libVulkan.cpp
@@ -2128,9 +2128,12 @@
 	TRACE("(VkDevice device = %p, const VkPipelineCacheCreateInfo* pCreateInfo = %p, const VkAllocationCallbacks* pAllocator = %p, VkPipelineCache* pPipelineCache = %p)",
 	      device, pCreateInfo, pAllocator, pPipelineCache);
 
-	if(pCreateInfo->flags != 0)
+	if(pCreateInfo->flags != 0 && pCreateInfo->flags != VK_PIPELINE_CACHE_CREATE_EXTERNALLY_SYNCHRONIZED_BIT)
 	{
-		// Vulkan 1.2: "flags is reserved for future use." "flags must be 0"
+		// Flags must be 0 or VK_PIPELINE_CACHE_CREATE_EXTERNALLY_SYNCHRONIZED_BIT.
+		// VK_PIPELINE_CACHE_CREATE_EXTERNALLY_SYNCHRONIZED_BIT: When set, the implementation may skip any
+		// unnecessary processing needed to support simultaneous modification from multiple threads where allowed.
+		// TODO(b/246369329): Optimize PipelineCache objects when VK_PIPELINE_CACHE_CREATE_EXTERNALLY_SYNCHRONIZED_BIT is used.
 		UNSUPPORTED("pCreateInfo->flags 0x%08X", int(pCreateInfo->flags));
 	}