Commit 88156d26 by Geoff Lang Committed by Commit Bot

Revert "[Vulkan] Add DisplayVkNull"

This reverts commit cbbaf76b. Reason for revert: Suspecting this breaks the fuchsia_x64 bot WebGL tests. Ex: https://chromium-review.googlesource.com/c/chromium/src/+/2904812 Original change's description: > [Vulkan] Add DisplayVkNull > > Currently all DisplayVk implementations depend on VK_KHR_swapchain and > VK_KHR_surface extensions. When running Chromium on Fuchsia these > extensions are never used (content is shown on the screen using > ImagePipe API without dependency on swapchain). ANGLE still depended > on these extensions for DisplayVkFuchsia. > This CL adds DisplayVkNull, which allows to run ANGLE without dependency > on swapchain. It's usable only offscreen and cannot present content on > a surface. > > Bug: chromium:1203879 > Change-Id: I4d1307060967ffa68877c4300ea4d5590eeb2152 > Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2861313 > Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> > Reviewed-by: Jamie Madill <jmadill@chromium.org> > Commit-Queue: Jamie Madill <jmadill@chromium.org> Bug: chromium:1203879 Change-Id: I6701ffff48fcb925f387e63b356d2d5cf360ea7e Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2904183Reviewed-by: 's avatarGeoff Lang <geofflang@chromium.org> Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com> Commit-Queue: Jamie Madill <jmadill@chromium.org>
parent 9a9392aa
...@@ -132,9 +132,7 @@ config("internal_config") { ...@@ -132,9 +132,7 @@ config("internal_config") {
defines += [ "__ggp__" ] defines += [ "__ggp__" ]
} }
if (angle_use_vulkan_null_display) { if (angle_use_vulkan_display) {
defines += [ "ANGLE_USE_VULKAN_NULL_DISPLAY" ]
} else if (angle_use_vulkan_display) {
defines += [ defines += [
"ANGLE_USE_VULKAN_DISPLAY", "ANGLE_USE_VULKAN_DISPLAY",
"EGL_NO_X11", "EGL_NO_X11",
......
...@@ -129,10 +129,6 @@ declare_args() { ...@@ -129,10 +129,6 @@ declare_args() {
(is_linux && (angle_use_x11 || angle_use_vulkan_display) && (is_linux && (angle_use_x11 || angle_use_vulkan_display) &&
!is_chromeos) || is_android || is_fuchsia || is_ggp || is_mac) !is_chromeos) || is_android || is_fuchsia || is_ggp || is_mac)
# When set to true, ANGLE will not use VK_KHR_surface and VK_KHR_swapchain
# extensions. Content can be rendered only off-screen.
angle_use_vulkan_null_display = build_with_chromium && is_fuchsia
# Disable null backend to save space for official build. # Disable null backend to save space for official build.
angle_enable_null = !is_official_build angle_enable_null = !is_official_build
angle_enable_gl_desktop = !is_android && !is_ios angle_enable_gl_desktop = !is_android && !is_ios
......
...@@ -31,11 +31,9 @@ group("angle_vulkan_entry_points") { ...@@ -31,11 +31,9 @@ group("angle_vulkan_entry_points") {
if (is_fuchsia) { if (is_fuchsia) {
public_deps += [ public_deps += [
"$angle_root/src/common/fuchsia_egl", "$angle_root/src/common/fuchsia_egl",
"//third_party/fuchsia-sdk:vulkan_base",
"//third_party/fuchsia-sdk/sdk/pkg/vulkan", "//third_party/fuchsia-sdk/sdk/pkg/vulkan",
] ]
if (!angle_use_vulkan_null_display) {
public_deps += [ "//third_party/fuchsia-sdk/sdk/pkg/vulkan_layers:VkLayer_image_pipe_swapchain" ]
}
} else if (!is_android && !is_ggp) { } else if (!is_android && !is_ggp) {
if (angle_shared_libvulkan) { if (angle_shared_libvulkan) {
data_deps = [ "$angle_vulkan_loader_dir:libvulkan" ] data_deps = [ "$angle_vulkan_loader_dir:libvulkan" ]
......
...@@ -356,12 +356,7 @@ rx::DisplayImpl *CreateDisplayFromAttribs(EGLAttrib displayType, ...@@ -356,12 +356,7 @@ rx::DisplayImpl *CreateDisplayFromAttribs(EGLAttrib displayType,
case EGL_PLATFORM_ANGLE_TYPE_VULKAN_ANGLE: case EGL_PLATFORM_ANGLE_TYPE_VULKAN_ANGLE:
#if defined(ANGLE_ENABLE_VULKAN) #if defined(ANGLE_ENABLE_VULKAN)
# if defined(ANGLE_USE_VULKAN_NULL_DISPLAY) # if defined(ANGLE_PLATFORM_WINDOWS)
if (rx::IsVulkanNullDisplayAvailable())
{
impl = rx::CreateVulkanNullDisplay(state);
}
# elif defined(ANGLE_PLATFORM_WINDOWS)
if (rx::IsVulkanWin32DisplayAvailable()) if (rx::IsVulkanWin32DisplayAvailable())
{ {
impl = rx::CreateVulkanWin32Display(state); impl = rx::CreateVulkanWin32Display(state);
......
...@@ -115,15 +115,6 @@ if (angle_enable_cl) { ...@@ -115,15 +115,6 @@ if (angle_enable_cl) {
] ]
} }
if (angle_use_vulkan_null_display) {
_vulkan_backend_sources += [
"null/DisplayVkNull.cpp",
"null/DisplayVkNull.h",
"null/WindowSurfaceVkNull.cpp",
"null/WindowSurfaceVkNull.h",
]
}
if (is_linux) { if (is_linux) {
_vulkan_backend_sources += [ _vulkan_backend_sources += [
"display/DisplayVkSimple.cpp", "display/DisplayVkSimple.cpp",
......
...@@ -260,11 +260,6 @@ const char *DisplayVk::getWSILayer() const ...@@ -260,11 +260,6 @@ const char *DisplayVk::getWSILayer() const
return nullptr; return nullptr;
} }
bool DisplayVk::isUsingSwapchain() const
{
return true;
}
bool DisplayVk::getScratchBuffer(size_t requstedSizeBytes, bool DisplayVk::getScratchBuffer(size_t requstedSizeBytes,
angle::MemoryBuffer **scratchBufferOut) const angle::MemoryBuffer **scratchBufferOut) const
{ {
......
...@@ -123,7 +123,6 @@ class DisplayVk : public DisplayImpl, public vk::Context ...@@ -123,7 +123,6 @@ class DisplayVk : public DisplayImpl, public vk::Context
virtual const char *getWSIExtension() const = 0; virtual const char *getWSIExtension() const = 0;
virtual const char *getWSILayer() const; virtual const char *getWSILayer() const;
virtual bool isUsingSwapchain() const;
// Determine if a config with given formats and sample counts is supported. This callback may // Determine if a config with given formats and sample counts is supported. This callback may
// modify the config to add or remove platform specific attributes such as nativeVisualID. If // modify the config to add or remove platform specific attributes such as nativeVisualID. If
......
...@@ -14,10 +14,6 @@ ...@@ -14,10 +14,6 @@
namespace rx namespace rx
{ {
bool IsVulkanNullDisplayAvailable();
DisplayImpl *CreateVulkanNullDisplay(const egl::DisplayState &state);
#if defined(ANGLE_PLATFORM_WINDOWS) #if defined(ANGLE_PLATFORM_WINDOWS)
bool IsVulkanWin32DisplayAvailable(); bool IsVulkanWin32DisplayAvailable();
DisplayImpl *CreateVulkanWin32Display(const egl::DisplayState &state); DisplayImpl *CreateVulkanWin32Display(const egl::DisplayState &state);
......
...@@ -926,15 +926,8 @@ angle::Result RendererVk::initialize(DisplayVk *displayVk, ...@@ -926,15 +926,8 @@ angle::Result RendererVk::initialize(DisplayVk *displayVk,
} }
vk::ExtensionNameList enabledInstanceExtensions; vk::ExtensionNameList enabledInstanceExtensions;
if (displayVk->isUsingSwapchain()) enabledInstanceExtensions.push_back(VK_KHR_SURFACE_EXTENSION_NAME);
{ enabledInstanceExtensions.push_back(wsiExtension);
enabledInstanceExtensions.push_back(VK_KHR_SURFACE_EXTENSION_NAME);
}
if (wsiExtension)
{
enabledInstanceExtensions.push_back(wsiExtension);
}
mEnableDebugUtils = mEnableValidationLayers && mEnableDebugUtils = mEnableValidationLayers &&
ExtensionFound(VK_EXT_DEBUG_UTILS_EXTENSION_NAME, instanceExtensionNames); ExtensionFound(VK_EXT_DEBUG_UTILS_EXTENSION_NAME, instanceExtensionNames);
...@@ -1443,10 +1436,7 @@ angle::Result RendererVk::initializeDevice(DisplayVk *displayVk, uint32_t queueF ...@@ -1443,10 +1436,7 @@ angle::Result RendererVk::initializeDevice(DisplayVk *displayVk, uint32_t queueF
} }
vk::ExtensionNameList enabledDeviceExtensions; vk::ExtensionNameList enabledDeviceExtensions;
if (displayVk->isUsingSwapchain()) enabledDeviceExtensions.push_back(VK_KHR_SWAPCHAIN_EXTENSION_NAME);
{
enabledDeviceExtensions.push_back(VK_KHR_SWAPCHAIN_EXTENSION_NAME);
}
// Queues: map low, med, high priority to whatever is supported up to 3 queues // Queues: map low, med, high priority to whatever is supported up to 3 queues
uint32_t queueCount = std::min(mQueueFamilyProperties[queueFamilyIndex].queueCount, uint32_t queueCount = std::min(mQueueFamilyProperties[queueFamilyIndex].queueCount,
......
//
// Copyright 2021 The ANGLE Project Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//
// DisplayVkNull.cpp:
// Implements the class methods for DisplayVkNull.
//
#include "DisplayVkNull.h"
#include "WindowSurfaceVkNull.h"
#include "libANGLE/Display.h"
#include "libANGLE/renderer/vulkan/RendererVk.h"
#include "libANGLE/renderer/vulkan/vk_caps_utils.h"
namespace rx
{
DisplayVkNull::DisplayVkNull(const egl::DisplayState &state) : DisplayVk(state) {}
bool DisplayVkNull::isValidNativeWindow(EGLNativeWindowType window) const
{
return false;
}
SurfaceImpl *DisplayVkNull::createWindowSurfaceVk(const egl::SurfaceState &state,
EGLNativeWindowType window)
{
return new WindowSurfaceVkNull(state, window);
}
const char *DisplayVkNull::getWSIExtension() const
{
return nullptr;
}
bool DisplayVkNull::isUsingSwapchain() const
{
return false;
}
egl::ConfigSet DisplayVkNull::generateConfigs()
{
constexpr GLenum kColorFormats[] = {GL_RGBA8, GL_BGRA8_EXT, GL_RGB565, GL_RGB8};
return egl_vk::GenerateConfigs(kColorFormats, egl_vk::kConfigDepthStencilFormats, this);
}
void DisplayVkNull::checkConfigSupport(egl::Config *config)
{
config->surfaceType &= ~EGL_WINDOW_BIT;
}
bool IsVulkanNullDisplayAvailable()
{
return true;
}
DisplayImpl *CreateVulkanNullDisplay(const egl::DisplayState &state)
{
return new DisplayVkNull(state);
}
} // namespace rx
//
// Copyright 2021 The ANGLE Project Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//
// DisplayVkNull.h:
// Defines the class interface for DisplayVkNull, implementing
// DisplayVk that doesn't depend on Vulkan extensions. It cannot be
// used to output any content to a surface.
//
#ifndef LIBANGLE_RENDERER_VULKAN_NULL_DISPLAYVKNULL_H_
#define LIBANGLE_RENDERER_VULKAN_NULL_DISPLAYVKNULL_H_
#include "libANGLE/renderer/vulkan/DisplayVk.h"
namespace rx
{
class DisplayVkNull : public DisplayVk
{
public:
DisplayVkNull(const egl::DisplayState &state);
bool isValidNativeWindow(EGLNativeWindowType window) const override;
SurfaceImpl *createWindowSurfaceVk(const egl::SurfaceState &state,
EGLNativeWindowType window) override;
virtual const char *getWSIExtension() const override;
bool isUsingSwapchain() const override;
egl::ConfigSet generateConfigs() override;
void checkConfigSupport(egl::Config *config) override;
private:
std::vector<VkSurfaceFormatKHR> mSurfaceFormats;
};
} // namespace rx
#endif // LIBANGLE_RENDERER_VULKAN_NULL_DISPLAYVKNULL_H_
//
// Copyright 2021 The ANGLE Project Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//
// WindowSurfaceVkNull.cpp:
// Implements the class methods for WindowSurfaceVkNull.
//
#include "WindowSurfaceVkNull.h"
#include "libANGLE/renderer/vulkan/RendererVk.h"
namespace rx
{
WindowSurfaceVkNull::WindowSurfaceVkNull(const egl::SurfaceState &surfaceState,
EGLNativeWindowType window)
: WindowSurfaceVk(surfaceState, window)
{}
WindowSurfaceVkNull::~WindowSurfaceVkNull() {}
angle::Result WindowSurfaceVkNull::createSurfaceVk(vk::Context *context, gl::Extents *extentsOut)
{
return angle::Result::Stop;
}
angle::Result WindowSurfaceVkNull::getCurrentWindowSize(vk::Context *context,
gl::Extents *extentsOut)
{
return angle::Result::Stop;
}
} // namespace rx
//
// Copyright 2021 The ANGLE Project Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//
// WindowSurfaceVkNull.h:
// Defines the class interface for WindowSurfaceVkNull, implementing WindowSurfaceVk.
//
#ifndef LIBANGLE_RENDERER_VULKAN_NULL_WINDOWSURFACEVKNULL_H_
#define LIBANGLE_RENDERER_VULKAN_NULL_WINDOWSURFACEVKNULL_H_
#include "libANGLE/renderer/vulkan/SurfaceVk.h"
namespace rx
{
class WindowSurfaceVkNull final : public WindowSurfaceVk
{
public:
WindowSurfaceVkNull(const egl::SurfaceState &surfaceState, EGLNativeWindowType window);
~WindowSurfaceVkNull() final;
private:
angle::Result createSurfaceVk(vk::Context *context, gl::Extents *extentsOut) override;
angle::Result getCurrentWindowSize(vk::Context *context, gl::Extents *extentsOut) override;
};
} // namespace rx
#endif // LIBANGLE_RENDERER_VULKAN_NULL_WINDOWSURFACEVKNULL_H_
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