зеркало из https://github.com/AvaloniaUI/angle.git
Revert "Vulkan: SwiftShader integration."
This reverts commit 1224802c21
.
Reason for revert: https://bugs.chromium.org/p/angleproject/issues/detail?id=3912
Original change's description:
> Vulkan: SwiftShader integration.
>
> Adds a new EGL extension for picking SwiftShader when using the Vulkan
> back-end. Also cleans up ICD enabling code RendererVk. Also includes a
> change to a buffer size necessary to support SwiftShader's minimum
> limits.
>
> 32-bit is currently left disabled to work around an issue on AMD Win7.
>
> Bug: angleproject:3876
> Bug: b/140251624
> Change-Id: I33c55d994801d6154caca0cad0a608c1e808d517
> Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1776231
> Commit-Queue: Jamie Madill <jmadill@chromium.org>
> Reviewed-by: Geoff Lang <geofflang@chromium.org>
TBR=geofflang@chromium.org,jonahr@google.com,jmadill@chromium.org
Change-Id: Id7464250f6941b0228a6b2a9bd0349823727275b
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: angleproject:3876, b/140251624
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1808101
Reviewed-by: Zhenyao Mo <zmo@chromium.org>
Commit-Queue: Zhenyao Mo <zmo@chromium.org>
This commit is contained in:
Родитель
2e16f639d8
Коммит
db7a36f456
|
@ -44,7 +44,6 @@
|
||||||
/third_party/rapidjson/src
|
/third_party/rapidjson/src
|
||||||
/third_party/spirv-headers/src
|
/third_party/spirv-headers/src
|
||||||
/third_party/spirv-tools/src
|
/third_party/spirv-tools/src
|
||||||
/third_party/SwiftShader
|
|
||||||
/third_party/vulkan-headers/src
|
/third_party/vulkan-headers/src
|
||||||
/third_party/vulkan-loader/src
|
/third_party/vulkan-loader/src
|
||||||
/third_party/vulkan-tools/src
|
/third_party/vulkan-tools/src
|
||||||
|
|
72
BUILD.gn
72
BUILD.gn
|
@ -25,11 +25,6 @@ declare_args() {
|
||||||
# Defaults to capture building to $root_out_dir/angle_libs/with_capture.
|
# Defaults to capture building to $root_out_dir/angle_libs/with_capture.
|
||||||
# Switch on to build capture to $root_out_dir.
|
# Switch on to build capture to $root_out_dir.
|
||||||
angle_with_capture_by_default = false
|
angle_with_capture_by_default = false
|
||||||
|
|
||||||
# Currently SwiftShader's Vulkan front-end doesn't build on Android.
|
|
||||||
# Disabled on 32-bit Windows temporarily to work around an AMD Win7 bug.
|
|
||||||
# TODO(jmadill): Re-enable with new testing config. http://anglebug.com/3909
|
|
||||||
angle_swiftshader = !is_android && (!is_win || target_cpu != "x86")
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!build_with_chromium) {
|
if (!build_with_chromium) {
|
||||||
|
@ -543,73 +538,23 @@ if (angle_enable_vulkan) {
|
||||||
defines = [
|
defines = [
|
||||||
"ANGLE_VK_LAYERS_DIR=\"$angle_data_dir\"",
|
"ANGLE_VK_LAYERS_DIR=\"$angle_data_dir\"",
|
||||||
"ANGLE_VK_MOCK_ICD_JSON=\"$angle_data_dir/VkICD_mock_icd.json\"",
|
"ANGLE_VK_MOCK_ICD_JSON=\"$angle_data_dir/VkICD_mock_icd.json\"",
|
||||||
"ANGLE_VK_SWIFTSHADER_ICD_JSON=\"swiftshader/libvk_swiftshader_icd.json\"",
|
|
||||||
]
|
]
|
||||||
if (is_android) {
|
if (is_android) {
|
||||||
libs = [ "vulkan" ]
|
libs = [ "vulkan" ]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (angle_swiftshader) {
|
|
||||||
copy("angle_swiftshader_icd_rename") {
|
|
||||||
sources = [
|
|
||||||
"$swiftshader_dir/src/Vulkan/vk_swiftshader_icd.json",
|
|
||||||
]
|
|
||||||
outputs = [
|
|
||||||
"$root_gen_dir/angle/libvk_swiftshader_icd.json",
|
|
||||||
]
|
|
||||||
}
|
|
||||||
|
|
||||||
action("angle_swiftshader_icd") {
|
|
||||||
deps = [
|
|
||||||
":angle_swiftshader_icd_rename",
|
|
||||||
]
|
|
||||||
script = "scripts/generate_vulkan_layers_json.py"
|
|
||||||
sources = [
|
|
||||||
"third_party/vulkan-headers/src/include/vulkan/vulkan_core.h",
|
|
||||||
]
|
|
||||||
|
|
||||||
# Must be listed after vulkan_core.h. git cl format sorts them if they
|
|
||||||
# are in one list. So split up the sources manually.
|
|
||||||
sources += [ "$root_gen_dir/angle/libvk_swiftshader_icd.json" ]
|
|
||||||
|
|
||||||
outputs = [
|
|
||||||
"$root_out_dir/swiftshader/libvk_swiftshader_icd.json",
|
|
||||||
]
|
|
||||||
data = outputs
|
|
||||||
|
|
||||||
_raw_sws_in = rebase_path("$root_gen_dir/angle", root_build_dir)
|
|
||||||
_raw_sws_out = rebase_path("$root_out_dir/swiftshader", root_build_dir)
|
|
||||||
|
|
||||||
_sws_output = ""
|
|
||||||
if (is_win) {
|
|
||||||
_sws_output += "swiftshader/vk_swiftshader.dll"
|
|
||||||
} else if (is_mac) {
|
|
||||||
_sws_output += "./libvk_swiftshader.dylib"
|
|
||||||
} else {
|
|
||||||
_sws_output += "./libvk_swiftshader.so"
|
|
||||||
}
|
|
||||||
|
|
||||||
args = [
|
|
||||||
"--icd",
|
|
||||||
"--replacement",
|
|
||||||
_sws_output,
|
|
||||||
_raw_sws_in,
|
|
||||||
_raw_sws_out,
|
|
||||||
] + rebase_path(sources, root_build_dir)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
# Use this target to include everything ANGLE needs for Vulkan.
|
# Use this target to include everything ANGLE needs for Vulkan.
|
||||||
group("angle_vulkan") {
|
group("angle_vulkan") {
|
||||||
public_deps = [
|
public_deps = [
|
||||||
"$angle_root/third_party/vulkan-headers:vulkan_headers",
|
"$angle_root/third_party/vulkan-headers:vulkan_headers",
|
||||||
]
|
]
|
||||||
public_configs = [ ":vulkan_config" ]
|
public_configs = [ ":vulkan_config" ]
|
||||||
deps = []
|
|
||||||
data_deps = []
|
data_deps = []
|
||||||
if (!is_android && !is_fuchsia) {
|
if (!is_android && !is_fuchsia) {
|
||||||
deps += [ "$angle_root/third_party/vulkan-loader:libvulkan" ]
|
deps = [
|
||||||
|
"$angle_root/third_party/vulkan-loader:libvulkan",
|
||||||
|
]
|
||||||
data_deps += [ "$angle_root/third_party/vulkan-tools:VkICD_mock_icd" ]
|
data_deps += [ "$angle_root/third_party/vulkan-tools:VkICD_mock_icd" ]
|
||||||
public_configs +=
|
public_configs +=
|
||||||
[ "$angle_root/third_party/vulkan-loader:vulkan_loader_config" ]
|
[ "$angle_root/third_party/vulkan-loader:vulkan_loader_config" ]
|
||||||
|
@ -624,7 +569,9 @@ if (angle_enable_vulkan) {
|
||||||
|
|
||||||
if (angle_enable_vulkan_validation_layers) {
|
if (angle_enable_vulkan_validation_layers) {
|
||||||
if (is_fuchsia) {
|
if (is_fuchsia) {
|
||||||
deps += [ "//third_party/fuchsia-sdk:vulkan_validation" ]
|
deps = [
|
||||||
|
"//third_party/fuchsia-sdk:vulkan_validation",
|
||||||
|
]
|
||||||
} else {
|
} else {
|
||||||
data_deps += [ "$angle_root/third_party/vulkan-validation-layers:vulkan_validation_layers" ]
|
data_deps += [ "$angle_root/third_party/vulkan-validation-layers:vulkan_validation_layers" ]
|
||||||
if (!is_android) {
|
if (!is_android) {
|
||||||
|
@ -632,13 +579,6 @@ if (angle_enable_vulkan) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (angle_swiftshader) {
|
|
||||||
deps += [
|
|
||||||
":angle_swiftshader_icd",
|
|
||||||
"$swiftshader_dir/src/Vulkan:swiftshader_libvulkan",
|
|
||||||
]
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
6
DEPS
6
DEPS
|
@ -5,7 +5,6 @@
|
||||||
vars = {
|
vars = {
|
||||||
'android_git': 'https://android.googlesource.com',
|
'android_git': 'https://android.googlesource.com',
|
||||||
'chromium_git': 'https://chromium.googlesource.com',
|
'chromium_git': 'https://chromium.googlesource.com',
|
||||||
'swiftshader_git': 'https://swiftshader.googlesource.com',
|
|
||||||
|
|
||||||
# This variable is set on the Chrome infra for compatiblity with gclient.
|
# This variable is set on the Chrome infra for compatiblity with gclient.
|
||||||
'angle_root': '.',
|
'angle_root': '.',
|
||||||
|
@ -161,11 +160,6 @@ deps = {
|
||||||
'condition': 'not build_with_chromium',
|
'condition': 'not build_with_chromium',
|
||||||
},
|
},
|
||||||
|
|
||||||
'{angle_root}/third_party/SwiftShader': {
|
|
||||||
'url': '{swiftshader_git}/SwiftShader@30847688f05927c32855b8ecf20465fc91fa893d',
|
|
||||||
'condition': 'not build_with_chromium',
|
|
||||||
},
|
|
||||||
|
|
||||||
'{angle_root}/third_party/vulkan-headers/src': {
|
'{angle_root}/third_party/vulkan-headers/src': {
|
||||||
'url': '{chromium_git}/external/github.com/KhronosGroup/Vulkan-Headers@{vulkan_headers_revision}',
|
'url': '{chromium_git}/external/github.com/KhronosGroup/Vulkan-Headers@{vulkan_headers_revision}',
|
||||||
},
|
},
|
||||||
|
|
|
@ -1,12 +0,0 @@
|
||||||
# Copyright 2019 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.
|
|
||||||
|
|
||||||
# We are building SwiftShader in ANGLE
|
|
||||||
swiftshader_standalone = false
|
|
||||||
|
|
||||||
# Path to SwiftShader
|
|
||||||
swiftshader_dir = "//third_party/SwiftShader"
|
|
||||||
|
|
||||||
# Paths to SwiftShader dependencies
|
|
||||||
swiftshader_spirv_tools_dir = "//third_party/spirv-tools/src"
|
|
|
@ -1,82 +0,0 @@
|
||||||
Name
|
|
||||||
|
|
||||||
ANGLE_platform_angle_device_type_swiftshader
|
|
||||||
|
|
||||||
Name Strings
|
|
||||||
|
|
||||||
EGL_ANGLE_platform_angle_device_type_swiftshader
|
|
||||||
|
|
||||||
Contributors
|
|
||||||
|
|
||||||
Jamie Madill, Google
|
|
||||||
|
|
||||||
Contacts
|
|
||||||
|
|
||||||
Jamie Madill, Google (jmadill 'at' google 'dot' com)
|
|
||||||
|
|
||||||
Status
|
|
||||||
|
|
||||||
Draft
|
|
||||||
|
|
||||||
Version
|
|
||||||
|
|
||||||
Version 1, 2019-08-24
|
|
||||||
|
|
||||||
Number
|
|
||||||
|
|
||||||
EGL Extension XXX
|
|
||||||
|
|
||||||
Extension Type
|
|
||||||
|
|
||||||
EGL client extension
|
|
||||||
|
|
||||||
Dependencies
|
|
||||||
|
|
||||||
Requires EGL_ANGLE_platform_angle_vulkan.
|
|
||||||
|
|
||||||
Overview
|
|
||||||
|
|
||||||
This extension enables choosing the SwiftShader Vulkan implementation
|
|
||||||
when it is available.
|
|
||||||
|
|
||||||
New Types
|
|
||||||
|
|
||||||
None
|
|
||||||
|
|
||||||
New Procedures and Functions
|
|
||||||
|
|
||||||
None
|
|
||||||
|
|
||||||
New Tokens
|
|
||||||
|
|
||||||
Accepted as values for the EGL_PLATFORM_ANGLE_TYPE_ANGLE attribute:
|
|
||||||
|
|
||||||
EGL_PLATFORM_ANGLE_DEVICE_TYPE_SWIFTSHADER_ANGLE 0x3487
|
|
||||||
|
|
||||||
Additions to the EGL Specification
|
|
||||||
|
|
||||||
None.
|
|
||||||
|
|
||||||
New Behavior
|
|
||||||
|
|
||||||
When calling eglGetPlatformDisplay:
|
|
||||||
|
|
||||||
To request a SwiftShader-backed Vulkan implementation with ANGLE, the value
|
|
||||||
of EGL_PLATFORM_ANGLE_TYPE_ANGLE should be EGL_PLATFORM_ANGLE_TYPE_VULKAN_ANGLE
|
|
||||||
and the value of EGL_PLATFORM_ANGLE_DEVICE_TYPE_ANGLE should be
|
|
||||||
EGL_PLATFORM_ANGLE_DEVICE_TYPE_SWIFTSHADER_ANGLE.
|
|
||||||
|
|
||||||
If EGL_PLATFORM_ANGLE_DEVICE_TYPE_ANGLE is
|
|
||||||
EGL_PLATFORM_ANGLE_DEVICE_TYPE_SWIFTSHADER_ANGLE and
|
|
||||||
EGL_PLATFORM_ANGLE_TYPE_ANGLE is not
|
|
||||||
EGL_PLATFORM_ANGLE_TYPE_VULKAN_ANGLE then an EGL_BAD_ATTRIBUTE
|
|
||||||
error is generated and EGL_NO_DISPLAY is returned.
|
|
||||||
|
|
||||||
Issues
|
|
||||||
|
|
||||||
None
|
|
||||||
|
|
||||||
Revision History
|
|
||||||
|
|
||||||
Version 1, 2019-08-29 (Jamie Madill)
|
|
||||||
- Initial draft
|
|
|
@ -7,7 +7,6 @@ import("//build/config/sanitizers/sanitizers.gni")
|
||||||
import("//build/config/ui.gni") # import the use_x11 variable
|
import("//build/config/ui.gni") # import the use_x11 variable
|
||||||
import("//build_overrides/angle.gni")
|
import("//build_overrides/angle.gni")
|
||||||
import("//build_overrides/build.gni")
|
import("//build_overrides/build.gni")
|
||||||
import("//build_overrides/swiftshader.gni")
|
|
||||||
import("//testing/test.gni")
|
import("//testing/test.gni")
|
||||||
if (is_android) {
|
if (is_android) {
|
||||||
import("//build/config/android/config.gni")
|
import("//build/config/android/config.gni")
|
||||||
|
|
|
@ -82,11 +82,6 @@
|
||||||
#define EGL_PLATFORM_ANGLE_TYPE_VULKAN_ANGLE 0x3450
|
#define EGL_PLATFORM_ANGLE_TYPE_VULKAN_ANGLE 0x3450
|
||||||
#endif /* EGL_ANGLE_platform_angle_vulkan */
|
#endif /* EGL_ANGLE_platform_angle_vulkan */
|
||||||
|
|
||||||
#ifndef EGL_ANGLE_platform_angle_device_type_swiftshader
|
|
||||||
#define EGL_ANGLE_platform_angle_device_type_swiftshader
|
|
||||||
#define EGL_PLATFORM_ANGLE_DEVICE_TYPE_SWIFTSHADER_ANGLE 0x3487
|
|
||||||
#endif /* EGL_ANGLE_platform_angle_device_type_swiftshader */
|
|
||||||
|
|
||||||
#ifndef EGL_ANGLE_platform_angle_context_virtualization
|
#ifndef EGL_ANGLE_platform_angle_context_virtualization
|
||||||
#define EGL_ANGLE_platform_angle_context_virtualization 1
|
#define EGL_ANGLE_platform_angle_context_virtualization 1
|
||||||
#define EGL_PLATFORM_ANGLE_CONTEXT_VIRTUALIZATION_ANGLE 0x3481
|
#define EGL_PLATFORM_ANGLE_CONTEXT_VIRTUALIZATION_ANGLE 0x3481
|
||||||
|
|
|
@ -28,7 +28,6 @@ def main():
|
||||||
parser.add_argument('target_dir')
|
parser.add_argument('target_dir')
|
||||||
parser.add_argument('version_header', help='path to vulkan_core.h')
|
parser.add_argument('version_header', help='path to vulkan_core.h')
|
||||||
parser.add_argument('json_files', nargs='*')
|
parser.add_argument('json_files', nargs='*')
|
||||||
parser.add_argument('--replacement', help='replacement for the library', default=None)
|
|
||||||
args = parser.parse_args()
|
args = parser.parse_args()
|
||||||
|
|
||||||
source_dir = args.source_dir
|
source_dir = args.source_dir
|
||||||
|
@ -47,8 +46,7 @@ def main():
|
||||||
os.makedirs(target_dir)
|
os.makedirs(target_dir)
|
||||||
|
|
||||||
# Copy the *.json files from source dir to target dir
|
# Copy the *.json files from source dir to target dir
|
||||||
if (set(glob_slash(os.path.join(source_dir, '*.json'))) !=
|
if (set(glob_slash(os.path.join(source_dir, '*.json'))) != set(json_files)):
|
||||||
set(json_files)) and data_key != 'ICD':
|
|
||||||
print(glob.glob(os.path.join(source_dir, '*.json')))
|
print(glob.glob(os.path.join(source_dir, '*.json')))
|
||||||
print('.json list in gn file is out-of-date', file=sys.stderr)
|
print('.json list in gn file is out-of-date', file=sys.stderr)
|
||||||
return 1
|
return 1
|
||||||
|
@ -66,10 +64,7 @@ def main():
|
||||||
# The standard validation layer has no library path.
|
# The standard validation layer has no library path.
|
||||||
if 'library_path' in data[data_key]:
|
if 'library_path' in data[data_key]:
|
||||||
prev_name = os.path.basename(data[data_key]['library_path'])
|
prev_name = os.path.basename(data[data_key]['library_path'])
|
||||||
if args.replacement:
|
data[data_key]['library_path'] = prev_name
|
||||||
data[data_key]['library_path'] = args.replacement
|
|
||||||
else:
|
|
||||||
data[data_key]['library_path'] = prev_name
|
|
||||||
|
|
||||||
target_fname = os.path.join(target_dir, os.path.basename(json_fname))
|
target_fname = os.path.join(target_dir, os.path.basename(json_fname))
|
||||||
with open(target_fname, 'wb') as outfile:
|
with open(target_fname, 'wb') as outfile:
|
||||||
|
@ -78,15 +73,14 @@ def main():
|
||||||
# Get the Vulkan version from the vulkan_core.h file
|
# Get the Vulkan version from the vulkan_core.h file
|
||||||
vk_header_filename = args.version_header
|
vk_header_filename = args.version_header
|
||||||
vk_version = None
|
vk_version = None
|
||||||
if data_key != 'ICD':
|
with open(vk_header_filename) as vk_header_file:
|
||||||
with open(vk_header_filename) as vk_header_file:
|
for line in vk_header_file:
|
||||||
for line in vk_header_file:
|
if line.startswith('#define VK_HEADER_VERSION'):
|
||||||
if line.startswith('#define VK_HEADER_VERSION'):
|
vk_version = line.split()[-1]
|
||||||
vk_version = line.split()[-1]
|
break
|
||||||
break
|
if not vk_version:
|
||||||
if not vk_version:
|
print('failed to extract vk_version', file=sys.stderr)
|
||||||
print('failed to extract vk_version', file=sys.stderr)
|
return 1
|
||||||
return 1
|
|
||||||
|
|
||||||
# Set json file prefix and suffix for generating files, default to Linux.
|
# Set json file prefix and suffix for generating files, default to Linux.
|
||||||
relative_path_prefix = '../lib'
|
relative_path_prefix = '../lib'
|
||||||
|
|
|
@ -1245,25 +1245,24 @@ std::vector<std::string> ClientExtensions::getStrings() const
|
||||||
std::vector<std::string> extensionStrings;
|
std::vector<std::string> extensionStrings;
|
||||||
|
|
||||||
// clang-format off
|
// clang-format off
|
||||||
// | Extension name | Supported flag | Output vector |
|
// | Extension name | Supported flag | Output vector |
|
||||||
InsertExtensionString("EGL_EXT_client_extensions", clientExtensions, &extensionStrings);
|
InsertExtensionString("EGL_EXT_client_extensions", clientExtensions, &extensionStrings);
|
||||||
InsertExtensionString("EGL_EXT_platform_base", platformBase, &extensionStrings);
|
InsertExtensionString("EGL_EXT_platform_base", platformBase, &extensionStrings);
|
||||||
InsertExtensionString("EGL_EXT_platform_device", platformDevice, &extensionStrings);
|
InsertExtensionString("EGL_EXT_platform_device", platformDevice, &extensionStrings);
|
||||||
InsertExtensionString("EGL_ANGLE_platform_angle", platformANGLE, &extensionStrings);
|
InsertExtensionString("EGL_ANGLE_platform_angle", platformANGLE, &extensionStrings);
|
||||||
InsertExtensionString("EGL_ANGLE_platform_angle_d3d", platformANGLED3D, &extensionStrings);
|
InsertExtensionString("EGL_ANGLE_platform_angle_d3d", platformANGLED3D, &extensionStrings);
|
||||||
InsertExtensionString("EGL_ANGLE_platform_angle_device_type_swiftshader", platformANGLEDeviceTypeSwiftShader, &extensionStrings);
|
InsertExtensionString("EGL_ANGLE_platform_angle_opengl", platformANGLEOpenGL, &extensionStrings);
|
||||||
InsertExtensionString("EGL_ANGLE_platform_angle_opengl", platformANGLEOpenGL, &extensionStrings);
|
InsertExtensionString("EGL_ANGLE_platform_angle_null", platformANGLENULL, &extensionStrings);
|
||||||
InsertExtensionString("EGL_ANGLE_platform_angle_null", platformANGLENULL, &extensionStrings);
|
InsertExtensionString("EGL_ANGLE_platform_angle_vulkan", platformANGLEVulkan, &extensionStrings);
|
||||||
InsertExtensionString("EGL_ANGLE_platform_angle_vulkan", platformANGLEVulkan, &extensionStrings);
|
InsertExtensionString("EGL_ANGLE_platform_angle_context_virtualization", platformANGLEContextVirtualization, &extensionStrings);
|
||||||
InsertExtensionString("EGL_ANGLE_platform_angle_context_virtualization", platformANGLEContextVirtualization, &extensionStrings);
|
InsertExtensionString("EGL_ANGLE_device_creation", deviceCreation, &extensionStrings);
|
||||||
InsertExtensionString("EGL_ANGLE_device_creation", deviceCreation, &extensionStrings);
|
InsertExtensionString("EGL_ANGLE_device_creation_d3d11", deviceCreationD3D11, &extensionStrings);
|
||||||
InsertExtensionString("EGL_ANGLE_device_creation_d3d11", deviceCreationD3D11, &extensionStrings);
|
InsertExtensionString("EGL_ANGLE_x11_visual", x11Visual, &extensionStrings);
|
||||||
InsertExtensionString("EGL_ANGLE_x11_visual", x11Visual, &extensionStrings);
|
InsertExtensionString("EGL_ANGLE_experimental_present_path", experimentalPresentPath, &extensionStrings);
|
||||||
InsertExtensionString("EGL_ANGLE_experimental_present_path", experimentalPresentPath, &extensionStrings);
|
InsertExtensionString("EGL_KHR_client_get_all_proc_addresses", clientGetAllProcAddresses, &extensionStrings);
|
||||||
InsertExtensionString("EGL_KHR_client_get_all_proc_addresses", clientGetAllProcAddresses, &extensionStrings);
|
InsertExtensionString("EGL_KHR_debug", debug, &extensionStrings);
|
||||||
InsertExtensionString("EGL_KHR_debug", debug, &extensionStrings);
|
InsertExtensionString("EGL_ANGLE_explicit_context", explicitContext, &extensionStrings);
|
||||||
InsertExtensionString("EGL_ANGLE_explicit_context", explicitContext, &extensionStrings);
|
InsertExtensionString("EGL_ANGLE_feature_control", featureControlANGLE, &extensionStrings);
|
||||||
InsertExtensionString("EGL_ANGLE_feature_control", featureControlANGLE, &extensionStrings);
|
|
||||||
// clang-format on
|
// clang-format on
|
||||||
|
|
||||||
return extensionStrings;
|
return extensionStrings;
|
||||||
|
|
|
@ -996,9 +996,6 @@ struct ClientExtensions
|
||||||
|
|
||||||
// EGL_ANGLE_feature_control
|
// EGL_ANGLE_feature_control
|
||||||
bool featureControlANGLE = false;
|
bool featureControlANGLE = false;
|
||||||
|
|
||||||
// EGL_ANGLE_platform_angle_device_type_swiftshader
|
|
||||||
bool platformANGLEDeviceTypeSwiftShader = false;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace egl
|
} // namespace egl
|
||||||
|
|
|
@ -1240,8 +1240,7 @@ static ClientExtensions GenerateClientExtensions()
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(ANGLE_ENABLE_VULKAN)
|
#if defined(ANGLE_ENABLE_VULKAN)
|
||||||
extensions.platformANGLEVulkan = true;
|
extensions.platformANGLEVulkan = true;
|
||||||
extensions.platformANGLEDeviceTypeSwiftShader = true;
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(ANGLE_USE_X11)
|
#if defined(ANGLE_USE_X11)
|
||||||
|
|
|
@ -1533,7 +1533,7 @@ angle::Result ProgramVk::updateTransformFeedbackDescriptorSet(ContextVk *context
|
||||||
|
|
||||||
void ProgramVk::updateTransformFeedbackDescriptorSetImpl(ContextVk *contextVk)
|
void ProgramVk::updateTransformFeedbackDescriptorSetImpl(ContextVk *contextVk)
|
||||||
{
|
{
|
||||||
const gl::State &glState = contextVk->getState();
|
const gl::State &glState = contextVk->getState();
|
||||||
gl::TransformFeedback *transformFeedback = glState.getCurrentTransformFeedback();
|
gl::TransformFeedback *transformFeedback = glState.getCurrentTransformFeedback();
|
||||||
|
|
||||||
if (!hasTransformFeedbackOutput())
|
if (!hasTransformFeedbackOutput())
|
||||||
|
|
|
@ -39,8 +39,6 @@ namespace
|
||||||
const uint32_t kMockVendorID = 0xba5eba11;
|
const uint32_t kMockVendorID = 0xba5eba11;
|
||||||
const uint32_t kMockDeviceID = 0xf005ba11;
|
const uint32_t kMockDeviceID = 0xf005ba11;
|
||||||
constexpr char kMockDeviceName[] = "Vulkan Mock Device";
|
constexpr char kMockDeviceName[] = "Vulkan Mock Device";
|
||||||
const uint32_t kSwiftShaderDeviceID = 0xC0DE;
|
|
||||||
constexpr char kSwiftShaderDeviceName[] = "SwiftShader Device";
|
|
||||||
constexpr VkFormatFeatureFlags kInvalidFormatFeatureFlags = static_cast<VkFormatFeatureFlags>(-1);
|
constexpr VkFormatFeatureFlags kInvalidFormatFeatureFlags = static_cast<VkFormatFeatureFlags>(-1);
|
||||||
} // anonymous namespace
|
} // anonymous namespace
|
||||||
|
|
||||||
|
@ -73,8 +71,6 @@ vk::ICD ChooseICDFromAttribs(const egl::AttributeMap &attribs)
|
||||||
break;
|
break;
|
||||||
case EGL_PLATFORM_ANGLE_DEVICE_TYPE_NULL_ANGLE:
|
case EGL_PLATFORM_ANGLE_DEVICE_TYPE_NULL_ANGLE:
|
||||||
return vk::ICD::Mock;
|
return vk::ICD::Mock;
|
||||||
case EGL_PLATFORM_ANGLE_DEVICE_TYPE_SWIFTSHADER_ANGLE:
|
|
||||||
return vk::ICD::SwiftShader;
|
|
||||||
default:
|
default:
|
||||||
UNREACHABLE();
|
UNREACHABLE();
|
||||||
break;
|
break;
|
||||||
|
@ -369,13 +365,6 @@ class ScopedVkLoaderEnvironment : angle::NonCopyable
|
||||||
ERR() << "Error setting environment for Mock/Null Driver.";
|
ERR() << "Error setting environment for Mock/Null Driver.";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (icd == vk::ICD::SwiftShader)
|
|
||||||
{
|
|
||||||
if (!setICDEnvironment(ANGLE_VK_SWIFTSHADER_ICD_JSON))
|
|
||||||
{
|
|
||||||
ERR() << "Error setting environment for SwiftShader.";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (mEnableValidationLayers || icd != vk::ICD::Default)
|
if (mEnableValidationLayers || icd != vk::ICD::Default)
|
||||||
{
|
{
|
||||||
const auto &cwd = angle::GetCWD();
|
const auto &cwd = angle::GetCWD();
|
||||||
|
@ -460,48 +449,28 @@ class ScopedVkLoaderEnvironment : angle::NonCopyable
|
||||||
Optional<std::string> mPreviousICDEnv;
|
Optional<std::string> mPreviousICDEnv;
|
||||||
};
|
};
|
||||||
|
|
||||||
using ICDFilterFunc = std::function<bool(const VkPhysicalDeviceProperties &)>;
|
|
||||||
|
|
||||||
ICDFilterFunc GetFilterForICD(vk::ICD preferredICD)
|
|
||||||
{
|
|
||||||
switch (preferredICD)
|
|
||||||
{
|
|
||||||
case vk::ICD::Mock:
|
|
||||||
return [](const VkPhysicalDeviceProperties &deviceProperties) {
|
|
||||||
return ((deviceProperties.vendorID == kMockVendorID) &&
|
|
||||||
(deviceProperties.deviceID == kMockDeviceID) &&
|
|
||||||
(strcmp(deviceProperties.deviceName, kMockDeviceName) == 0));
|
|
||||||
};
|
|
||||||
case vk::ICD::SwiftShader:
|
|
||||||
return [](const VkPhysicalDeviceProperties &deviceProperties) {
|
|
||||||
return ((deviceProperties.vendorID == VENDOR_ID_GOOGLE) &&
|
|
||||||
(deviceProperties.deviceID == kSwiftShaderDeviceID) &&
|
|
||||||
(strcmp(deviceProperties.deviceName, kSwiftShaderDeviceName) == 0));
|
|
||||||
};
|
|
||||||
default:
|
|
||||||
return [](const VkPhysicalDeviceProperties &deviceProperties) { return true; };
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void ChoosePhysicalDevice(const std::vector<VkPhysicalDevice> &physicalDevices,
|
void ChoosePhysicalDevice(const std::vector<VkPhysicalDevice> &physicalDevices,
|
||||||
vk::ICD preferredICD,
|
vk::ICD preferredICD,
|
||||||
VkPhysicalDevice *physicalDeviceOut,
|
VkPhysicalDevice *physicalDeviceOut,
|
||||||
VkPhysicalDeviceProperties *physicalDevicePropertiesOut)
|
VkPhysicalDeviceProperties *physicalDevicePropertiesOut)
|
||||||
{
|
{
|
||||||
ASSERT(!physicalDevices.empty());
|
ASSERT(!physicalDevices.empty());
|
||||||
|
if (preferredICD == vk::ICD::Mock)
|
||||||
ICDFilterFunc filter = GetFilterForICD(preferredICD);
|
|
||||||
|
|
||||||
for (const VkPhysicalDevice &physicalDevice : physicalDevices)
|
|
||||||
{
|
{
|
||||||
vkGetPhysicalDeviceProperties(physicalDevice, physicalDevicePropertiesOut);
|
for (const VkPhysicalDevice &physicalDevice : physicalDevices)
|
||||||
if (filter(*physicalDevicePropertiesOut))
|
|
||||||
{
|
{
|
||||||
*physicalDeviceOut = physicalDevice;
|
vkGetPhysicalDeviceProperties(physicalDevice, physicalDevicePropertiesOut);
|
||||||
return;
|
if ((kMockVendorID == physicalDevicePropertiesOut->vendorID) &&
|
||||||
|
(kMockDeviceID == physicalDevicePropertiesOut->deviceID) &&
|
||||||
|
(strcmp(kMockDeviceName, physicalDevicePropertiesOut->deviceName) == 0))
|
||||||
|
{
|
||||||
|
*physicalDeviceOut = physicalDevice;
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
WARN() << "Vulkan Mock Driver was requested but Mock Device was not found. Using default "
|
||||||
|
"physicalDevice instead.";
|
||||||
}
|
}
|
||||||
WARN() << "Preferred device ICD not found. Using default physicalDevice instead.";
|
|
||||||
|
|
||||||
// Fall back to first device.
|
// Fall back to first device.
|
||||||
*physicalDeviceOut = physicalDevices[0];
|
*physicalDeviceOut = physicalDevices[0];
|
||||||
|
@ -514,8 +483,8 @@ angle::Result WaitFences(vk::Context *context,
|
||||||
{
|
{
|
||||||
uint64_t timeout = block ? kMaxFenceWaitTimeNs : 0;
|
uint64_t timeout = block ? kMaxFenceWaitTimeNs : 0;
|
||||||
|
|
||||||
// Iterate backwards over the fences, removing them from the list in constant time when they
|
// Iterate backwards over the fences, removing them from the list in constant time when they are
|
||||||
// are complete.
|
// complete.
|
||||||
while (!fences->empty())
|
while (!fences->empty())
|
||||||
{
|
{
|
||||||
VkResult result = fences->back().get().wait(context->getDevice(), timeout);
|
VkResult result = fences->back().get().wait(context->getDevice(), timeout);
|
||||||
|
@ -532,7 +501,7 @@ angle::Result WaitFences(vk::Context *context,
|
||||||
return angle::Result::Continue;
|
return angle::Result::Continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace
|
} // anonymous namespace
|
||||||
|
|
||||||
// RendererVk implementation.
|
// RendererVk implementation.
|
||||||
RendererVk::RendererVk()
|
RendererVk::RendererVk()
|
||||||
|
|
|
@ -39,7 +39,7 @@ class FramebufferVk;
|
||||||
namespace vk
|
namespace vk
|
||||||
{
|
{
|
||||||
struct Format;
|
struct Format;
|
||||||
} // namespace vk
|
}
|
||||||
|
|
||||||
// Supports one semaphore from current surface, and one semaphore passed to
|
// Supports one semaphore from current surface, and one semaphore passed to
|
||||||
// glSignalSemaphoreEXT.
|
// glSignalSemaphoreEXT.
|
||||||
|
|
|
@ -108,7 +108,6 @@ enum class ICD
|
||||||
{
|
{
|
||||||
Default,
|
Default,
|
||||||
Mock,
|
Mock,
|
||||||
SwiftShader,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
// Abstracts error handling. Implemented by both ContextVk for GL and DisplayVk for EGL errors.
|
// Abstracts error handling. Implemented by both ContextVk for GL and DisplayVk for EGL errors.
|
||||||
|
|
|
@ -468,14 +468,6 @@ Error ValidateGetPlatformDisplayCommon(EGLenum platform,
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case EGL_PLATFORM_ANGLE_DEVICE_TYPE_SWIFTSHADER_ANGLE:
|
|
||||||
if (!clientExtensions.platformANGLEDeviceTypeSwiftShader)
|
|
||||||
{
|
|
||||||
return EglBadAttribute() << "EGL_ANGLE_platform_angle_device_type_"
|
|
||||||
"swiftshader is not supported";
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
|
|
||||||
default:
|
default:
|
||||||
return EglBadAttribute() << "Invalid value for "
|
return EglBadAttribute() << "Invalid value for "
|
||||||
"EGL_PLATFORM_ANGLE_DEVICE_TYPE_ANGLE "
|
"EGL_PLATFORM_ANGLE_DEVICE_TYPE_ANGLE "
|
||||||
|
@ -571,16 +563,6 @@ Error ValidateGetPlatformDisplayCommon(EGLenum platform,
|
||||||
"EGL_PLATFORM_ANGLE_TYPE_D3D9_ANGLE.";
|
"EGL_PLATFORM_ANGLE_TYPE_D3D9_ANGLE.";
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case EGL_PLATFORM_ANGLE_DEVICE_TYPE_SWIFTSHADER_ANGLE:
|
|
||||||
if (platformType != EGL_PLATFORM_ANGLE_TYPE_VULKAN_ANGLE)
|
|
||||||
{
|
|
||||||
return EglBadAttribute()
|
|
||||||
<< "This device type requires a "
|
|
||||||
"platform type of EGL_PLATFORM_ANGLE_TYPE_VULKAN_ANGLE.";
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
|
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1094,7 +1094,6 @@ ANGLE_INSTANTIATE_TEST(SimpleOperationTest,
|
||||||
ES3_OPENGL(),
|
ES3_OPENGL(),
|
||||||
ES2_OPENGLES(),
|
ES2_OPENGLES(),
|
||||||
ES3_OPENGLES(),
|
ES3_OPENGLES(),
|
||||||
ES2_VULKAN(),
|
ES2_VULKAN());
|
||||||
ES2_VULKAN_SWIFTSHADER());
|
|
||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|
|
@ -141,10 +141,6 @@ std::ostream &operator<<(std::ostream &stream, const PlatformParameters &pp)
|
||||||
stream << "_Warp";
|
stream << "_Warp";
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case EGL_PLATFORM_ANGLE_DEVICE_TYPE_SWIFTSHADER_ANGLE:
|
|
||||||
stream << "_SwiftShader";
|
|
||||||
break;
|
|
||||||
|
|
||||||
default:
|
default:
|
||||||
stream << "_Error";
|
stream << "_Error";
|
||||||
break;
|
break;
|
||||||
|
@ -398,11 +394,6 @@ EGLPlatformParameters VULKAN_NULL()
|
||||||
EGL_PLATFORM_ANGLE_DEVICE_TYPE_NULL_ANGLE);
|
EGL_PLATFORM_ANGLE_DEVICE_TYPE_NULL_ANGLE);
|
||||||
}
|
}
|
||||||
|
|
||||||
EGLPlatformParameters VULKAN_SWIFTSHADER()
|
|
||||||
{
|
|
||||||
return EGLPlatformParameters(EGL_PLATFORM_ANGLE_TYPE_VULKAN_ANGLE, EGL_DONT_CARE, EGL_DONT_CARE,
|
|
||||||
EGL_PLATFORM_ANGLE_DEVICE_TYPE_SWIFTSHADER_ANGLE);
|
|
||||||
}
|
|
||||||
} // namespace egl_platform
|
} // namespace egl_platform
|
||||||
|
|
||||||
// ANGLE tests platforms
|
// ANGLE tests platforms
|
||||||
|
@ -666,11 +657,6 @@ PlatformParameters ES2_VULKAN_NULL()
|
||||||
return PlatformParameters(2, 0, egl_platform::VULKAN_NULL());
|
return PlatformParameters(2, 0, egl_platform::VULKAN_NULL());
|
||||||
}
|
}
|
||||||
|
|
||||||
PlatformParameters ES2_VULKAN_SWIFTSHADER()
|
|
||||||
{
|
|
||||||
return PlatformParameters(2, 0, egl_platform::VULKAN_SWIFTSHADER());
|
|
||||||
}
|
|
||||||
|
|
||||||
PlatformParameters ES3_VULKAN()
|
PlatformParameters ES3_VULKAN()
|
||||||
{
|
{
|
||||||
return PlatformParameters(3, 0, egl_platform::VULKAN());
|
return PlatformParameters(3, 0, egl_platform::VULKAN());
|
||||||
|
|
|
@ -111,7 +111,6 @@ EGLPlatformParameters OPENGL_OR_GLES_NULL();
|
||||||
|
|
||||||
EGLPlatformParameters VULKAN();
|
EGLPlatformParameters VULKAN();
|
||||||
EGLPlatformParameters VULKAN_NULL();
|
EGLPlatformParameters VULKAN_NULL();
|
||||||
EGLPlatformParameters VULKAN_SWIFTSHADER();
|
|
||||||
|
|
||||||
} // namespace egl_platform
|
} // namespace egl_platform
|
||||||
|
|
||||||
|
@ -177,7 +176,6 @@ PlatformParameters ES1_VULKAN();
|
||||||
PlatformParameters ES1_VULKAN_NULL();
|
PlatformParameters ES1_VULKAN_NULL();
|
||||||
PlatformParameters ES2_VULKAN();
|
PlatformParameters ES2_VULKAN();
|
||||||
PlatformParameters ES2_VULKAN_NULL();
|
PlatformParameters ES2_VULKAN_NULL();
|
||||||
PlatformParameters ES2_VULKAN_SWIFTSHADER();
|
|
||||||
PlatformParameters ES3_VULKAN();
|
PlatformParameters ES3_VULKAN();
|
||||||
PlatformParameters ES3_VULKAN_NULL();
|
PlatformParameters ES3_VULKAN_NULL();
|
||||||
PlatformParameters ES31_VULKAN();
|
PlatformParameters ES31_VULKAN();
|
||||||
|
|
|
@ -262,13 +262,6 @@ bool IsConfigWhitelisted(const SystemInfo &systemInfo, const PlatformParameters
|
||||||
case EGL_PLATFORM_ANGLE_TYPE_D3D11_ANGLE:
|
case EGL_PLATFORM_ANGLE_TYPE_D3D11_ANGLE:
|
||||||
case EGL_PLATFORM_ANGLE_TYPE_OPENGL_ANGLE:
|
case EGL_PLATFORM_ANGLE_TYPE_OPENGL_ANGLE:
|
||||||
case EGL_PLATFORM_ANGLE_TYPE_VULKAN_ANGLE:
|
case EGL_PLATFORM_ANGLE_TYPE_VULKAN_ANGLE:
|
||||||
// SwiftShader temporarily disabled on AMD.
|
|
||||||
// TODO(jmadill): Re-enable. http://anglebug.com/3876
|
|
||||||
if (param.eglParameters.deviceType ==
|
|
||||||
EGL_PLATFORM_ANGLE_DEVICE_TYPE_SWIFTSHADER_ANGLE)
|
|
||||||
{
|
|
||||||
return !IsAMD(vendorID);
|
|
||||||
}
|
|
||||||
return true;
|
return true;
|
||||||
case EGL_PLATFORM_ANGLE_TYPE_OPENGLES_ANGLE:
|
case EGL_PLATFORM_ANGLE_TYPE_OPENGLES_ANGLE:
|
||||||
// ES 3.1+ back-end is not supported properly.
|
// ES 3.1+ back-end is not supported properly.
|
||||||
|
|
Загрузка…
Ссылка в новой задаче