Fix IOSurface synchronization issues
It appears that not only render targets, but also samplers that use
IOSurfaces require SwiftShader to perform synchronized draws,
otherwise it seems like using a shared IOSurface's CPU memory is
unsafe and can cause crashes in Layout Tests.
Bug chromium:846693
Change-Id: I0ce24700d34c657ac2447ceb2f6f837bfa3a9a58
Reviewed-on: https://swiftshader-review.googlesource.com/19288
Tested-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
diff --git a/src/Renderer/Sampler.cpp b/src/Renderer/Sampler.cpp
index 748fb4e..efac4c6 100644
--- a/src/Renderer/Sampler.cpp
+++ b/src/Renderer/Sampler.cpp
@@ -401,6 +401,16 @@
return textureType == TEXTURE_3D || textureType == TEXTURE_2D_ARRAY;
}
+ void Sampler::setSyncRequired(bool isSyncRequired)
+ {
+ syncRequired = isSyncRequired;
+ }
+
+ bool Sampler::requiresSync() const
+ {
+ return syncRequired;
+ }
+
const Texture &Sampler::getTextureData()
{
return texture;