Skip to content

Commit

Permalink
FrameCapture: Don't use shadow memory on Pixel after Android 14
Browse files Browse the repository at this point in the history
The platform bug that required shadow memory to track changes to
coherent mapped buffers has been fixed in Android 14.

mprotect now works on Vulkan surfaces.

Test: MEC with title using coherent buffers
Bug: angleproject:7402
Bug: b/269535398
Change-Id: I370f29ee7d033b19facf48cfd76576950c39b735
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5399117
Reviewed-by: Mark Łobodziński <[email protected]>
Reviewed-by: Mike Schuchardt <[email protected]>
Auto-Submit: Cody Northrop <[email protected]>
Commit-Queue: Mark Łobodziński <[email protected]>
  • Loading branch information
cnorthrop authored and Angle LUCI CQ committed Mar 27, 2024
1 parent 0156fe4 commit 71e5a43
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions src/libANGLE/capture/FrameCapture.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@
#include "libANGLE/entry_points_utils.h"
#include "libANGLE/queryconversions.h"
#include "libANGLE/queryutils.h"
#include "libANGLE/renderer/driver_utils.h"
#include "libANGLE/validationEGL.h"
#include "third_party/ceval/ceval.h"

Expand Down Expand Up @@ -6816,11 +6817,17 @@ void FrameCaptureShared::determineMemoryProtectionSupport(gl::Context *context)
angle::GetSystemInfo(&info);
bool isDeviceDenyListed = false;

if (denyList.find(info.machineManufacturer) != denyList.end())
if (rx::GetAndroidSDKVersion() < 34)
{
const std::vector<std::string> &models = denyList[info.machineManufacturer];
isDeviceDenyListed =
std::find(models.begin(), models.end(), info.machineModelName) != models.end();
// Before Android 14, there was a bug in Mali based Pixel preventing mprotect
// on Vulkan surfaces. (https://b.corp.google.com/issues/269535398)
// Check the denylist in this case.
if (denyList.find(info.machineManufacturer) != denyList.end())
{
const std::vector<std::string> &models = denyList[info.machineManufacturer];
isDeviceDenyListed =
std::find(models.begin(), models.end(), info.machineModelName) != models.end();
}
}

if (isDeviceDenyListed)
Expand Down

0 comments on commit 71e5a43

Please sign in to comment.