mirror of
https://github.com/godotengine/godot-angle-static.git
synced 2026-01-06 02:09:55 +03:00
Reland "Make ANGLE program version only dependent on data that matters"
This is a reland of commit c303758fbc
Changes made on top of original commit
1. Enable execution permission on python script
program_serialize_data_version.py
2. Remove unused list in libGLESv2.gni
3. In angle/BUILD.gn, change file path from
"relative to angle_root", to "relative to root_build_dir",
so that inside the script program_serialize_data_version.py,
we don't have to find the absolute path of the code files for
hashing.
Original change's description
> This change introduces a new variable ANGLE_PROGRAM_VERSION
> to track the version of ANGLE source files that affect shader
> program serialization/deserialization. This change include more
> source files than necessary, to serve the purpose of a conservative
> jumping off point. We will narrow down the list of files for
> ANGLE_PROGRAM_VERSION hash generation in the future.
> Add a new script program_serialize_data_version.py that will
> be triggered during the build when the related source files changed.
> The script will generate a hash and the hash size from the related
> source files. In program serialization/deserialization and cache
> key generation, we will use this hash value instead of the entire
> ANGLE git hash. When the hash value changed, we know that the
> related source files changed, and we should invalidate the program
> cache and re-generate the blob cache / program binary.
> Bug: angleproject:4981
> Change-Id: I2fb609416738d459d3289190c232c2d797ba58e3
> Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4072215
> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
> Reviewed-by: Cody Northrop <cnorthrop@google.com>
> Reviewed-by: Jamie Madill <jmadill@chromium.org>
> Commit-Queue: Yuxin Hu <yuxinhu@google.com>
Bug: angleproject:4981
Change-Id: Iaa9eb0ab33439197bc30d03064fc245ea7ef1ea8
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4113445
Reviewed-by: Amirali Abdolrashidi <abdolrashidi@google.com>
Reviewed-by: Cody Northrop <cnorthrop@google.com>
Commit-Queue: Yuxin Hu <yuxinhu@google.com>
This commit is contained in:
38
BUILD.gn
38
BUILD.gn
@@ -94,6 +94,7 @@ if (angle_build_all) {
|
||||
}
|
||||
}
|
||||
|
||||
import("src/angle_program_serialize_data_version.gni")
|
||||
import("src/compiler.gni")
|
||||
import("src/libGLESv2.gni")
|
||||
|
||||
@@ -779,6 +780,33 @@ angle_source_set("translator_fuzzer") {
|
||||
deps = [ ":translator" ]
|
||||
}
|
||||
|
||||
config("angle_program_version_id_config") {
|
||||
include_dirs = [ "$root_gen_dir/angle" ]
|
||||
visibility = [ ":angle_program_version_id" ]
|
||||
}
|
||||
|
||||
action("angle_program_version_id") {
|
||||
write_file(
|
||||
"$root_gen_dir/angle_code_affecting_program_serialize",
|
||||
rebase_path(angle_code_affecting_program_serialize, root_build_dir))
|
||||
|
||||
_program_version_header = "$root_gen_dir/angle/ANGLEShaderProgramVersion.h"
|
||||
script = "src/program_serialize_data_version.py"
|
||||
outputs = [ _program_version_header ]
|
||||
|
||||
visibility = [ ":angle_version" ]
|
||||
|
||||
inputs = angle_code_affecting_program_serialize
|
||||
|
||||
args = [
|
||||
rebase_path(_program_version_header, root_build_dir),
|
||||
rebase_path("$root_gen_dir/angle_code_affecting_program_serialize",
|
||||
root_build_dir),
|
||||
]
|
||||
|
||||
public_configs = [ ":angle_program_version_id_config" ]
|
||||
}
|
||||
|
||||
config("angle_commit_id_config") {
|
||||
include_dirs = [ "$root_gen_dir/angle" ]
|
||||
visibility = [ ":angle_commit_id" ]
|
||||
@@ -823,7 +851,10 @@ action("angle_commit_id") {
|
||||
|
||||
angle_source_set("angle_version") {
|
||||
sources = [ "src/common/angle_version.h" ]
|
||||
public_deps = [ ":angle_commit_id" ]
|
||||
public_deps = [
|
||||
":angle_commit_id",
|
||||
":angle_program_version_id",
|
||||
]
|
||||
visibility = [ ":angle_version_info" ]
|
||||
|
||||
# The version headers are used directly in Windows .RC files.
|
||||
@@ -849,7 +880,10 @@ angle_source_set("angle_version_info") {
|
||||
"src/common/angle_version_info.cpp",
|
||||
"src/common/angle_version_info.h",
|
||||
]
|
||||
deps = [ ":angle_version" ]
|
||||
deps = [
|
||||
":angle_translator_headers",
|
||||
":angle_version",
|
||||
]
|
||||
}
|
||||
|
||||
config("angle_backend_config") {
|
||||
|
||||
58
src/angle_program_serialize_data_version.gni
Normal file
58
src/angle_program_serialize_data_version.gni
Normal file
@@ -0,0 +1,58 @@
|
||||
# Copyright 2022 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.
|
||||
|
||||
# Define a list of source files that ANGLE_PROGRAM_VERSION hash value is
|
||||
# generated from. When any of the files listed below changes, the
|
||||
# ANGLE_PROGRAM_VERSION should change and we will invalidate shader program
|
||||
# cache blobs: applications will compile shader programs from scratch and not
|
||||
# loading from blob caches.
|
||||
|
||||
# The path of all the files added to angle_code_affecting_program_serialize
|
||||
# must be relative to angle_root.
|
||||
|
||||
import("libANGLE/renderer/d3d/d3d_backend.gni")
|
||||
import("libANGLE/renderer/gl/gl_backend.gni")
|
||||
import("libANGLE/renderer/metal/metal_backend.gni")
|
||||
import("libANGLE/renderer/null/null_backend.gni")
|
||||
import("libANGLE/renderer/vulkan/vulkan_backend.gni")
|
||||
import("libGLESv2.gni")
|
||||
|
||||
angle_code_affecting_program_serialize = libangle_common_sources
|
||||
angle_code_affecting_program_serialize += libangle_headers
|
||||
angle_code_affecting_program_serialize += libangle_sources
|
||||
angle_code_affecting_program_serialize += libangle_includes
|
||||
|
||||
vulkan_backend_dir = "libANGLE/renderer/vulkan/"
|
||||
angle_code_affecting_program_serialize +=
|
||||
rebase_path(vulkan_backend_sources, angle_root, vulkan_backend_dir)
|
||||
|
||||
gl_backend_dir = "libANGLE/renderer/gl/"
|
||||
angle_code_affecting_program_serialize +=
|
||||
rebase_path(gl_backend_sources, angle_root, gl_backend_dir)
|
||||
|
||||
d3d_backend_dir = "libANGLE/renderer/d3d/"
|
||||
angle_code_affecting_program_serialize +=
|
||||
rebase_path(d3d_shared_sources, angle_root, d3d_backend_dir)
|
||||
|
||||
if (angle_enable_d3d9) {
|
||||
angle_code_affecting_program_serialize +=
|
||||
rebase_path(d3d9_backend_sources, angle_root, d3d_backend_dir)
|
||||
}
|
||||
|
||||
if (angle_enable_d3d11) {
|
||||
angle_code_affecting_program_serialize +=
|
||||
rebase_path(d3d11_backend_sources, angle_root, d3d_backend_dir)
|
||||
}
|
||||
|
||||
null_backend_dir = "libANGLE/renderer/null/"
|
||||
angle_code_affecting_program_serialize +=
|
||||
rebase_path(null_backend_sources, angle_root, null_backend_dir)
|
||||
|
||||
metal_backend_dir = "libANGLE/renderer/metal/"
|
||||
angle_code_affecting_program_serialize +=
|
||||
rebase_path(metal_backend_sources, angle_root, metal_backend_dir)
|
||||
|
||||
if (angle_has_frame_capture) {
|
||||
angle_code_affecting_program_serialize += libangle_capture_sources
|
||||
}
|
||||
@@ -8,6 +8,7 @@
|
||||
#ifndef COMMON_ANGLE_VERSION_H_
|
||||
#define COMMON_ANGLE_VERSION_H_
|
||||
|
||||
#include "ANGLEShaderProgramVersion.h"
|
||||
#include "angle_commit.h"
|
||||
|
||||
#define ANGLE_MAJOR_VERSION 2
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
//
|
||||
// angle_version_info.cpp: ANGLE version queries.
|
||||
|
||||
#include "GLSLANG/ShaderLang.h"
|
||||
#include "common/angle_version.h"
|
||||
|
||||
namespace angle
|
||||
@@ -29,6 +30,21 @@ int GetANGLECommitHashSize()
|
||||
return ANGLE_COMMIT_HASH_SIZE;
|
||||
}
|
||||
|
||||
const char *GetANGLEShaderProgramVersion()
|
||||
{
|
||||
return ANGLE_PROGRAM_VERSION;
|
||||
}
|
||||
|
||||
int GetANGLEShaderProgramVersionHashSize()
|
||||
{
|
||||
return ANGLE_PROGRAM_VERSION_HASH_SIZE;
|
||||
}
|
||||
|
||||
int GetANGLESHVersion()
|
||||
{
|
||||
return ANGLE_SH_VERSION;
|
||||
}
|
||||
|
||||
bool GetANGLEHasBinaryLoading()
|
||||
{
|
||||
#ifdef ANGLE_HAS_BINARY_LOADING
|
||||
|
||||
@@ -15,6 +15,9 @@ const char *GetANGLEVersionString();
|
||||
const char *GetANGLECommitHash();
|
||||
int GetANGLECommitHashSize();
|
||||
bool GetANGLEHasBinaryLoading();
|
||||
const char *GetANGLEShaderProgramVersion();
|
||||
int GetANGLEShaderProgramVersionHashSize();
|
||||
int GetANGLESHVersion();
|
||||
} // namespace angle
|
||||
|
||||
#endif // COMMON_VERSION_INFO_H_
|
||||
|
||||
@@ -113,8 +113,9 @@ void MemoryProgramCache::ComputeHash(const Context *context,
|
||||
}
|
||||
|
||||
// Add some ANGLE metadata and Context properties, such as version and back-end.
|
||||
hashStream << angle::GetANGLECommitHash() << context->getClientMajorVersion()
|
||||
<< context->getClientMinorVersion() << context->getString(GL_RENDERER);
|
||||
hashStream << angle::GetANGLEShaderProgramVersion() << angle::GetANGLESHVersion()
|
||||
<< context->getClientMajorVersion() << context->getClientMinorVersion()
|
||||
<< context->getString(GL_RENDERER);
|
||||
|
||||
// Hash pre-link program properties.
|
||||
hashStream << program->getAttributeBindings() << program->getUniformLocationBindings()
|
||||
|
||||
@@ -3490,8 +3490,11 @@ angle::Result Program::serialize(const Context *context, angle::MemoryBuffer *bi
|
||||
{
|
||||
BinaryOutputStream stream;
|
||||
|
||||
stream.writeBytes(reinterpret_cast<const unsigned char *>(angle::GetANGLECommitHash()),
|
||||
angle::GetANGLECommitHashSize());
|
||||
stream.writeBytes(
|
||||
reinterpret_cast<const unsigned char *>(angle::GetANGLEShaderProgramVersion()),
|
||||
angle::GetANGLEShaderProgramVersionHashSize());
|
||||
|
||||
stream.writeInt(angle::GetANGLESHVersion());
|
||||
|
||||
// nullptr context is supported when computing binary length.
|
||||
if (context)
|
||||
@@ -3585,14 +3588,24 @@ angle::Result Program::deserialize(const Context *context,
|
||||
BinaryInputStream &stream,
|
||||
InfoLog &infoLog)
|
||||
{
|
||||
std::vector<uint8_t> commitString(angle::GetANGLECommitHashSize(), 0);
|
||||
stream.readBytes(commitString.data(), commitString.size());
|
||||
if (memcmp(commitString.data(), angle::GetANGLECommitHash(), commitString.size()) != 0)
|
||||
std::vector<uint8_t> angleShaderProgramVersionString(
|
||||
angle::GetANGLEShaderProgramVersionHashSize(), 0);
|
||||
stream.readBytes(angleShaderProgramVersionString.data(),
|
||||
angleShaderProgramVersionString.size());
|
||||
if (memcmp(angleShaderProgramVersionString.data(), angle::GetANGLEShaderProgramVersion(),
|
||||
angleShaderProgramVersionString.size()) != 0)
|
||||
{
|
||||
infoLog << "Invalid program binary version.";
|
||||
return angle::Result::Stop;
|
||||
}
|
||||
|
||||
int angleSHVersion = stream.readInt<int>();
|
||||
if (angleSHVersion != angle::GetANGLESHVersion())
|
||||
{
|
||||
infoLog << "cannot load program binaries across different angle sh version.";
|
||||
return angle::Result::Stop;
|
||||
}
|
||||
|
||||
int majorVersion = stream.readInt<int>();
|
||||
int minorVersion = stream.readInt<int>();
|
||||
if (majorVersion != context->getClientMajorVersion() ||
|
||||
|
||||
@@ -5,289 +5,16 @@
|
||||
# This file houses the build configuration for the ANGLE D3D back-ends.
|
||||
|
||||
import("../../../../gni/angle.gni")
|
||||
import("d3d_backend.gni")
|
||||
|
||||
assert(angle_enable_d3d11 || angle_enable_d3d9)
|
||||
|
||||
_d3d_shared_sources = [
|
||||
"BufferD3D.cpp",
|
||||
"BufferD3D.h",
|
||||
"CompilerD3D.cpp",
|
||||
"CompilerD3D.h",
|
||||
"ContextD3D.h",
|
||||
"DeviceD3D.cpp",
|
||||
"DeviceD3D.h",
|
||||
"DisplayD3D.cpp",
|
||||
"DisplayD3D.h",
|
||||
"DynamicHLSL.cpp",
|
||||
"DynamicHLSL.h",
|
||||
"DynamicImage2DHLSL.cpp",
|
||||
"DynamicImage2DHLSL.h",
|
||||
"EGLImageD3D.cpp",
|
||||
"EGLImageD3D.h",
|
||||
"FramebufferD3D.cpp",
|
||||
"FramebufferD3D.h",
|
||||
"HLSLCompiler.cpp",
|
||||
"HLSLCompiler.h",
|
||||
"ImageD3D.cpp",
|
||||
"ImageD3D.h",
|
||||
"IndexBuffer.cpp",
|
||||
"IndexBuffer.h",
|
||||
"IndexDataManager.cpp",
|
||||
"IndexDataManager.h",
|
||||
"NativeWindowD3D.cpp",
|
||||
"NativeWindowD3D.h",
|
||||
"ProgramD3D.cpp",
|
||||
"ProgramD3D.h",
|
||||
"RenderTargetD3D.cpp",
|
||||
"RenderTargetD3D.h",
|
||||
"RenderbufferD3D.cpp",
|
||||
"RenderbufferD3D.h",
|
||||
"RendererD3D.cpp",
|
||||
"RendererD3D.h",
|
||||
"SamplerD3D.h",
|
||||
"ShaderD3D.cpp",
|
||||
"ShaderD3D.h",
|
||||
"ShaderExecutableD3D.cpp",
|
||||
"ShaderExecutableD3D.h",
|
||||
"SurfaceD3D.cpp",
|
||||
"SurfaceD3D.h",
|
||||
"SwapChainD3D.cpp",
|
||||
"SwapChainD3D.h",
|
||||
"TextureD3D.cpp",
|
||||
"TextureD3D.h",
|
||||
"TextureStorage.h",
|
||||
"VertexBuffer.cpp",
|
||||
"VertexBuffer.h",
|
||||
"VertexDataManager.cpp",
|
||||
"VertexDataManager.h",
|
||||
"driver_utils_d3d.cpp",
|
||||
"driver_utils_d3d.h",
|
||||
"formatutilsD3D.h",
|
||||
]
|
||||
|
||||
if (!angle_is_winuwp) {
|
||||
_d3d_shared_sources += [
|
||||
"../../../third_party/systeminfo/SystemInfo.cpp",
|
||||
"../../../third_party/systeminfo/SystemInfo.h",
|
||||
]
|
||||
}
|
||||
|
||||
if (angle_enable_d3d9) {
|
||||
_d3d9_backend_sources = [
|
||||
"d3d9/Blit9.cpp",
|
||||
"d3d9/Blit9.h",
|
||||
"d3d9/Buffer9.cpp",
|
||||
"d3d9/Buffer9.h",
|
||||
"d3d9/Context9.cpp",
|
||||
"d3d9/Context9.h",
|
||||
"d3d9/DebugAnnotator9.cpp",
|
||||
"d3d9/DebugAnnotator9.h",
|
||||
"d3d9/Fence9.cpp",
|
||||
"d3d9/Fence9.h",
|
||||
"d3d9/Framebuffer9.cpp",
|
||||
"d3d9/Framebuffer9.h",
|
||||
"d3d9/Image9.cpp",
|
||||
"d3d9/Image9.h",
|
||||
"d3d9/IndexBuffer9.cpp",
|
||||
"d3d9/IndexBuffer9.h",
|
||||
"d3d9/NativeWindow9.cpp",
|
||||
"d3d9/NativeWindow9.h",
|
||||
"d3d9/Query9.cpp",
|
||||
"d3d9/Query9.h",
|
||||
"d3d9/RenderTarget9.cpp",
|
||||
"d3d9/RenderTarget9.h",
|
||||
"d3d9/Renderer9.cpp",
|
||||
"d3d9/Renderer9.h",
|
||||
"d3d9/ShaderCache.h",
|
||||
"d3d9/ShaderExecutable9.cpp",
|
||||
"d3d9/ShaderExecutable9.h",
|
||||
"d3d9/StateManager9.cpp",
|
||||
"d3d9/StateManager9.h",
|
||||
"d3d9/SwapChain9.cpp",
|
||||
"d3d9/SwapChain9.h",
|
||||
"d3d9/TextureStorage9.cpp",
|
||||
"d3d9/TextureStorage9.h",
|
||||
"d3d9/VertexArray9.h",
|
||||
"d3d9/VertexBuffer9.cpp",
|
||||
"d3d9/VertexBuffer9.h",
|
||||
"d3d9/VertexDeclarationCache.cpp",
|
||||
"d3d9/VertexDeclarationCache.h",
|
||||
"d3d9/formatutils9.cpp",
|
||||
"d3d9/formatutils9.h",
|
||||
"d3d9/renderer9_utils.cpp",
|
||||
"d3d9/renderer9_utils.h",
|
||||
"d3d9/shaders/compiled/componentmaskpremultps.h",
|
||||
"d3d9/shaders/compiled/componentmaskps.h",
|
||||
"d3d9/shaders/compiled/componentmaskunmultps.h",
|
||||
"d3d9/shaders/compiled/luminancepremultps.h",
|
||||
"d3d9/shaders/compiled/luminanceps.h",
|
||||
"d3d9/shaders/compiled/luminanceunmultps.h",
|
||||
"d3d9/shaders/compiled/passthroughps.h",
|
||||
"d3d9/shaders/compiled/standardvs.h",
|
||||
"d3d9/vertexconversion.h",
|
||||
]
|
||||
}
|
||||
|
||||
if (angle_enable_d3d11) {
|
||||
_d3d11_backend_sources = [
|
||||
"d3d11/Blit11.cpp",
|
||||
"d3d11/Blit11.h",
|
||||
"d3d11/Blit11Helper_autogen.inc",
|
||||
"d3d11/Buffer11.cpp",
|
||||
"d3d11/Buffer11.h",
|
||||
"d3d11/Clear11.cpp",
|
||||
"d3d11/Clear11.h",
|
||||
"d3d11/Context11.cpp",
|
||||
"d3d11/Context11.h",
|
||||
"d3d11/DebugAnnotator11.cpp",
|
||||
"d3d11/DebugAnnotator11.h",
|
||||
"d3d11/ExternalImageSiblingImpl11.cpp",
|
||||
"d3d11/ExternalImageSiblingImpl11.h",
|
||||
"d3d11/Fence11.cpp",
|
||||
"d3d11/Fence11.h",
|
||||
"d3d11/Framebuffer11.cpp",
|
||||
"d3d11/Framebuffer11.h",
|
||||
"d3d11/Image11.cpp",
|
||||
"d3d11/Image11.h",
|
||||
"d3d11/IndexBuffer11.cpp",
|
||||
"d3d11/IndexBuffer11.h",
|
||||
"d3d11/InputLayoutCache.cpp",
|
||||
"d3d11/InputLayoutCache.h",
|
||||
"d3d11/MappedSubresourceVerifier11.cpp",
|
||||
"d3d11/MappedSubresourceVerifier11.h",
|
||||
"d3d11/NativeWindow11.h",
|
||||
"d3d11/PixelTransfer11.cpp",
|
||||
"d3d11/PixelTransfer11.h",
|
||||
"d3d11/Program11.cpp",
|
||||
"d3d11/Program11.h",
|
||||
"d3d11/ProgramPipeline11.cpp",
|
||||
"d3d11/ProgramPipeline11.h",
|
||||
"d3d11/Query11.cpp",
|
||||
"d3d11/Query11.h",
|
||||
"d3d11/RenderStateCache.cpp",
|
||||
"d3d11/RenderStateCache.h",
|
||||
"d3d11/RenderTarget11.cpp",
|
||||
"d3d11/RenderTarget11.h",
|
||||
"d3d11/Renderer11.cpp",
|
||||
"d3d11/Renderer11.h",
|
||||
"d3d11/ResourceManager11.cpp",
|
||||
"d3d11/ResourceManager11.h",
|
||||
"d3d11/ShaderExecutable11.cpp",
|
||||
"d3d11/ShaderExecutable11.h",
|
||||
"d3d11/StateManager11.cpp",
|
||||
"d3d11/StateManager11.h",
|
||||
"d3d11/StreamProducerD3DTexture.cpp",
|
||||
"d3d11/StreamProducerD3DTexture.h",
|
||||
"d3d11/SwapChain11.cpp",
|
||||
"d3d11/SwapChain11.h",
|
||||
"d3d11/TextureStorage11.cpp",
|
||||
"d3d11/TextureStorage11.h",
|
||||
"d3d11/TransformFeedback11.cpp",
|
||||
"d3d11/TransformFeedback11.h",
|
||||
"d3d11/Trim11.cpp",
|
||||
"d3d11/Trim11.h",
|
||||
"d3d11/VertexArray11.cpp",
|
||||
"d3d11/VertexArray11.h",
|
||||
"d3d11/VertexBuffer11.cpp",
|
||||
"d3d11/VertexBuffer11.h",
|
||||
"d3d11/formatutils11.cpp",
|
||||
"d3d11/formatutils11.h",
|
||||
"d3d11/renderer11_utils.cpp",
|
||||
"d3d11/renderer11_utils.h",
|
||||
"d3d11/shaders/compiled/buffertotexture11_gs.h",
|
||||
"d3d11/shaders/compiled/buffertotexture11_ps_4f.h",
|
||||
"d3d11/shaders/compiled/buffertotexture11_ps_4i.h",
|
||||
"d3d11/shaders/compiled/buffertotexture11_ps_4ui.h",
|
||||
"d3d11/shaders/compiled/buffertotexture11_vs.h",
|
||||
"d3d11/shaders/compiled/clear11_fl9vs.h",
|
||||
"d3d11/shaders/compiled/clear11multiviewgs.h",
|
||||
"d3d11/shaders/compiled/clear11multiviewvs.h",
|
||||
"d3d11/shaders/compiled/clear11vs.h",
|
||||
"d3d11/shaders/compiled/cleardepth11ps.h",
|
||||
"d3d11/shaders/compiled/clearfloat11_fl9ps.h",
|
||||
"d3d11/shaders/compiled/clearfloat11ps1.h",
|
||||
"d3d11/shaders/compiled/clearfloat11ps2.h",
|
||||
"d3d11/shaders/compiled/clearfloat11ps3.h",
|
||||
"d3d11/shaders/compiled/clearfloat11ps4.h",
|
||||
"d3d11/shaders/compiled/clearfloat11ps5.h",
|
||||
"d3d11/shaders/compiled/clearfloat11ps6.h",
|
||||
"d3d11/shaders/compiled/clearfloat11ps7.h",
|
||||
"d3d11/shaders/compiled/clearfloat11ps8.h",
|
||||
"d3d11/shaders/compiled/clearsint11ps1.h",
|
||||
"d3d11/shaders/compiled/clearsint11ps2.h",
|
||||
"d3d11/shaders/compiled/clearsint11ps3.h",
|
||||
"d3d11/shaders/compiled/clearsint11ps4.h",
|
||||
"d3d11/shaders/compiled/clearsint11ps5.h",
|
||||
"d3d11/shaders/compiled/clearsint11ps6.h",
|
||||
"d3d11/shaders/compiled/clearsint11ps7.h",
|
||||
"d3d11/shaders/compiled/clearsint11ps8.h",
|
||||
"d3d11/shaders/compiled/clearuint11ps1.h",
|
||||
"d3d11/shaders/compiled/clearuint11ps2.h",
|
||||
"d3d11/shaders/compiled/clearuint11ps3.h",
|
||||
"d3d11/shaders/compiled/clearuint11ps4.h",
|
||||
"d3d11/shaders/compiled/clearuint11ps5.h",
|
||||
"d3d11/shaders/compiled/clearuint11ps6.h",
|
||||
"d3d11/shaders/compiled/clearuint11ps7.h",
|
||||
"d3d11/shaders/compiled/clearuint11ps8.h",
|
||||
"d3d11/shaders/compiled/passthrough2d11vs.h",
|
||||
"d3d11/shaders/compiled/passthrough3d11gs.h",
|
||||
"d3d11/shaders/compiled/passthrough3d11vs.h",
|
||||
"d3d11/shaders/compiled/passthroughdepth2d11ps.h",
|
||||
"d3d11/shaders/compiled/passthroughrgba2dms11ps.h",
|
||||
"d3d11/shaders/compiled/resolvecolor2dps.h",
|
||||
"d3d11/shaders/compiled/resolvedepth11_ps.h",
|
||||
"d3d11/shaders/compiled/resolvedepthstencil11_ps.h",
|
||||
"d3d11/shaders/compiled/resolvedepthstencil11_vs.h",
|
||||
"d3d11/shaders/compiled/resolvestencil11_ps.h",
|
||||
"d3d11/shaders/compiled/swizzlef2darrayps.h",
|
||||
"d3d11/shaders/compiled/swizzlef2dps.h",
|
||||
"d3d11/shaders/compiled/swizzlef3dps.h",
|
||||
"d3d11/shaders/compiled/swizzlei2darrayps.h",
|
||||
"d3d11/shaders/compiled/swizzlei2dps.h",
|
||||
"d3d11/shaders/compiled/swizzlei3dps.h",
|
||||
"d3d11/shaders/compiled/swizzleui2darrayps.h",
|
||||
"d3d11/shaders/compiled/swizzleui2dps.h",
|
||||
"d3d11/shaders/compiled/swizzleui3dps.h",
|
||||
"d3d11/texture_format_table.cpp",
|
||||
"d3d11/texture_format_table.h",
|
||||
"d3d11/texture_format_table_autogen.cpp",
|
||||
"d3d11/texture_format_table_utils.h",
|
||||
]
|
||||
|
||||
if (angle_is_winuwp) {
|
||||
_d3d11_backend_sources += [
|
||||
"d3d11/winrt/CoreWindowNativeWindow.cpp",
|
||||
"d3d11/winrt/CoreWindowNativeWindow.h",
|
||||
"d3d11/winrt/InspectableNativeWindow.cpp",
|
||||
"d3d11/winrt/InspectableNativeWindow.h",
|
||||
"d3d11/winrt/NativeWindow11WinRT.cpp",
|
||||
"d3d11/winrt/NativeWindow11WinRT.h",
|
||||
"d3d11/winrt/SwapChainPanelNativeWindow.cpp",
|
||||
"d3d11/winrt/SwapChainPanelNativeWindow.h",
|
||||
]
|
||||
} else {
|
||||
_d3d11_backend_sources += [
|
||||
"d3d11/win32/NativeWindow11Win32.cpp",
|
||||
"d3d11/win32/NativeWindow11Win32.h",
|
||||
]
|
||||
}
|
||||
if (angle_enable_d3d11_compositor_native_window) {
|
||||
_d3d11_backend_sources += [
|
||||
"d3d11/converged/CompositorNativeWindow11.cpp",
|
||||
"d3d11/converged/CompositorNativeWindow11.h",
|
||||
]
|
||||
}
|
||||
|
||||
import("d3d11/d3d11_blit_shaders_autogen.gni")
|
||||
_d3d11_backend_sources += libangle_d3d11_blit_shaders
|
||||
}
|
||||
|
||||
config("angle_d3d_shared_config") {
|
||||
defines = [ "ANGLE_PRELOADED_D3DCOMPILER_MODULE_NAMES={ " + "\"d3dcompiler_47.dll\", \"d3dcompiler_46.dll\", \"d3dcompiler_43.dll\" }" ]
|
||||
}
|
||||
|
||||
angle_source_set("angle_d3d_shared") {
|
||||
sources = _d3d_shared_sources
|
||||
sources = d3d_shared_sources
|
||||
public_deps = [
|
||||
"$angle_root:angle_d3d_format_tables",
|
||||
"$angle_root:angle_gpu_info_util",
|
||||
@@ -304,7 +31,7 @@ if (angle_enable_d3d9) {
|
||||
}
|
||||
|
||||
angle_source_set("angle_d3d9_backend") {
|
||||
sources = _d3d9_backend_sources
|
||||
sources = d3d9_backend_sources
|
||||
libs = [
|
||||
"d3d9.lib",
|
||||
"delayimp.lib",
|
||||
@@ -323,7 +50,7 @@ if (angle_enable_d3d11) {
|
||||
}
|
||||
|
||||
angle_source_set("angle_d3d11_backend") {
|
||||
sources = _d3d11_backend_sources
|
||||
sources = d3d11_backend_sources
|
||||
|
||||
libs = [ "dxguid.lib" ]
|
||||
|
||||
|
||||
281
src/libANGLE/renderer/d3d/d3d_backend.gni
Normal file
281
src/libANGLE/renderer/d3d/d3d_backend.gni
Normal file
@@ -0,0 +1,281 @@
|
||||
# Copyright 2022 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.
|
||||
|
||||
import("../../../../gni/angle.gni")
|
||||
|
||||
d3d_shared_sources = [
|
||||
"BufferD3D.cpp",
|
||||
"BufferD3D.h",
|
||||
"CompilerD3D.cpp",
|
||||
"CompilerD3D.h",
|
||||
"ContextD3D.h",
|
||||
"DeviceD3D.cpp",
|
||||
"DeviceD3D.h",
|
||||
"DisplayD3D.cpp",
|
||||
"DisplayD3D.h",
|
||||
"DynamicHLSL.cpp",
|
||||
"DynamicHLSL.h",
|
||||
"DynamicImage2DHLSL.cpp",
|
||||
"DynamicImage2DHLSL.h",
|
||||
"EGLImageD3D.cpp",
|
||||
"EGLImageD3D.h",
|
||||
"FramebufferD3D.cpp",
|
||||
"FramebufferD3D.h",
|
||||
"HLSLCompiler.cpp",
|
||||
"HLSLCompiler.h",
|
||||
"ImageD3D.cpp",
|
||||
"ImageD3D.h",
|
||||
"IndexBuffer.cpp",
|
||||
"IndexBuffer.h",
|
||||
"IndexDataManager.cpp",
|
||||
"IndexDataManager.h",
|
||||
"NativeWindowD3D.cpp",
|
||||
"NativeWindowD3D.h",
|
||||
"ProgramD3D.cpp",
|
||||
"ProgramD3D.h",
|
||||
"RenderTargetD3D.cpp",
|
||||
"RenderTargetD3D.h",
|
||||
"RenderbufferD3D.cpp",
|
||||
"RenderbufferD3D.h",
|
||||
"RendererD3D.cpp",
|
||||
"RendererD3D.h",
|
||||
"SamplerD3D.h",
|
||||
"ShaderD3D.cpp",
|
||||
"ShaderD3D.h",
|
||||
"ShaderExecutableD3D.cpp",
|
||||
"ShaderExecutableD3D.h",
|
||||
"SurfaceD3D.cpp",
|
||||
"SurfaceD3D.h",
|
||||
"SwapChainD3D.cpp",
|
||||
"SwapChainD3D.h",
|
||||
"TextureD3D.cpp",
|
||||
"TextureD3D.h",
|
||||
"TextureStorage.h",
|
||||
"VertexBuffer.cpp",
|
||||
"VertexBuffer.h",
|
||||
"VertexDataManager.cpp",
|
||||
"VertexDataManager.h",
|
||||
"driver_utils_d3d.cpp",
|
||||
"driver_utils_d3d.h",
|
||||
"formatutilsD3D.h",
|
||||
]
|
||||
|
||||
if (!angle_is_winuwp) {
|
||||
d3d_shared_sources += [
|
||||
"../../../third_party/systeminfo/SystemInfo.cpp",
|
||||
"../../../third_party/systeminfo/SystemInfo.h",
|
||||
]
|
||||
}
|
||||
|
||||
if (angle_enable_d3d9) {
|
||||
d3d9_backend_sources = [
|
||||
"d3d9/Blit9.cpp",
|
||||
"d3d9/Blit9.h",
|
||||
"d3d9/Buffer9.cpp",
|
||||
"d3d9/Buffer9.h",
|
||||
"d3d9/Context9.cpp",
|
||||
"d3d9/Context9.h",
|
||||
"d3d9/DebugAnnotator9.cpp",
|
||||
"d3d9/DebugAnnotator9.h",
|
||||
"d3d9/Fence9.cpp",
|
||||
"d3d9/Fence9.h",
|
||||
"d3d9/Framebuffer9.cpp",
|
||||
"d3d9/Framebuffer9.h",
|
||||
"d3d9/Image9.cpp",
|
||||
"d3d9/Image9.h",
|
||||
"d3d9/IndexBuffer9.cpp",
|
||||
"d3d9/IndexBuffer9.h",
|
||||
"d3d9/NativeWindow9.cpp",
|
||||
"d3d9/NativeWindow9.h",
|
||||
"d3d9/Query9.cpp",
|
||||
"d3d9/Query9.h",
|
||||
"d3d9/RenderTarget9.cpp",
|
||||
"d3d9/RenderTarget9.h",
|
||||
"d3d9/Renderer9.cpp",
|
||||
"d3d9/Renderer9.h",
|
||||
"d3d9/ShaderCache.h",
|
||||
"d3d9/ShaderExecutable9.cpp",
|
||||
"d3d9/ShaderExecutable9.h",
|
||||
"d3d9/StateManager9.cpp",
|
||||
"d3d9/StateManager9.h",
|
||||
"d3d9/SwapChain9.cpp",
|
||||
"d3d9/SwapChain9.h",
|
||||
"d3d9/TextureStorage9.cpp",
|
||||
"d3d9/TextureStorage9.h",
|
||||
"d3d9/VertexArray9.h",
|
||||
"d3d9/VertexBuffer9.cpp",
|
||||
"d3d9/VertexBuffer9.h",
|
||||
"d3d9/VertexDeclarationCache.cpp",
|
||||
"d3d9/VertexDeclarationCache.h",
|
||||
"d3d9/formatutils9.cpp",
|
||||
"d3d9/formatutils9.h",
|
||||
"d3d9/renderer9_utils.cpp",
|
||||
"d3d9/renderer9_utils.h",
|
||||
"d3d9/shaders/compiled/componentmaskpremultps.h",
|
||||
"d3d9/shaders/compiled/componentmaskps.h",
|
||||
"d3d9/shaders/compiled/componentmaskunmultps.h",
|
||||
"d3d9/shaders/compiled/luminancepremultps.h",
|
||||
"d3d9/shaders/compiled/luminanceps.h",
|
||||
"d3d9/shaders/compiled/luminanceunmultps.h",
|
||||
"d3d9/shaders/compiled/passthroughps.h",
|
||||
"d3d9/shaders/compiled/standardvs.h",
|
||||
"d3d9/vertexconversion.h",
|
||||
]
|
||||
}
|
||||
|
||||
if (angle_enable_d3d11) {
|
||||
d3d11_backend_sources = [
|
||||
"d3d11/Blit11.cpp",
|
||||
"d3d11/Blit11.h",
|
||||
"d3d11/Blit11Helper_autogen.inc",
|
||||
"d3d11/Buffer11.cpp",
|
||||
"d3d11/Buffer11.h",
|
||||
"d3d11/Clear11.cpp",
|
||||
"d3d11/Clear11.h",
|
||||
"d3d11/Context11.cpp",
|
||||
"d3d11/Context11.h",
|
||||
"d3d11/DebugAnnotator11.cpp",
|
||||
"d3d11/DebugAnnotator11.h",
|
||||
"d3d11/ExternalImageSiblingImpl11.cpp",
|
||||
"d3d11/ExternalImageSiblingImpl11.h",
|
||||
"d3d11/Fence11.cpp",
|
||||
"d3d11/Fence11.h",
|
||||
"d3d11/Framebuffer11.cpp",
|
||||
"d3d11/Framebuffer11.h",
|
||||
"d3d11/Image11.cpp",
|
||||
"d3d11/Image11.h",
|
||||
"d3d11/IndexBuffer11.cpp",
|
||||
"d3d11/IndexBuffer11.h",
|
||||
"d3d11/InputLayoutCache.cpp",
|
||||
"d3d11/InputLayoutCache.h",
|
||||
"d3d11/MappedSubresourceVerifier11.cpp",
|
||||
"d3d11/MappedSubresourceVerifier11.h",
|
||||
"d3d11/NativeWindow11.h",
|
||||
"d3d11/PixelTransfer11.cpp",
|
||||
"d3d11/PixelTransfer11.h",
|
||||
"d3d11/Program11.cpp",
|
||||
"d3d11/Program11.h",
|
||||
"d3d11/ProgramPipeline11.cpp",
|
||||
"d3d11/ProgramPipeline11.h",
|
||||
"d3d11/Query11.cpp",
|
||||
"d3d11/Query11.h",
|
||||
"d3d11/RenderStateCache.cpp",
|
||||
"d3d11/RenderStateCache.h",
|
||||
"d3d11/RenderTarget11.cpp",
|
||||
"d3d11/RenderTarget11.h",
|
||||
"d3d11/Renderer11.cpp",
|
||||
"d3d11/Renderer11.h",
|
||||
"d3d11/ResourceManager11.cpp",
|
||||
"d3d11/ResourceManager11.h",
|
||||
"d3d11/ShaderExecutable11.cpp",
|
||||
"d3d11/ShaderExecutable11.h",
|
||||
"d3d11/StateManager11.cpp",
|
||||
"d3d11/StateManager11.h",
|
||||
"d3d11/StreamProducerD3DTexture.cpp",
|
||||
"d3d11/StreamProducerD3DTexture.h",
|
||||
"d3d11/SwapChain11.cpp",
|
||||
"d3d11/SwapChain11.h",
|
||||
"d3d11/TextureStorage11.cpp",
|
||||
"d3d11/TextureStorage11.h",
|
||||
"d3d11/TransformFeedback11.cpp",
|
||||
"d3d11/TransformFeedback11.h",
|
||||
"d3d11/Trim11.cpp",
|
||||
"d3d11/Trim11.h",
|
||||
"d3d11/VertexArray11.cpp",
|
||||
"d3d11/VertexArray11.h",
|
||||
"d3d11/VertexBuffer11.cpp",
|
||||
"d3d11/VertexBuffer11.h",
|
||||
"d3d11/formatutils11.cpp",
|
||||
"d3d11/formatutils11.h",
|
||||
"d3d11/renderer11_utils.cpp",
|
||||
"d3d11/renderer11_utils.h",
|
||||
"d3d11/shaders/compiled/buffertotexture11_gs.h",
|
||||
"d3d11/shaders/compiled/buffertotexture11_ps_4f.h",
|
||||
"d3d11/shaders/compiled/buffertotexture11_ps_4i.h",
|
||||
"d3d11/shaders/compiled/buffertotexture11_ps_4ui.h",
|
||||
"d3d11/shaders/compiled/buffertotexture11_vs.h",
|
||||
"d3d11/shaders/compiled/clear11_fl9vs.h",
|
||||
"d3d11/shaders/compiled/clear11multiviewgs.h",
|
||||
"d3d11/shaders/compiled/clear11multiviewvs.h",
|
||||
"d3d11/shaders/compiled/clear11vs.h",
|
||||
"d3d11/shaders/compiled/cleardepth11ps.h",
|
||||
"d3d11/shaders/compiled/clearfloat11_fl9ps.h",
|
||||
"d3d11/shaders/compiled/clearfloat11ps1.h",
|
||||
"d3d11/shaders/compiled/clearfloat11ps2.h",
|
||||
"d3d11/shaders/compiled/clearfloat11ps3.h",
|
||||
"d3d11/shaders/compiled/clearfloat11ps4.h",
|
||||
"d3d11/shaders/compiled/clearfloat11ps5.h",
|
||||
"d3d11/shaders/compiled/clearfloat11ps6.h",
|
||||
"d3d11/shaders/compiled/clearfloat11ps7.h",
|
||||
"d3d11/shaders/compiled/clearfloat11ps8.h",
|
||||
"d3d11/shaders/compiled/clearsint11ps1.h",
|
||||
"d3d11/shaders/compiled/clearsint11ps2.h",
|
||||
"d3d11/shaders/compiled/clearsint11ps3.h",
|
||||
"d3d11/shaders/compiled/clearsint11ps4.h",
|
||||
"d3d11/shaders/compiled/clearsint11ps5.h",
|
||||
"d3d11/shaders/compiled/clearsint11ps6.h",
|
||||
"d3d11/shaders/compiled/clearsint11ps7.h",
|
||||
"d3d11/shaders/compiled/clearsint11ps8.h",
|
||||
"d3d11/shaders/compiled/clearuint11ps1.h",
|
||||
"d3d11/shaders/compiled/clearuint11ps2.h",
|
||||
"d3d11/shaders/compiled/clearuint11ps3.h",
|
||||
"d3d11/shaders/compiled/clearuint11ps4.h",
|
||||
"d3d11/shaders/compiled/clearuint11ps5.h",
|
||||
"d3d11/shaders/compiled/clearuint11ps6.h",
|
||||
"d3d11/shaders/compiled/clearuint11ps7.h",
|
||||
"d3d11/shaders/compiled/clearuint11ps8.h",
|
||||
"d3d11/shaders/compiled/passthrough2d11vs.h",
|
||||
"d3d11/shaders/compiled/passthrough3d11gs.h",
|
||||
"d3d11/shaders/compiled/passthrough3d11vs.h",
|
||||
"d3d11/shaders/compiled/passthroughdepth2d11ps.h",
|
||||
"d3d11/shaders/compiled/passthroughrgba2dms11ps.h",
|
||||
"d3d11/shaders/compiled/resolvecolor2dps.h",
|
||||
"d3d11/shaders/compiled/resolvedepth11_ps.h",
|
||||
"d3d11/shaders/compiled/resolvedepthstencil11_ps.h",
|
||||
"d3d11/shaders/compiled/resolvedepthstencil11_vs.h",
|
||||
"d3d11/shaders/compiled/resolvestencil11_ps.h",
|
||||
"d3d11/shaders/compiled/swizzlef2darrayps.h",
|
||||
"d3d11/shaders/compiled/swizzlef2dps.h",
|
||||
"d3d11/shaders/compiled/swizzlef3dps.h",
|
||||
"d3d11/shaders/compiled/swizzlei2darrayps.h",
|
||||
"d3d11/shaders/compiled/swizzlei2dps.h",
|
||||
"d3d11/shaders/compiled/swizzlei3dps.h",
|
||||
"d3d11/shaders/compiled/swizzleui2darrayps.h",
|
||||
"d3d11/shaders/compiled/swizzleui2dps.h",
|
||||
"d3d11/shaders/compiled/swizzleui3dps.h",
|
||||
"d3d11/texture_format_table.cpp",
|
||||
"d3d11/texture_format_table.h",
|
||||
"d3d11/texture_format_table_autogen.cpp",
|
||||
"d3d11/texture_format_table_utils.h",
|
||||
]
|
||||
|
||||
if (angle_is_winuwp) {
|
||||
d3d11_backend_sources += [
|
||||
"d3d11/winrt/CoreWindowNativeWindow.cpp",
|
||||
"d3d11/winrt/CoreWindowNativeWindow.h",
|
||||
"d3d11/winrt/InspectableNativeWindow.cpp",
|
||||
"d3d11/winrt/InspectableNativeWindow.h",
|
||||
"d3d11/winrt/NativeWindow11WinRT.cpp",
|
||||
"d3d11/winrt/NativeWindow11WinRT.h",
|
||||
"d3d11/winrt/SwapChainPanelNativeWindow.cpp",
|
||||
"d3d11/winrt/SwapChainPanelNativeWindow.h",
|
||||
]
|
||||
} else {
|
||||
d3d11_backend_sources += [
|
||||
"d3d11/win32/NativeWindow11Win32.cpp",
|
||||
"d3d11/win32/NativeWindow11Win32.h",
|
||||
]
|
||||
}
|
||||
if (angle_enable_d3d11_compositor_native_window) {
|
||||
d3d11_backend_sources += [
|
||||
"d3d11/converged/CompositorNativeWindow11.cpp",
|
||||
"d3d11/converged/CompositorNativeWindow11.h",
|
||||
]
|
||||
}
|
||||
|
||||
import("d3d11/d3d11_blit_shaders_autogen.gni")
|
||||
foreach(item, libangle_d3d11_blit_shaders) {
|
||||
d3d11_backend_sources += [ "" + item ]
|
||||
}
|
||||
}
|
||||
@@ -5,6 +5,7 @@
|
||||
# This file houses the build configuration for the ANGLE GL back-ends.
|
||||
|
||||
import("../../../../gni/angle.gni")
|
||||
import("gl_backend.gni")
|
||||
|
||||
if (angle_has_build && ozone_platform_gbm) {
|
||||
import("//build/config/linux/pkg_config.gni")
|
||||
@@ -12,210 +13,6 @@ if (angle_has_build && ozone_platform_gbm) {
|
||||
|
||||
assert(angle_enable_gl)
|
||||
|
||||
declare_args() {
|
||||
angle_enable_gl_null = true
|
||||
}
|
||||
|
||||
_gl_backend_sources = [
|
||||
"BlitGL.cpp",
|
||||
"BlitGL.h",
|
||||
"BufferGL.cpp",
|
||||
"BufferGL.h",
|
||||
"ClearMultiviewGL.cpp",
|
||||
"ClearMultiviewGL.h",
|
||||
"CompilerGL.cpp",
|
||||
"CompilerGL.h",
|
||||
"ContextGL.cpp",
|
||||
"ContextGL.h",
|
||||
"DispatchTableGL_autogen.cpp",
|
||||
"DispatchTableGL_autogen.h",
|
||||
"DisplayGL.cpp",
|
||||
"DisplayGL.h",
|
||||
"FenceNVGL.cpp",
|
||||
"FenceNVGL.h",
|
||||
"FramebufferGL.cpp",
|
||||
"FramebufferGL.h",
|
||||
"FunctionsGL.cpp",
|
||||
"FunctionsGL.h",
|
||||
"ImageGL.cpp",
|
||||
"ImageGL.h",
|
||||
"MemoryObjectGL.cpp",
|
||||
"MemoryObjectGL.h",
|
||||
"PLSProgramCache.cpp",
|
||||
"PLSProgramCache.h",
|
||||
"ProgramGL.cpp",
|
||||
"ProgramGL.h",
|
||||
"ProgramPipelineGL.cpp",
|
||||
"ProgramPipelineGL.h",
|
||||
"QueryGL.cpp",
|
||||
"QueryGL.h",
|
||||
"RenderbufferGL.cpp",
|
||||
"RenderbufferGL.h",
|
||||
"RendererGL.cpp",
|
||||
"RendererGL.h",
|
||||
"SamplerGL.cpp",
|
||||
"SamplerGL.h",
|
||||
"SemaphoreGL.cpp",
|
||||
"SemaphoreGL.h",
|
||||
"ShaderGL.cpp",
|
||||
"ShaderGL.h",
|
||||
"StateManagerGL.cpp",
|
||||
"StateManagerGL.h",
|
||||
"SurfaceGL.cpp",
|
||||
"SurfaceGL.h",
|
||||
"SyncGL.cpp",
|
||||
"SyncGL.h",
|
||||
"TextureGL.cpp",
|
||||
"TextureGL.h",
|
||||
"TransformFeedbackGL.cpp",
|
||||
"TransformFeedbackGL.h",
|
||||
"VertexArrayGL.cpp",
|
||||
"VertexArrayGL.h",
|
||||
"formatutilsgl.cpp",
|
||||
"formatutilsgl.h",
|
||||
"functionsgl_enums.h",
|
||||
"functionsgl_typedefs.h",
|
||||
"renderergl_utils.cpp",
|
||||
"renderergl_utils.h",
|
||||
]
|
||||
|
||||
if (is_win) {
|
||||
_gl_backend_sources += [
|
||||
"../../../third_party/khronos/GL/wglext.h",
|
||||
"wgl/ContextWGL.cpp",
|
||||
"wgl/ContextWGL.h",
|
||||
"wgl/D3DTextureSurfaceWGL.cpp",
|
||||
"wgl/D3DTextureSurfaceWGL.h",
|
||||
"wgl/DXGISwapChainWindowSurfaceWGL.cpp",
|
||||
"wgl/DXGISwapChainWindowSurfaceWGL.h",
|
||||
"wgl/DisplayWGL.cpp",
|
||||
"wgl/DisplayWGL.h",
|
||||
"wgl/FunctionsWGL.cpp",
|
||||
"wgl/FunctionsWGL.h",
|
||||
"wgl/PbufferSurfaceWGL.cpp",
|
||||
"wgl/PbufferSurfaceWGL.h",
|
||||
"wgl/RendererWGL.cpp",
|
||||
"wgl/RendererWGL.h",
|
||||
"wgl/SurfaceWGL.h",
|
||||
"wgl/WindowSurfaceWGL.cpp",
|
||||
"wgl/WindowSurfaceWGL.h",
|
||||
"wgl/functionswgl_typedefs.h",
|
||||
"wgl/wgl_utils.cpp",
|
||||
"wgl/wgl_utils.h",
|
||||
]
|
||||
}
|
||||
|
||||
if (angle_use_x11) {
|
||||
_gl_backend_sources += [
|
||||
"glx/DisplayGLX.cpp",
|
||||
"glx/DisplayGLX.h",
|
||||
"glx/FunctionsGLX.cpp",
|
||||
"glx/FunctionsGLX.h",
|
||||
"glx/PbufferSurfaceGLX.cpp",
|
||||
"glx/PbufferSurfaceGLX.h",
|
||||
"glx/PixmapSurfaceGLX.cpp",
|
||||
"glx/PixmapSurfaceGLX.h",
|
||||
"glx/RendererGLX.cpp",
|
||||
"glx/RendererGLX.h",
|
||||
"glx/SurfaceGLX.h",
|
||||
"glx/WindowSurfaceGLX.cpp",
|
||||
"glx/WindowSurfaceGLX.h",
|
||||
"glx/functionsglx_typedefs.h",
|
||||
"glx/glx_utils.cpp",
|
||||
"glx/glx_utils.h",
|
||||
"glx/platform_glx.h",
|
||||
]
|
||||
}
|
||||
|
||||
if (is_android || is_linux || is_chromeos) {
|
||||
_gl_backend_sources += [
|
||||
"egl/ContextEGL.cpp",
|
||||
"egl/ContextEGL.h",
|
||||
"egl/DeviceEGL.cpp",
|
||||
"egl/DeviceEGL.h",
|
||||
"egl/DisplayEGL.cpp",
|
||||
"egl/DisplayEGL.h",
|
||||
"egl/DmaBufImageSiblingEGL.cpp",
|
||||
"egl/DmaBufImageSiblingEGL.h",
|
||||
"egl/ExternalImageSiblingEGL.h",
|
||||
"egl/FunctionsEGL.cpp",
|
||||
"egl/FunctionsEGL.h",
|
||||
"egl/FunctionsEGLDL.cpp",
|
||||
"egl/FunctionsEGLDL.h",
|
||||
"egl/ImageEGL.cpp",
|
||||
"egl/ImageEGL.h",
|
||||
"egl/PbufferSurfaceEGL.cpp",
|
||||
"egl/PbufferSurfaceEGL.h",
|
||||
"egl/RendererEGL.cpp",
|
||||
"egl/RendererEGL.h",
|
||||
"egl/SurfaceEGL.cpp",
|
||||
"egl/SurfaceEGL.h",
|
||||
"egl/SyncEGL.cpp",
|
||||
"egl/SyncEGL.h",
|
||||
"egl/WindowSurfaceEGL.cpp",
|
||||
"egl/WindowSurfaceEGL.h",
|
||||
"egl/egl_utils.cpp",
|
||||
"egl/egl_utils.h",
|
||||
"egl/functionsegl_typedefs.h",
|
||||
]
|
||||
}
|
||||
|
||||
if (is_android) {
|
||||
_gl_backend_sources += [
|
||||
"egl/android/DisplayAndroid.cpp",
|
||||
"egl/android/DisplayAndroid.h",
|
||||
"egl/android/NativeBufferImageSiblingAndroid.cpp",
|
||||
"egl/android/NativeBufferImageSiblingAndroid.h",
|
||||
]
|
||||
}
|
||||
|
||||
if (angle_enable_cgl) {
|
||||
_gl_backend_sources += [
|
||||
"cgl/ContextCGL.cpp",
|
||||
"cgl/ContextCGL.h",
|
||||
"cgl/DeviceCGL.cpp",
|
||||
"cgl/DeviceCGL.h",
|
||||
"cgl/DisplayCGL.h",
|
||||
"cgl/DisplayCGL.mm",
|
||||
"cgl/IOSurfaceSurfaceCGL.cpp",
|
||||
"cgl/IOSurfaceSurfaceCGL.h",
|
||||
"cgl/PbufferSurfaceCGL.cpp",
|
||||
"cgl/PbufferSurfaceCGL.h",
|
||||
"cgl/RendererCGL.cpp",
|
||||
"cgl/RendererCGL.h",
|
||||
"cgl/WindowSurfaceCGL.h",
|
||||
"cgl/WindowSurfaceCGL.mm",
|
||||
]
|
||||
}
|
||||
|
||||
if (angle_enable_eagl) {
|
||||
_gl_backend_sources += [
|
||||
"eagl/ContextEAGL.cpp",
|
||||
"eagl/ContextEAGL.h",
|
||||
"eagl/DeviceEAGL.cpp",
|
||||
"eagl/DeviceEAGL.h",
|
||||
"eagl/DisplayEAGL.h",
|
||||
"eagl/DisplayEAGL.mm",
|
||||
"eagl/FunctionsEAGL.h",
|
||||
"eagl/FunctionsEAGL.mm",
|
||||
"eagl/IOSurfaceSurfaceEAGL.h",
|
||||
"eagl/IOSurfaceSurfaceEAGL.mm",
|
||||
"eagl/PbufferSurfaceEAGL.cpp",
|
||||
"eagl/PbufferSurfaceEAGL.h",
|
||||
"eagl/RendererEAGL.cpp",
|
||||
"eagl/RendererEAGL.h",
|
||||
"eagl/WindowSurfaceEAGL.h",
|
||||
"eagl/WindowSurfaceEAGL.mm",
|
||||
]
|
||||
}
|
||||
|
||||
if (angle_enable_gl_null) {
|
||||
_gl_backend_sources += [
|
||||
"null_functions.cpp",
|
||||
"null_functions.h",
|
||||
]
|
||||
}
|
||||
|
||||
config("angle_gl_backend_config") {
|
||||
defines = [ "ANGLE_ENABLE_OPENGL" ]
|
||||
if (angle_enable_gl_desktop_backend) {
|
||||
@@ -234,7 +31,7 @@ config("angle_gl_backend_config") {
|
||||
}
|
||||
|
||||
angle_source_set("angle_gl_backend") {
|
||||
sources = _gl_backend_sources
|
||||
sources = gl_backend_sources
|
||||
|
||||
public_configs = [ ":angle_gl_backend_config" ]
|
||||
public_deps = [ "$angle_root:libANGLE_headers" ]
|
||||
|
||||
209
src/libANGLE/renderer/gl/gl_backend.gni
Normal file
209
src/libANGLE/renderer/gl/gl_backend.gni
Normal file
@@ -0,0 +1,209 @@
|
||||
# Copyright 2022 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.
|
||||
|
||||
import("../../../../gni/angle.gni")
|
||||
|
||||
declare_args() {
|
||||
angle_enable_gl_null = true
|
||||
}
|
||||
|
||||
gl_backend_sources = [
|
||||
"BlitGL.cpp",
|
||||
"BlitGL.h",
|
||||
"BufferGL.cpp",
|
||||
"BufferGL.h",
|
||||
"ClearMultiviewGL.cpp",
|
||||
"ClearMultiviewGL.h",
|
||||
"CompilerGL.cpp",
|
||||
"CompilerGL.h",
|
||||
"ContextGL.cpp",
|
||||
"ContextGL.h",
|
||||
"DispatchTableGL_autogen.cpp",
|
||||
"DispatchTableGL_autogen.h",
|
||||
"DisplayGL.cpp",
|
||||
"DisplayGL.h",
|
||||
"FenceNVGL.cpp",
|
||||
"FenceNVGL.h",
|
||||
"FramebufferGL.cpp",
|
||||
"FramebufferGL.h",
|
||||
"FunctionsGL.cpp",
|
||||
"FunctionsGL.h",
|
||||
"ImageGL.cpp",
|
||||
"ImageGL.h",
|
||||
"MemoryObjectGL.cpp",
|
||||
"MemoryObjectGL.h",
|
||||
"PLSProgramCache.cpp",
|
||||
"PLSProgramCache.h",
|
||||
"ProgramGL.cpp",
|
||||
"ProgramGL.h",
|
||||
"ProgramPipelineGL.cpp",
|
||||
"ProgramPipelineGL.h",
|
||||
"QueryGL.cpp",
|
||||
"QueryGL.h",
|
||||
"RenderbufferGL.cpp",
|
||||
"RenderbufferGL.h",
|
||||
"RendererGL.cpp",
|
||||
"RendererGL.h",
|
||||
"SamplerGL.cpp",
|
||||
"SamplerGL.h",
|
||||
"SemaphoreGL.cpp",
|
||||
"SemaphoreGL.h",
|
||||
"ShaderGL.cpp",
|
||||
"ShaderGL.h",
|
||||
"StateManagerGL.cpp",
|
||||
"StateManagerGL.h",
|
||||
"SurfaceGL.cpp",
|
||||
"SurfaceGL.h",
|
||||
"SyncGL.cpp",
|
||||
"SyncGL.h",
|
||||
"TextureGL.cpp",
|
||||
"TextureGL.h",
|
||||
"TransformFeedbackGL.cpp",
|
||||
"TransformFeedbackGL.h",
|
||||
"VertexArrayGL.cpp",
|
||||
"VertexArrayGL.h",
|
||||
"formatutilsgl.cpp",
|
||||
"formatutilsgl.h",
|
||||
"functionsgl_enums.h",
|
||||
"functionsgl_typedefs.h",
|
||||
"renderergl_utils.cpp",
|
||||
"renderergl_utils.h",
|
||||
]
|
||||
|
||||
if (is_win) {
|
||||
gl_backend_sources += [
|
||||
"../../../third_party/khronos/GL/wglext.h",
|
||||
"wgl/ContextWGL.cpp",
|
||||
"wgl/ContextWGL.h",
|
||||
"wgl/D3DTextureSurfaceWGL.cpp",
|
||||
"wgl/D3DTextureSurfaceWGL.h",
|
||||
"wgl/DXGISwapChainWindowSurfaceWGL.cpp",
|
||||
"wgl/DXGISwapChainWindowSurfaceWGL.h",
|
||||
"wgl/DisplayWGL.cpp",
|
||||
"wgl/DisplayWGL.h",
|
||||
"wgl/FunctionsWGL.cpp",
|
||||
"wgl/FunctionsWGL.h",
|
||||
"wgl/PbufferSurfaceWGL.cpp",
|
||||
"wgl/PbufferSurfaceWGL.h",
|
||||
"wgl/RendererWGL.cpp",
|
||||
"wgl/RendererWGL.h",
|
||||
"wgl/SurfaceWGL.h",
|
||||
"wgl/WindowSurfaceWGL.cpp",
|
||||
"wgl/WindowSurfaceWGL.h",
|
||||
"wgl/functionswgl_typedefs.h",
|
||||
"wgl/wgl_utils.cpp",
|
||||
"wgl/wgl_utils.h",
|
||||
]
|
||||
}
|
||||
|
||||
if (angle_use_x11) {
|
||||
gl_backend_sources += [
|
||||
"glx/DisplayGLX.cpp",
|
||||
"glx/DisplayGLX.h",
|
||||
"glx/FunctionsGLX.cpp",
|
||||
"glx/FunctionsGLX.h",
|
||||
"glx/PbufferSurfaceGLX.cpp",
|
||||
"glx/PbufferSurfaceGLX.h",
|
||||
"glx/PixmapSurfaceGLX.cpp",
|
||||
"glx/PixmapSurfaceGLX.h",
|
||||
"glx/RendererGLX.cpp",
|
||||
"glx/RendererGLX.h",
|
||||
"glx/SurfaceGLX.h",
|
||||
"glx/WindowSurfaceGLX.cpp",
|
||||
"glx/WindowSurfaceGLX.h",
|
||||
"glx/functionsglx_typedefs.h",
|
||||
"glx/glx_utils.cpp",
|
||||
"glx/glx_utils.h",
|
||||
"glx/platform_glx.h",
|
||||
]
|
||||
}
|
||||
|
||||
if (is_android || is_linux || is_chromeos) {
|
||||
gl_backend_sources += [
|
||||
"egl/ContextEGL.cpp",
|
||||
"egl/ContextEGL.h",
|
||||
"egl/DeviceEGL.cpp",
|
||||
"egl/DeviceEGL.h",
|
||||
"egl/DisplayEGL.cpp",
|
||||
"egl/DisplayEGL.h",
|
||||
"egl/DmaBufImageSiblingEGL.cpp",
|
||||
"egl/DmaBufImageSiblingEGL.h",
|
||||
"egl/ExternalImageSiblingEGL.h",
|
||||
"egl/FunctionsEGL.cpp",
|
||||
"egl/FunctionsEGL.h",
|
||||
"egl/FunctionsEGLDL.cpp",
|
||||
"egl/FunctionsEGLDL.h",
|
||||
"egl/ImageEGL.cpp",
|
||||
"egl/ImageEGL.h",
|
||||
"egl/PbufferSurfaceEGL.cpp",
|
||||
"egl/PbufferSurfaceEGL.h",
|
||||
"egl/RendererEGL.cpp",
|
||||
"egl/RendererEGL.h",
|
||||
"egl/SurfaceEGL.cpp",
|
||||
"egl/SurfaceEGL.h",
|
||||
"egl/SyncEGL.cpp",
|
||||
"egl/SyncEGL.h",
|
||||
"egl/WindowSurfaceEGL.cpp",
|
||||
"egl/WindowSurfaceEGL.h",
|
||||
"egl/egl_utils.cpp",
|
||||
"egl/egl_utils.h",
|
||||
"egl/functionsegl_typedefs.h",
|
||||
]
|
||||
}
|
||||
|
||||
if (is_android) {
|
||||
gl_backend_sources += [
|
||||
"egl/android/DisplayAndroid.cpp",
|
||||
"egl/android/DisplayAndroid.h",
|
||||
"egl/android/NativeBufferImageSiblingAndroid.cpp",
|
||||
"egl/android/NativeBufferImageSiblingAndroid.h",
|
||||
]
|
||||
}
|
||||
|
||||
if (angle_enable_cgl) {
|
||||
gl_backend_sources += [
|
||||
"cgl/ContextCGL.cpp",
|
||||
"cgl/ContextCGL.h",
|
||||
"cgl/DeviceCGL.cpp",
|
||||
"cgl/DeviceCGL.h",
|
||||
"cgl/DisplayCGL.h",
|
||||
"cgl/DisplayCGL.mm",
|
||||
"cgl/IOSurfaceSurfaceCGL.cpp",
|
||||
"cgl/IOSurfaceSurfaceCGL.h",
|
||||
"cgl/PbufferSurfaceCGL.cpp",
|
||||
"cgl/PbufferSurfaceCGL.h",
|
||||
"cgl/RendererCGL.cpp",
|
||||
"cgl/RendererCGL.h",
|
||||
"cgl/WindowSurfaceCGL.h",
|
||||
"cgl/WindowSurfaceCGL.mm",
|
||||
]
|
||||
}
|
||||
|
||||
if (angle_enable_eagl) {
|
||||
gl_backend_sources += [
|
||||
"eagl/ContextEAGL.cpp",
|
||||
"eagl/ContextEAGL.h",
|
||||
"eagl/DeviceEAGL.cpp",
|
||||
"eagl/DeviceEAGL.h",
|
||||
"eagl/DisplayEAGL.h",
|
||||
"eagl/DisplayEAGL.mm",
|
||||
"eagl/FunctionsEAGL.h",
|
||||
"eagl/FunctionsEAGL.mm",
|
||||
"eagl/IOSurfaceSurfaceEAGL.h",
|
||||
"eagl/IOSurfaceSurfaceEAGL.mm",
|
||||
"eagl/PbufferSurfaceEAGL.cpp",
|
||||
"eagl/PbufferSurfaceEAGL.h",
|
||||
"eagl/RendererEAGL.cpp",
|
||||
"eagl/RendererEAGL.h",
|
||||
"eagl/WindowSurfaceEAGL.h",
|
||||
"eagl/WindowSurfaceEAGL.mm",
|
||||
]
|
||||
}
|
||||
|
||||
if (angle_enable_gl_null) {
|
||||
gl_backend_sources += [
|
||||
"null_functions.cpp",
|
||||
"null_functions.h",
|
||||
]
|
||||
}
|
||||
@@ -5,85 +5,11 @@
|
||||
# This file houses the build configuration for the ANGLE Metal back-end.
|
||||
|
||||
import("../../../../gni/angle.gni")
|
||||
import("metal_backend.gni")
|
||||
|
||||
assert(is_mac || is_ios)
|
||||
assert(angle_enable_metal)
|
||||
|
||||
_metal_backend_sources = [
|
||||
"BufferMtl.h",
|
||||
"BufferMtl.mm",
|
||||
"CompilerMtl.h",
|
||||
"CompilerMtl.mm",
|
||||
"ContextMtl.h",
|
||||
"ContextMtl.mm",
|
||||
"DeviceMtl.h",
|
||||
"DeviceMtl.mm",
|
||||
"DisplayMtl.h",
|
||||
"DisplayMtl.mm",
|
||||
"DisplayMtl_api.h",
|
||||
"FrameBufferMtl.h",
|
||||
"FrameBufferMtl.mm",
|
||||
"IOSurfaceSurfaceMtl.h",
|
||||
"IOSurfaceSurfaceMtl.mm",
|
||||
"ImageMtl.h",
|
||||
"ImageMtl.mm",
|
||||
"ProgramMtl.h",
|
||||
"ProgramMtl.mm",
|
||||
"ProvokingVertexHelper.h",
|
||||
"ProvokingVertexHelper.mm",
|
||||
"QueryMtl.h",
|
||||
"QueryMtl.mm",
|
||||
"RenderBufferMtl.h",
|
||||
"RenderBufferMtl.mm",
|
||||
"RenderTargetMtl.h",
|
||||
"RenderTargetMtl.mm",
|
||||
"SamplerMtl.h",
|
||||
"SamplerMtl.mm",
|
||||
"ShaderMtl.h",
|
||||
"ShaderMtl.mm",
|
||||
"SurfaceMtl.h",
|
||||
"SurfaceMtl.mm",
|
||||
"SyncMtl.h",
|
||||
"SyncMtl.mm",
|
||||
"TextureMtl.h",
|
||||
"TextureMtl.mm",
|
||||
"TransformFeedbackMtl.h",
|
||||
"TransformFeedbackMtl.mm",
|
||||
"VertexArrayMtl.h",
|
||||
"VertexArrayMtl.mm",
|
||||
"mtl_buffer_manager.h",
|
||||
"mtl_buffer_manager.mm",
|
||||
"mtl_buffer_pool.h",
|
||||
"mtl_buffer_pool.mm",
|
||||
"mtl_command_buffer.h",
|
||||
"mtl_command_buffer.mm",
|
||||
"mtl_common.h",
|
||||
"mtl_common.mm",
|
||||
"mtl_context_device.h",
|
||||
"mtl_context_device.mm",
|
||||
"mtl_default_shaders_compiled.inc",
|
||||
"mtl_format_table_autogen.mm",
|
||||
"mtl_format_utils.h",
|
||||
"mtl_format_utils.mm",
|
||||
"mtl_msl_utils.h",
|
||||
"mtl_msl_utils.mm",
|
||||
"mtl_occlusion_query_pool.h",
|
||||
"mtl_occlusion_query_pool.mm",
|
||||
"mtl_render_utils.h",
|
||||
"mtl_render_utils.mm",
|
||||
"mtl_resource_spi.h",
|
||||
"mtl_resources.h",
|
||||
"mtl_resources.mm",
|
||||
"mtl_state_cache.h",
|
||||
"mtl_state_cache.mm",
|
||||
"mtl_utils.h",
|
||||
"mtl_utils.mm",
|
||||
"shaders/constants.h",
|
||||
"shaders/format_autogen.h",
|
||||
"shaders/mtl_default_shaders_src_autogen.inc",
|
||||
"shaders/rewrite_indices_shared.h",
|
||||
]
|
||||
|
||||
config("angle_metal_backend_config") {
|
||||
defines = [ "ANGLE_ENABLE_METAL" ]
|
||||
ldflags = [
|
||||
@@ -95,7 +21,7 @@ config("angle_metal_backend_config") {
|
||||
angle_source_set("angle_metal_backend") {
|
||||
public_configs = [ ":angle_metal_backend_config" ]
|
||||
|
||||
sources = _metal_backend_sources
|
||||
sources = metal_backend_sources
|
||||
|
||||
cflags = []
|
||||
cflags_cc = []
|
||||
|
||||
80
src/libANGLE/renderer/metal/metal_backend.gni
Normal file
80
src/libANGLE/renderer/metal/metal_backend.gni
Normal file
@@ -0,0 +1,80 @@
|
||||
# Copyright 2022 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.
|
||||
|
||||
import("../../../../gni/angle.gni")
|
||||
|
||||
metal_backend_sources = [
|
||||
"BufferMtl.h",
|
||||
"BufferMtl.mm",
|
||||
"CompilerMtl.h",
|
||||
"CompilerMtl.mm",
|
||||
"ContextMtl.h",
|
||||
"ContextMtl.mm",
|
||||
"DeviceMtl.h",
|
||||
"DeviceMtl.mm",
|
||||
"DisplayMtl.h",
|
||||
"DisplayMtl.mm",
|
||||
"DisplayMtl_api.h",
|
||||
"FrameBufferMtl.h",
|
||||
"FrameBufferMtl.mm",
|
||||
"IOSurfaceSurfaceMtl.h",
|
||||
"IOSurfaceSurfaceMtl.mm",
|
||||
"ImageMtl.h",
|
||||
"ImageMtl.mm",
|
||||
"ProgramMtl.h",
|
||||
"ProgramMtl.mm",
|
||||
"ProvokingVertexHelper.h",
|
||||
"ProvokingVertexHelper.mm",
|
||||
"QueryMtl.h",
|
||||
"QueryMtl.mm",
|
||||
"RenderBufferMtl.h",
|
||||
"RenderBufferMtl.mm",
|
||||
"RenderTargetMtl.h",
|
||||
"RenderTargetMtl.mm",
|
||||
"SamplerMtl.h",
|
||||
"SamplerMtl.mm",
|
||||
"ShaderMtl.h",
|
||||
"ShaderMtl.mm",
|
||||
"SurfaceMtl.h",
|
||||
"SurfaceMtl.mm",
|
||||
"SyncMtl.h",
|
||||
"SyncMtl.mm",
|
||||
"TextureMtl.h",
|
||||
"TextureMtl.mm",
|
||||
"TransformFeedbackMtl.h",
|
||||
"TransformFeedbackMtl.mm",
|
||||
"VertexArrayMtl.h",
|
||||
"VertexArrayMtl.mm",
|
||||
"mtl_buffer_manager.h",
|
||||
"mtl_buffer_manager.mm",
|
||||
"mtl_buffer_pool.h",
|
||||
"mtl_buffer_pool.mm",
|
||||
"mtl_command_buffer.h",
|
||||
"mtl_command_buffer.mm",
|
||||
"mtl_common.h",
|
||||
"mtl_common.mm",
|
||||
"mtl_context_device.h",
|
||||
"mtl_context_device.mm",
|
||||
"mtl_default_shaders_compiled.inc",
|
||||
"mtl_format_table_autogen.mm",
|
||||
"mtl_format_utils.h",
|
||||
"mtl_format_utils.mm",
|
||||
"mtl_msl_utils.h",
|
||||
"mtl_msl_utils.mm",
|
||||
"mtl_occlusion_query_pool.h",
|
||||
"mtl_occlusion_query_pool.mm",
|
||||
"mtl_render_utils.h",
|
||||
"mtl_render_utils.mm",
|
||||
"mtl_resource_spi.h",
|
||||
"mtl_resources.h",
|
||||
"mtl_resources.mm",
|
||||
"mtl_state_cache.h",
|
||||
"mtl_state_cache.mm",
|
||||
"mtl_utils.h",
|
||||
"mtl_utils.mm",
|
||||
"shaders/constants.h",
|
||||
"shaders/format_autogen.h",
|
||||
"shaders/mtl_default_shaders_src_autogen.inc",
|
||||
"shaders/rewrite_indices_shared.h",
|
||||
]
|
||||
@@ -5,56 +5,16 @@
|
||||
# This file houses the build configuration for the ANGLE NULL back-end.
|
||||
|
||||
import("../../../../gni/angle.gni")
|
||||
import("null_backend.gni")
|
||||
|
||||
assert(angle_enable_null)
|
||||
|
||||
_null_backend_sources = [
|
||||
"BufferNULL.cpp",
|
||||
"BufferNULL.h",
|
||||
"CompilerNULL.cpp",
|
||||
"CompilerNULL.h",
|
||||
"ContextNULL.cpp",
|
||||
"ContextNULL.h",
|
||||
"DeviceNULL.cpp",
|
||||
"DeviceNULL.h",
|
||||
"DisplayNULL.cpp",
|
||||
"DisplayNULL.h",
|
||||
"FenceNVNULL.cpp",
|
||||
"FenceNVNULL.h",
|
||||
"FramebufferNULL.cpp",
|
||||
"FramebufferNULL.h",
|
||||
"ImageNULL.cpp",
|
||||
"ImageNULL.h",
|
||||
"ProgramNULL.cpp",
|
||||
"ProgramNULL.h",
|
||||
"ProgramPipelineNULL.cpp",
|
||||
"ProgramPipelineNULL.h",
|
||||
"QueryNULL.cpp",
|
||||
"QueryNULL.h",
|
||||
"RenderbufferNULL.cpp",
|
||||
"RenderbufferNULL.h",
|
||||
"SamplerNULL.cpp",
|
||||
"SamplerNULL.h",
|
||||
"ShaderNULL.cpp",
|
||||
"ShaderNULL.h",
|
||||
"SurfaceNULL.cpp",
|
||||
"SurfaceNULL.h",
|
||||
"SyncNULL.cpp",
|
||||
"SyncNULL.h",
|
||||
"TextureNULL.cpp",
|
||||
"TextureNULL.h",
|
||||
"TransformFeedbackNULL.cpp",
|
||||
"TransformFeedbackNULL.h",
|
||||
"VertexArrayNULL.cpp",
|
||||
"VertexArrayNULL.h",
|
||||
]
|
||||
|
||||
config("angle_null_backend_config") {
|
||||
defines = [ "ANGLE_ENABLE_NULL" ]
|
||||
}
|
||||
|
||||
angle_source_set("angle_null_backend") {
|
||||
sources = _null_backend_sources
|
||||
sources = null_backend_sources
|
||||
|
||||
public_deps = [ "$angle_root:libANGLE_headers" ]
|
||||
}
|
||||
|
||||
46
src/libANGLE/renderer/null/null_backend.gni
Normal file
46
src/libANGLE/renderer/null/null_backend.gni
Normal file
@@ -0,0 +1,46 @@
|
||||
# Copyright 2022 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.
|
||||
|
||||
import("../../../../gni/angle.gni")
|
||||
|
||||
null_backend_sources = [
|
||||
"BufferNULL.cpp",
|
||||
"BufferNULL.h",
|
||||
"CompilerNULL.cpp",
|
||||
"CompilerNULL.h",
|
||||
"ContextNULL.cpp",
|
||||
"ContextNULL.h",
|
||||
"DeviceNULL.cpp",
|
||||
"DeviceNULL.h",
|
||||
"DisplayNULL.cpp",
|
||||
"DisplayNULL.h",
|
||||
"FenceNVNULL.cpp",
|
||||
"FenceNVNULL.h",
|
||||
"FramebufferNULL.cpp",
|
||||
"FramebufferNULL.h",
|
||||
"ImageNULL.cpp",
|
||||
"ImageNULL.h",
|
||||
"ProgramNULL.cpp",
|
||||
"ProgramNULL.h",
|
||||
"ProgramPipelineNULL.cpp",
|
||||
"ProgramPipelineNULL.h",
|
||||
"QueryNULL.cpp",
|
||||
"QueryNULL.h",
|
||||
"RenderbufferNULL.cpp",
|
||||
"RenderbufferNULL.h",
|
||||
"SamplerNULL.cpp",
|
||||
"SamplerNULL.h",
|
||||
"ShaderNULL.cpp",
|
||||
"ShaderNULL.h",
|
||||
"SurfaceNULL.cpp",
|
||||
"SurfaceNULL.h",
|
||||
"SyncNULL.cpp",
|
||||
"SyncNULL.h",
|
||||
"TextureNULL.cpp",
|
||||
"TextureNULL.h",
|
||||
"TransformFeedbackNULL.cpp",
|
||||
"TransformFeedbackNULL.h",
|
||||
"VertexArrayNULL.cpp",
|
||||
"VertexArrayNULL.h",
|
||||
]
|
||||
@@ -6,7 +6,9 @@
|
||||
|
||||
import("//build/config/dcheck_always_on.gni")
|
||||
import("//build_overrides/swiftshader.gni")
|
||||
import("../../../../gni/angle.gni")
|
||||
import("vulkan_backend.gni")
|
||||
|
||||
#import("../../../../gni/angle.gni")
|
||||
|
||||
assert(angle_enable_vulkan)
|
||||
|
||||
@@ -31,230 +33,6 @@ declare_args() {
|
||||
angle_enable_vulkan_shared_ring_buffer_cmd_alloc = false
|
||||
}
|
||||
|
||||
_vulkan_backend_sources = [
|
||||
"AllocatorHelperPool.cpp",
|
||||
"AllocatorHelperPool.h",
|
||||
"AllocatorHelperRing.cpp",
|
||||
"AllocatorHelperRing.h",
|
||||
"BufferVk.cpp",
|
||||
"BufferVk.h",
|
||||
"CommandProcessor.cpp",
|
||||
"CommandProcessor.h",
|
||||
"CompilerVk.cpp",
|
||||
"CompilerVk.h",
|
||||
"ContextVk.cpp",
|
||||
"ContextVk.h",
|
||||
"DebugAnnotatorVk.cpp",
|
||||
"DebugAnnotatorVk.h",
|
||||
"DeviceVk.cpp",
|
||||
"DeviceVk.h",
|
||||
"DisplayVk.cpp",
|
||||
"DisplayVk.h",
|
||||
"DisplayVk_api.h",
|
||||
"FenceNVVk.cpp",
|
||||
"FenceNVVk.h",
|
||||
"FramebufferVk.cpp",
|
||||
"FramebufferVk.h",
|
||||
"ImageVk.cpp",
|
||||
"ImageVk.h",
|
||||
"MemoryObjectVk.cpp",
|
||||
"MemoryObjectVk.h",
|
||||
"OverlayVk.cpp",
|
||||
"OverlayVk.h",
|
||||
"PersistentCommandPool.cpp",
|
||||
"PersistentCommandPool.h",
|
||||
"ProgramExecutableVk.cpp",
|
||||
"ProgramExecutableVk.h",
|
||||
"ProgramPipelineVk.cpp",
|
||||
"ProgramPipelineVk.h",
|
||||
"ProgramVk.cpp",
|
||||
"ProgramVk.h",
|
||||
"QueryVk.cpp",
|
||||
"QueryVk.h",
|
||||
"RenderTargetVk.cpp",
|
||||
"RenderTargetVk.h",
|
||||
"RenderbufferVk.cpp",
|
||||
"RenderbufferVk.h",
|
||||
"RendererVk.cpp",
|
||||
"RendererVk.h",
|
||||
"ResourceVk.cpp",
|
||||
"ResourceVk.h",
|
||||
"SamplerVk.cpp",
|
||||
"SamplerVk.h",
|
||||
"SecondaryCommandBuffer.cpp",
|
||||
"SecondaryCommandBuffer.h",
|
||||
"SemaphoreVk.cpp",
|
||||
"SemaphoreVk.h",
|
||||
"ShaderInterfaceVariableInfoMap.cpp",
|
||||
"ShaderInterfaceVariableInfoMap.h",
|
||||
"ShaderVk.cpp",
|
||||
"ShaderVk.h",
|
||||
"Suballocation.cpp",
|
||||
"Suballocation.h",
|
||||
"SurfaceVk.cpp",
|
||||
"SurfaceVk.h",
|
||||
"SyncVk.cpp",
|
||||
"SyncVk.h",
|
||||
"TextureVk.cpp",
|
||||
"TextureVk.h",
|
||||
"TransformFeedbackVk.cpp",
|
||||
"TransformFeedbackVk.h",
|
||||
"UtilsVk.cpp",
|
||||
"UtilsVk.h",
|
||||
"VertexArrayVk.cpp",
|
||||
"VertexArrayVk.h",
|
||||
"VkImageImageSiblingVk.cpp",
|
||||
"VkImageImageSiblingVk.h",
|
||||
"VulkanSecondaryCommandBuffer.cpp",
|
||||
"VulkanSecondaryCommandBuffer.h",
|
||||
"android/vk_android_utils.cpp",
|
||||
"android/vk_android_utils.h",
|
||||
"spv_utils.cpp",
|
||||
"spv_utils.h",
|
||||
"vk_cache_utils.cpp",
|
||||
"vk_cache_utils.h",
|
||||
"vk_caps_utils.cpp",
|
||||
"vk_caps_utils.h",
|
||||
"vk_command_buffer_utils.h",
|
||||
"vk_format_table_autogen.cpp",
|
||||
"vk_format_utils.cpp",
|
||||
"vk_format_utils.h",
|
||||
"vk_helpers.cpp",
|
||||
"vk_helpers.h",
|
||||
"vk_internal_shaders_autogen.cpp",
|
||||
"vk_internal_shaders_autogen.h",
|
||||
"vk_mandatory_format_support_table_autogen.cpp",
|
||||
"vk_utils.cpp",
|
||||
"vk_utils.h",
|
||||
"vk_wrapper.h",
|
||||
]
|
||||
|
||||
if (angle_enable_cl) {
|
||||
_vulkan_backend_sources += [
|
||||
"CLCommandQueueVk.cpp",
|
||||
"CLCommandQueueVk.h",
|
||||
"CLContextVk.cpp",
|
||||
"CLContextVk.h",
|
||||
"CLDeviceVk.cpp",
|
||||
"CLDeviceVk.h",
|
||||
"CLEventVk.cpp",
|
||||
"CLEventVk.h",
|
||||
"CLKernelVk.cpp",
|
||||
"CLKernelVk.h",
|
||||
"CLMemoryVk.cpp",
|
||||
"CLMemoryVk.h",
|
||||
"CLPlatformVk.cpp",
|
||||
"CLPlatformVk.h",
|
||||
"CLProgramVk.cpp",
|
||||
"CLProgramVk.h",
|
||||
"CLSamplerVk.cpp",
|
||||
"CLSamplerVk.h",
|
||||
"cl_types.h",
|
||||
]
|
||||
}
|
||||
|
||||
if (angle_use_vulkan_null_display) {
|
||||
_vulkan_backend_sources += [
|
||||
"null/DisplayVkNull.cpp",
|
||||
"null/DisplayVkNull.h",
|
||||
]
|
||||
}
|
||||
|
||||
if (is_linux || is_chromeos) {
|
||||
_vulkan_backend_sources += [
|
||||
"linux/DeviceVkLinux.cpp",
|
||||
"linux/DeviceVkLinux.h",
|
||||
"linux/DisplayVkLinux.cpp",
|
||||
"linux/DisplayVkLinux.h",
|
||||
"linux/DmaBufImageSiblingVkLinux.cpp",
|
||||
"linux/DmaBufImageSiblingVkLinux.h",
|
||||
"linux/display/DisplayVkSimple.cpp",
|
||||
"linux/display/DisplayVkSimple.h",
|
||||
"linux/display/WindowSurfaceVkSimple.cpp",
|
||||
"linux/display/WindowSurfaceVkSimple.h",
|
||||
"linux/headless/DisplayVkHeadless.cpp",
|
||||
"linux/headless/DisplayVkHeadless.h",
|
||||
"linux/headless/WindowSurfaceVkHeadless.cpp",
|
||||
"linux/headless/WindowSurfaceVkHeadless.h",
|
||||
]
|
||||
}
|
||||
|
||||
if (is_android) {
|
||||
_vulkan_backend_sources += [
|
||||
"android/AHBFunctions.cpp",
|
||||
"android/AHBFunctions.h",
|
||||
"android/DisplayVkAndroid.cpp",
|
||||
"android/DisplayVkAndroid.h",
|
||||
"android/HardwareBufferImageSiblingVkAndroid.cpp",
|
||||
"android/HardwareBufferImageSiblingVkAndroid.h",
|
||||
"android/WindowSurfaceVkAndroid.cpp",
|
||||
"android/WindowSurfaceVkAndroid.h",
|
||||
]
|
||||
}
|
||||
|
||||
if (is_win) {
|
||||
_vulkan_backend_sources += [
|
||||
"win32/DisplayVkWin32.cpp",
|
||||
"win32/DisplayVkWin32.h",
|
||||
"win32/WindowSurfaceVkWin32.cpp",
|
||||
"win32/WindowSurfaceVkWin32.h",
|
||||
]
|
||||
}
|
||||
|
||||
if (angle_use_x11) {
|
||||
_vulkan_backend_sources += [
|
||||
"linux/xcb/DisplayVkXcb.cpp",
|
||||
"linux/xcb/DisplayVkXcb.h",
|
||||
"linux/xcb/WindowSurfaceVkXcb.cpp",
|
||||
"linux/xcb/WindowSurfaceVkXcb.h",
|
||||
]
|
||||
}
|
||||
|
||||
if (angle_use_wayland) {
|
||||
_vulkan_backend_sources += [
|
||||
"linux/wayland/DisplayVkWayland.cpp",
|
||||
"linux/wayland/DisplayVkWayland.h",
|
||||
"linux/wayland/WindowSurfaceVkWayland.cpp",
|
||||
"linux/wayland/WindowSurfaceVkWayland.h",
|
||||
]
|
||||
}
|
||||
|
||||
if (angle_use_gbm) {
|
||||
_vulkan_backend_sources += [
|
||||
"linux/gbm/DisplayVkGbm.cpp",
|
||||
"linux/gbm/DisplayVkGbm.h",
|
||||
]
|
||||
}
|
||||
|
||||
if (is_fuchsia) {
|
||||
_vulkan_backend_sources += [
|
||||
"fuchsia/DisplayVkFuchsia.cpp",
|
||||
"fuchsia/DisplayVkFuchsia.h",
|
||||
"fuchsia/WindowSurfaceVkFuchsia.cpp",
|
||||
"fuchsia/WindowSurfaceVkFuchsia.h",
|
||||
]
|
||||
}
|
||||
|
||||
if (is_ggp) {
|
||||
_vulkan_backend_sources += [
|
||||
"ggp/DisplayVkGGP.cpp",
|
||||
"ggp/DisplayVkGGP.h",
|
||||
"ggp/WindowSurfaceVkGGP.cpp",
|
||||
"ggp/WindowSurfaceVkGGP.h",
|
||||
]
|
||||
}
|
||||
|
||||
if (is_mac) {
|
||||
_vulkan_backend_sources += [
|
||||
"mac/DisplayVkMac.h",
|
||||
"mac/DisplayVkMac.mm",
|
||||
"mac/IOSurfaceSurfaceVkMac.h",
|
||||
"mac/IOSurfaceSurfaceVkMac.mm",
|
||||
"mac/WindowSurfaceVkMac.h",
|
||||
"mac/WindowSurfaceVkMac.mm",
|
||||
]
|
||||
}
|
||||
|
||||
angle_source_set("angle_vk_mem_alloc_wrapper") {
|
||||
deps = [
|
||||
"$angle_root/src/common/vulkan:angle_vulkan_headers",
|
||||
@@ -313,7 +91,7 @@ template("angle_vulkan_backend_template") {
|
||||
}
|
||||
|
||||
angle_source_set(target_name) {
|
||||
sources = _vulkan_backend_sources
|
||||
sources = vulkan_backend_sources
|
||||
libs = []
|
||||
deps = [
|
||||
":angle_vk_mem_alloc_wrapper",
|
||||
|
||||
228
src/libANGLE/renderer/vulkan/vulkan_backend.gni
Normal file
228
src/libANGLE/renderer/vulkan/vulkan_backend.gni
Normal file
@@ -0,0 +1,228 @@
|
||||
# Copyright 2022 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.
|
||||
import("../../../../gni/angle.gni")
|
||||
|
||||
vulkan_backend_sources = [
|
||||
"AllocatorHelperPool.cpp",
|
||||
"AllocatorHelperPool.h",
|
||||
"AllocatorHelperRing.cpp",
|
||||
"AllocatorHelperRing.h",
|
||||
"BufferVk.cpp",
|
||||
"BufferVk.h",
|
||||
"CommandProcessor.cpp",
|
||||
"CommandProcessor.h",
|
||||
"CompilerVk.cpp",
|
||||
"CompilerVk.h",
|
||||
"ContextVk.cpp",
|
||||
"ContextVk.h",
|
||||
"DebugAnnotatorVk.cpp",
|
||||
"DebugAnnotatorVk.h",
|
||||
"DeviceVk.cpp",
|
||||
"DeviceVk.h",
|
||||
"DisplayVk.cpp",
|
||||
"DisplayVk.h",
|
||||
"DisplayVk_api.h",
|
||||
"FenceNVVk.cpp",
|
||||
"FenceNVVk.h",
|
||||
"FramebufferVk.cpp",
|
||||
"FramebufferVk.h",
|
||||
"ImageVk.cpp",
|
||||
"ImageVk.h",
|
||||
"MemoryObjectVk.cpp",
|
||||
"MemoryObjectVk.h",
|
||||
"OverlayVk.cpp",
|
||||
"OverlayVk.h",
|
||||
"PersistentCommandPool.cpp",
|
||||
"PersistentCommandPool.h",
|
||||
"ProgramExecutableVk.cpp",
|
||||
"ProgramExecutableVk.h",
|
||||
"ProgramPipelineVk.cpp",
|
||||
"ProgramPipelineVk.h",
|
||||
"ProgramVk.cpp",
|
||||
"ProgramVk.h",
|
||||
"QueryVk.cpp",
|
||||
"QueryVk.h",
|
||||
"RenderTargetVk.cpp",
|
||||
"RenderTargetVk.h",
|
||||
"RenderbufferVk.cpp",
|
||||
"RenderbufferVk.h",
|
||||
"RendererVk.cpp",
|
||||
"RendererVk.h",
|
||||
"ResourceVk.cpp",
|
||||
"ResourceVk.h",
|
||||
"SamplerVk.cpp",
|
||||
"SamplerVk.h",
|
||||
"SecondaryCommandBuffer.cpp",
|
||||
"SecondaryCommandBuffer.h",
|
||||
"SemaphoreVk.cpp",
|
||||
"SemaphoreVk.h",
|
||||
"ShaderInterfaceVariableInfoMap.cpp",
|
||||
"ShaderInterfaceVariableInfoMap.h",
|
||||
"ShaderVk.cpp",
|
||||
"ShaderVk.h",
|
||||
"Suballocation.cpp",
|
||||
"Suballocation.h",
|
||||
"SurfaceVk.cpp",
|
||||
"SurfaceVk.h",
|
||||
"SyncVk.cpp",
|
||||
"SyncVk.h",
|
||||
"TextureVk.cpp",
|
||||
"TextureVk.h",
|
||||
"TransformFeedbackVk.cpp",
|
||||
"TransformFeedbackVk.h",
|
||||
"UtilsVk.cpp",
|
||||
"UtilsVk.h",
|
||||
"VertexArrayVk.cpp",
|
||||
"VertexArrayVk.h",
|
||||
"VkImageImageSiblingVk.cpp",
|
||||
"VkImageImageSiblingVk.h",
|
||||
"VulkanSecondaryCommandBuffer.cpp",
|
||||
"VulkanSecondaryCommandBuffer.h",
|
||||
"android/vk_android_utils.cpp",
|
||||
"android/vk_android_utils.h",
|
||||
"spv_utils.cpp",
|
||||
"spv_utils.h",
|
||||
"vk_cache_utils.cpp",
|
||||
"vk_cache_utils.h",
|
||||
"vk_caps_utils.cpp",
|
||||
"vk_caps_utils.h",
|
||||
"vk_command_buffer_utils.h",
|
||||
"vk_format_table_autogen.cpp",
|
||||
"vk_format_utils.cpp",
|
||||
"vk_format_utils.h",
|
||||
"vk_helpers.cpp",
|
||||
"vk_helpers.h",
|
||||
"vk_internal_shaders_autogen.cpp",
|
||||
"vk_internal_shaders_autogen.h",
|
||||
"vk_mandatory_format_support_table_autogen.cpp",
|
||||
"vk_utils.cpp",
|
||||
"vk_utils.h",
|
||||
"vk_wrapper.h",
|
||||
]
|
||||
|
||||
if (angle_enable_cl) {
|
||||
vulkan_backend_sources += [
|
||||
"CLCommandQueueVk.cpp",
|
||||
"CLCommandQueueVk.h",
|
||||
"CLContextVk.cpp",
|
||||
"CLContextVk.h",
|
||||
"CLDeviceVk.cpp",
|
||||
"CLDeviceVk.h",
|
||||
"CLEventVk.cpp",
|
||||
"CLEventVk.h",
|
||||
"CLKernelVk.cpp",
|
||||
"CLKernelVk.h",
|
||||
"CLMemoryVk.cpp",
|
||||
"CLMemoryVk.h",
|
||||
"CLPlatformVk.cpp",
|
||||
"CLPlatformVk.h",
|
||||
"CLProgramVk.cpp",
|
||||
"CLProgramVk.h",
|
||||
"CLSamplerVk.cpp",
|
||||
"CLSamplerVk.h",
|
||||
"cl_types.h",
|
||||
]
|
||||
}
|
||||
|
||||
if (angle_use_vulkan_null_display) {
|
||||
vulkan_backend_sources += [
|
||||
"null/DisplayVkNull.cpp",
|
||||
"null/DisplayVkNull.h",
|
||||
]
|
||||
}
|
||||
|
||||
if (is_linux || is_chromeos) {
|
||||
vulkan_backend_sources += [
|
||||
"linux/DeviceVkLinux.cpp",
|
||||
"linux/DeviceVkLinux.h",
|
||||
"linux/DisplayVkLinux.cpp",
|
||||
"linux/DisplayVkLinux.h",
|
||||
"linux/DmaBufImageSiblingVkLinux.cpp",
|
||||
"linux/DmaBufImageSiblingVkLinux.h",
|
||||
"linux/display/DisplayVkSimple.cpp",
|
||||
"linux/display/DisplayVkSimple.h",
|
||||
"linux/display/WindowSurfaceVkSimple.cpp",
|
||||
"linux/display/WindowSurfaceVkSimple.h",
|
||||
"linux/headless/DisplayVkHeadless.cpp",
|
||||
"linux/headless/DisplayVkHeadless.h",
|
||||
"linux/headless/WindowSurfaceVkHeadless.cpp",
|
||||
"linux/headless/WindowSurfaceVkHeadless.h",
|
||||
]
|
||||
}
|
||||
|
||||
if (is_android) {
|
||||
vulkan_backend_sources += [
|
||||
"android/AHBFunctions.cpp",
|
||||
"android/AHBFunctions.h",
|
||||
"android/DisplayVkAndroid.cpp",
|
||||
"android/DisplayVkAndroid.h",
|
||||
"android/HardwareBufferImageSiblingVkAndroid.cpp",
|
||||
"android/HardwareBufferImageSiblingVkAndroid.h",
|
||||
"android/WindowSurfaceVkAndroid.cpp",
|
||||
"android/WindowSurfaceVkAndroid.h",
|
||||
]
|
||||
}
|
||||
|
||||
if (is_win) {
|
||||
vulkan_backend_sources += [
|
||||
"win32/DisplayVkWin32.cpp",
|
||||
"win32/DisplayVkWin32.h",
|
||||
"win32/WindowSurfaceVkWin32.cpp",
|
||||
"win32/WindowSurfaceVkWin32.h",
|
||||
]
|
||||
}
|
||||
|
||||
if (angle_use_x11) {
|
||||
vulkan_backend_sources += [
|
||||
"linux/xcb/DisplayVkXcb.cpp",
|
||||
"linux/xcb/DisplayVkXcb.h",
|
||||
"linux/xcb/WindowSurfaceVkXcb.cpp",
|
||||
"linux/xcb/WindowSurfaceVkXcb.h",
|
||||
]
|
||||
}
|
||||
|
||||
if (angle_use_wayland) {
|
||||
vulkan_backend_sources += [
|
||||
"linux/wayland/DisplayVkWayland.cpp",
|
||||
"linux/wayland/DisplayVkWayland.h",
|
||||
"linux/wayland/WindowSurfaceVkWayland.cpp",
|
||||
"linux/wayland/WindowSurfaceVkWayland.h",
|
||||
]
|
||||
}
|
||||
|
||||
if (angle_has_build && angle_use_gbm) {
|
||||
vulkan_backend_sources += [
|
||||
"linux/gbm/DisplayVkGbm.cpp",
|
||||
"linux/gbm/DisplayVkGbm.h",
|
||||
]
|
||||
}
|
||||
|
||||
if (is_fuchsia) {
|
||||
vulkan_backend_sources += [
|
||||
"fuchsia/DisplayVkFuchsia.cpp",
|
||||
"fuchsia/DisplayVkFuchsia.h",
|
||||
"fuchsia/WindowSurfaceVkFuchsia.cpp",
|
||||
"fuchsia/WindowSurfaceVkFuchsia.h",
|
||||
]
|
||||
}
|
||||
|
||||
if (is_ggp) {
|
||||
vulkan_backend_sources += [
|
||||
"ggp/DisplayVkGGP.cpp",
|
||||
"ggp/DisplayVkGGP.h",
|
||||
"ggp/WindowSurfaceVkGGP.cpp",
|
||||
"ggp/WindowSurfaceVkGGP.h",
|
||||
]
|
||||
}
|
||||
|
||||
if (is_mac) {
|
||||
vulkan_backend_sources += [
|
||||
"mac/DisplayVkMac.h",
|
||||
"mac/DisplayVkMac.mm",
|
||||
"mac/IOSurfaceSurfaceVkMac.h",
|
||||
"mac/IOSurfaceSurfaceVkMac.mm",
|
||||
"mac/WindowSurfaceVkMac.h",
|
||||
"mac/WindowSurfaceVkMac.mm",
|
||||
]
|
||||
}
|
||||
45
src/program_serialize_data_version.py
Executable file
45
src/program_serialize_data_version.py
Executable file
@@ -0,0 +1,45 @@
|
||||
#!/usr/bin/env python3
|
||||
# Copyright 2022 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.
|
||||
|
||||
# Generate ANGLEShaderProgramVersion.h with hash of files affecting data
|
||||
# used in serializing/deserializing shader programs.
|
||||
|
||||
import hashlib
|
||||
import argparse
|
||||
|
||||
|
||||
def GenerateHashOfAffectedFiles(angle_code_files):
|
||||
hash_md5 = hashlib.md5()
|
||||
for file in angle_code_files:
|
||||
assert (file != "")
|
||||
with open(file, 'r') as f:
|
||||
for chunk in iter(lambda: f.read(4096), ""):
|
||||
hash_md5.update(chunk.encode())
|
||||
return hash_md5.hexdigest(), hash_md5.digest_size
|
||||
|
||||
|
||||
parser = argparse.ArgumentParser(description='Generate the file ANGLEShaderProgramVersion.h')
|
||||
parser.add_argument(
|
||||
'output_file',
|
||||
help='path (relative to build directory) to output file name, stores ANGLE_PROGRAM_VERSION and ANGLE_PROGRAM_VERSION_HASH_SIZE'
|
||||
)
|
||||
parser.add_argument(
|
||||
'input_file',
|
||||
help='path (relative to build directory) to input file name, the input file stores a list of program files that ANGLE_PROGRAM_VERSION hashes over'
|
||||
)
|
||||
args = parser.parse_args()
|
||||
output_file = args.output_file
|
||||
input_file = args.input_file
|
||||
with open(input_file, "r") as input_files:
|
||||
angle_code_files = input_files.read().split('\n')
|
||||
#remove the last empty item because of the '\n' in input_file (file $root_gen_dir/angle_code_affecting_program_serialize)
|
||||
if (len(angle_code_files) > 0):
|
||||
assert (angle_code_files.pop() == "")
|
||||
angle_shader_program_version_hash_result = GenerateHashOfAffectedFiles(angle_code_files)
|
||||
hfile = open(output_file, 'w')
|
||||
hfile.write('#define ANGLE_PROGRAM_VERSION "%s"\n' % angle_shader_program_version_hash_result[0])
|
||||
hfile.write('#define ANGLE_PROGRAM_VERSION_HASH_SIZE %d\n' %
|
||||
angle_shader_program_version_hash_result[1])
|
||||
hfile.close()
|
||||
Reference in New Issue
Block a user