* Use vcpkg to build ANGLE
* Use a separate step to build ANGLE for now
* Use the new ANGLE constants
This commit is contained in:
Matthew Leibowitz 2020-03-03 00:09:52 +02:00 коммит произвёл GitHub
Родитель 842d6c7946
Коммит ee0e668235
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
5 изменённых файлов: 75 добавлений и 32 удалений

1
externals/.gitignore поставляемый
Просмотреть файл

@ -1,2 +1,3 @@
angle/
package_cache/
vcpkg/

Просмотреть файл

@ -1,5 +1,7 @@
var SKIP_ANGLE = Argument ("skipAngle", false);
DirectoryPath ROOT_PATH = MakeAbsolute(Directory("../.."));
DirectoryPath ANGLE_PATH = MakeAbsolute(ROOT_PATH.Combine("externals/angle"));
DirectoryPath VCPKG_PATH = MakeAbsolute(ROOT_PATH.Combine("externals/vcpkg"));
DirectoryPath OUTPUT_PATH = MakeAbsolute(ROOT_PATH.Combine("output/native/uwp"));
#load "../../cake/native-shared.cake"
@ -83,25 +85,33 @@ Task("SkiaSharp.Views.Interop.UWP")
Task("ANGLE")
.Does(() =>
{
if (!FileExists(ANGLE_PATH.CombineWithFilePath("uwp/ANGLE.WindowsStore.nuspec"))) {
var id = "ANGLE.WindowsStore";
var version = GetVersion(id, "release");
var angleUrl = $"https://api.nuget.org/v3-flatcontainer/{id.ToLower()}/{version}/{id.ToLower()}.{version}.nupkg";
var angleRoot = ANGLE_PATH.Combine("uwp");
var angleNupkg = angleRoot.CombineWithFilePath($"angle_{version}.nupkg");
if (SKIP_ANGLE)
return;
EnsureDirectoryExists(angleRoot);
CleanDirectory(angleRoot);
if (!DirectoryExists (VCPKG_PATH))
RunProcess ("git", $"clone --depth 1 https://github.com/microsoft/vcpkg.git --branch master --single-branch {VCPKG_PATH}");
DownloadFile(angleUrl, angleNupkg);
Unzip(angleNupkg, angleRoot);
}
var vcpkg = VCPKG_PATH.CombineWithFilePath ("vcpkg.exe");
if (!FileExists (vcpkg))
RunProcess (VCPKG_PATH.CombineWithFilePath ("bootstrap-vcpkg.bat"));
foreach (var arch in new[] { ("arm", "ARM"), ("x86", "Win32"), ("x64", "X64") }) {
var outDir = OUTPUT_PATH.Combine(arch.Item1);
Build("x86");
Build("x64");
Build("arm");
// Build("arm64");
void Build(string arch)
{
if (Skip(arch)) return;
RunProcess (vcpkg, $"install angle:{arch}-uwp");
var outDir = OUTPUT_PATH.Combine(arch);
EnsureDirectoryExists(outDir);
CopyFileToDirectory(ANGLE_PATH.CombineWithFilePath($"uwp/bin/UAP/{arch.Item2}/libEGL.dll"), outDir);
CopyFileToDirectory(ANGLE_PATH.CombineWithFilePath($"uwp/bin/UAP/{arch.Item2}/libGLESv2.dll"), outDir);
CopyFileToDirectory(VCPKG_PATH.CombineWithFilePath ($"installed/{arch}-uwp/bin/libEGL.dll"), outDir);
CopyFileToDirectory(VCPKG_PATH.CombineWithFilePath ($"installed/{arch}-uwp/bin/libEGL.pdb"), outDir);
CopyFileToDirectory(VCPKG_PATH.CombineWithFilePath ($"installed/{arch}-uwp/bin/libGLESv2.dll"), outDir);
CopyFileToDirectory(VCPKG_PATH.CombineWithFilePath ($"installed/{arch}-uwp/bin/libGLESv2.pdb"), outDir);
}
});

Просмотреть файл

@ -85,34 +85,64 @@ stages:
vmImage: $(VM_IMAGE_WINDOWS_NATIVE)
target: externals-tizen
condition: false # TODO: TIZEN INSTALL BUGS
- template: azure-templates-bootstrapper.yml # Build ANGLE UWP|x86 (Windows)
parameters:
name: native_uwp_angle_x86_windows
displayName: Build ANGLE UWP|x86 (Windows)
vmImage: $(VM_IMAGE_WINDOWS)
target: ANGLE
additionalArgs: -Script .\native\uwp\build.cake --buildarch=x86
- template: azure-templates-bootstrapper.yml # Build ANGLE UWP|x64 (Windows)
parameters:
name: native_uwp_angle_x64_windows
displayName: Build ANGLE UWP|x64 (Windows)
vmImage: $(VM_IMAGE_WINDOWS)
target: ANGLE
additionalArgs: -Script .\native\uwp\build.cake --buildarch=x64
- template: azure-templates-bootstrapper.yml # Build ANGLE UWP|arm (Windows)
parameters:
name: native_uwp_angle_arm_windows
displayName: Build ANGLE UWP|arm (Windows)
vmImage: $(VM_IMAGE_WINDOWS)
target: ANGLE
additionalArgs: -Script .\native\uwp\build.cake --buildarch=arm
- template: azure-templates-bootstrapper.yml # Build ANGLE UWP|arm64 (Windows)
parameters:
name: native_uwp_angle_arm64_windows
displayName: Build ANGLE UWP|arm64 (Windows)
vmImage: $(VM_IMAGE_WINDOWS)
target: ANGLE
additionalArgs: -Script .\native\uwp\build.cake --buildarch=arm64
condition: false # TODO: NOT YET SUPPORTED
- template: azure-templates-bootstrapper.yml # Build Native UWP|x86 (Windows)
parameters:
name: native_uwp_x86_windows
displayName: Build Native UWP|x86 (Windows)
vmImage: $(VM_IMAGE_WINDOWS_NATIVE)
target: externals-uwp
additionalArgs: --buildarch=x86
additionalArgs: --buildarch=x86 --skipAngle=true
- template: azure-templates-bootstrapper.yml # Build Native UWP|x64 (Windows)
parameters:
name: native_uwp_x64_windows
displayName: Build Native UWP|x64 (Windows)
vmImage: $(VM_IMAGE_WINDOWS_NATIVE)
target: externals-uwp
additionalArgs: --buildarch=x64
additionalArgs: --buildarch=x64 --skipAngle=true
- template: azure-templates-bootstrapper.yml # Build Native UWP|arm (Windows)
parameters:
name: native_uwp_arm_windows
displayName: Build Native UWP|arm (Windows)
vmImage: $(VM_IMAGE_WINDOWS_NATIVE)
target: externals-uwp
additionalArgs: --buildarch=arm
additionalArgs: --buildarch=arm --skipAngle=true
- template: azure-templates-bootstrapper.yml # Build Native UWP|arm64 (Windows)
parameters:
name: native_uwp_arm64_windows
displayName: Build Native UWP|arm64 (Windows)
vmImage: $(VM_IMAGE_WINDOWS_NATIVE)
target: externals-uwp
additionalArgs: --buildarch=arm64
additionalArgs: --buildarch=arm64 --skipAngle=true
condition: false # TODO: NOT YET SUPPORTED
- template: azure-templates-bootstrapper.yml # Build Native Win32|x86 (Windows)
parameters:
name: native_win32_x86_windows
@ -240,10 +270,14 @@ stages:
- native_android_arm64_windows
# - native_tizen_windows
- native_tizen_linux
- native_uwp_angle_x86_windows
- native_uwp_angle_x64_windows
- native_uwp_angle_arm_windows
# - native_uwp_angle_arm64_windows
- native_uwp_x86_windows
- native_uwp_x64_windows
- native_uwp_arm_windows
- native_uwp_arm64_windows
# - native_uwp_arm64_windows
- native_win32_x86_windows
- native_win32_x64_windows
- native_win32_x64_nanoserver_windows

Просмотреть файл

@ -58,8 +58,9 @@ namespace SkiaSharp.Views.GlesInterop
public const int EGL_SWAP_BEHAVIOR_PRESERVED_BIT = 0x0400;
// ANGLE
public const int EGL_ANGLE_DISPLAY_ALLOW_RENDER_TO_BACK_BUFFER = 0x320B;
public const int EGL_ANGLE_SURFACE_RENDER_TO_BACK_BUFFER = 0x320C;
public const int EGL_EXPERIMENTAL_PRESENT_PATH_ANGLE = 0x33A4;
public const int EGL_EXPERIMENTAL_PRESENT_PATH_FAST_ANGLE = 0x33AA;
public const int EGL_EXPERIMENTAL_PRESENT_PATH_COPY_ANGLE = 0x33AA;
public const int EGL_PLATFORM_ANGLE_TYPE_ANGLE = 0x3203;
public const int EGL_PLATFORM_ANGLE_MAX_VERSION_MAJOR_ANGLE = 0x3204;
@ -72,8 +73,8 @@ namespace SkiaSharp.Views.GlesInterop
public const int EGL_PLATFORM_ANGLE_TYPE_D3D11_ANGLE = 0x3208;
public const int EGL_PLATFORM_ANGLE_DEVICE_TYPE_ANGLE = 0x3209;
public const int EGL_PLATFORM_ANGLE_DEVICE_TYPE_HARDWARE_ANGLE = 0x320A;
public const int EGL_PLATFORM_ANGLE_DEVICE_TYPE_WARP_ANGLE = 0x320B;
public const int EGL_PLATFORM_ANGLE_DEVICE_TYPE_REFERENCE_ANGLE = 0x320C;
public const int EGL_PLATFORM_ANGLE_DEVICE_TYPE_D3D_WARP_ANGLE = 0x320B;
public const int EGL_PLATFORM_ANGLE_DEVICE_TYPE_D3D_REFERENCE_ANGLE = 0x320C;
public const int EGL_PLATFORM_ANGLE_ENABLE_AUTOMATIC_TRIM_ANGLE = 0x320F;
public const int EGL_FIXED_SIZE_ANGLE = 0x3201;

Просмотреть файл

@ -72,9 +72,6 @@ namespace SkiaSharp.Views.GlesInterop
int[] surfaceAttributes = new[]
{
// EGL_ANGLE_SURFACE_RENDER_TO_BACK_BUFFER is part of the same optimization as EGL_ANGLE_DISPLAY_ALLOW_RENDER_TO_BACK_BUFFER (see above).
// If you have compilation issues with it then please update your Visual Studio templates.
Egl.EGL_ANGLE_SURFACE_RENDER_TO_BACK_BUFFER, Egl.EGL_TRUE,
Egl.EGL_NONE
};
@ -169,7 +166,7 @@ namespace SkiaSharp.Views.GlesInterop
// EGL_ANGLE_DISPLAY_ALLOW_RENDER_TO_BACK_BUFFER is an optimization that can have large performance benefits on mobile devices.
// Its syntax is subject to change, though. Please update your Visual Studio templates if you experience compilation issues with it.
Egl.EGL_ANGLE_DISPLAY_ALLOW_RENDER_TO_BACK_BUFFER, Egl.EGL_TRUE,
Egl.EGL_EXPERIMENTAL_PRESENT_PATH_ANGLE, Egl.EGL_EXPERIMENTAL_PRESENT_PATH_FAST_ANGLE,
// EGL_PLATFORM_ANGLE_ENABLE_AUTOMATIC_TRIM_ANGLE is an option that enables ANGLE to automatically call
// the IDXGIDevice3::Trim method on behalf of the application when it gets suspended.
@ -185,7 +182,7 @@ namespace SkiaSharp.Views.GlesInterop
Egl.EGL_PLATFORM_ANGLE_TYPE_ANGLE, Egl.EGL_PLATFORM_ANGLE_TYPE_D3D11_ANGLE,
Egl.EGL_PLATFORM_ANGLE_MAX_VERSION_MAJOR_ANGLE, 9,
Egl.EGL_PLATFORM_ANGLE_MAX_VERSION_MINOR_ANGLE, 3,
Egl.EGL_ANGLE_DISPLAY_ALLOW_RENDER_TO_BACK_BUFFER, Egl.EGL_TRUE,
Egl.EGL_EXPERIMENTAL_PRESENT_PATH_ANGLE, Egl.EGL_EXPERIMENTAL_PRESENT_PATH_FAST_ANGLE,
Egl.EGL_PLATFORM_ANGLE_ENABLE_AUTOMATIC_TRIM_ANGLE, Egl.EGL_TRUE,
Egl.EGL_NONE,
};
@ -195,8 +192,8 @@ namespace SkiaSharp.Views.GlesInterop
// These attributes can be used to request D3D11 WARP.
// They are used if eglInitialize fails with both the default display attributes and the 9_3 display attributes.
Egl.EGL_PLATFORM_ANGLE_TYPE_ANGLE, Egl.EGL_PLATFORM_ANGLE_TYPE_D3D11_ANGLE,
Egl.EGL_PLATFORM_ANGLE_DEVICE_TYPE_ANGLE, Egl.EGL_PLATFORM_ANGLE_DEVICE_TYPE_WARP_ANGLE,
Egl.EGL_ANGLE_DISPLAY_ALLOW_RENDER_TO_BACK_BUFFER, Egl.EGL_TRUE,
Egl.EGL_PLATFORM_ANGLE_DEVICE_TYPE_ANGLE, Egl.EGL_PLATFORM_ANGLE_DEVICE_TYPE_D3D_WARP_ANGLE,
Egl.EGL_EXPERIMENTAL_PRESENT_PATH_ANGLE, Egl.EGL_EXPERIMENTAL_PRESENT_PATH_FAST_ANGLE,
Egl.EGL_PLATFORM_ANGLE_ENABLE_AUTOMATIC_TRIM_ANGLE, Egl.EGL_TRUE,
Egl.EGL_NONE,
};