5 Commits

Author SHA1 Message Date
Rémi Verschelde
9e33007a2e Merge pull request #2 from bruvzg/mac_angle_over_gl
[macOS] Enable ANGLE over GL.
2023-11-09 19:00:36 +01:00
bruvzg
a32c26072f [macOS] Enable ANGLE over GL. 2023-11-06 21:54:21 +02:00
Rémi Verschelde
eaa3385c3c Merge pull request #1 from bruvzg/fix_pref
Fix macOS build with older Xcode and performance issues.
2023-09-25 13:02:41 +02:00
bruvzg
b0997bce23 Fix macOS build with older Xcode and performance issues. 2023-09-25 11:27:55 +03:00
bruvzg
8539c2d74a [Godot] Custom static library config. 2023-07-26 16:17:42 +03:00
17 changed files with 1548 additions and 5 deletions

6
.gitignore vendored
View File

@@ -126,3 +126,9 @@ TestResults.qpa
# Any temporary files will confuse code generation.
!scripts/code_generation_hashes/*
# Godot scons files.
*.obj
.sconsign.dblite
bin/
*.o

6
.gitmodules vendored Normal file
View File

@@ -0,0 +1,6 @@
[submodule "third_party/astc-encoder/src"]
path = third_party/astc-encoder/src
url = https://chromium.googlesource.com/external/github.com/ARM-software/astc-encoder
[submodule "third_party/zlib"]
path = third_party/zlib
url = https://chromium.googlesource.com/chromium/src/third_party/zlib

853
SConstruct Normal file
View File

@@ -0,0 +1,853 @@
#!/usr/bin/env python
import os
import platform
import sys
import subprocess
from SCons.Errors import UserError
EnsureSConsVersion(4, 0)
def add_sources(sources, dir, extension):
for f in os.listdir(dir):
if f.endswith("." + extension):
sources.append(dir + "/" + f)
def normalize_path(val):
return val if os.path.isabs(val) else os.path.join(env.Dir("#").abspath, val)
# Try to detect the host platform automatically.
# This is used if no `platform` argument is passed
if sys.platform == "darwin":
default_platform = "macos"
elif sys.platform == "win32" or sys.platform == "msys":
default_platform = "windows"
elif ARGUMENTS.get("platform", ""):
default_platform = ARGUMENTS.get("platform")
else:
raise ValueError("Could not detect platform automatically, please specify with platform=<platform>")
try:
Import("env")
except:
# Default tools with no platform defaults to gnu toolchain.
# We apply platform specific toolchains via our custom tools.
env = Environment(tools=["default"], PLATFORM="")
env.PrependENVPath("PATH", os.getenv("PATH"))
# Default num_jobs to local cpu count if not user specified.
# SCons has a peculiarity where user-specified options won't be overridden
# by SetOption, so we can rely on this to know if we should use our default.
initial_num_jobs = env.GetOption("num_jobs")
altered_num_jobs = initial_num_jobs + 1
env.SetOption("num_jobs", altered_num_jobs)
if env.GetOption("num_jobs") == altered_num_jobs:
cpu_count = os.cpu_count()
if cpu_count is None:
print("Couldn't auto-detect CPU count to configure build parallelism. Specify it with the -j argument.")
else:
safer_cpu_count = cpu_count if cpu_count <= 4 else cpu_count - 1
print(
"Auto-detected %d CPU cores available for build parallelism. Using %d cores by default. You can override it with the -j argument."
% (cpu_count, safer_cpu_count)
)
env.SetOption("num_jobs", safer_cpu_count)
# Custom options and profile flags.
customs = ["custom.py"]
profile = ARGUMENTS.get("profile", "")
if profile:
if os.path.isfile(profile):
customs.append(profile)
elif os.path.isfile(profile + ".py"):
customs.append(profile + ".py")
opts = Variables(customs, ARGUMENTS)
platforms = ("macos", "windows")
opts.Add(
EnumVariable(
key="platform",
help="Target platform",
default=env.get("platform", default_platform),
allowed_values=platforms,
ignorecase=2,
)
)
# Add platform options
tools = {}
for pl in platforms:
tool = Tool(pl, toolpath=["godot-tools"])
if hasattr(tool, "options"):
tool.options(opts)
tools[pl] = tool
# CPU architecture options.
architecture_array = ["", "universal", "x86_32", "x86_64", "arm32", "arm64", "rv64", "ppc32", "ppc64", "wasm32"]
architecture_aliases = {
"x64": "x86_64",
"amd64": "x86_64",
"armv7": "arm32",
"armv8": "arm64",
"arm64v8": "arm64",
"aarch64": "arm64",
"rv": "rv64",
"riscv": "rv64",
"riscv64": "rv64",
"ppcle": "ppc32",
"ppc": "ppc32",
"ppc64le": "ppc64",
}
opts.Add(
EnumVariable(
key="arch",
help="CPU architecture",
default=env.get("arch", ""),
allowed_values=architecture_array,
map=architecture_aliases,
)
)
# Targets flags tool (optimizations, debug symbols)
target_tool = Tool("targets", toolpath=["godot-tools"])
target_tool.options(opts)
opts.Update(env)
Help(opts.GenerateHelpText(env))
# Process CPU architecture argument.
if env["arch"] == "":
# No architecture specified. Default to arm64 if building for Android,
# universal if building for macOS or iOS, wasm32 if building for web,
# otherwise default to the host architecture.
if env["platform"] in ["macos", "ios"]:
env["arch"] = "universal"
else:
host_machine = platform.machine().lower()
if host_machine in architecture_array:
env["arch"] = host_machine
elif host_machine in architecture_aliases.keys():
env["arch"] = architecture_aliases[host_machine]
elif "86" in host_machine:
# Catches x86, i386, i486, i586, i686, etc.
env["arch"] = "x86_32"
else:
print("Unsupported CPU architecture: " + host_machine)
Exit()
tool = Tool(env["platform"], toolpath=["godot-tools"])
if tool is None or not tool.exists(env):
raise ValueError("Required toolchain not found for platform " + env["platform"])
tool.generate(env)
target_tool.generate(env)
# Detect and print a warning listing unknown SCons variables to ease troubleshooting.
unknown = opts.UnknownVariables()
if unknown:
print("WARNING: Unknown SCons variables were passed and will be ignored:")
for item in unknown.items():
print(" " + item[0] + "=" + item[1])
print("Building for architecture " + env["arch"] + " on platform " + env["platform"])
# Require C++17
if env.get("is_msvc", False):
env.Append(CXXFLAGS=["/std:c++17"])
else:
env.Append(CXXFLAGS=["-std=c++17"])
if env["platform"] == "macos":
# CPU architecture.
if env["arch"] == "arm64":
print("Building for macOS 11.0+.")
env.Append(ASFLAGS=["-mmacosx-version-min=11.0"])
env.Append(CCFLAGS=["-mmacosx-version-min=11.0"])
env.Append(LINKFLAGS=["-mmacosx-version-min=11.0"])
elif env["arch"] == "x86_64":
print("Building for macOS 10.13+.")
env.Append(ASFLAGS=["-mmacosx-version-min=10.13"])
env.Append(CCFLAGS=["-mmacosx-version-min=10.13"])
env.Append(LINKFLAGS=["-mmacosx-version-min=10.13"])
elif env["platform"] == "windows":
env.AppendUnique(CPPDEFINES=["WINVER=0x0603", "_WIN32_WINNT=0x0603"])
scons_cache_path = os.environ.get("SCONS_CACHE")
if scons_cache_path is not None:
CacheDir(scons_cache_path)
Decider("MD5")
angle_sources = [
"src/common/aligned_memory.cpp",
"src/common/android_util.cpp",
"src/common/angleutils.cpp",
"src/common/angle_version_info.cpp",
"src/common/CompiledShaderState.cpp",
"src/common/debug.cpp",
"src/common/entry_points_enum_autogen.cpp",
"src/common/event_tracer.cpp",
"src/common/Float16ToFloat32.cpp",
"src/common/gl_enum_utils.cpp",
"src/common/gl_enum_utils_autogen.cpp",
"src/common/mathutil.cpp",
"src/common/matrix_utils.cpp",
"src/common/MemoryBuffer.cpp",
"src/common/PackedCLEnums_autogen.cpp",
"src/common/PackedEGLEnums_autogen.cpp",
"src/common/PackedEnums.cpp",
"src/common/PackedGLEnums_autogen.cpp",
"src/common/platform_helpers.cpp",
"src/common/PoolAlloc.cpp",
"src/common/RingBufferAllocator.cpp",
"src/common/string_utils.cpp",
"src/common/system_utils.cpp",
"src/common/tls.cpp",
"src/common/uniform_type_info_autogen.cpp",
"src/common/utilities.cpp",
"src/common/WorkerThread.cpp",
"src/common/base/anglebase/sha1.cc",
"src/compiler/preprocessor/DiagnosticsBase.cpp",
"src/compiler/preprocessor/DirectiveHandlerBase.cpp",
"src/compiler/preprocessor/DirectiveParser.cpp",
"src/compiler/preprocessor/Input.cpp",
"src/compiler/preprocessor/Lexer.cpp",
"src/compiler/preprocessor/Macro.cpp",
"src/compiler/preprocessor/MacroExpander.cpp",
"src/compiler/preprocessor/Preprocessor.cpp",
"src/compiler/preprocessor/preprocessor_lex_autogen.cpp",
"src/compiler/preprocessor/preprocessor_tab_autogen.cpp",
"src/compiler/preprocessor/Token.cpp",
"src/compiler/translator/BaseTypes.cpp",
"src/compiler/translator/blocklayout.cpp",
"src/compiler/translator/BuiltInFunctionEmulator.cpp",
"src/compiler/translator/CallDAG.cpp",
"src/compiler/translator/CodeGen.cpp",
"src/compiler/translator/CollectVariables.cpp",
"src/compiler/translator/Compiler.cpp",
"src/compiler/translator/ConstantUnion.cpp",
"src/compiler/translator/Declarator.cpp",
"src/compiler/translator/Diagnostics.cpp",
"src/compiler/translator/DirectiveHandler.cpp",
"src/compiler/translator/ExtensionBehavior.cpp",
"src/compiler/translator/FlagStd140Structs.cpp",
"src/compiler/translator/FunctionLookup.cpp",
"src/compiler/translator/glslang_lex_autogen.cpp",
"src/compiler/translator/glslang_tab_autogen.cpp",
"src/compiler/translator/HashNames.cpp",
"src/compiler/translator/ImmutableStringBuilder.cpp",
"src/compiler/translator/ImmutableString_ESSL_autogen.cpp",
"src/compiler/translator/InfoSink.cpp",
"src/compiler/translator/Initialize.cpp",
"src/compiler/translator/InitializeDll.cpp",
"src/compiler/translator/IntermNode.cpp",
"src/compiler/translator/IsASTDepthBelowLimit.cpp",
"src/compiler/translator/Operator.cpp",
"src/compiler/translator/OutputTree.cpp",
"src/compiler/translator/ParseContext.cpp",
"src/compiler/translator/PoolAlloc.cpp",
"src/compiler/translator/QualifierTypes.cpp",
"src/compiler/translator/ShaderLang.cpp",
"src/compiler/translator/ShaderVars.cpp",
"src/compiler/translator/Symbol.cpp",
"src/compiler/translator/SymbolTable.cpp",
"src/compiler/translator/SymbolTable_ESSL_autogen.cpp",
"src/compiler/translator/SymbolUniqueId.cpp",
"src/compiler/translator/Types.cpp",
"src/compiler/translator/util.cpp",
"src/compiler/translator/ValidateAST.cpp",
"src/compiler/translator/ValidateBarrierFunctionCall.cpp",
"src/compiler/translator/ValidateClipCullDistance.cpp",
"src/compiler/translator/ValidateGlobalInitializer.cpp",
"src/compiler/translator/ValidateLimitations.cpp",
"src/compiler/translator/ValidateMaxParameters.cpp",
"src/compiler/translator/ValidateOutputs.cpp",
"src/compiler/translator/ValidateSwitch.cpp",
"src/compiler/translator/ValidateTypeSizeLimitations.cpp",
"src/compiler/translator/ValidateVaryingLocations.cpp",
"src/compiler/translator/VariablePacker.cpp",
"src/compiler/translator/glsl/BuiltInFunctionEmulatorGLSL.cpp",
"src/compiler/translator/glsl/ExtensionGLSL.cpp",
"src/compiler/translator/glsl/OutputESSL.cpp",
"src/compiler/translator/glsl/OutputGLSL.cpp",
"src/compiler/translator/glsl/OutputGLSLBase.cpp",
"src/compiler/translator/glsl/TranslatorESSL.cpp",
"src/compiler/translator/glsl/TranslatorGLSL.cpp",
"src/compiler/translator/glsl/VersionGLSL.cpp",
"src/compiler/translator/tree_ops/ClampFragDepth.cpp",
"src/compiler/translator/tree_ops/ClampIndirectIndices.cpp",
"src/compiler/translator/tree_ops/ClampPointSize.cpp",
"src/compiler/translator/tree_ops/DeclareAndInitBuiltinsForInstancedMultiview.cpp",
"src/compiler/translator/tree_ops/DeclarePerVertexBlocks.cpp",
"src/compiler/translator/tree_ops/DeferGlobalInitializers.cpp",
"src/compiler/translator/tree_ops/EmulateGLFragColorBroadcast.cpp",
"src/compiler/translator/tree_ops/EmulateMultiDrawShaderBuiltins.cpp",
"src/compiler/translator/tree_ops/FoldExpressions.cpp",
"src/compiler/translator/tree_ops/ForcePrecisionQualifier.cpp",
"src/compiler/translator/tree_ops/InitializeVariables.cpp",
"src/compiler/translator/tree_ops/MonomorphizeUnsupportedFunctions.cpp",
"src/compiler/translator/tree_ops/PruneEmptyCases.cpp",
"src/compiler/translator/tree_ops/PruneNoOps.cpp",
"src/compiler/translator/tree_ops/RecordConstantPrecision.cpp",
"src/compiler/translator/tree_ops/RemoveArrayLengthMethod.cpp",
"src/compiler/translator/tree_ops/RemoveAtomicCounterBuiltins.cpp",
"src/compiler/translator/tree_ops/RemoveDynamicIndexing.cpp",
"src/compiler/translator/tree_ops/RemoveInactiveInterfaceVariables.cpp",
"src/compiler/translator/tree_ops/RemoveInvariantDeclaration.cpp",
"src/compiler/translator/tree_ops/RemoveUnreferencedVariables.cpp",
"src/compiler/translator/tree_ops/RewriteArrayOfArrayOfOpaqueUniforms.cpp",
"src/compiler/translator/tree_ops/RewriteAtomicCounters.cpp",
"src/compiler/translator/tree_ops/RewriteCubeMapSamplersAs2DArray.cpp",
"src/compiler/translator/tree_ops/RewriteDfdy.cpp",
"src/compiler/translator/tree_ops/RewritePixelLocalStorage.cpp",
"src/compiler/translator/tree_ops/RewriteStructSamplers.cpp",
"src/compiler/translator/tree_ops/RewriteTexelFetchOffset.cpp",
"src/compiler/translator/tree_ops/SeparateDeclarations.cpp",
"src/compiler/translator/tree_ops/SeparateStructFromUniformDeclarations.cpp",
"src/compiler/translator/tree_ops/SimplifyLoopConditions.cpp",
"src/compiler/translator/tree_ops/SplitSequenceOperator.cpp",
"src/compiler/translator/tree_ops/glsl/RegenerateStructNames.cpp",
"src/compiler/translator/tree_ops/glsl/RewriteRepeatedAssignToSwizzled.cpp",
"src/compiler/translator/tree_ops/glsl/ScalarizeVecAndMatConstructorArgs.cpp",
"src/compiler/translator/tree_ops/glsl/UseInterfaceBlockFields.cpp",
"src/compiler/translator/tree_util/DriverUniform.cpp",
"src/compiler/translator/tree_util/FindFunction.cpp",
"src/compiler/translator/tree_util/FindMain.cpp",
"src/compiler/translator/tree_util/FindPreciseNodes.cpp",
"src/compiler/translator/tree_util/FindSymbolNode.cpp",
"src/compiler/translator/tree_util/IntermNodePatternMatcher.cpp",
"src/compiler/translator/tree_util/IntermNode_util.cpp",
"src/compiler/translator/tree_util/IntermTraverse.cpp",
"src/compiler/translator/tree_util/ReplaceArrayOfMatrixVarying.cpp",
"src/compiler/translator/tree_util/ReplaceClipCullDistanceVariable.cpp",
"src/compiler/translator/tree_util/ReplaceShadowingVariables.cpp",
"src/compiler/translator/tree_util/ReplaceVariable.cpp",
"src/compiler/translator/tree_util/RewriteSampleMaskVariable.cpp",
"src/compiler/translator/tree_util/RunAtTheBeginningOfShader.cpp",
"src/compiler/translator/tree_util/RunAtTheEndOfShader.cpp",
"src/compiler/translator/tree_util/SpecializationConstant.cpp",
"src/gpu_info_util/SystemInfo.cpp",
"src/libANGLE/angletypes.cpp",
"src/libANGLE/AttributeMap.cpp",
"src/libANGLE/BlobCache.cpp",
"src/libANGLE/Buffer.cpp",
"src/libANGLE/Caps.cpp",
"src/libANGLE/CLBuffer.cpp",
"src/libANGLE/CLCommandQueue.cpp",
"src/libANGLE/CLContext.cpp",
"src/libANGLE/CLDevice.cpp",
"src/libANGLE/CLEvent.cpp",
"src/libANGLE/CLImage.cpp",
"src/libANGLE/CLKernel.cpp",
"src/libANGLE/CLMemory.cpp",
"src/libANGLE/CLObject.cpp",
"src/libANGLE/CLPlatform.cpp",
"src/libANGLE/CLProgram.cpp",
"src/libANGLE/CLSampler.cpp",
"src/libANGLE/cl_utils.cpp",
"src/libANGLE/Compiler.cpp",
"src/libANGLE/Config.cpp",
"src/libANGLE/Context.cpp",
"src/libANGLE/Context_gl.cpp",
"src/libANGLE/Context_gles_1_0.cpp",
"src/libANGLE/context_private_call_gl.cpp",
"src/libANGLE/context_private_call_gles.cpp",
"src/libANGLE/Debug.cpp",
"src/libANGLE/Device.cpp",
"src/libANGLE/Display.cpp",
"src/libANGLE/EGLSync.cpp",
"src/libANGLE/entry_points_utils.cpp",
"src/libANGLE/Error.cpp",
"src/libANGLE/es3_copy_conversion_table_autogen.cpp",
"src/libANGLE/Fence.cpp",
"src/libANGLE/formatutils.cpp",
"src/libANGLE/format_map_autogen.cpp",
"src/libANGLE/format_map_desktop.cpp",
"src/libANGLE/Framebuffer.cpp",
"src/libANGLE/FramebufferAttachment.cpp",
"src/libANGLE/GLES1Renderer.cpp",
"src/libANGLE/GLES1State.cpp",
"src/libANGLE/gles_extensions_autogen.cpp",
"src/libANGLE/GlobalMutex.cpp",
"src/libANGLE/HandleAllocator.cpp",
"src/libANGLE/Image.cpp",
"src/libANGLE/ImageIndex.cpp",
"src/libANGLE/IndexRangeCache.cpp",
"src/libANGLE/LoggingAnnotator.cpp",
"src/libANGLE/MemoryObject.cpp",
"src/libANGLE/MemoryProgramCache.cpp",
"src/libANGLE/MemoryShaderCache.cpp",
"src/libANGLE/Observer.cpp",
"src/libANGLE/Overlay.cpp",
"src/libANGLE/OverlayWidgets.cpp",
"src/libANGLE/Overlay_autogen.cpp",
"src/libANGLE/Overlay_font_autogen.cpp",
"src/libANGLE/PixelLocalStorage.cpp",
"src/libANGLE/Platform.cpp",
"src/libANGLE/Program.cpp",
"src/libANGLE/ProgramExecutable.cpp",
"src/libANGLE/ProgramLinkedResources.cpp",
"src/libANGLE/ProgramPipeline.cpp",
"src/libANGLE/Query.cpp",
"src/libANGLE/queryconversions.cpp",
"src/libANGLE/queryutils.cpp",
"src/libANGLE/Renderbuffer.cpp",
"src/libANGLE/ResourceManager.cpp",
"src/libANGLE/Sampler.cpp",
"src/libANGLE/Semaphore.cpp",
"src/libANGLE/Shader.cpp",
"src/libANGLE/SharedContextMutex.cpp",
"src/libANGLE/ShareGroup.cpp",
"src/libANGLE/State.cpp",
"src/libANGLE/Stream.cpp",
"src/libANGLE/Surface.cpp",
"src/libANGLE/Texture.cpp",
"src/libANGLE/Thread.cpp",
"src/libANGLE/TransformFeedback.cpp",
"src/libANGLE/Uniform.cpp",
"src/libANGLE/validationCL.cpp",
"src/libANGLE/validationEGL.cpp",
"src/libANGLE/validationES.cpp",
"src/libANGLE/validationES1.cpp",
"src/libANGLE/validationES2.cpp",
"src/libANGLE/validationES3.cpp",
"src/libANGLE/validationES31.cpp",
"src/libANGLE/validationES32.cpp",
"src/libANGLE/validationESEXT.cpp",
"src/libANGLE/validationGL1.cpp",
"src/libANGLE/validationGL2.cpp",
"src/libANGLE/validationGL3.cpp",
"src/libANGLE/validationGL4.cpp",
"src/libANGLE/VaryingPacking.cpp",
"src/libANGLE/VertexArray.cpp",
"src/libANGLE/VertexAttribute.cpp",
"src/libANGLE/capture/FrameCapture_mock.cpp",
"src/libANGLE/capture/serialize_mock.cpp",
"src/libANGLE/renderer/BufferImpl.cpp",
"src/libANGLE/renderer/CLCommandQueueImpl.cpp",
"src/libANGLE/renderer/CLContextImpl.cpp",
"src/libANGLE/renderer/CLDeviceImpl.cpp",
"src/libANGLE/renderer/CLEventImpl.cpp",
"src/libANGLE/renderer/CLExtensions.cpp",
"src/libANGLE/renderer/CLKernelImpl.cpp",
"src/libANGLE/renderer/CLMemoryImpl.cpp",
"src/libANGLE/renderer/CLPlatformImpl.cpp",
"src/libANGLE/renderer/CLProgramImpl.cpp",
"src/libANGLE/renderer/CLSamplerImpl.cpp",
"src/libANGLE/renderer/ContextImpl.cpp",
"src/libANGLE/renderer/DeviceImpl.cpp",
"src/libANGLE/renderer/DisplayImpl.cpp",
"src/libANGLE/renderer/driver_utils.cpp",
"src/libANGLE/renderer/EGLReusableSync.cpp",
"src/libANGLE/renderer/EGLSyncImpl.cpp",
"src/libANGLE/renderer/Format_table_autogen.cpp",
"src/libANGLE/renderer/FramebufferImpl.cpp",
"src/libANGLE/renderer/ImageImpl.cpp",
"src/libANGLE/renderer/load_functions_table_autogen.cpp",
"src/libANGLE/renderer/ProgramImpl.cpp",
"src/libANGLE/renderer/ProgramPipelineImpl.cpp",
"src/libANGLE/renderer/QueryImpl.cpp",
"src/libANGLE/renderer/RenderbufferImpl.cpp",
"src/libANGLE/renderer/renderer_utils.cpp",
"src/libANGLE/renderer/ShaderImpl.cpp",
"src/libANGLE/renderer/SurfaceImpl.cpp",
"src/libANGLE/renderer/TextureImpl.cpp",
"src/libANGLE/renderer/TransformFeedbackImpl.cpp",
"src/libANGLE/renderer/VertexArrayImpl.cpp",
"src/image_util/AstcDecompressor.cpp",
"src/image_util/copyimage.cpp",
"src/image_util/imageformats.cpp",
"src/image_util/loadimage.cpp",
"src/image_util/loadimage_astc.cpp",
"src/image_util/loadimage_etc.cpp",
"src/image_util/loadimage_paletted.cpp",
"src/image_util/storeimage_paletted.cpp",
"src/common/third_party/xxhash/xxhash.c",
"third_party/zlib/google/compression_utils_portable.cc",
"third_party/zlib/adler32.c",
"third_party/zlib/compress.c",
"third_party/zlib/cpu_features.c",
"third_party/zlib/crc32.c",
"third_party/zlib/crc_folding.c",
"third_party/zlib/deflate.c",
"third_party/zlib/gzclose.c",
"third_party/zlib/gzlib.c",
"third_party/zlib/gzread.c",
"third_party/zlib/gzwrite.c",
"third_party/zlib/infback.c",
"third_party/zlib/inffast.c",
"third_party/zlib/inflate.c",
"third_party/zlib/inftrees.c",
"third_party/zlib/trees.c",
"third_party/zlib/uncompr.c",
"third_party/zlib/zutil.c",
"third_party/astc-encoder/src/Source/astcenc_averages_and_directions.cpp",
"third_party/astc-encoder/src/Source/astcenc_block_sizes.cpp",
"third_party/astc-encoder/src/Source/astcenc_color_quantize.cpp",
"third_party/astc-encoder/src/Source/astcenc_color_unquantize.cpp",
"third_party/astc-encoder/src/Source/astcenc_compress_symbolic.cpp",
"third_party/astc-encoder/src/Source/astcenc_compute_variance.cpp",
"third_party/astc-encoder/src/Source/astcenc_decompress_symbolic.cpp",
"third_party/astc-encoder/src/Source/astcenc_diagnostic_trace.cpp",
"third_party/astc-encoder/src/Source/astcenc_entry.cpp",
"third_party/astc-encoder/src/Source/astcenc_find_best_partitioning.cpp",
"third_party/astc-encoder/src/Source/astcenc_ideal_endpoints_and_weights.cpp",
"third_party/astc-encoder/src/Source/astcenc_image.cpp",
"third_party/astc-encoder/src/Source/astcenc_integer_sequence.cpp",
"third_party/astc-encoder/src/Source/astcenc_mathlib.cpp",
"third_party/astc-encoder/src/Source/astcenc_mathlib_softfloat.cpp",
"third_party/astc-encoder/src/Source/astcenc_partition_tables.cpp",
"third_party/astc-encoder/src/Source/astcenc_percentile_tables.cpp",
"third_party/astc-encoder/src/Source/astcenc_pick_best_endpoint_format.cpp",
"third_party/astc-encoder/src/Source/astcenc_platform_isa_detection.cpp",
"third_party/astc-encoder/src/Source/astcenc_quantization.cpp",
"third_party/astc-encoder/src/Source/astcenc_symbolic_physical.cpp",
"third_party/astc-encoder/src/Source/astcenc_weight_align.cpp",
"third_party/astc-encoder/src/Source/astcenc_weight_quant_xfer_tables.cpp",
]
if env["platform"] == "macos":
angle_sources += [
"src/common/apple_platform_utils.mm",
"src/common/system_utils_apple.cpp",
"src/common/system_utils_posix.cpp",
"src/common/system_utils_mac.cpp",
"src/common/gl/cgl/FunctionsCGL.cpp",
"src/compiler/translator/msl/AstHelpers.cpp",
"src/compiler/translator/msl/ConstantNames.cpp",
"src/compiler/translator/msl/DiscoverDependentFunctions.cpp",
"src/compiler/translator/msl/DiscoverEnclosingFunctionTraverser.cpp",
"src/compiler/translator/msl/DriverUniformMetal.cpp",
"src/compiler/translator/msl/EmitMetal.cpp",
"src/compiler/translator/msl/IdGen.cpp",
"src/compiler/translator/msl/IntermRebuild.cpp",
"src/compiler/translator/msl/Layout.cpp",
"src/compiler/translator/msl/MapFunctionsToDefinitions.cpp",
"src/compiler/translator/msl/MapSymbols.cpp",
"src/compiler/translator/msl/ModifyStruct.cpp",
"src/compiler/translator/msl/Name.cpp",
"src/compiler/translator/msl/Pipeline.cpp",
"src/compiler/translator/msl/ProgramPrelude.cpp",
"src/compiler/translator/msl/RewritePipelines.cpp",
"src/compiler/translator/msl/SymbolEnv.cpp",
"src/compiler/translator/msl/ToposortStructs.cpp",
"src/compiler/translator/msl/TranslatorMSL.cpp",
"src/compiler/translator/msl/UtilsMSL.cpp",
"src/compiler/translator/tree_ops/glsl/apple/AddAndTrueToLoopCondition.cpp",
"src/compiler/translator/tree_ops/glsl/apple/RewriteDoWhile.cpp",
"src/compiler/translator/tree_ops/glsl/apple/RewriteRowMajorMatrices.cpp",
"src/compiler/translator/tree_ops/glsl/apple/RewriteUnaryMinusOperatorFloat.cpp",
"src/compiler/translator/tree_ops/glsl/apple/UnfoldShortCircuitAST.cpp",
"src/compiler/translator/tree_ops/msl/AddExplicitTypeCasts.cpp",
"src/compiler/translator/tree_ops/msl/ConvertUnsupportedConstructorsToFunctionCalls.cpp",
"src/compiler/translator/tree_ops/msl/FixTypeConstructors.cpp",
"src/compiler/translator/tree_ops/msl/GuardFragDepthWrite.cpp",
"src/compiler/translator/tree_ops/msl/HoistConstants.cpp",
"src/compiler/translator/tree_ops/msl/IntroduceVertexIndexID.cpp",
"src/compiler/translator/tree_ops/msl/NameEmbeddedUniformStructsMetal.cpp",
"src/compiler/translator/tree_ops/msl/ReduceInterfaceBlocks.cpp",
"src/compiler/translator/tree_ops/msl/RewriteCaseDeclarations.cpp",
"src/compiler/translator/tree_ops/msl/RewriteInterpolants.cpp",
"src/compiler/translator/tree_ops/msl/RewriteOutArgs.cpp",
"src/compiler/translator/tree_ops/msl/RewriteUnaddressableReferences.cpp",
"src/compiler/translator/tree_ops/msl/SeparateCompoundExpressions.cpp",
"src/compiler/translator/tree_ops/msl/SeparateCompoundStructDeclarations.cpp",
"src/compiler/translator/tree_ops/msl/TransposeRowMajorMatrices.cpp",
"src/compiler/translator/tree_ops/msl/WrapMain.cpp",
"src/gpu_info_util/SystemInfo_apple.mm",
"src/gpu_info_util/SystemInfo_macos.mm",
"src/libANGLE/renderer/driver_utils_mac.mm",
"src/libANGLE/renderer/metal/BufferMtl.mm",
"src/libANGLE/renderer/metal/CompilerMtl.mm",
"src/libANGLE/renderer/metal/ContextMtl.mm",
"src/libANGLE/renderer/metal/DeviceMtl.mm",
"src/libANGLE/renderer/metal/DisplayMtl.mm",
"src/libANGLE/renderer/metal/FrameBufferMtl.mm",
"src/libANGLE/renderer/metal/IOSurfaceSurfaceMtl.mm",
"src/libANGLE/renderer/metal/ImageMtl.mm",
"src/libANGLE/renderer/metal/ProgramMtl.mm",
"src/libANGLE/renderer/metal/ProvokingVertexHelper.mm",
"src/libANGLE/renderer/metal/QueryMtl.mm",
"src/libANGLE/renderer/metal/RenderBufferMtl.mm",
"src/libANGLE/renderer/metal/RenderTargetMtl.mm",
"src/libANGLE/renderer/metal/SamplerMtl.mm",
"src/libANGLE/renderer/metal/ShaderMtl.mm",
"src/libANGLE/renderer/metal/SurfaceMtl.mm",
"src/libANGLE/renderer/metal/SyncMtl.mm",
"src/libANGLE/renderer/metal/TextureMtl.mm",
"src/libANGLE/renderer/metal/TransformFeedbackMtl.mm",
"src/libANGLE/renderer/metal/VertexArrayMtl.mm",
"src/libANGLE/renderer/metal/blocklayoutMetal.cpp",
"src/libANGLE/renderer/metal/mtl_buffer_manager.mm",
"src/libANGLE/renderer/metal/mtl_buffer_pool.mm",
"src/libANGLE/renderer/metal/mtl_command_buffer.mm",
"src/libANGLE/renderer/metal/mtl_common.mm",
"src/libANGLE/renderer/metal/mtl_context_device.mm",
"src/libANGLE/renderer/metal/mtl_format_table_autogen.mm",
"src/libANGLE/renderer/metal/mtl_format_utils.mm",
"src/libANGLE/renderer/metal/mtl_library_cache.mm",
"src/libANGLE/renderer/metal/mtl_msl_utils.mm",
"src/libANGLE/renderer/metal/mtl_occlusion_query_pool.mm",
"src/libANGLE/renderer/metal/mtl_pipeline_cache.mm",
"src/libANGLE/renderer/metal/mtl_render_utils.mm",
"src/libANGLE/renderer/metal/mtl_resources.mm",
"src/libANGLE/renderer/metal/mtl_state_cache.mm",
"src/libANGLE/renderer/metal/mtl_utils.mm",
"src/libANGLE/renderer/metal/process.cpp",
"src/libANGLE/renderer/metal/renderermtl_utils.cpp",
"src/libANGLE/renderer/gl/BlitGL.cpp",
"src/libANGLE/renderer/gl/DisplayGL.cpp",
"src/libANGLE/renderer/gl/MemoryObjectGL.cpp",
"src/libANGLE/renderer/gl/RendererGL.cpp",
"src/libANGLE/renderer/gl/SyncGL.cpp",
"src/libANGLE/renderer/gl/renderergl_utils.cpp",
"src/libANGLE/renderer/gl/BufferGL.cpp",
"src/libANGLE/renderer/gl/PLSProgramCache.cpp",
"src/libANGLE/renderer/gl/SamplerGL.cpp",
"src/libANGLE/renderer/gl/TextureGL.cpp",
"src/libANGLE/renderer/gl/ClearMultiviewGL.cpp",
"src/libANGLE/renderer/gl/FenceNVGL.cpp",
"src/libANGLE/renderer/gl/ProgramGL.cpp",
"src/libANGLE/renderer/gl/SemaphoreGL.cpp",
"src/libANGLE/renderer/gl/TransformFeedbackGL.cpp",
"src/libANGLE/renderer/gl/CompilerGL.cpp",
"src/libANGLE/renderer/gl/FramebufferGL.cpp",
"src/libANGLE/renderer/gl/ProgramPipelineGL.cpp",
"src/libANGLE/renderer/gl/ShaderGL.cpp",
"src/libANGLE/renderer/gl/VertexArrayGL.cpp",
"src/libANGLE/renderer/gl/ContextGL.cpp",
"src/libANGLE/renderer/gl/FunctionsGL.cpp",
"src/libANGLE/renderer/gl/QueryGL.cpp",
"src/libANGLE/renderer/gl/StateManagerGL.cpp",
"src/libANGLE/renderer/gl/formatutilsgl.cpp",
"src/libANGLE/renderer/gl/DispatchTableGL_autogen.cpp",
"src/libANGLE/renderer/gl/ImageGL.cpp",
"src/libANGLE/renderer/gl/RenderbufferGL.cpp",
"src/libANGLE/renderer/gl/SurfaceGL.cpp",
"src/libANGLE/renderer/gl/null_functions.cpp",
"src/libANGLE/renderer/gl/cgl/ContextCGL.cpp",
"src/libANGLE/renderer/gl/cgl/DisplayCGL.mm",
"src/libANGLE/renderer/gl/cgl/DeviceCGL.cpp",
"src/libANGLE/renderer/gl/cgl/IOSurfaceSurfaceCGL.cpp",
"src/libANGLE/renderer/gl/cgl/PbufferSurfaceCGL.cpp",
"src/libANGLE/renderer/gl/cgl/RendererCGL.cpp",
"src/libANGLE/renderer/gl/cgl/WindowSurfaceCGL.mm",
]
if env["platform"] == "windows":
angle_sources += [
"src/common/system_utils_win.cpp",
"src/common/system_utils_win32.cpp",
"src/compiler/translator/hlsl/ASTMetadataHLSL.cpp",
"src/compiler/translator/hlsl/AtomicCounterFunctionHLSL.cpp",
"src/compiler/translator/hlsl/blocklayoutHLSL.cpp",
"src/compiler/translator/hlsl/BuiltInFunctionEmulatorHLSL.cpp",
"src/compiler/translator/hlsl/emulated_builtin_functions_hlsl_autogen.cpp",
"src/compiler/translator/hlsl/ImageFunctionHLSL.cpp",
"src/compiler/translator/hlsl/OutputHLSL.cpp",
"src/compiler/translator/hlsl/ResourcesHLSL.cpp",
"src/compiler/translator/hlsl/ShaderStorageBlockFunctionHLSL.cpp",
"src/compiler/translator/hlsl/ShaderStorageBlockOutputHLSL.cpp",
"src/compiler/translator/hlsl/StructureHLSL.cpp",
"src/compiler/translator/hlsl/TextureFunctionHLSL.cpp",
"src/compiler/translator/hlsl/TranslatorHLSL.cpp",
"src/compiler/translator/hlsl/UtilsHLSL.cpp",
"src/compiler/translator/tree_ops/hlsl/AddDefaultReturnStatements.cpp",
"src/compiler/translator/tree_ops/hlsl/AggregateAssignArraysInSSBOs.cpp",
"src/compiler/translator/tree_ops/hlsl/AggregateAssignStructsInSSBOs.cpp",
"src/compiler/translator/tree_ops/hlsl/ArrayReturnValueToOutParameter.cpp",
"src/compiler/translator/tree_ops/hlsl/BreakVariableAliasingInInnerLoops.cpp",
"src/compiler/translator/tree_ops/hlsl/ExpandIntegerPowExpressions.cpp",
"src/compiler/translator/tree_ops/hlsl/RecordUniformBlocksWithLargeArrayMember.cpp",
"src/compiler/translator/tree_ops/hlsl/RemoveSwitchFallThrough.cpp",
"src/compiler/translator/tree_ops/hlsl/RewriteAtomicFunctionExpressions.cpp",
"src/compiler/translator/tree_ops/hlsl/RewriteElseBlocks.cpp",
"src/compiler/translator/tree_ops/hlsl/RewriteExpressionsWithShaderStorageBlock.cpp",
"src/compiler/translator/tree_ops/hlsl/RewriteUnaryMinusOperatorInt.cpp",
"src/compiler/translator/tree_ops/hlsl/SeparateArrayConstructorStatements.cpp",
"src/compiler/translator/tree_ops/hlsl/SeparateArrayInitialization.cpp",
"src/compiler/translator/tree_ops/hlsl/SeparateExpressionsReturningArrays.cpp",
"src/compiler/translator/tree_ops/hlsl/UnfoldShortCircuitToIf.cpp",
"src/compiler/translator/tree_ops/hlsl/WrapSwitchStatementsInBlocks.cpp",
"src/gpu_info_util/SystemInfo_win.cpp",
"src/libANGLE/renderer/d3d_format.cpp",
"src/libANGLE/renderer/dxgi_format_map_autogen.cpp",
"src/libANGLE/renderer/dxgi_support_table_autogen.cpp",
"src/libANGLE/renderer/d3d/BufferD3D.cpp",
"src/libANGLE/renderer/d3d/CompilerD3D.cpp",
"src/libANGLE/renderer/d3d/DeviceD3D.cpp",
"src/libANGLE/renderer/d3d/DisplayD3D.cpp",
"src/libANGLE/renderer/d3d/driver_utils_d3d.cpp",
"src/libANGLE/renderer/d3d/DynamicHLSL.cpp",
"src/libANGLE/renderer/d3d/DynamicImage2DHLSL.cpp",
"src/libANGLE/renderer/d3d/EGLImageD3D.cpp",
"src/libANGLE/renderer/d3d/FramebufferD3D.cpp",
"src/libANGLE/renderer/d3d/HLSLCompiler.cpp",
"src/libANGLE/renderer/d3d/ImageD3D.cpp",
"src/libANGLE/renderer/d3d/IndexBuffer.cpp",
"src/libANGLE/renderer/d3d/IndexDataManager.cpp",
"src/libANGLE/renderer/d3d/NativeWindowD3D.cpp",
"src/libANGLE/renderer/d3d/ProgramD3D.cpp",
"src/libANGLE/renderer/d3d/RenderbufferD3D.cpp",
"src/libANGLE/renderer/d3d/RendererD3D.cpp",
"src/libANGLE/renderer/d3d/RenderTargetD3D.cpp",
"src/libANGLE/renderer/d3d/ShaderD3D.cpp",
"src/libANGLE/renderer/d3d/ShaderExecutableD3D.cpp",
"src/libANGLE/renderer/d3d/SurfaceD3D.cpp",
"src/libANGLE/renderer/d3d/SwapChainD3D.cpp",
"src/libANGLE/renderer/d3d/TextureD3D.cpp",
"src/libANGLE/renderer/d3d/VertexBuffer.cpp",
"src/libANGLE/renderer/d3d/VertexDataManager.cpp",
"src/libANGLE/renderer/d3d/d3d11/Blit11.cpp",
"src/libANGLE/renderer/d3d/d3d11/Buffer11.cpp",
"src/libANGLE/renderer/d3d/d3d11/Clear11.cpp",
"src/libANGLE/renderer/d3d/d3d11/Context11.cpp",
"src/libANGLE/renderer/d3d/d3d11/DebugAnnotator11.cpp",
"src/libANGLE/renderer/d3d/d3d11/ExternalImageSiblingImpl11.cpp",
"src/libANGLE/renderer/d3d/d3d11/Fence11.cpp",
"src/libANGLE/renderer/d3d/d3d11/formatutils11.cpp",
"src/libANGLE/renderer/d3d/d3d11/Framebuffer11.cpp",
"src/libANGLE/renderer/d3d/d3d11/Image11.cpp",
"src/libANGLE/renderer/d3d/d3d11/IndexBuffer11.cpp",
"src/libANGLE/renderer/d3d/d3d11/InputLayoutCache.cpp",
"src/libANGLE/renderer/d3d/d3d11/MappedSubresourceVerifier11.cpp",
"src/libANGLE/renderer/d3d/d3d11/PixelTransfer11.cpp",
"src/libANGLE/renderer/d3d/d3d11/Program11.cpp",
"src/libANGLE/renderer/d3d/d3d11/ProgramPipeline11.cpp",
"src/libANGLE/renderer/d3d/d3d11/Query11.cpp",
"src/libANGLE/renderer/d3d/d3d11/Renderer11.cpp",
"src/libANGLE/renderer/d3d/d3d11/renderer11_utils.cpp",
"src/libANGLE/renderer/d3d/d3d11/RenderStateCache.cpp",
"src/libANGLE/renderer/d3d/d3d11/RenderTarget11.cpp",
"src/libANGLE/renderer/d3d/d3d11/ResourceManager11.cpp",
"src/libANGLE/renderer/d3d/d3d11/ShaderExecutable11.cpp",
"src/libANGLE/renderer/d3d/d3d11/StateManager11.cpp",
"src/libANGLE/renderer/d3d/d3d11/StreamProducerD3DTexture.cpp",
"src/libANGLE/renderer/d3d/d3d11/SwapChain11.cpp",
"src/libANGLE/renderer/d3d/d3d11/TextureStorage11.cpp",
"src/libANGLE/renderer/d3d/d3d11/texture_format_table.cpp",
"src/libANGLE/renderer/d3d/d3d11/texture_format_table_autogen.cpp",
"src/libANGLE/renderer/d3d/d3d11/TransformFeedback11.cpp",
"src/libANGLE/renderer/d3d/d3d11/Trim11.cpp",
"src/libANGLE/renderer/d3d/d3d11/VertexArray11.cpp",
"src/libANGLE/renderer/d3d/d3d11/VertexBuffer11.cpp",
"src/libANGLE/renderer/d3d/d3d11/converged/CompositorNativeWindow11.cpp",
"src/libANGLE/renderer/d3d/d3d11/win32/NativeWindow11Win32.cpp",
]
angle_sources_egl = [
"src/libEGL/egl_loader_autogen.cpp",
"src/libEGL/libEGL_autogen.cpp",
]
angle_sources_gles = [
"src/libGLESv2/egl_ext_stubs.cpp",
"src/libGLESv2/egl_stubs.cpp",
"src/libGLESv2/entry_points_egl_autogen.cpp",
"src/libGLESv2/entry_points_egl_ext_autogen.cpp",
"src/libGLESv2/entry_points_gles_1_0_autogen.cpp",
"src/libGLESv2/entry_points_gles_2_0_autogen.cpp",
"src/libGLESv2/entry_points_gles_3_0_autogen.cpp",
"src/libGLESv2/entry_points_gles_3_1_autogen.cpp",
"src/libGLESv2/entry_points_gles_3_2_autogen.cpp",
"src/libGLESv2/entry_points_gles_ext_autogen.cpp",
"src/libGLESv2/global_state.cpp",
"src/libGLESv2/libGLESv2_autogen.cpp",
"src/libGLESv2/proc_table_egl_autogen.cpp",
]
env.Append(CPPDEFINES=[("ANGLE_CAPTURE_ENABLED", 0)])
env.Append(CPPDEFINES=[("ANGLE_ENABLE_ESSL", 1)])
env.Append(CPPDEFINES=[("ANGLE_ENABLE_GLSL", 1)])
env.Append(CPPDEFINES=[("ANGLE_EXPORT", '""')])
if env["arch"] in ["x86_64", "arm64"]:
env.Append(CPPDEFINES=[("ANGLE_IS_64_BIT_CPU", 1)])
else:
env.Append(CPPDEFINES=[("ANGLE_IS_32_BIT_CPU", 1)])
if env["platform"] == "macos":
env.Append(CPPDEFINES=[("ANGLE_IS_MAC", 1)])
env.Append(CPPDEFINES=[("ANGLE_ENABLE_METAL", 1)])
env.Append(CPPDEFINES=[("ANGLE_ENABLE_OPENGL", 1)])
env.Append(CPPDEFINES=[("ANGLE_ENABLE_GL_DESKTOP_BACKEND", 1)])
env.Append(CPPDEFINES=[("ANGLE_ENABLE_GL_NULL", 1)])
env.Append(CPPDEFINES=[("ANGLE_ENABLE_CGL", 1)])
env.Append(CCFLAGS=["-fno-objc-arc", "-fno-objc-msgsend-selector-stubs", "-Wno-unused-command-line-argument"])
if env["platform"] == "windows":
env.Append(CPPDEFINES=[("ANGLE_IS_WIN", 1)])
env.Append(
CPPDEFINES=[
(
"ANGLE_PRELOADED_D3DCOMPILER_MODULE_NAMES",
'{ \\"d3dcompiler_47.dll\\", \\"d3dcompiler_46.dll\\", \\"d3dcompiler_43.dll\\" }',
)
]
)
env.Append(CPPDEFINES=[("ANGLE_ENABLE_D3D11", 1)])
env.Append(CPPDEFINES=[("ANGLE_ENABLE_D3D11_COMPOSITOR_NATIVE_WINDOW", 1)])
env.Append(CPPDEFINES=[("ANGLE_ENABLE_HLSL", 1)])
env.Append(CPPDEFINES=[("NOMINMAX", 1)])
env.Append(CPPDEFINES=[("X86_WINDOWS", 1)])
env.Append(CPPDEFINES=[("ANGLE_STANDALONE_BUILD", 1)])
env.Append(CPPDEFINES=[("ANGLE_STATIC", 1)])
env.Append(CPPDEFINES=[("ANGLE_UTIL_EXPORT", '""')])
env.Append(CPPDEFINES=[("EGLAPI", '""')])
env.Append(CPPDEFINES=[("GL_API", '""')])
env.Append(CPPDEFINES=[("GL_APICALL", '""')])
env.Append(CPPDEFINES=[("GL_SILENCE_DEPRECATION", 1)])
env.Prepend(CPPPATH=["src"])
env.Prepend(CPPPATH=["include"])
env.Prepend(CPPPATH=["include/KHR"])
env.Prepend(CPPPATH=["src/common/third_party/base"])
env.Prepend(CPPPATH=["src/common/base"])
env.Prepend(CPPPATH=["src/common/third_party/xxhash"])
env.Prepend(CPPPATH=["src/third_party/khronos"])
env.Prepend(CPPPATH=["third_party/astc-encoder/src/Source"])
env.Prepend(CPPPATH=["third_party/zlib"])
env.Prepend(CPPPATH=["third_party/zlib/google"])
env.Append(CPPDEFINES=[("USE_AURA", 1)])
env.Append(CPPDEFINES=[("_HAS_EXCEPTIONS", "0")])
env.Append(CPPDEFINES=[("NDEBUG", 1)])
env.Append(CPPDEFINES=[("NVALGRIND", 1)])
env.Append(CPPDEFINES=[("DYNAMIC_ANNOTATIONS_ENABLED", 0)])
env.Append(CPPDEFINES=[("ANGLE_VMA_VERSION", 3000000)])
env.Append(CPPDEFINES=[("ANGLE_ENABLE_SHARE_CONTEXT_LOCK", 1)])
env.Append(CPPDEFINES=[("ANGLE_ENABLE_CONTEXT_MUTEX", 1)])
env.Append(CPPDEFINES=[("ANGLE_OUTSIDE_WEBKIT", 1)])
env_egl = env.Clone()
env_gles = env.Clone()
env.Append(CPPDEFINES=[("LIBANGLE_IMPLEMENTATION", 1)])
env.Append(CPPDEFINES=[("EGL_EGL_PROTOTYPES", 0)])
env_egl.Append(CPPDEFINES=[("EGL_EGLEXT_PROTOTYPES", 1)])
env_egl.Append(CPPDEFINES=[("EGL_EGL_PROTOTYPES", 1)])
env_egl.Append(CPPDEFINES=[("GL_GLES_PROTOTYPES", 1)])
env_egl.Append(CPPDEFINES=[("GL_GLEXT_PROTOTYPES", 1)])
env_gles.Append(CPPDEFINES=[("LIBGLESV2_IMPLEMENTATION", 1)])
env_gles.Append(CPPDEFINES=[("EGL_EGL_PROTOTYPES", 0)])
env_gles.Append(CPPDEFINES=[("GL_GLES_PROTOTYPES", 0)])
suffix = ".{}.{}".format(env["platform"], env["arch"])
# Expose it when included from another project
env["suffix"] = suffix
library = None
library_egl = None
library_gles = None
env["OBJSUFFIX"] = suffix + env["OBJSUFFIX"]
library_name = "libANGLE{}{}".format(suffix, env["LIBSUFFIX"])
library_egl_name = "libEGL{}{}".format(suffix, env["LIBSUFFIX"])
library_gles_name = "libGLES{}{}".format(suffix, env["LIBSUFFIX"])
library = env.StaticLibrary(name="ANGLE", target=env.File("bin/%s" % library_name), source=angle_sources)
library_egl = env_egl.StaticLibrary(name="EGL", target=env_egl.File("bin/%s" % library_egl_name), source=angle_sources_egl)
library_gles = env_gles.StaticLibrary(name="GLES", target=env_gles.File("bin/%s" % library_gles_name), source=angle_sources_gles)
Return("env")

View File

@@ -0,0 +1,228 @@
diff --git a/include/platform/PlatformMethods.h b/include/platform/PlatformMethods.h
index a3233a2cd5..b4e684842c 100644
--- a/include/platform/PlatformMethods.h
+++ b/include/platform/PlatformMethods.h
@@ -313,7 +313,7 @@ extern "C" {
// The application should set any platform methods it cares about on the returned pointer.
// If display is not valid, behaviour is undefined.
-ANGLE_PLATFORM_EXPORT bool ANGLE_APIENTRY ANGLEGetDisplayPlatform(angle::EGLDisplayType display,
+bool ANGLE_APIENTRY ANGLEGetDisplayPlatform(angle::EGLDisplayType display,
const char *const methodNames[],
unsigned int methodNameCount,
void *context,
@@ -321,7 +321,7 @@ ANGLE_PLATFORM_EXPORT bool ANGLE_APIENTRY ANGLEGetDisplayPlatform(angle::EGLDisp
// Sets the platform methods back to their defaults.
// If display is not valid, behaviour is undefined.
-ANGLE_PLATFORM_EXPORT void ANGLE_APIENTRY ANGLEResetDisplayPlatform(angle::EGLDisplayType display);
+void ANGLE_APIENTRY ANGLEResetDisplayPlatform(angle::EGLDisplayType display);
} // extern "C"
namespace angle
diff --git a/src/libANGLE/SharedContextMutex.cpp b/src/libANGLE/SharedContextMutex.cpp
index 352a6781b2..714d01c51a 100644
--- a/src/libANGLE/SharedContextMutex.cpp
+++ b/src/libANGLE/SharedContextMutex.cpp
@@ -125,7 +125,7 @@ void SharedContextMutex<Mutex>::unlock()
}
template <class Mutex>
-ANGLE_INLINE SharedContextMutex<Mutex> *SharedContextMutex<Mutex>::doTryLock()
+SharedContextMutex<Mutex> *SharedContextMutex<Mutex>::doTryLock()
{
angle::ThreadId currentThreadId;
ASSERT(!CheckThreadIdCurrent(mOwnerThreadId, &currentThreadId));
@@ -147,7 +147,7 @@ ANGLE_INLINE SharedContextMutex<Mutex> *SharedContextMutex<Mutex>::doTryLock()
}
template <class Mutex>
-ANGLE_INLINE SharedContextMutex<Mutex> *SharedContextMutex<Mutex>::doLock()
+SharedContextMutex<Mutex> *SharedContextMutex<Mutex>::doLock()
{
angle::ThreadId currentThreadId;
ASSERT(!CheckThreadIdCurrent(mOwnerThreadId, &currentThreadId));
@@ -166,7 +166,7 @@ ANGLE_INLINE SharedContextMutex<Mutex> *SharedContextMutex<Mutex>::doLock()
}
template <class Mutex>
-ANGLE_INLINE void SharedContextMutex<Mutex>::doUnlock()
+void SharedContextMutex<Mutex>::doUnlock()
{
ASSERT(
TryUpdateThreadId(&mOwnerThreadId, angle::GetCurrentThreadId(), angle::InvalidThreadId()));
diff --git a/src/libANGLE/renderer/d3d/d3d11/converged/CompositorNativeWindow11.cpp b/src/libANGLE/renderer/d3d/d3d11/converged/CompositorNativeWindow11.cpp
index 0e64f78d53..17ed63e66c 100644
--- a/src/libANGLE/renderer/d3d/d3d11/converged/CompositorNativeWindow11.cpp
+++ b/src/libANGLE/renderer/d3d/d3d11/converged/CompositorNativeWindow11.cpp
@@ -38,14 +38,22 @@ bool CompositorNativeWindow11::getClientRect(LPRECT rect) const
mHostVisual.As(&visual);
ABI::Windows::Foundation::Numerics::Vector2 size;
+#if defined(MINGW_ENABLED)
+ HRESULT hr = visual->get_Size((ABI::Windows::UI::Composition::Vector2*)&size);
+#else
HRESULT hr = visual->get_Size(&size);
+#endif
if (FAILED(hr))
{
return false;
}
ABI::Windows::Foundation::Numerics::Vector3 offset;
+#if defined(MINGW_ENABLED)
+ hr = visual->get_Offset((ABI::Windows::UI::Composition::Vector3*)&offset);
+#else
hr = visual->get_Offset(&offset);
+#endif
if (FAILED(hr))
{
return false;
diff --git a/src/libANGLE/renderer/d3d/d3d11/converged/CompositorNativeWindow11.h b/src/libANGLE/renderer/d3d/d3d11/converged/CompositorNativeWindow11.h
index aec331a76c..be98814486 100644
--- a/src/libANGLE/renderer/d3d/d3d11/converged/CompositorNativeWindow11.h
+++ b/src/libANGLE/renderer/d3d/d3d11/converged/CompositorNativeWindow11.h
@@ -12,6 +12,143 @@
#include "libANGLE/renderer/d3d/d3d11/NativeWindow11.h"
+#if defined(MINGW_ENABLED)
+#ifndef DirectXAlphaMode
+enum DirectXAlphaMode {
+ DirectXAlphaMode_Unspecified = 0,
+ DirectXAlphaMode_Premultiplied = 1,
+ DirectXAlphaMode_Straight = 2,
+ DirectXAlphaMode_Ignore = 3
+};
+#endif
+
+#ifndef DirectXPixelFormat
+enum DirectXPixelFormat {
+ DirectXPixelFormat_Unknown = 0,
+ DirectXPixelFormat_R32G32B32A32Typeless = 1,
+ DirectXPixelFormat_R32G32B32A32Float = 2,
+ DirectXPixelFormat_R32G32B32A32UInt = 3,
+ DirectXPixelFormat_R32G32B32A32Int = 4,
+ DirectXPixelFormat_R32G32B32Typeless = 5,
+ DirectXPixelFormat_R32G32B32Float = 6,
+ DirectXPixelFormat_R32G32B32UInt = 7,
+ DirectXPixelFormat_R32G32B32Int = 8,
+ DirectXPixelFormat_R16G16B16A16Typeless = 9,
+ DirectXPixelFormat_R16G16B16A16Float = 10,
+ DirectXPixelFormat_R16G16B16A16UIntNormalized = 11,
+ DirectXPixelFormat_R16G16B16A16UInt = 12,
+ DirectXPixelFormat_R16G16B16A16IntNormalized = 13,
+ DirectXPixelFormat_R16G16B16A16Int = 14,
+ DirectXPixelFormat_R32G32Typeless = 15,
+ DirectXPixelFormat_R32G32Float = 16,
+ DirectXPixelFormat_R32G32UInt = 17,
+ DirectXPixelFormat_R32G32Int = 18,
+ DirectXPixelFormat_R32G8X24Typeless = 19,
+ DirectXPixelFormat_D32FloatS8X24UInt = 20,
+ DirectXPixelFormat_R32FloatX8X24Typeless = 21,
+ DirectXPixelFormat_X32TypelessG8X24UInt = 22,
+ DirectXPixelFormat_R10G10B10A2Typeless = 23,
+ DirectXPixelFormat_R10G10B10A2UIntNormalized = 24,
+ DirectXPixelFormat_R10G10B10A2UInt = 25,
+ DirectXPixelFormat_R11G11B10Float = 26,
+ DirectXPixelFormat_R8G8B8A8Typeless = 27,
+ DirectXPixelFormat_R8G8B8A8UIntNormalized = 28,
+ DirectXPixelFormat_R8G8B8A8UIntNormalizedSrgb = 29,
+ DirectXPixelFormat_R8G8B8A8UInt = 30,
+ DirectXPixelFormat_R8G8B8A8IntNormalized = 31,
+ DirectXPixelFormat_R8G8B8A8Int = 32,
+ DirectXPixelFormat_R16G16Typeless = 33,
+ DirectXPixelFormat_R16G16Float = 34,
+ DirectXPixelFormat_R16G16UIntNormalized = 35,
+ DirectXPixelFormat_R16G16UInt = 36,
+ DirectXPixelFormat_R16G16IntNormalized = 37,
+ DirectXPixelFormat_R16G16Int = 38,
+ DirectXPixelFormat_R32Typeless = 39,
+ DirectXPixelFormat_D32Float = 40,
+ DirectXPixelFormat_R32Float = 41,
+ DirectXPixelFormat_R32UInt = 42,
+ DirectXPixelFormat_R32Int = 43,
+ DirectXPixelFormat_R24G8Typeless = 44,
+ DirectXPixelFormat_D24UIntNormalizedS8UInt = 45,
+ DirectXPixelFormat_R24UIntNormalizedX8Typeless = 46,
+ DirectXPixelFormat_X24TypelessG8UInt = 47,
+ DirectXPixelFormat_R8G8Typeless = 48,
+ DirectXPixelFormat_R8G8UIntNormalized = 49,
+ DirectXPixelFormat_R8G8UInt = 50,
+ DirectXPixelFormat_R8G8IntNormalized = 51,
+ DirectXPixelFormat_R8G8Int = 52,
+ DirectXPixelFormat_R16Typeless = 53,
+ DirectXPixelFormat_R16Float = 54,
+ DirectXPixelFormat_D16UIntNormalized = 55,
+ DirectXPixelFormat_R16UIntNormalized = 56,
+ DirectXPixelFormat_R16UInt = 57,
+ DirectXPixelFormat_R16IntNormalized = 58,
+ DirectXPixelFormat_R16Int = 59,
+ DirectXPixelFormat_R8Typeless = 60,
+ DirectXPixelFormat_R8UIntNormalized = 61,
+ DirectXPixelFormat_R8UInt = 62,
+ DirectXPixelFormat_R8IntNormalized = 63,
+ DirectXPixelFormat_R8Int = 64,
+ DirectXPixelFormat_A8UIntNormalized = 65,
+ DirectXPixelFormat_R1UIntNormalized = 66,
+ DirectXPixelFormat_R9G9B9E5SharedExponent = 67,
+ DirectXPixelFormat_R8G8B8G8UIntNormalized = 68,
+ DirectXPixelFormat_G8R8G8B8UIntNormalized = 69,
+ DirectXPixelFormat_BC1Typeless = 70,
+ DirectXPixelFormat_BC1UIntNormalized = 71,
+ DirectXPixelFormat_BC1UIntNormalizedSrgb = 72,
+ DirectXPixelFormat_BC2Typeless = 73,
+ DirectXPixelFormat_BC2UIntNormalized = 74,
+ DirectXPixelFormat_BC2UIntNormalizedSrgb = 75,
+ DirectXPixelFormat_BC3Typeless = 76,
+ DirectXPixelFormat_BC3UIntNormalized = 77,
+ DirectXPixelFormat_BC3UIntNormalizedSrgb = 78,
+ DirectXPixelFormat_BC4Typeless = 79,
+ DirectXPixelFormat_BC4UIntNormalized = 80,
+ DirectXPixelFormat_BC4IntNormalized = 81,
+ DirectXPixelFormat_BC5Typeless = 82,
+ DirectXPixelFormat_BC5UIntNormalized = 83,
+ DirectXPixelFormat_BC5IntNormalized = 84,
+ DirectXPixelFormat_B5G6R5UIntNormalized = 85,
+ DirectXPixelFormat_B5G5R5A1UIntNormalized = 86,
+ DirectXPixelFormat_B8G8R8A8UIntNormalized = 87,
+ DirectXPixelFormat_B8G8R8X8UIntNormalized = 88,
+ DirectXPixelFormat_R10G10B10XRBiasA2UIntNormalized = 89,
+ DirectXPixelFormat_B8G8R8A8Typeless = 90,
+ DirectXPixelFormat_B8G8R8A8UIntNormalizedSrgb = 91,
+ DirectXPixelFormat_B8G8R8X8Typeless = 92,
+ DirectXPixelFormat_B8G8R8X8UIntNormalizedSrgb = 93,
+ DirectXPixelFormat_BC6HTypeless = 94,
+ DirectXPixelFormat_BC6H16UnsignedFloat = 95,
+ DirectXPixelFormat_BC6H16Float = 96,
+ DirectXPixelFormat_BC7Typeless = 97,
+ DirectXPixelFormat_BC7UIntNormalized = 98,
+ DirectXPixelFormat_BC7UIntNormalizedSrgb = 99,
+ DirectXPixelFormat_Ayuv = 100,
+ DirectXPixelFormat_Y410 = 101,
+ DirectXPixelFormat_Y416 = 102,
+ DirectXPixelFormat_NV12 = 103,
+ DirectXPixelFormat_P010 = 104,
+ DirectXPixelFormat_P016 = 105,
+ DirectXPixelFormat_Opaque420 = 106,
+ DirectXPixelFormat_Yuy2 = 107,
+ DirectXPixelFormat_Y210 = 108,
+ DirectXPixelFormat_Y216 = 109,
+ DirectXPixelFormat_NV11 = 110,
+ DirectXPixelFormat_AI44 = 111,
+ DirectXPixelFormat_IA44 = 112,
+ DirectXPixelFormat_P8 = 113,
+ DirectXPixelFormat_A8P8 = 114,
+ DirectXPixelFormat_B4G4R4A4UIntNormalized = 115,
+ DirectXPixelFormat_P208 = 130,
+ DirectXPixelFormat_V208 = 131,
+ DirectXPixelFormat_V408 = 132,
+ DirectXPixelFormat_SamplerFeedbackMinMipOpaque = 189,
+ DirectXPixelFormat_SamplerFeedbackMipRegionUsedOpaque = 190
+};
+#endif
+#endif
+
#include <dispatcherqueue.h>
#include <windows.foundation.metadata.h>
#include <windows.ui.composition.h>

50
godot-tools/macos.py Normal file
View File

@@ -0,0 +1,50 @@
import os
import sys
import macos_osxcross
def options(opts):
opts.Add("macos_deployment_target", "macOS deployment target", "default")
opts.Add("macos_sdk_path", "macOS SDK path", "")
macos_osxcross.options(opts)
def exists(env):
return sys.platform == "darwin" or macos_osxcross.exists(env)
def generate(env):
if env["arch"] not in ("universal", "arm64", "x86_64"):
print("Only universal, arm64, and x86_64 are supported on macOS. Exiting.")
Exit()
if sys.platform == "darwin":
# Use clang on macOS by default
env["CXX"] = "clang++"
env["CC"] = "clang"
else:
# Use osxcross
macos_osxcross.generate(env)
if env["arch"] == "universal":
env.Append(LINKFLAGS=["-arch", "x86_64", "-arch", "arm64"])
env.Append(CCFLAGS=["-arch", "x86_64", "-arch", "arm64"])
else:
env.Append(LINKFLAGS=["-arch", env["arch"]])
env.Append(CCFLAGS=["-arch", env["arch"]])
if env["macos_deployment_target"] != "default":
env.Append(CCFLAGS=["-mmacosx-version-min=" + env["macos_deployment_target"]])
env.Append(LINKFLAGS=["-mmacosx-version-min=" + env["macos_deployment_target"]])
if env["macos_sdk_path"]:
env.Append(CCFLAGS=["-isysroot", env["macos_sdk_path"]])
env.Append(LINKFLAGS=["-isysroot", env["macos_sdk_path"]])
env.Append(
LINKFLAGS=[
"-framework",
"Cocoa",
"-Wl,-undefined,dynamic_lookup",
]
)

View File

@@ -0,0 +1,28 @@
import os
def options(opts):
opts.Add("osxcross_sdk", "OSXCross SDK version", "darwin16")
def exists(env):
return "OSXCROSS_ROOT" in os.environ
def generate(env):
root = os.environ.get("OSXCROSS_ROOT", "")
if env["arch"] == "arm64":
basecmd = root + "/target/bin/arm64-apple-" + env["osxcross_sdk"] + "-"
else:
basecmd = root + "/target/bin/x86_64-apple-" + env["osxcross_sdk"] + "-"
env["CC"] = basecmd + "clang"
env["CXX"] = basecmd + "clang++"
env["AR"] = basecmd + "ar"
env["RANLIB"] = basecmd + "ranlib"
env["AS"] = basecmd + "as"
binpath = os.path.join(root, "target", "bin")
if binpath not in env["ENV"]["PATH"]:
# Add OSXCROSS bin folder to PATH (required for linking).
env["ENV"]["PATH"] = "%s:%s" % (binpath, env["ENV"]["PATH"])

52
godot-tools/my_spawn.py Normal file
View File

@@ -0,0 +1,52 @@
import os
def exists(env):
return os.name == "nt"
# Workaround for MinGW. See:
# http://www.scons.org/wiki/LongCmdLinesOnWin32
def configure(env):
import subprocess
def mySubProcess(cmdline, env):
# print "SPAWNED : " + cmdline
startupinfo = subprocess.STARTUPINFO()
startupinfo.dwFlags |= subprocess.STARTF_USESHOWWINDOW
proc = subprocess.Popen(
cmdline,
stdin=subprocess.PIPE,
stdout=subprocess.PIPE,
stderr=subprocess.PIPE,
startupinfo=startupinfo,
shell=False,
env=env,
)
data, err = proc.communicate()
rv = proc.wait()
if rv:
print("=====")
print(err.decode("utf-8"))
print("=====")
return rv
def mySpawn(sh, escape, cmd, args, env):
newargs = " ".join(args[1:])
cmdline = cmd + " " + newargs
rv = 0
if len(cmdline) > 32000 and cmd.endswith("ar"):
cmdline = cmd + " " + args[1] + " " + args[2] + " "
for i in range(3, len(args)):
rv = mySubProcess(cmdline + args[i], env)
if rv:
break
else:
rv = mySubProcess(cmdline, env)
return rv
env["SPAWN"] = mySpawn
env.Replace(ARFLAGS=["q"])

73
godot-tools/targets.py Normal file
View File

@@ -0,0 +1,73 @@
import os
import sys
from SCons.Script import ARGUMENTS
from SCons.Variables import *
from SCons.Variables.BoolVariable import _text2bool
def get_cmdline_bool(option, default):
"""We use `ARGUMENTS.get()` to check if options were manually overridden on the command line,
and SCons' _text2bool helper to convert them to booleans, otherwise they're handled as strings.
"""
cmdline_val = ARGUMENTS.get(option)
if cmdline_val is not None:
return _text2bool(cmdline_val)
else:
return default
def options(opts):
opts.Add(
EnumVariable(
"optimize",
"The desired optimization flags",
"speed_trace",
("none", "custom", "debug", "speed", "speed_trace", "size"),
)
)
opts.Add(BoolVariable("debug_symbols", "Build with debugging symbols", True))
def exists(env):
return True
def generate(env):
opt_level = "speed"
env["optimize"] = ARGUMENTS.get("optimize", opt_level)
env["debug_symbols"] = get_cmdline_bool("debug_symbols", False)
if env.get("is_msvc", False):
if env["debug_symbols"]:
env.Append(CCFLAGS=["/Zi", "/FS"])
env.Append(LINKFLAGS=["/DEBUG:FULL"])
if env["optimize"] == "speed" or env["optimize"] == "speed_trace":
env.Append(CCFLAGS=["/O2"])
env.Append(LINKFLAGS=["/OPT:REF"])
elif env["optimize"] == "size":
env.Append(CCFLAGS=["/O1"])
env.Append(LINKFLAGS=["/OPT:REF"])
if env["optimize"] == "debug" or env["optimize"] == "none":
env.Append(CCFLAGS=["/Od"])
else:
if env["debug_symbols"]:
if env.dev_build:
env.Append(CCFLAGS=["-g3"])
else:
env.Append(CCFLAGS=["-g2"])
if env["optimize"] == "speed":
env.Append(CCFLAGS=["-O3"])
# `-O2` is friendlier to debuggers than `-O3`, leading to better crash backtraces.
elif env["optimize"] == "speed_trace":
env.Append(CCFLAGS=["-O2"])
elif env["optimize"] == "size":
env.Append(CCFLAGS=["-Os"])
elif env["optimize"] == "debug":
env.Append(CCFLAGS=["-Og"])
elif env["optimize"] == "none":
env.Append(CCFLAGS=["-O0"])

94
godot-tools/windows.py Normal file
View File

@@ -0,0 +1,94 @@
import sys
import my_spawn
from SCons.Tool import msvc, mingw
from SCons.Variables import *
def options(opts):
opts.Add(BoolVariable("use_mingw", "Use the MinGW compiler instead of MSVC - only effective on Windows", False))
opts.Add(BoolVariable("use_clang_cl", "Use the clang driver instead of MSVC - only effective on Windows", False))
opts.Add(BoolVariable("use_static_cpp", "Link MinGW/MSVC C++ runtime libraries statically", True))
opts.Add(BoolVariable("debug_crt", "Compile with MSVC's debug CRT (/MDd)", False))
opts.Add(BoolVariable("use_llvm", "Use the LLVM compiler", False))
def exists(env):
return True
def generate(env):
base = None
if not env["use_mingw"] and msvc.exists(env):
if env["arch"] == "x86_64":
env["TARGET_ARCH"] = "amd64"
elif env["arch"] == "x86_32":
env["TARGET_ARCH"] = "x86"
env["is_msvc"] = True
# MSVC, linker, and archiver.
msvc.generate(env)
env.Tool("mslib")
env.Tool("mslink")
env.Append(CPPDEFINES=["TYPED_METHOD_BIND", "NOMINMAX"])
env.Append(CCFLAGS=["/EHsc", "/utf-8"])
if env["debug_crt"]:
# Always use dynamic runtime, static debug CRT breaks thread_local.
env.AppendUnique(CCFLAGS=["/MDd"])
else:
if env["use_static_cpp"]:
env.AppendUnique(CCFLAGS=["/MT"])
else:
env.AppendUnique(CCFLAGS=["/MD"])
env.Append(LINKFLAGS=["/WX"])
if env["use_clang_cl"]:
env["CC"] = "clang-cl"
env["CXX"] = "clang-cl"
elif sys.platform == "win32" or sys.platform == "msys":
env["use_mingw"] = True
mingw.generate(env)
env.Append(CPPDEFINES=["MINGW_ENABLED"])
# Don't want lib prefixes
env["IMPLIBPREFIX"] = ""
env["SHLIBPREFIX"] = ""
# Want dll suffix
env["SHLIBSUFFIX"] = ".dll"
# Long line hack. Use custom spawn, quick AR append (to avoid files with the same names to override each other).
my_spawn.configure(env)
else:
env["use_mingw"] = True
# Cross-compilation using MinGW
prefix = "i686" if env["arch"] == "x86_32" else env["arch"]
if env["use_llvm"]:
env["CXX"] = prefix + "-w64-mingw32-clang"
env["CC"] = prefix + "-w64-mingw32-clang++"
env["AR"] = prefix + "-w64-mingw32-ar"
env["RANLIB"] = prefix + "-w64-mingw32-ranlib"
env["LINK"] = prefix + "-w64-mingw32-clang"
else:
env["CXX"] = prefix + "-w64-mingw32-g++"
env["CC"] = prefix + "-w64-mingw32-gcc"
env["AR"] = prefix + "-w64-mingw32-ar"
env["RANLIB"] = prefix + "-w64-mingw32-ranlib"
env["LINK"] = prefix + "-w64-mingw32-g++"
env.Append(CPPDEFINES=["MINGW_ENABLED"])
env.Append(CCFLAGS=["-O3", "-Wwrite-strings"])
if env["arch"] == "x86_32":
if env["use_static_cpp"]:
env.Append(LINKFLAGS=["-static"])
env.Append(LINKFLAGS=["-static-libgcc"])
env.Append(LINKFLAGS=["-static-libstdc++"])
else:
if env["use_static_cpp"]:
env.Append(LINKFLAGS=["-static"])
env.Append(
LINKFLAGS=[
"-Wl,--no-undefined",
]
)

View File

@@ -313,7 +313,7 @@ extern "C" {
// The application should set any platform methods it cares about on the returned pointer.
// If display is not valid, behaviour is undefined.
ANGLE_PLATFORM_EXPORT bool ANGLE_APIENTRY ANGLEGetDisplayPlatform(angle::EGLDisplayType display,
bool ANGLE_APIENTRY ANGLEGetDisplayPlatform(angle::EGLDisplayType display,
const char *const methodNames[],
unsigned int methodNameCount,
void *context,
@@ -321,7 +321,7 @@ ANGLE_PLATFORM_EXPORT bool ANGLE_APIENTRY ANGLEGetDisplayPlatform(angle::EGLDisp
// Sets the platform methods back to their defaults.
// If display is not valid, behaviour is undefined.
ANGLE_PLATFORM_EXPORT void ANGLE_APIENTRY ANGLEResetDisplayPlatform(angle::EGLDisplayType display);
void ANGLE_APIENTRY ANGLEResetDisplayPlatform(angle::EGLDisplayType display);
} // extern "C"
namespace angle

View File

@@ -0,0 +1,2 @@
#define ANGLE_PROGRAM_VERSION "2c4d7e3fb583948c1c335359680cfb4a"
#define ANGLE_PROGRAM_VERSION_HASH_SIZE 16

View File

@@ -0,0 +1,4 @@
#define ANGLE_COMMIT_HASH "430a4f559cbc"
#define ANGLE_COMMIT_HASH_SIZE 12
#define ANGLE_COMMIT_DATE "2023-07-23 01:36:14 +0000"
#define ANGLE_COMMIT_POSITION 21553

View File

@@ -125,7 +125,7 @@ void SharedContextMutex<Mutex>::unlock()
}
template <class Mutex>
ANGLE_INLINE SharedContextMutex<Mutex> *SharedContextMutex<Mutex>::doTryLock()
SharedContextMutex<Mutex> *SharedContextMutex<Mutex>::doTryLock()
{
angle::ThreadId currentThreadId;
ASSERT(!CheckThreadIdCurrent(mOwnerThreadId, &currentThreadId));
@@ -147,7 +147,7 @@ ANGLE_INLINE SharedContextMutex<Mutex> *SharedContextMutex<Mutex>::doTryLock()
}
template <class Mutex>
ANGLE_INLINE SharedContextMutex<Mutex> *SharedContextMutex<Mutex>::doLock()
SharedContextMutex<Mutex> *SharedContextMutex<Mutex>::doLock()
{
angle::ThreadId currentThreadId;
ASSERT(!CheckThreadIdCurrent(mOwnerThreadId, &currentThreadId));
@@ -166,7 +166,7 @@ ANGLE_INLINE SharedContextMutex<Mutex> *SharedContextMutex<Mutex>::doLock()
}
template <class Mutex>
ANGLE_INLINE void SharedContextMutex<Mutex>::doUnlock()
void SharedContextMutex<Mutex>::doUnlock()
{
ASSERT(
TryUpdateThreadId(&mOwnerThreadId, angle::GetCurrentThreadId(), angle::InvalidThreadId()));

View File

@@ -38,14 +38,22 @@ bool CompositorNativeWindow11::getClientRect(LPRECT rect) const
mHostVisual.As(&visual);
ABI::Windows::Foundation::Numerics::Vector2 size;
#if defined(MINGW_ENABLED)
HRESULT hr = visual->get_Size((ABI::Windows::UI::Composition::Vector2*)&size);
#else
HRESULT hr = visual->get_Size(&size);
#endif
if (FAILED(hr))
{
return false;
}
ABI::Windows::Foundation::Numerics::Vector3 offset;
#if defined(MINGW_ENABLED)
hr = visual->get_Offset((ABI::Windows::UI::Composition::Vector3*)&offset);
#else
hr = visual->get_Offset(&offset);
#endif
if (FAILED(hr))
{
return false;

View File

@@ -12,6 +12,143 @@
#include "libANGLE/renderer/d3d/d3d11/NativeWindow11.h"
#if defined(MINGW_ENABLED)
#ifndef DirectXAlphaMode
enum DirectXAlphaMode {
DirectXAlphaMode_Unspecified = 0,
DirectXAlphaMode_Premultiplied = 1,
DirectXAlphaMode_Straight = 2,
DirectXAlphaMode_Ignore = 3
};
#endif
#ifndef DirectXPixelFormat
enum DirectXPixelFormat {
DirectXPixelFormat_Unknown = 0,
DirectXPixelFormat_R32G32B32A32Typeless = 1,
DirectXPixelFormat_R32G32B32A32Float = 2,
DirectXPixelFormat_R32G32B32A32UInt = 3,
DirectXPixelFormat_R32G32B32A32Int = 4,
DirectXPixelFormat_R32G32B32Typeless = 5,
DirectXPixelFormat_R32G32B32Float = 6,
DirectXPixelFormat_R32G32B32UInt = 7,
DirectXPixelFormat_R32G32B32Int = 8,
DirectXPixelFormat_R16G16B16A16Typeless = 9,
DirectXPixelFormat_R16G16B16A16Float = 10,
DirectXPixelFormat_R16G16B16A16UIntNormalized = 11,
DirectXPixelFormat_R16G16B16A16UInt = 12,
DirectXPixelFormat_R16G16B16A16IntNormalized = 13,
DirectXPixelFormat_R16G16B16A16Int = 14,
DirectXPixelFormat_R32G32Typeless = 15,
DirectXPixelFormat_R32G32Float = 16,
DirectXPixelFormat_R32G32UInt = 17,
DirectXPixelFormat_R32G32Int = 18,
DirectXPixelFormat_R32G8X24Typeless = 19,
DirectXPixelFormat_D32FloatS8X24UInt = 20,
DirectXPixelFormat_R32FloatX8X24Typeless = 21,
DirectXPixelFormat_X32TypelessG8X24UInt = 22,
DirectXPixelFormat_R10G10B10A2Typeless = 23,
DirectXPixelFormat_R10G10B10A2UIntNormalized = 24,
DirectXPixelFormat_R10G10B10A2UInt = 25,
DirectXPixelFormat_R11G11B10Float = 26,
DirectXPixelFormat_R8G8B8A8Typeless = 27,
DirectXPixelFormat_R8G8B8A8UIntNormalized = 28,
DirectXPixelFormat_R8G8B8A8UIntNormalizedSrgb = 29,
DirectXPixelFormat_R8G8B8A8UInt = 30,
DirectXPixelFormat_R8G8B8A8IntNormalized = 31,
DirectXPixelFormat_R8G8B8A8Int = 32,
DirectXPixelFormat_R16G16Typeless = 33,
DirectXPixelFormat_R16G16Float = 34,
DirectXPixelFormat_R16G16UIntNormalized = 35,
DirectXPixelFormat_R16G16UInt = 36,
DirectXPixelFormat_R16G16IntNormalized = 37,
DirectXPixelFormat_R16G16Int = 38,
DirectXPixelFormat_R32Typeless = 39,
DirectXPixelFormat_D32Float = 40,
DirectXPixelFormat_R32Float = 41,
DirectXPixelFormat_R32UInt = 42,
DirectXPixelFormat_R32Int = 43,
DirectXPixelFormat_R24G8Typeless = 44,
DirectXPixelFormat_D24UIntNormalizedS8UInt = 45,
DirectXPixelFormat_R24UIntNormalizedX8Typeless = 46,
DirectXPixelFormat_X24TypelessG8UInt = 47,
DirectXPixelFormat_R8G8Typeless = 48,
DirectXPixelFormat_R8G8UIntNormalized = 49,
DirectXPixelFormat_R8G8UInt = 50,
DirectXPixelFormat_R8G8IntNormalized = 51,
DirectXPixelFormat_R8G8Int = 52,
DirectXPixelFormat_R16Typeless = 53,
DirectXPixelFormat_R16Float = 54,
DirectXPixelFormat_D16UIntNormalized = 55,
DirectXPixelFormat_R16UIntNormalized = 56,
DirectXPixelFormat_R16UInt = 57,
DirectXPixelFormat_R16IntNormalized = 58,
DirectXPixelFormat_R16Int = 59,
DirectXPixelFormat_R8Typeless = 60,
DirectXPixelFormat_R8UIntNormalized = 61,
DirectXPixelFormat_R8UInt = 62,
DirectXPixelFormat_R8IntNormalized = 63,
DirectXPixelFormat_R8Int = 64,
DirectXPixelFormat_A8UIntNormalized = 65,
DirectXPixelFormat_R1UIntNormalized = 66,
DirectXPixelFormat_R9G9B9E5SharedExponent = 67,
DirectXPixelFormat_R8G8B8G8UIntNormalized = 68,
DirectXPixelFormat_G8R8G8B8UIntNormalized = 69,
DirectXPixelFormat_BC1Typeless = 70,
DirectXPixelFormat_BC1UIntNormalized = 71,
DirectXPixelFormat_BC1UIntNormalizedSrgb = 72,
DirectXPixelFormat_BC2Typeless = 73,
DirectXPixelFormat_BC2UIntNormalized = 74,
DirectXPixelFormat_BC2UIntNormalizedSrgb = 75,
DirectXPixelFormat_BC3Typeless = 76,
DirectXPixelFormat_BC3UIntNormalized = 77,
DirectXPixelFormat_BC3UIntNormalizedSrgb = 78,
DirectXPixelFormat_BC4Typeless = 79,
DirectXPixelFormat_BC4UIntNormalized = 80,
DirectXPixelFormat_BC4IntNormalized = 81,
DirectXPixelFormat_BC5Typeless = 82,
DirectXPixelFormat_BC5UIntNormalized = 83,
DirectXPixelFormat_BC5IntNormalized = 84,
DirectXPixelFormat_B5G6R5UIntNormalized = 85,
DirectXPixelFormat_B5G5R5A1UIntNormalized = 86,
DirectXPixelFormat_B8G8R8A8UIntNormalized = 87,
DirectXPixelFormat_B8G8R8X8UIntNormalized = 88,
DirectXPixelFormat_R10G10B10XRBiasA2UIntNormalized = 89,
DirectXPixelFormat_B8G8R8A8Typeless = 90,
DirectXPixelFormat_B8G8R8A8UIntNormalizedSrgb = 91,
DirectXPixelFormat_B8G8R8X8Typeless = 92,
DirectXPixelFormat_B8G8R8X8UIntNormalizedSrgb = 93,
DirectXPixelFormat_BC6HTypeless = 94,
DirectXPixelFormat_BC6H16UnsignedFloat = 95,
DirectXPixelFormat_BC6H16Float = 96,
DirectXPixelFormat_BC7Typeless = 97,
DirectXPixelFormat_BC7UIntNormalized = 98,
DirectXPixelFormat_BC7UIntNormalizedSrgb = 99,
DirectXPixelFormat_Ayuv = 100,
DirectXPixelFormat_Y410 = 101,
DirectXPixelFormat_Y416 = 102,
DirectXPixelFormat_NV12 = 103,
DirectXPixelFormat_P010 = 104,
DirectXPixelFormat_P016 = 105,
DirectXPixelFormat_Opaque420 = 106,
DirectXPixelFormat_Yuy2 = 107,
DirectXPixelFormat_Y210 = 108,
DirectXPixelFormat_Y216 = 109,
DirectXPixelFormat_NV11 = 110,
DirectXPixelFormat_AI44 = 111,
DirectXPixelFormat_IA44 = 112,
DirectXPixelFormat_P8 = 113,
DirectXPixelFormat_A8P8 = 114,
DirectXPixelFormat_B4G4R4A4UIntNormalized = 115,
DirectXPixelFormat_P208 = 130,
DirectXPixelFormat_V208 = 131,
DirectXPixelFormat_V408 = 132,
DirectXPixelFormat_SamplerFeedbackMinMipOpaque = 189,
DirectXPixelFormat_SamplerFeedbackMipRegionUsedOpaque = 190
};
#endif
#endif
#include <dispatcherqueue.h>
#include <windows.foundation.metadata.h>
#include <windows.ui.composition.h>

1
third_party/astc-encoder/src vendored Submodule

1
third_party/zlib vendored Submodule

Submodule third_party/zlib added at d3b3d64f7d