Merge changes Icd615355,I590a161a
* changes:
Update SPIR-V Tools to 2f2e72bae
Squashed 'third_party/SPIRV-Tools/' changes from 0174dd11f..e9dc2c8ce
diff --git a/src/Vulkan/VkQueue.cpp b/src/Vulkan/VkQueue.cpp
index c8fd79c..d0e2965 100644
--- a/src/Vulkan/VkQueue.cpp
+++ b/src/Vulkan/VkQueue.cpp
@@ -197,6 +197,9 @@
// to get rid of it. b/132458423
waitIdle();
+ // Note: VkSwapchainPresentModeInfoEXT can be used to override the present mode, but present
+ // mode is currently ignored by SwiftShader.
+
for(uint32_t i = 0; i < presentInfo->waitSemaphoreCount; i++)
{
auto *semaphore = vk::DynamicCast<BinarySemaphore>(presentInfo->pWaitSemaphores[i]);
diff --git a/src/WSI/VkSurfaceKHR.cpp b/src/WSI/VkSurfaceKHR.cpp
index 05989df..09dac10 100644
--- a/src/WSI/VkSurfaceKHR.cpp
+++ b/src/WSI/VkSurfaceKHR.cpp
@@ -224,16 +224,22 @@
const auto *presentMode = vk::GetExtendedStruct<VkSurfacePresentModeEXT>(pSurfaceInfoPNext, VK_STRUCTURE_TYPE_SURFACE_PRESENT_MODE_EXT);
ASSERT(presentMode != nullptr);
- // No support for switching between present modes; i.e. each mode is only compatible with itself.
+ // Present mode is ignored, so FIFO and MAILBOX are compatible.
if(presentModeCompatibility->pPresentModes == nullptr)
{
- presentModeCompatibility->presentModeCount = 1;
+ presentModeCompatibility->presentModeCount = 2;
}
- else if(presentModeCompatibility->presentModeCount >= 1)
+ else if(presentModeCompatibility->presentModeCount == 1)
{
presentModeCompatibility->pPresentModes[0] = presentMode->presentMode;
presentModeCompatibility->presentModeCount = 1;
}
+ else if(presentModeCompatibility->presentModeCount > 1)
+ {
+ presentModeCompatibility->pPresentModes[0] = presentModes[0];
+ presentModeCompatibility->pPresentModes[1] = presentModes[1];
+ presentModeCompatibility->presentModeCount = 2;
+ }
break;
}
default: