Commit 60ad763d by Jason Macnak Committed by Commit Bot

Vulkan: Enable EGL_ANDROID_recordable for EGL configs on SwiftShader

There does not seem to be a way to query the Gralloc and Vulkan drivers for recordable support so keep this as a narrow hack restricted to SwiftShader. Bug: b/181163023 Test: `cts -m CtsMediaTestCases` on Cuttlefish w/ SwANGLE Change-Id: I0bfee01d43ea8e3d9965f5bfaa578a285d37db29 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2727874 Commit-Queue: Jason Macnak <natsu@google.com> Reviewed-by: 's avatarNicolas Capens <nicolascapens@google.com> Reviewed-by: 's avatarGeoff Lang <geofflang@chromium.org> Reviewed-by: 's avatarTim Van Patten <timvp@google.com>
parent 559cb622
......@@ -14,6 +14,7 @@
#include <vulkan/vulkan.h>
#include "common/angle_version.h"
#include "libANGLE/renderer/driver_utils.h"
#include "libANGLE/renderer/vulkan/RendererVk.h"
#include "libANGLE/renderer/vulkan/android/HardwareBufferImageSiblingVkAndroid.h"
#include "libANGLE/renderer/vulkan/android/WindowSurfaceVkAndroid.h"
......@@ -65,10 +66,28 @@ egl::ConfigSet DisplayVkAndroid::generateConfigs()
depthStencilFormats.data(), depthStencilFormats.size(), this);
}
void DisplayVkAndroid::enableRecordableIfSupported(egl::Config *config)
{
const VkPhysicalDeviceProperties &physicalDeviceProperties =
getRenderer()->getPhysicalDeviceProperties();
// TODO(b/181163023): Determine how to properly query for support. This is a hack to unblock
// launching SwANGLE on Cuttlefish.
bool isSwiftShader =
IsSwiftshader(physicalDeviceProperties.vendorID, physicalDeviceProperties.deviceID);
if (isSwiftShader)
{
config->recordable = true;
}
}
void DisplayVkAndroid::checkConfigSupport(egl::Config *config)
{
// TODO(geofflang): Test for native support and modify the config accordingly.
// anglebug.com/2692
enableRecordableIfSupported(config);
}
egl::Error DisplayVkAndroid::validateImageClientBuffer(const gl::Context *context,
......
......@@ -45,6 +45,8 @@ class DisplayVkAndroid : public DisplayVk
const AHBFunctions &getAHBFunctions() const { return mAHBFunctions; }
private:
void enableRecordableIfSupported(egl::Config *config);
AHBFunctions mAHBFunctions;
};
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment