├── .azuredevops ├── pipelines │ ├── DirectXMesh-GitHub-CMake-Dev17.yml │ ├── DirectXMesh-GitHub-CMake.yml │ ├── DirectXMesh-GitHub-Dev17.yml │ ├── DirectXMesh-GitHub-GDK-Dev17.yml │ ├── DirectXMesh-GitHub-GDK.yml │ ├── DirectXMesh-GitHub-MinGW.yml │ ├── DirectXMesh-GitHub-SDK-prerelease.yml │ ├── DirectXMesh-GitHub-SDK-release.yml │ ├── DirectXMesh-GitHub-Test-Dev17.yml │ ├── DirectXMesh-GitHub-Test.yml │ ├── DirectXMesh-GitHub-WSL-11.yml │ ├── DirectXMesh-GitHub-WSL-13.yml │ ├── DirectXMesh-GitHub.yml │ ├── DirectXMesh-OneFuzz-Coverage.yml │ ├── DirectXMesh-OneFuzz.yml │ └── DirectXMesh-SDL.yml ├── policies │ └── approvercountpolicy.yml └── templates │ ├── DirectXMesh-build-gdk.yml │ ├── DirectXMesh-build-uwp.yml │ └── DirectXMesh-build-win32.yml ├── .editorconfig ├── .gitattributes ├── .github ├── dependabot.yml ├── linters │ ├── .editorconfig-checker.json │ ├── .markdown-lint.yml │ ├── .powershell-psscriptanalyzer.psd1 │ └── .yaml-lint.yml └── workflows │ ├── bvt.yml │ ├── codeql.yml │ ├── lint.yml │ ├── main.yml │ ├── msbuild.yml │ ├── msvc.yml │ ├── test.yml │ ├── uwp.yml │ ├── vcpkg.yml │ └── wsl.yml ├── .gitignore ├── .nuget ├── directxmesh_desktop_2019.nuspec ├── directxmesh_desktop_2019.targets ├── directxmesh_desktop_win10.nuspec ├── directxmesh_desktop_win10.targets ├── directxmesh_uwp.nuspec ├── directxmesh_uwp.targets └── icon.jpg ├── .onefuzz ├── CHANGELOG.md ├── CMakeLists.txt ├── CMakePresets.json ├── CODE_OF_CONDUCT.md ├── DirectXMesh ├── DirectXMesh.h ├── DirectXMesh.inl ├── DirectXMeshAdjacency.cpp ├── DirectXMeshClean.cpp ├── DirectXMeshConcat.cpp ├── DirectXMeshGSAdjacency.cpp ├── DirectXMeshNormals.cpp ├── DirectXMeshOptimize.cpp ├── DirectXMeshOptimizeLRU.cpp ├── DirectXMeshOptimizeTVC.cpp ├── DirectXMeshP.h ├── DirectXMeshRemap.cpp ├── DirectXMeshTangentFrame.cpp ├── DirectXMeshUtil.cpp ├── DirectXMeshVBReader.cpp ├── DirectXMeshVBWriter.cpp ├── DirectXMeshValidate.cpp ├── DirectXMeshWeldVertices.cpp ├── DirectXMesh_Desktop_2019.vcxproj ├── DirectXMesh_Desktop_2019.vcxproj.filters ├── DirectXMesh_Desktop_2019_Win10.vcxproj ├── DirectXMesh_Desktop_2019_Win10.vcxproj.filters ├── DirectXMesh_Desktop_2022.vcxproj ├── DirectXMesh_Desktop_2022.vcxproj.filters ├── DirectXMesh_Desktop_2022_Win10.vcxproj ├── DirectXMesh_Desktop_2022_Win10.vcxproj.filters ├── DirectXMesh_GDK_2019.vcxproj ├── DirectXMesh_GDK_2019.vcxproj.filters ├── DirectXMesh_GDK_2022.vcxproj ├── DirectXMesh_GDK_2022.vcxproj.filters ├── DirectXMesh_Windows10_2022.vcxproj ├── DirectXMesh_Windows10_2022.vcxproj.filters ├── DirectXMeshletGenerator.cpp └── scoped.h ├── DirectXMesh_Desktop_2019.sln ├── DirectXMesh_Desktop_2019_Win10.sln ├── DirectXMesh_Desktop_2022.sln ├── DirectXMesh_Desktop_2022_Win10.sln ├── DirectXMesh_GDK_2019.sln ├── DirectXMesh_GDK_2022.sln ├── DirectXMesh_Windows10_2022.sln ├── LICENSE ├── Meshconvert ├── CMO.h ├── CmdLineHelpers.h ├── Mesh.cpp ├── Mesh.h ├── MeshOBJ.cpp ├── Meshconvert.cpp ├── Meshconvert_Desktop_2019.vcxproj ├── Meshconvert_Desktop_2019.vcxproj.filters ├── Meshconvert_Desktop_2019_Win10.vcxproj ├── Meshconvert_Desktop_2019_Win10.vcxproj.filters ├── Meshconvert_Desktop_2022.vcxproj ├── Meshconvert_Desktop_2022.vcxproj.filters ├── Meshconvert_Desktop_2022_Win10.vcxproj ├── Meshconvert_Desktop_2022_Win10.vcxproj.filters ├── SDKMesh.h ├── directx.ico ├── meshconvert.rc ├── settings.manifest └── vbo.h ├── README.md ├── SECURITY.md ├── Utilities ├── FlexibleVertexFormat.h └── WaveFrontReader.h └── build ├── CompilerAndLinker.cmake ├── CopyASan.targets ├── DirectXMesh-config.cmake.in ├── DirectXMesh.pc.in ├── DirectXMesh.rc.in ├── Directory.Build.props ├── JoinPaths.cmake ├── OneFuzzConfig.json ├── SetupBWOI.cmd ├── SetupBWOI.targets ├── onefuzz-setup.ps1 ├── placeholder.xvd ├── preparerelease.ps1 ├── vcpkg.json └── versioninfo.ps1 /.azuredevops/pipelines/DirectXMesh-GitHub-Dev17.yml: -------------------------------------------------------------------------------- 1 | # Copyright (c) Microsoft Corporation. 2 | # Licensed under the MIT License. 3 | # 4 | # https://go.microsoft.com/fwlink/?LinkID=324981 5 | 6 | # Builds the library for Windows Desktop and UWP. 7 | 8 | schedules: 9 | - cron: "30 6 * * *" 10 | displayName: 'Nightly build' 11 | branches: 12 | include: 13 | - main 14 | 15 | # GitHub Actions handles MSBuild for CI/PR 16 | trigger: none 17 | pr: 18 | branches: 19 | include: 20 | - main 21 | paths: 22 | include: 23 | - '.azuredevops/pipelines/DirectXMesh-GitHub-Dev17.yml' 24 | 25 | resources: 26 | repositories: 27 | - repository: self 28 | type: git 29 | ref: refs/heads/main 30 | 31 | name: $(Year:yyyy).$(Month).$(DayOfMonth)$(Rev:.r) 32 | 33 | variables: 34 | Codeql.Enabled: false 35 | 36 | pool: 37 | vmImage: windows-2022 38 | 39 | jobs: 40 | - job: DESKTOP_BUILD 41 | displayName: 'Windows Desktop' 42 | timeoutInMinutes: 120 43 | cancelTimeoutInMinutes: 1 44 | strategy: 45 | maxParallel: 3 46 | matrix: 47 | Release_arm64: 48 | BuildPlatform: ARM64 49 | BuildConfiguration: Release 50 | SpectreMitigation: false 51 | Debug_arm64: 52 | BuildPlatform: ARM64 53 | BuildConfiguration: Debug 54 | SpectreMitigation: false 55 | Release_x64: 56 | BuildPlatform: x64 57 | BuildConfiguration: Release 58 | SpectreMitigation: false 59 | Debug_x64: 60 | BuildPlatform: x64 61 | BuildConfiguration: Debug 62 | SpectreMitigation: false 63 | Release_x86: 64 | BuildPlatform: x86 65 | BuildConfiguration: Release 66 | SpectreMitigation: false 67 | Debug_x86: 68 | BuildPlatform: x86 69 | BuildConfiguration: Debug 70 | SpectreMitigation: false 71 | Release_arm64_SpectreMitigated: 72 | BuildPlatform: ARM64 73 | BuildConfiguration: Release 74 | SpectreMitigation: 'Spectre' 75 | Debug_arm64_SpectreMitigated: 76 | BuildPlatform: ARM64 77 | BuildConfiguration: Debug 78 | SpectreMitigation: 'Spectre' 79 | Release_x64_SpectreMitigated: 80 | BuildPlatform: x64 81 | BuildConfiguration: Release 82 | SpectreMitigation: 'Spectre' 83 | Debug_x64_SpectreMitigated: 84 | BuildPlatform: x64 85 | BuildConfiguration: Debug 86 | SpectreMitigation: 'Spectre' 87 | Release_x86_SpectreMitigated: 88 | BuildPlatform: x86 89 | BuildConfiguration: Release 90 | SpectreMitigation: 'Spectre' 91 | Debug_x86_SpectreMitigated: 92 | BuildPlatform: x86 93 | BuildConfiguration: Debug 94 | SpectreMitigation: 'Spectre' 95 | steps: 96 | - checkout: self 97 | clean: true 98 | fetchTags: false 99 | - task: VSBuild@1 100 | displayName: Build solution DirectXMesh_Desktop_2022.sln 101 | inputs: 102 | solution: DirectXMesh_Desktop_2022.sln 103 | msbuildArgs: /p:PreferredToolArchitecture=x64 /p:SpectreMitigation=$(SpectreMitigation) 104 | platform: '$(BuildPlatform)' 105 | configuration: '$(BuildConfiguration)' 106 | msbuildArchitecture: x64 107 | condition: ne(variables['BuildPlatform'], 'ARM64') 108 | - task: VSBuild@1 109 | displayName: Build solution DirectXMesh_Desktop_2022_Win10.sln 110 | inputs: 111 | solution: DirectXMesh_Desktop_2022_Win10.sln 112 | msbuildArgs: /p:PreferredToolArchitecture=x64 /p:SpectreMitigation=$(SpectreMitigation) 113 | platform: '$(BuildPlatform)' 114 | configuration: '$(BuildConfiguration)' 115 | msbuildArchitecture: x64 116 | 117 | - job: UWP_BUILD 118 | displayName: 'Universal Windows Platform (UWP)' 119 | timeoutInMinutes: 120 120 | cancelTimeoutInMinutes: 1 121 | strategy: 122 | maxParallel: 3 123 | matrix: 124 | Release_arm64: 125 | BuildPlatform: ARM64 126 | BuildConfiguration: Release 127 | Debug_arm64: 128 | BuildPlatform: ARM64 129 | BuildConfiguration: Debug 130 | Release_x64: 131 | BuildPlatform: x64 132 | BuildConfiguration: Release 133 | Debug_x64: 134 | BuildPlatform: x64 135 | BuildConfiguration: Debug 136 | Release_x86: 137 | BuildPlatform: x86 138 | BuildConfiguration: Release 139 | Debug_x86: 140 | BuildPlatform: x86 141 | BuildConfiguration: Debug 142 | steps: 143 | - checkout: self 144 | clean: true 145 | fetchTags: false 146 | - task: VSBuild@1 147 | displayName: Build solution DirectXMesh_Windows10_2022.sln 148 | inputs: 149 | solution: DirectXMesh_Windows10_2022.sln 150 | msbuildArgs: /p:PreferredToolArchitecture=x64 151 | platform: '$(BuildPlatform)' 152 | configuration: '$(BuildConfiguration)' 153 | msbuildArchitecture: x64 154 | -------------------------------------------------------------------------------- /.azuredevops/pipelines/DirectXMesh-GitHub-GDK.yml: -------------------------------------------------------------------------------- 1 | # Copyright (c) Microsoft Corporation. 2 | # Licensed under the MIT License. 3 | # 4 | # https://go.microsoft.com/fwlink/?LinkID=324981 5 | 6 | # Builds the library using the Microsoft GDK. 7 | 8 | # NOTE: We use x64 MSBuild for the GDK as the NuGets don't include 32-bit support to avoid cross-arch dependencies. 9 | 10 | schedules: 11 | - cron: "0 6 * * *" 12 | displayName: 'Nightly build' 13 | branches: 14 | include: 15 | - main 16 | 17 | trigger: 18 | branches: 19 | include: 20 | - main 21 | paths: 22 | exclude: 23 | - '*.md' 24 | - LICENSE 25 | - CMake* 26 | - '.github/**' 27 | - '.nuget/*' 28 | - build/*.cmake 29 | - build/*.cmd 30 | - build/*.in 31 | - build/*.ps1 32 | 33 | pr: 34 | branches: 35 | include: 36 | - main 37 | paths: 38 | exclude: 39 | - '*.md' 40 | - LICENSE 41 | - CMake* 42 | - '.github/**' 43 | - '.nuget/*' 44 | - build/*.cmake 45 | - build/*.cmd 46 | - build/*.in 47 | - build/*.ps1 48 | drafts: false 49 | 50 | resources: 51 | repositories: 52 | - repository: self 53 | type: git 54 | ref: refs/heads/main 55 | 56 | name: $(Year:yyyy).$(Month).$(DayOfMonth)$(Rev:.r) 57 | 58 | pool: 59 | vmImage: windows-2019 60 | 61 | variables: 62 | - group: dxmesh-shared-variables 63 | - name: Codeql.Enabled 64 | value: false 65 | - name: EXTRACTED_FOLDER 66 | value: '$(ExtractedFolder)' 67 | - name: GDKEnableBWOI 68 | value: true 69 | - name: URL_FEED 70 | value: $(ADOFeedURL) 71 | - name: skipNugetSecurityAnalysis 72 | value: true # We explicitly call this task so we don't need it to be auto-injected 73 | 74 | jobs: 75 | - job: BUILD_GDK 76 | displayName: 'Microsoft Game Development Kit (GDK)' 77 | timeoutInMinutes: 120 78 | cancelTimeoutInMinutes: 1 79 | steps: 80 | - checkout: self 81 | clean: true 82 | fetchTags: false 83 | - task: NuGetToolInstaller@1 84 | displayName: 'Use NuGet' 85 | - task: PowerShell@2 86 | displayName: 'Create nuget.config with single source' 87 | inputs: 88 | targetType: inline 89 | script: | 90 | $xml = @' 91 | 92 | 93 | 94 | 95 | 96 | 97 | '@ 98 | $xml | Set-Content -Path "$(Build.SourcesDirectory)\NuGet.config" 99 | 100 | - task: NuGetCommand@2 101 | # We have to use a nuget.config to provide the feed for the 'nuget install' option. 102 | displayName: 'NuGet set package source to ADO feed' 103 | inputs: 104 | command: custom 105 | arguments: sources add -Name xboxgdk -Source $(URL_FEED) -ConfigFile $(Build.SourcesDirectory)\NuGet.config 106 | - task: nuget-security-analysis@0 107 | displayName: 'Secure Supply Chain Analysis' 108 | - task: NuGetAuthenticate@1 109 | displayName: 'NuGet Auth' 110 | - task: NuGetCommand@2 111 | displayName: NuGet install PGDK 112 | inputs: 113 | command: custom 114 | arguments: install -prerelease Microsoft.GDK.PC.$(GDK_EDITION) -ExcludeVersion -OutputDirectory $(EXTRACTED_FOLDER) 115 | - task: NuGetCommand@2 116 | displayName: NuGet install GDKX 117 | inputs: 118 | command: custom 119 | arguments: install -prerelease Microsoft.GDK.Xbox.$(GDK_EDITION) -ExcludeVersion -OutputDirectory $(EXTRACTED_FOLDER) 120 | - task: CopyFiles@2 121 | displayName: Set up Directory.Build.props 122 | inputs: 123 | SourceFolder: build 124 | Contents: 'Directory.Build.props' 125 | TargetFolder: $(Build.SourcesDirectory) 126 | - task: MSBuild@1 127 | displayName: Setup BWOI VCTargets 128 | inputs: 129 | solution: build/SetupBWOI.targets 130 | msbuildVersion: 16.0 131 | msbuildArchitecture: x64 132 | msbuildArguments: /p:GDKEditionNumber=$(GDK_EDITION) 133 | - template: '/.azuredevops/templates/DirectXMesh-build-gdk.yml' 134 | parameters: 135 | msVersion: '16.0' 136 | vsYear: 2019 137 | -------------------------------------------------------------------------------- /.azuredevops/pipelines/DirectXMesh-GitHub-SDK-prerelease.yml: -------------------------------------------------------------------------------- 1 | # Copyright (c) Microsoft Corporation. 2 | # Licensed under the MIT License. 3 | # 4 | # https://go.microsoft.com/fwlink/?LinkID=324981 5 | 6 | # Builds the library using the latest prerelease of the Windows SDK from nuget.org. 7 | 8 | schedules: 9 | - cron: "0 6 * * 6" 10 | displayName: 'Saturday night build' 11 | branches: 12 | include: 13 | - main 14 | always: true 15 | 16 | trigger: none 17 | pr: none 18 | 19 | resources: 20 | repositories: 21 | - repository: self 22 | type: git 23 | ref: refs/heads/main 24 | 25 | name: $(Year:yyyy).$(Month).$(DayOfMonth)$(Rev:.r) 26 | 27 | variables: 28 | - group: dxmesh-shared-variables 29 | - name: Codeql.Enabled 30 | value: false 31 | - name: EXTRACTED_FOLDER 32 | value: '$(ExtractedFolder)' 33 | - name: WSDKEnableBWOI 34 | value: true 35 | - name: URL_FEED 36 | value: $(ADOFeedURL) 37 | - name: skipNugetSecurityAnalysis 38 | value: true # We explicitly call this task so we don't need it to be auto-injected 39 | 40 | pool: 41 | vmImage: windows-2022 42 | 43 | jobs: 44 | - job: DESKTOP_BUILD 45 | displayName: 'Windows Desktop' 46 | timeoutInMinutes: 120 47 | cancelTimeoutInMinutes: 1 48 | steps: 49 | - checkout: self 50 | clean: true 51 | fetchTags: false 52 | - task: NuGetToolInstaller@1 53 | displayName: 'Use NuGet' 54 | - task: PowerShell@2 55 | displayName: 'Create nuget.config with single source' 56 | inputs: 57 | targetType: inline 58 | script: | 59 | $xml = @' 60 | 61 | 62 | 63 | 64 | 65 | 66 | '@ 67 | $xml | Set-Content -Path "$(Build.SourcesDirectory)\NuGet.config" 68 | 69 | - task: NuGetCommand@2 70 | # We have to use a nuget.config to provide the feed for the 'nuget install' option. 71 | displayName: 'NuGet set package source to ADO feed' 72 | inputs: 73 | command: custom 74 | arguments: sources add -Name xboxgdk -Source $(URL_FEED) -ConfigFile $(Build.SourcesDirectory)\NuGet.config 75 | - task: nuget-security-analysis@0 76 | displayName: 'Secure Supply Chain Analysis' 77 | - task: NuGetAuthenticate@1 78 | displayName: 'NuGet Auth' 79 | - task: NuGetCommand@2 80 | displayName: NuGet Install WSDK x64 81 | inputs: 82 | command: custom 83 | arguments: install -prerelease Microsoft.Windows.SDK.CPP.x64 -ExcludeVersion -OutputDirectory $(EXTRACTED_FOLDER) 84 | - task: NuGetCommand@2 85 | displayName: NuGet Install WSDK x86 86 | inputs: 87 | command: custom 88 | arguments: install -prerelease Microsoft.Windows.SDK.CPP.x86 -ExcludeVersion -OutputDirectory $(EXTRACTED_FOLDER) 89 | - task: NuGetCommand@2 90 | displayName: NuGet Install WSDK arm64 91 | inputs: 92 | command: custom 93 | arguments: install -prerelease Microsoft.Windows.SDK.CPP.arm64 -ExcludeVersion -OutputDirectory $(EXTRACTED_FOLDER) 94 | - task: CopyFiles@2 95 | displayName: Set up Directory.Build.props 96 | inputs: 97 | SourceFolder: build 98 | Contents: 'Directory.Build.props' 99 | TargetFolder: $(Build.SourcesDirectory) 100 | - template: '/.azuredevops/templates/DirectXMesh-build-win32.yml' 101 | 102 | - job: UWP_BUILD 103 | displayName: 'Universal Windows Platform (UWP)' 104 | timeoutInMinutes: 120 105 | cancelTimeoutInMinutes: 1 106 | steps: 107 | - checkout: self 108 | clean: true 109 | fetchTags: false 110 | - task: NuGetToolInstaller@1 111 | displayName: 'Use NuGet' 112 | - task: PowerShell@2 113 | displayName: 'Create nuget.config with single source' 114 | inputs: 115 | targetType: inline 116 | script: | 117 | $xml = @' 118 | 119 | 120 | 121 | 122 | 123 | 124 | '@ 125 | $xml | Set-Content -Path "$(Build.SourcesDirectory)\NuGet.config" 126 | 127 | - task: NuGetCommand@2 128 | displayName: NuGet set package source to ADO feed 129 | inputs: 130 | command: custom 131 | arguments: sources add -Name xboxgdk -Source $(URL_FEED) -ConfigFile $(Build.SourcesDirectory)\NuGet.config 132 | - task: nuget-security-analysis@0 133 | displayName: 'Secure Supply Chain Analysis' 134 | - task: NuGetAuthenticate@1 135 | displayName: 'NuGet Auth' 136 | - task: NuGetCommand@2 137 | displayName: NuGet Install WSDK x64 138 | inputs: 139 | command: custom 140 | arguments: install -prerelease Microsoft.Windows.SDK.CPP.x64 -ExcludeVersion -OutputDirectory $(EXTRACTED_FOLDER) 141 | - task: NuGetCommand@2 142 | displayName: NuGet Install WSDK x86 143 | inputs: 144 | command: custom 145 | arguments: install -prerelease Microsoft.Windows.SDK.CPP.x86 -ExcludeVersion -OutputDirectory $(EXTRACTED_FOLDER) 146 | - task: NuGetCommand@2 147 | displayName: NuGet Install WSDK arm64 148 | inputs: 149 | command: custom 150 | arguments: install -prerelease Microsoft.Windows.SDK.CPP.arm64 -ExcludeVersion -OutputDirectory $(EXTRACTED_FOLDER) 151 | - task: CopyFiles@2 152 | displayName: Set up Directory.Build.props 153 | inputs: 154 | SourceFolder: build 155 | Contents: 'Directory.Build.props' 156 | TargetFolder: $(Build.SourcesDirectory) 157 | - template: '/.azuredevops/templates/DirectXMesh-build-uwp.yml' 158 | -------------------------------------------------------------------------------- /.azuredevops/pipelines/DirectXMesh-GitHub-SDK-release.yml: -------------------------------------------------------------------------------- 1 | # Copyright (c) Microsoft Corporation. 2 | # Licensed under the MIT License. 3 | # 4 | # https://go.microsoft.com/fwlink/?LinkID=324981 5 | 6 | # Builds the library using the latest release of the Windows SDK from nuget.org. 7 | 8 | schedules: 9 | - cron: "0 6 * * 0" 10 | displayName: 'Sunday night build' 11 | branches: 12 | include: 13 | - main 14 | always: true 15 | 16 | trigger: none 17 | pr: none 18 | 19 | resources: 20 | repositories: 21 | - repository: self 22 | type: git 23 | ref: refs/heads/main 24 | 25 | name: $(Year:yyyy).$(Month).$(DayOfMonth)$(Rev:.r) 26 | 27 | variables: 28 | - group: dxmesh-shared-variables 29 | - name: Codeql.Enabled 30 | value: false 31 | - name: EXTRACTED_FOLDER 32 | value: '$(ExtractedFolder)' 33 | - name: WSDKEnableBWOI 34 | value: true 35 | - name: URL_FEED 36 | value: $(ADOFeedURL) 37 | - name: skipNugetSecurityAnalysis 38 | value: true # We explicitly call this task so we don't need it to be auto-injected 39 | 40 | pool: 41 | vmImage: windows-2022 42 | 43 | jobs: 44 | - job: DESKTOP_BUILD 45 | displayName: 'Windows Desktop' 46 | timeoutInMinutes: 120 47 | cancelTimeoutInMinutes: 1 48 | steps: 49 | - checkout: self 50 | clean: true 51 | fetchTags: false 52 | - task: NuGetToolInstaller@1 53 | displayName: 'Use NuGet' 54 | - task: PowerShell@2 55 | displayName: 'Create nuget.config with single source' 56 | inputs: 57 | targetType: inline 58 | script: | 59 | $xml = @' 60 | 61 | 62 | 63 | 64 | 65 | 66 | '@ 67 | $xml | Set-Content -Path "$(Build.SourcesDirectory)\NuGet.config" 68 | 69 | - task: NuGetCommand@2 70 | # We have to use a nuget.config to provide the feed for the 'nuget install' option. 71 | displayName: 'NuGet set package source to ADO feed' 72 | inputs: 73 | command: custom 74 | arguments: sources add -Name xboxgdk -Source $(URL_FEED) -ConfigFile $(Build.SourcesDirectory)\NuGet.config 75 | - task: nuget-security-analysis@0 76 | displayName: 'Secure Supply Chain Analysis' 77 | - task: NuGetAuthenticate@1 78 | displayName: 'NuGet Auth' 79 | - task: NuGetCommand@2 80 | displayName: NuGet Install WSDK x64 81 | inputs: 82 | command: custom 83 | arguments: install Microsoft.Windows.SDK.CPP.x64 -ExcludeVersion -OutputDirectory $(EXTRACTED_FOLDER) 84 | - task: NuGetCommand@2 85 | displayName: NuGet Install WSDK x86 86 | inputs: 87 | command: custom 88 | arguments: install Microsoft.Windows.SDK.CPP.x86 -ExcludeVersion -OutputDirectory $(EXTRACTED_FOLDER) 89 | - task: NuGetCommand@2 90 | displayName: NuGet Install WSDK arm64 91 | inputs: 92 | command: custom 93 | arguments: install Microsoft.Windows.SDK.CPP.arm64 -ExcludeVersion -OutputDirectory $(EXTRACTED_FOLDER) 94 | - task: CopyFiles@2 95 | displayName: Set up Directory.Build.props 96 | inputs: 97 | SourceFolder: build 98 | Contents: 'Directory.Build.props' 99 | TargetFolder: $(Build.SourcesDirectory) 100 | - template: '/.azuredevops/templates/DirectXMesh-build-win32.yml' 101 | 102 | - job: UWP_BUILD 103 | displayName: 'Universal Windows Platform (UWP)' 104 | timeoutInMinutes: 120 105 | cancelTimeoutInMinutes: 1 106 | steps: 107 | - checkout: self 108 | clean: true 109 | fetchTags: false 110 | - task: NuGetToolInstaller@1 111 | displayName: 'Use NuGet' 112 | - task: PowerShell@2 113 | displayName: 'Create nuget.config with single source' 114 | inputs: 115 | targetType: inline 116 | script: | 117 | $xml = @' 118 | 119 | 120 | 121 | 122 | 123 | 124 | '@ 125 | $xml | Set-Content -Path "$(Build.SourcesDirectory)\NuGet.config" 126 | 127 | - task: NuGetCommand@2 128 | displayName: NuGet set package source to ADO feed 129 | inputs: 130 | command: custom 131 | arguments: sources add -Name xboxgdk -Source $(URL_FEED) -ConfigFile $(Build.SourcesDirectory)\NuGet.config 132 | - task: nuget-security-analysis@0 133 | displayName: 'Secure Supply Chain Analysis' 134 | - task: NuGetAuthenticate@1 135 | displayName: 'NuGet Auth' 136 | - task: NuGetCommand@2 137 | displayName: NuGet Install WSDK x64 138 | inputs: 139 | command: custom 140 | arguments: install Microsoft.Windows.SDK.CPP.x64 -ExcludeVersion -OutputDirectory $(EXTRACTED_FOLDER) 141 | - task: NuGetCommand@2 142 | displayName: NuGet Install WSDK x86 143 | inputs: 144 | command: custom 145 | arguments: install Microsoft.Windows.SDK.CPP.x86 -ExcludeVersion -OutputDirectory $(EXTRACTED_FOLDER) 146 | - task: NuGetCommand@2 147 | displayName: NuGet Install WSDK arm64 148 | inputs: 149 | command: custom 150 | arguments: install Microsoft.Windows.SDK.CPP.arm64 -ExcludeVersion -OutputDirectory $(EXTRACTED_FOLDER) 151 | - task: CopyFiles@2 152 | displayName: Set up Directory.Build.props 153 | inputs: 154 | SourceFolder: build 155 | Contents: 'Directory.Build.props' 156 | TargetFolder: $(Build.SourcesDirectory) 157 | - template: '/.azuredevops/templates/DirectXMesh-build-uwp.yml' 158 | -------------------------------------------------------------------------------- /.azuredevops/pipelines/DirectXMesh-GitHub-Test.yml: -------------------------------------------------------------------------------- 1 | # Copyright (c) Microsoft Corporation. 2 | # Licensed under the MIT License. 3 | # 4 | # https://go.microsoft.com/fwlink/?LinkID=324981 5 | 6 | # Builds the library and test suite. 7 | 8 | schedules: 9 | - cron: "30 3 * * *" 10 | displayName: 'Nightly build' 11 | branches: 12 | include: 13 | - main 14 | 15 | # GitHub Actions handles test suite for CI/PR 16 | trigger: none 17 | pr: 18 | branches: 19 | include: 20 | - main 21 | paths: 22 | include: 23 | - '.azuredevops/pipelines/DirectXMesh-GitHub-Test.yml' 24 | 25 | resources: 26 | repositories: 27 | - repository: self 28 | type: git 29 | ref: refs/heads/main 30 | - repository: testRepo 31 | name: walbourn/directxmeshtest 32 | type: github 33 | endpoint: microsoft 34 | ref: refs/heads/main 35 | 36 | name: $(Year:yyyy).$(Month).$(DayOfMonth)$(Rev:.r) 37 | 38 | pool: 39 | vmImage: windows-2019 40 | 41 | variables: 42 | Codeql.Enabled: false 43 | VC_PATH: 'C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC' 44 | 45 | jobs: 46 | - job: DESKTOP_BUILD 47 | displayName: 'Windows Desktop' 48 | timeoutInMinutes: 120 49 | cancelTimeoutInMinutes: 1 50 | strategy: 51 | maxParallel: 2 52 | matrix: 53 | Release_x64: 54 | BuildPlatform: x64 55 | BuildConfiguration: Release 56 | Debug_x64: 57 | BuildPlatform: x64 58 | BuildConfiguration: Debug 59 | Release_x86: 60 | BuildPlatform: x86 61 | BuildConfiguration: Release 62 | Debug_x86: 63 | BuildPlatform: x86 64 | BuildConfiguration: Debug 65 | steps: 66 | - checkout: self 67 | clean: true 68 | fetchTags: false 69 | fetchDepth: 1 70 | path: 's' 71 | - checkout: testRepo 72 | displayName: Fetch Tests 73 | clean: true 74 | fetchTags: false 75 | fetchDepth: 1 76 | path: 's/Tests' 77 | - task: VSBuild@1 78 | displayName: Build solution DirectXMesh_Tests_Desktop_2019.sln 79 | inputs: 80 | solution: Tests/DirectXMesh_Tests_Desktop_2019.sln 81 | vsVersion: 16.0 82 | msbuildArgs: /p:PreferredToolArchitecture=x64 83 | platform: '$(BuildPlatform)' 84 | configuration: '$(BuildConfiguration)' 85 | - task: VSBuild@1 86 | displayName: Build solution DirectXMesh_Tests_Desktop_2019_Win10.sln 87 | inputs: 88 | solution: Tests/DirectXMesh_Tests_Desktop_2019_Win10.sln 89 | vsVersion: 16.0 90 | msbuildArgs: /p:PreferredToolArchitecture=x64 91 | platform: '$(BuildPlatform)' 92 | configuration: '$(BuildConfiguration)' 93 | 94 | - job: CMAKE_BUILD_X64 95 | displayName: 'CMake for X64 BUILD_TESTING=ON' 96 | timeoutInMinutes: 60 97 | workspace: 98 | clean: all 99 | steps: 100 | - checkout: self 101 | clean: true 102 | fetchTags: false 103 | fetchDepth: 1 104 | path: 's' 105 | - checkout: testRepo 106 | displayName: Fetch Tests 107 | clean: true 108 | fetchTags: false 109 | fetchDepth: 1 110 | path: 's/Tests' 111 | - task: CmdLine@2 112 | displayName: Setup environment for CMake to use VS 113 | inputs: 114 | script: | 115 | call "$(VC_PATH)\Auxiliary\Build\vcvars64.bat" 116 | echo ##vso[task.setvariable variable=WindowsSdkVerBinPath;]%WindowsSdkVerBinPath% 117 | echo ##vso[task.prependpath]%VSINSTALLDIR%Common7\IDE\CommonExtensions\Microsoft\CMake\Ninja 118 | echo ##vso[task.prependpath]%VCINSTALLDIR%Tools\Llvm\x64\bin 119 | echo ##vso[task.prependpath]%WindowsSdkBinPath%x64 120 | echo ##vso[task.prependpath]%WindowsSdkVerBinPath%x64 121 | echo ##vso[task.prependpath]%VCToolsInstallDir%bin\Hostx64\x64 122 | echo ##vso[task.setvariable variable=EXTERNAL_INCLUDE;]%EXTERNAL_INCLUDE% 123 | echo ##vso[task.setvariable variable=INCLUDE;]%INCLUDE% 124 | echo ##vso[task.setvariable variable=LIB;]%LIB% 125 | 126 | - task: CMake@1 127 | displayName: CMake (MSVC; x64-Debug) Config 128 | inputs: 129 | cwd: '$(Build.SourcesDirectory)' 130 | cmakeArgs: --preset=x64-Debug 131 | - task: CMake@1 132 | displayName: CMake (MSVC; x64-Debug) Build 133 | inputs: 134 | cwd: '$(Build.SourcesDirectory)' 135 | cmakeArgs: --build out/build/x64-Debug -v 136 | - task: DeleteFiles@1 137 | inputs: 138 | Contents: 'out' 139 | - task: CMake@1 140 | displayName: CMake (MSVC; x64-Release) Config 141 | inputs: 142 | cwd: '$(Build.SourcesDirectory)' 143 | cmakeArgs: --preset=x64-Release 144 | - task: CMake@1 145 | displayName: CMake (MSVC; x64-Release) Build 146 | inputs: 147 | cwd: '$(Build.SourcesDirectory)' 148 | cmakeArgs: --build out/build/x64-Release -v 149 | - task: DeleteFiles@1 150 | inputs: 151 | Contents: 'out' 152 | - task: CMake@1 153 | displayName: CMake (clang/LLVM; x64-Debug) Config 154 | inputs: 155 | cwd: '$(Build.SourcesDirectory)' 156 | cmakeArgs: --preset=x64-Debug-Clang 157 | - task: CMake@1 158 | displayName: CMake (clang/LLVM; x64-Debug) Build 159 | inputs: 160 | cwd: '$(Build.SourcesDirectory)' 161 | cmakeArgs: --build out/build/x64-Debug-Clang -v 162 | - task: DeleteFiles@1 163 | inputs: 164 | Contents: 'out' 165 | - task: CMake@1 166 | displayName: CMake (clang/LLVM; x64-Release) Config 167 | inputs: 168 | cwd: '$(Build.SourcesDirectory)' 169 | cmakeArgs: --preset=x64-Release-Clang 170 | - task: CMake@1 171 | displayName: CMake (clang/LLVM; x64-Release) Build 172 | inputs: 173 | cwd: '$(Build.SourcesDirectory)' 174 | cmakeArgs: --build out/build/x64-Release-Clang -v 175 | -------------------------------------------------------------------------------- /.azuredevops/pipelines/DirectXMesh-GitHub-WSL-11.yml: -------------------------------------------------------------------------------- 1 | # Copyright (c) Microsoft Corporation. 2 | # Licensed under the MIT License. 3 | # 4 | # https://go.microsoft.com/fwlink/?LinkID=324981 5 | 6 | # Builds the library for Windows Subsystem for Linux (WSL) 7 | 8 | schedules: 9 | - cron: "0 1 * * *" 10 | displayName: 'Nightly build' 11 | branches: 12 | include: 13 | - main 14 | 15 | trigger: none 16 | 17 | pr: 18 | branches: 19 | include: 20 | - main 21 | paths: 22 | include: 23 | - '.azuredevops/pipelines/DirectXMesh-GitHub-WSL-11.yml' 24 | - CMake* 25 | - build/*.cmake 26 | - build/*.in 27 | 28 | resources: 29 | repositories: 30 | - repository: self 31 | type: git 32 | ref: refs/heads/main 33 | trigger: none 34 | - repository: dxHeadersRepo 35 | name: Microsoft/DirectX-Headers 36 | type: github 37 | endpoint: microsoft 38 | ref: refs/heads/main 39 | - repository: dxMathRepo 40 | name: Microsoft/DirectXMath 41 | type: github 42 | endpoint: microsoft 43 | ref: refs/heads/main 44 | 45 | name: $(Year:yyyy).$(Month).$(DayOfMonth)$(Rev:.r) 46 | 47 | pool: 48 | vmImage: ubuntu-22.04 49 | 50 | variables: 51 | Codeql.Enabled: false 52 | LOCAL_PKG_DIR: '$(Agent.BuildDirectory)/install/' 53 | SAL_URL: https://raw.githubusercontent.com/dotnet/runtime/v8.0.1/src/coreclr/pal/inc/rt/sal.h 54 | SAL_HASH: 0f5a80b97564217db2ba3e4624cc9eb308e19cc9911dae21d983c4ab37003f4756473297ba81b386c498514cedc1ef5a3553d7002edc09aeb6a1335df973095f 55 | 56 | jobs: 57 | - job: BUILD_WSL 58 | displayName: 'Windows Subsystem for Linux (WSL)' 59 | timeoutInMinutes: 120 60 | cancelTimeoutInMinutes: 1 61 | steps: 62 | - checkout: self 63 | clean: true 64 | fetchTags: false 65 | fetchDepth: 1 66 | path: 's' 67 | - checkout: dxHeadersRepo 68 | displayName: Fetch DirectX-Headers 69 | clean: true 70 | fetchTags: false 71 | fetchDepth: 1 72 | path: 's/DirectX-Headers' 73 | - checkout: dxMathRepo 74 | displayName: Fetch DirectX-Math 75 | clean: true 76 | fetchTags: false 77 | fetchDepth: 1 78 | path: 's/DirectXMath' 79 | - task: CMake@1 80 | displayName: CMake DirectX-Headers 81 | inputs: 82 | cwd: DirectX-Headers 83 | cmakeArgs: > 84 | . -DDXHEADERS_BUILD_TEST=OFF -DDXHEADERS_BUILD_GOOGLE_TEST=OFF 85 | -DCMAKE_INSTALL_PREFIX=$(LOCAL_PKG_DIR) 86 | - task: CMake@1 87 | displayName: CMake DirectX-Headers (Build) 88 | inputs: 89 | cwd: DirectX-Headers 90 | cmakeArgs: --build . -v 91 | - task: CMake@1 92 | displayName: CMake DirectX-Headers (Install) 93 | inputs: 94 | cwd: DirectX-Headers 95 | cmakeArgs: --install . 96 | - task: CMake@1 97 | displayName: CMake DirectXMath 98 | inputs: 99 | cwd: DirectXMath 100 | cmakeArgs: . -DCMAKE_INSTALL_PREFIX=$(LOCAL_PKG_DIR) 101 | - task: CMake@1 102 | displayName: CMake DirectXMath (Build) 103 | inputs: 104 | cwd: DirectXMath 105 | cmakeArgs: --build . -v 106 | - task: CMake@1 107 | displayName: CMake DirectXMath (Install) 108 | inputs: 109 | cwd: DirectXMath 110 | cmakeArgs: --install . 111 | - task: PowerShell@2 112 | displayName: Fetch SAL.H 113 | inputs: 114 | targetType: inline 115 | script: | 116 | $ProgressPreference = 'SilentlyContinue' 117 | Invoke-WebRequest -Uri "$(SAL_URL)" -OutFile $(LOCAL_PKG_DIR)/include/sal.h 118 | $fileHash = Get-FileHash -Algorithm SHA512 $(LOCAL_PKG_DIR)/include/sal.h | ForEach { $_.Hash} | Out-String 119 | $filehash = $fileHash.Trim() 120 | Write-Host "##[debug]SHA512: " $filehash 121 | if ($fileHash -ne "$(SAL_HASH)") { 122 | Write-Error -Message "##[error]Computed hash does not match!" -ErrorAction Stop 123 | } 124 | 125 | - task: CMake@1 126 | displayName: CMake DirectXMesh (Config) dbg 127 | inputs: 128 | cwd: $(Build.SourcesDirectory) 129 | cmakeArgs: > 130 | -B out -DCMAKE_BUILD_TYPE=Debug 131 | -DCMAKE_PREFIX_PATH=$(LOCAL_PKG_DIR)/share;$(LOCAL_PKG_DIR)/cmake 132 | - task: CMake@1 133 | displayName: CMake DirectXMesh (Build) dbg 134 | inputs: 135 | cwd: $(Build.SourcesDirectory) 136 | cmakeArgs: --build out -v 137 | - task: CMake@1 138 | displayName: CMake DirectXMesh (Config) rel 139 | inputs: 140 | cwd: $(Build.SourcesDirectory) 141 | cmakeArgs: > 142 | -B out2 -DCMAKE_BUILD_TYPE=Release 143 | -DCMAKE_PREFIX_PATH=$(LOCAL_PKG_DIR)/share;$(LOCAL_PKG_DIR)/cmake 144 | - task: CMake@1 145 | displayName: CMake DirectXMesh (Build) rel 146 | inputs: 147 | cwd: $(Build.SourcesDirectory) 148 | cmakeArgs: --build out2 -v 149 | -------------------------------------------------------------------------------- /.azuredevops/pipelines/DirectXMesh-GitHub-WSL-13.yml: -------------------------------------------------------------------------------- 1 | # Copyright (c) Microsoft Corporation. 2 | # Licensed under the MIT License. 3 | # 4 | # https://go.microsoft.com/fwlink/?LinkID=324981 5 | 6 | # Builds the library for Windows Subsystem for Linux (WSL) 7 | 8 | schedules: 9 | - cron: "0 1 * * *" 10 | displayName: 'Nightly build' 11 | branches: 12 | include: 13 | - main 14 | 15 | trigger: none 16 | 17 | pr: 18 | branches: 19 | include: 20 | - main 21 | paths: 22 | include: 23 | - '.azuredevops/pipelines/DirectXMesh-GitHub-WSL-13.yml' 24 | - CMake* 25 | - build/*.cmake 26 | - build/*.in 27 | 28 | resources: 29 | repositories: 30 | - repository: self 31 | type: git 32 | ref: refs/heads/main 33 | trigger: none 34 | - repository: dxHeadersRepo 35 | name: Microsoft/DirectX-Headers 36 | type: github 37 | endpoint: microsoft 38 | ref: refs/heads/main 39 | - repository: dxMathRepo 40 | name: Microsoft/DirectXMath 41 | type: github 42 | endpoint: microsoft 43 | ref: refs/heads/main 44 | 45 | name: $(Year:yyyy).$(Month).$(DayOfMonth)$(Rev:.r) 46 | 47 | pool: 48 | vmImage: ubuntu-24.04 49 | 50 | variables: 51 | Codeql.Enabled: false 52 | LOCAL_PKG_DIR: '$(Agent.BuildDirectory)/install/' 53 | SAL_URL: https://raw.githubusercontent.com/dotnet/runtime/v8.0.1/src/coreclr/pal/inc/rt/sal.h 54 | SAL_HASH: 0f5a80b97564217db2ba3e4624cc9eb308e19cc9911dae21d983c4ab37003f4756473297ba81b386c498514cedc1ef5a3553d7002edc09aeb6a1335df973095f 55 | 56 | jobs: 57 | - job: BUILD_WSL 58 | displayName: 'Windows Subsystem for Linux (WSL)' 59 | timeoutInMinutes: 120 60 | cancelTimeoutInMinutes: 1 61 | steps: 62 | - checkout: self 63 | clean: true 64 | fetchTags: false 65 | fetchDepth: 1 66 | path: 's' 67 | - checkout: dxHeadersRepo 68 | displayName: Fetch DirectX-Headers 69 | clean: true 70 | fetchTags: false 71 | fetchDepth: 1 72 | path: 's/DirectX-Headers' 73 | - checkout: dxMathRepo 74 | displayName: Fetch DirectX-Math 75 | clean: true 76 | fetchTags: false 77 | fetchDepth: 1 78 | path: 's/DirectXMath' 79 | - task: CMake@1 80 | displayName: CMake DirectX-Headers 81 | inputs: 82 | cwd: DirectX-Headers 83 | cmakeArgs: > 84 | . -DDXHEADERS_BUILD_TEST=OFF -DDXHEADERS_BUILD_GOOGLE_TEST=OFF 85 | -DCMAKE_INSTALL_PREFIX=$(LOCAL_PKG_DIR) 86 | - task: CMake@1 87 | displayName: CMake DirectX-Headers (Build) 88 | inputs: 89 | cwd: DirectX-Headers 90 | cmakeArgs: --build . -v 91 | - task: CMake@1 92 | displayName: CMake DirectX-Headers (Install) 93 | inputs: 94 | cwd: DirectX-Headers 95 | cmakeArgs: --install . 96 | - task: CMake@1 97 | displayName: CMake DirectXMath 98 | inputs: 99 | cwd: DirectXMath 100 | cmakeArgs: . -DCMAKE_INSTALL_PREFIX=$(LOCAL_PKG_DIR) 101 | - task: CMake@1 102 | displayName: CMake DirectXMath (Build) 103 | inputs: 104 | cwd: DirectXMath 105 | cmakeArgs: --build . -v 106 | - task: CMake@1 107 | displayName: CMake DirectXMath (Install) 108 | inputs: 109 | cwd: DirectXMath 110 | cmakeArgs: --install . 111 | - task: PowerShell@2 112 | displayName: Fetch SAL.H 113 | inputs: 114 | targetType: inline 115 | script: | 116 | $ProgressPreference = 'SilentlyContinue' 117 | Invoke-WebRequest -Uri "$(SAL_URL)" -OutFile $(LOCAL_PKG_DIR)/include/sal.h 118 | $fileHash = Get-FileHash -Algorithm SHA512 $(LOCAL_PKG_DIR)/include/sal.h | ForEach { $_.Hash} | Out-String 119 | $filehash = $fileHash.Trim() 120 | Write-Host "##[debug]SHA512: " $filehash 121 | if ($fileHash -ne "$(SAL_HASH)") { 122 | Write-Error -Message "##[error]Computed hash does not match!" -ErrorAction Stop 123 | } 124 | 125 | - task: CMake@1 126 | displayName: CMake DirectXMesh (Config) dbg 127 | inputs: 128 | cwd: $(Build.SourcesDirectory) 129 | cmakeArgs: > 130 | -B out -DCMAKE_BUILD_TYPE=Debug 131 | -DCMAKE_PREFIX_PATH=$(LOCAL_PKG_DIR)/share;$(LOCAL_PKG_DIR)/cmake 132 | - task: CMake@1 133 | displayName: CMake DirectXMesh (Build) dbg 134 | inputs: 135 | cwd: $(Build.SourcesDirectory) 136 | cmakeArgs: --build out -v 137 | - task: CMake@1 138 | displayName: CMake DirectXMesh (Config) rel 139 | inputs: 140 | cwd: $(Build.SourcesDirectory) 141 | cmakeArgs: > 142 | -B out2 -DCMAKE_BUILD_TYPE=Release 143 | -DCMAKE_PREFIX_PATH=$(LOCAL_PKG_DIR)/share;$(LOCAL_PKG_DIR)/cmake 144 | - task: CMake@1 145 | displayName: CMake DirectXMesh (Build) rel 146 | inputs: 147 | cwd: $(Build.SourcesDirectory) 148 | cmakeArgs: --build out2 -v 149 | -------------------------------------------------------------------------------- /.azuredevops/pipelines/DirectXMesh-GitHub.yml: -------------------------------------------------------------------------------- 1 | # Copyright (c) Microsoft Corporation. 2 | # Licensed under the MIT License. 3 | # 4 | # https://go.microsoft.com/fwlink/?LinkID=324981 5 | 6 | # Builds the library for Windows Desktop. 7 | 8 | schedules: 9 | - cron: "0 6 * * *" 10 | displayName: 'Nightly build' 11 | branches: 12 | include: 13 | - main 14 | 15 | # GitHub Actions handles MSBuild for CI/PR 16 | trigger: none 17 | pr: 18 | branches: 19 | include: 20 | - main 21 | paths: 22 | include: 23 | - '.azuredevops/pipelines/DirectXMesh-GitHub.yml' 24 | 25 | resources: 26 | repositories: 27 | - repository: self 28 | type: git 29 | ref: refs/heads/main 30 | 31 | name: $(Year:yyyy).$(Month).$(DayOfMonth)$(Rev:.r) 32 | 33 | variables: 34 | Codeql.Enabled: false 35 | 36 | pool: 37 | vmImage: windows-2019 38 | 39 | jobs: 40 | - job: DESKTOP_BUILD 41 | displayName: 'Windows Desktop' 42 | timeoutInMinutes: 120 43 | cancelTimeoutInMinutes: 1 44 | strategy: 45 | maxParallel: 2 46 | matrix: 47 | Release_x64: 48 | BuildPlatform: x64 49 | BuildConfiguration: Release 50 | SpectreMitigation: false 51 | Debug_x64: 52 | BuildPlatform: x64 53 | BuildConfiguration: Debug 54 | SpectreMitigation: false 55 | Release_x86: 56 | BuildPlatform: x86 57 | BuildConfiguration: Release 58 | SpectreMitigation: false 59 | Debug_x86: 60 | BuildPlatform: x86 61 | BuildConfiguration: Debug 62 | SpectreMitigation: false 63 | Release_x64_SpectreMitigated: 64 | BuildPlatform: x64 65 | BuildConfiguration: Release 66 | SpectreMitigation: 'Spectre' 67 | Debug_x64_SpectreMitigated: 68 | BuildPlatform: x64 69 | BuildConfiguration: Debug 70 | SpectreMitigation: 'Spectre' 71 | Release_x86_SpectreMitigated: 72 | BuildPlatform: x86 73 | BuildConfiguration: Release 74 | SpectreMitigation: 'Spectre' 75 | Debug_x86_SpectreMitigated: 76 | BuildPlatform: x86 77 | BuildConfiguration: Debug 78 | SpectreMitigation: 'Spectre' 79 | steps: 80 | - checkout: self 81 | clean: true 82 | fetchTags: false 83 | - task: VSBuild@1 84 | displayName: Build solution DirectXMesh_Desktop_2019.sln 85 | inputs: 86 | solution: DirectXMesh_Desktop_2019.sln 87 | msbuildArgs: /p:PreferredToolArchitecture=x64 /p:SpectreMitigation=$(SpectreMitigation) 88 | platform: '$(BuildPlatform)' 89 | configuration: '$(BuildConfiguration)' 90 | - task: VSBuild@1 91 | displayName: Build solution DirectXMesh_Desktop_2019_Win10.sln 92 | inputs: 93 | solution: DirectXMesh_Desktop_2019_Win10.sln 94 | msbuildArgs: /p:PreferredToolArchitecture=x64 /p:SpectreMitigation=$(SpectreMitigation) 95 | platform: '$(BuildPlatform)' 96 | configuration: '$(BuildConfiguration)' 97 | -------------------------------------------------------------------------------- /.azuredevops/pipelines/DirectXMesh-OneFuzz-Coverage.yml: -------------------------------------------------------------------------------- 1 | # Copyright (c) Microsoft Corporation. 2 | # Licensed under the MIT License. 3 | # 4 | # https://go.microsoft.com/fwlink/?LinkID=324981 5 | 6 | # OneFuzz code coverage pipeline 7 | 8 | pr: none 9 | trigger: none 10 | 11 | resources: 12 | repositories: 13 | - repository: self 14 | type: git 15 | ref: refs/heads/main 16 | - repository: testRepo 17 | name: walbourn/directxmeshtest 18 | type: github 19 | endpoint: microsoft 20 | ref: refs/heads/main 21 | 22 | pool: 23 | vmImage: windows-latest 24 | 25 | parameters: 26 | - name: sasUrl 27 | type: string 28 | displayName: SAS URL 29 | - name: branch 30 | type: string 31 | displayName: Branch 32 | - name: jobID 33 | type: string 34 | displayName: OneFuzz Job ID 35 | - name: buildDate 36 | type: string 37 | displayName: Build Date 38 | - name: commitID 39 | type: string 40 | displayName: Commit ID 41 | 42 | variables: 43 | - name: coverage-file 44 | value: cobertura-coverage.xml 45 | - name: job-ID 46 | value: ${{ parameters.jobID }} 47 | - name: build-date 48 | value: ${{ parameters.buildDate }} 49 | - name: branch 50 | value: ${{ parameters.branch }} 51 | - name: sas-url 52 | value: ${{ parameters.sasUrl }} 53 | - name: commit-ID 54 | value: ${{ parameters.commitID }} 55 | 56 | jobs: 57 | - job: prod 58 | displayName: Prod Task 59 | workspace: 60 | clean: all 61 | steps: 62 | - checkout: self 63 | clean: true 64 | fetchTags: false 65 | fetchDepth: 1 66 | path: 's' 67 | - checkout: testRepo 68 | displayName: Fetch Tests 69 | clean: true 70 | fetchTags: false 71 | fetchDepth: 1 72 | path: 's/Tests' 73 | - powershell: | 74 | Write-Host "Job ID: $(job-ID), Build Date: $(build-date), Branch: $(branch)" 75 | $SASUrl = [System.Uri]::new("$(sas-url)") 76 | azcopy cp $SASUrl.AbsoluteUri ./ --recursive 77 | $ContainerName = $SASURL.LocalPath.Split("/")[1] 78 | Write-Host "##vso[task.setvariable variable=container-name;]$ContainerName" 79 | cd $ContainerName 80 | $size = ((Get-Item .\$(coverage-file)).length) 81 | if ($size -eq 0) { 82 | Write-Host "Cobertura coverage XML is empty." 83 | exit 1 84 | } 85 | displayName: 'Get code coverage from OneFuzz' 86 | 87 | - task: PublishCodeCoverageResults@1 88 | inputs: 89 | codeCoverageTool: 'Cobertura' 90 | summaryFileLocation: ./$(container-name)\$(coverage-file) 91 | pathToSources: $(Build.SourcesDirectory) 92 | displayName: 'Generate coverage report' 93 | -------------------------------------------------------------------------------- /.azuredevops/pipelines/DirectXMesh-OneFuzz.yml: -------------------------------------------------------------------------------- 1 | # Copyright (c) Microsoft Corporation. 2 | # Licensed under the MIT License. 3 | # 4 | # https://go.microsoft.com/fwlink/?LinkID=324981 5 | 6 | # Builds the library using CMake and submit for file fuzzing 7 | 8 | schedules: 9 | - cron: "0 12 1 * *" 10 | displayName: 'Submit for File Fuzzing (Monthly)' 11 | branches: 12 | include: 13 | - main 14 | always: true 15 | 16 | trigger: none 17 | pr: none 18 | 19 | resources: 20 | repositories: 21 | - repository: self 22 | type: git 23 | ref: refs/heads/main 24 | - repository: testRepo 25 | name: walbourn/directxmeshtest 26 | type: github 27 | endpoint: microsoft 28 | ref: refs/heads/main 29 | 30 | name: $(Year:yyyy).$(Month).$(DayOfMonth)$(Rev:.r) 31 | 32 | variables: 33 | Codeql.Enabled: false 34 | VS_GENERATOR: 'Visual Studio 17 2022' 35 | WIN11_SDK: '10.0.22000.0' 36 | 37 | pool: 38 | vmImage: windows-2022 39 | 40 | jobs: 41 | - job: FUZZ_BUILD 42 | displayName: 'Build for file fuzzing' 43 | steps: 44 | - checkout: self 45 | clean: true 46 | fetchTags: false 47 | fetchDepth: 1 48 | path: 's' 49 | - checkout: testRepo 50 | displayName: Fetch Tests 51 | clean: true 52 | fetchTags: false 53 | fetchDepth: 1 54 | path: 's/Tests' 55 | - task: CMake@1 56 | displayName: 'CMake (MSVC): Config with ASan' 57 | inputs: 58 | cwd: '$(Build.SourcesDirectory)' 59 | cmakeArgs: > 60 | -G "$(VS_GENERATOR)" -A x64 -B out -DCMAKE_SYSTEM_VERSION=$(WIN11_SDK) 61 | -DBUILD_TOOLS=OFF -DBUILD_FUZZING=ON -DBUILD_TESTING=OFF 62 | - task: CMake@1 63 | displayName: 'CMake (MSVC): Build with ASan' 64 | inputs: 65 | cwd: '$(Build.SourcesDirectory)' 66 | cmakeArgs: --build out -v --config RelWithDebInfo 67 | - task: CopyFiles@2 68 | displayName: Copy fuzzer 69 | inputs: 70 | Contents: | 71 | build\OneFuzzConfig.json 72 | out\bin\RelWithDebInfo\fuzzloaders.exe 73 | TargetFolder: .drop 74 | OverWrite: true 75 | flattenFolders: true 76 | - task: CopyFiles@2 77 | displayName: Copy symbols 78 | inputs: 79 | Contents: | 80 | out\bin\RelWithDebInfo\fuzzloaders.pdb 81 | TargetFolder: .drop\symbols 82 | OverWrite: true 83 | flattenFolders: true 84 | - task: PowerShell@2 85 | displayName: Download seed files 86 | inputs: 87 | targetType: inline 88 | script: | 89 | $seedfiles = "cube._obj", 90 | "cup.mtl", 91 | "cup._obj", 92 | "cylinder.vbo", 93 | "torus.vbo", 94 | "player_ship_a.mtl", 95 | "player_ship_a._obj", 96 | "shuttle._obj", 97 | "teapot._obj", 98 | "vp.mtl"; 99 | 100 | New-Item -ItemType Directory -Force -Path .drop\seeds\ 101 | 102 | foreach($filename in $seedfiles) 103 | { 104 | Write-Host "Fetching: $filename" 105 | $url = "https://raw.githubusercontent.com/walbourn/directxmeshmedia/main/" + $filename 106 | $target = [System.IO.Path]::Combine(".drop\seeds\", $filename) 107 | Invoke-WebRequest -Uri $url -OutFile $target 108 | } 109 | 110 | - task: PowerShell@2 111 | displayName: Copy OneFuzz setup script 112 | inputs: 113 | targetType: 'inline' 114 | script: | 115 | Copy-Item -Path .\build\onefuzz-setup.ps1 -Destination .drop/setup.ps1 116 | 117 | - task: MSBuild@1 118 | displayName: 'Copy ASan binaries' 119 | inputs: 120 | solution: build/CopyASAN.targets 121 | msbuildArguments: /p:TargetFolder=$(Build.SourcesDirectory)\.drop 122 | msbuildVersion: 17.0 123 | msbuildArchitecture: x64 124 | - task: PowerShell@2 125 | displayName: List drop files 126 | inputs: 127 | targetType: inline 128 | script: | 129 | Get-ChildItem ".drop" -Recurse | select FullName 130 | 131 | - task: onefuzz-task@0 132 | displayName: 'Submit to OneFuzz' 133 | inputs: 134 | onefuzzOSes: 'Windows' 135 | env: 136 | onefuzzDropDirectory: $(Build.SourcesDirectory)\.drop 137 | SYSTEM_ACCESSTOKEN: $(System.AccessToken) 138 | -------------------------------------------------------------------------------- /.azuredevops/policies/approvercountpolicy.yml: -------------------------------------------------------------------------------- 1 | name: approver_count 2 | description: Approver count policy for mscodehub/DirectXMesh/DirectXMesh repository 3 | resource: repository 4 | where: 5 | configuration: 6 | approverCountPolicySettings: 7 | isBlocking: true 8 | requireMinimumApproverCount: 1 9 | creatorVoteCounts: false 10 | allowDownvotes: false 11 | sourcePushOptions: 12 | resetOnSourcePush: false 13 | requireVoteOnLastIteration: true 14 | requireVoteOnEachIteration: false 15 | resetRejectionsOnSourcePush: false 16 | blockLastPusherVote: true 17 | branchNames: 18 | - refs/heads/release 19 | - refs/heads/main 20 | displayName: mscodehub/DirectXMesh/DirectXMesh Approver Count Policy 21 | -------------------------------------------------------------------------------- /.azuredevops/templates/DirectXMesh-build-gdk.yml: -------------------------------------------------------------------------------- 1 | # Copyright (c) Microsoft Corporation. 2 | # Licensed under the MIT License. 3 | # 4 | # http://go.microsoft.com/fwlink/?LinkId=248926 5 | 6 | # Template used by GitHub-GDK-* pipelines 7 | 8 | parameters: 9 | - name: msVersion 10 | type: string 11 | values: 12 | - '16.0' 13 | - '17.0' 14 | - name: vsYear 15 | type: number 16 | values: 17 | - 2019 18 | - 2022 19 | 20 | steps: 21 | - task: VSBuild@1 22 | displayName: Build solution DirectXMesh_GDK_${{ parameters.vsYear }} pcdbg 23 | inputs: 24 | solution: DirectXMesh_GDK_${{ parameters.vsYear }}.sln 25 | vsVersion: ${{ parameters.msVersion }} 26 | platform: Gaming.Desktop.x64 27 | configuration: Debug 28 | msbuildArchitecture: x64 29 | msbuildArgs: /p:GDKEditionNumber=$(GDK_EDITION) 30 | - task: VSBuild@1 31 | displayName: Build solution DirectXMesh_GDK_${{ parameters.vsYear }} pcrel 32 | inputs: 33 | solution: DirectXMesh_GDK_${{ parameters.vsYear }}.sln 34 | vsVersion: ${{ parameters.msVersion }} 35 | platform: Gaming.Desktop.x64 36 | configuration: Release 37 | msbuildArchitecture: x64 38 | msbuildArgs: /p:GDKEditionNumber=$(GDK_EDITION) 39 | - task: VSBuild@1 40 | displayName: Build solution DirectXMesh_GDK_${{ parameters.vsYear }} xbdbg 41 | inputs: 42 | solution: DirectXMesh_GDK_${{ parameters.vsYear }}.sln 43 | vsVersion: ${{ parameters.msVersion }} 44 | platform: Gaming.Xbox.XboxOne.x64 45 | configuration: Debug 46 | msbuildArchitecture: x64 47 | msbuildArgs: /p:GDKEditionNumber=$(GDK_EDITION) 48 | - task: VSBuild@1 49 | displayName: Build solution DirectXMesh_GDK_${{ parameters.vsYear }} xbrel 50 | inputs: 51 | solution: DirectXMesh_GDK_${{ parameters.vsYear }}.sln 52 | vsVersion: ${{ parameters.msVersion }} 53 | platform: Gaming.Xbox.XboxOne.x64 54 | configuration: Release 55 | msbuildArchitecture: x64 56 | msbuildArgs: /p:GDKEditionNumber=$(GDK_EDITION) 57 | - task: VSBuild@1 58 | displayName: Build solution DirectXMesh_GDK_${{ parameters.vsYear }} scardbg 59 | inputs: 60 | solution: DirectXMesh_GDK_${{ parameters.vsYear }}.sln 61 | vsVersion: ${{ parameters.msVersion }} 62 | platform: Gaming.Xbox.Scarlett.x64 63 | configuration: Debug 64 | msbuildArchitecture: x64 65 | msbuildArgs: /p:GDKEditionNumber=$(GDK_EDITION) 66 | - task: VSBuild@1 67 | displayName: Build solution DirectXMesh_GDK_${{ parameters.vsYear }} scarrel 68 | inputs: 69 | solution: DirectXMesh_GDK_${{ parameters.vsYear }}.sln 70 | vsVersion: ${{ parameters.msVersion }} 71 | platform: Gaming.Xbox.Scarlett.x64 72 | configuration: Release 73 | msbuildArchitecture: x64 74 | msbuildArgs: /p:GDKEditionNumber=$(GDK_EDITION) 75 | -------------------------------------------------------------------------------- /.azuredevops/templates/DirectXMesh-build-uwp.yml: -------------------------------------------------------------------------------- 1 | # Copyright (c) Microsoft Corporation. 2 | # Licensed under the MIT License. 3 | # 4 | # https://go.microsoft.com/fwlink/?LinkID=324981 5 | 6 | # Template used by SDK-release and SDK-prerelease pipelines 7 | 8 | steps: 9 | - task: VSBuild@1 10 | displayName: Build solution DirectXMesh_Windows10_2022.sln 32dbg 11 | inputs: 12 | solution: DirectXMesh_Windows10_2022.sln 13 | msbuildArgs: /p:PreferredToolArchitecture=x64 14 | platform: x86 15 | configuration: Debug 16 | - task: VSBuild@1 17 | displayName: Build solution DirectXMesh_Windows10_2022.sln 32rel 18 | inputs: 19 | solution: DirectXMesh_Windows10_2022.sln 20 | msbuildArgs: /p:PreferredToolArchitecture=x64 21 | platform: x86 22 | configuration: Release 23 | - task: VSBuild@1 24 | displayName: Build solution DirectXMesh_Windows10_2022.sln 64dbg 25 | inputs: 26 | solution: DirectXMesh_Windows10_2022.sln 27 | msbuildArgs: /p:PreferredToolArchitecture=x64 28 | platform: x64 29 | configuration: Debug 30 | - task: VSBuild@1 31 | displayName: Build solution DirectXMesh_Windows10_2022.sln 64rel 32 | inputs: 33 | solution: DirectXMesh_Windows10_2022.sln 34 | msbuildArgs: /p:PreferredToolArchitecture=x64 35 | platform: x64 36 | configuration: Release 37 | # Windows on ARM 32-bit is deprecated. https://learn.microsoft.com/windows/arm/arm32-to-arm64 38 | - task: VSBuild@1 39 | displayName: Build solution DirectXMesh_Windows10_2022.sln arm64dbg 40 | inputs: 41 | solution: DirectXMesh_Windows10_2022.sln 42 | msbuildArgs: /p:PreferredToolArchitecture=x64 43 | platform: ARM64 44 | configuration: Debug 45 | - task: VSBuild@1 46 | displayName: Build solution DirectXMesh_Windows10_2022.sln arm64rel 47 | inputs: 48 | solution: DirectXMesh_Windows10_2022.sln 49 | msbuildArgs: /p:PreferredToolArchitecture=x64 50 | platform: ARM64 51 | configuration: Release 52 | -------------------------------------------------------------------------------- /.azuredevops/templates/DirectXMesh-build-win32.yml: -------------------------------------------------------------------------------- 1 | # Copyright (c) Microsoft Corporation. 2 | # Licensed under the MIT License. 3 | # 4 | # https://go.microsoft.com/fwlink/?LinkID=324981 5 | 6 | # Template used by SDK-release and SDK-prerelease pipelines 7 | 8 | steps: 9 | - task: VSBuild@1 10 | displayName: Build solution DirectXMesh_Desktop_2019.sln 32dbg 11 | inputs: 12 | solution: DirectXMesh_Desktop_2019.sln 13 | msbuildArgs: /p:PreferredToolArchitecture=x64 14 | platform: x86 15 | configuration: Debug 16 | - task: VSBuild@1 17 | displayName: Build solution DirectXMesh_Desktop_2019.sln 32rel 18 | inputs: 19 | solution: DirectXMesh_Desktop_2019.sln 20 | msbuildArgs: /p:PreferredToolArchitecture=x64 21 | platform: x86 22 | configuration: Release 23 | - task: VSBuild@1 24 | displayName: Build solution DirectXMesh_Desktop_2019.sln 64dbg 25 | inputs: 26 | solution: DirectXMesh_Desktop_2019.sln 27 | msbuildArgs: /p:PreferredToolArchitecture=x64 28 | platform: x64 29 | configuration: Debug 30 | - task: VSBuild@1 31 | displayName: Build solution DirectXMesh_Desktop_2019.sln 64rel 32 | inputs: 33 | solution: DirectXMesh_Desktop_2019.sln 34 | msbuildArgs: /p:PreferredToolArchitecture=x64 35 | platform: x64 36 | configuration: Release 37 | - task: VSBuild@1 38 | displayName: Build solution DirectXMesh_Desktop_2019_Win10.sln 32dbg 39 | inputs: 40 | solution: DirectXMesh_Desktop_2019_Win10.sln 41 | msbuildArgs: /p:PreferredToolArchitecture=x64 42 | platform: x86 43 | configuration: Debug 44 | - task: VSBuild@1 45 | displayName: Build solution DirectXMesh_Desktop_2019_Win10.sln 32rel 46 | inputs: 47 | solution: DirectXMesh_Desktop_2019_Win10.sln 48 | msbuildArgs: /p:PreferredToolArchitecture=x64 49 | platform: x86 50 | configuration: Release 51 | - task: VSBuild@1 52 | displayName: Build solution DirectXMesh_Desktop_2019_Win10.sln 64dbg 53 | inputs: 54 | solution: DirectXMesh_Desktop_2019_Win10.sln 55 | msbuildArgs: /p:PreferredToolArchitecture=x64 56 | platform: x64 57 | configuration: Debug 58 | - task: VSBuild@1 59 | displayName: Build solution DirectXMesh_Desktop_2019_Win10.sln 64rel 60 | inputs: 61 | solution: DirectXMesh_Desktop_2019_Win10.sln 62 | msbuildArgs: /p:PreferredToolArchitecture=x64 63 | platform: x64 64 | configuration: Release 65 | # VS 2019 for Win32 on ARM64 is out of support. 66 | - task: VSBuild@1 67 | displayName: Build solution DirectXMesh_Desktop_2022_Win10.sln arm64dbg 68 | inputs: 69 | solution: DirectXMesh_Desktop_2022_Win10.sln 70 | msbuildArgs: /p:PreferredToolArchitecture=x64 71 | platform: ARM64 72 | configuration: Debug 73 | - task: VSBuild@1 74 | displayName: Build solution DirectXMesh_Desktop_2022_Win10.sln arm64rel 75 | inputs: 76 | solution: DirectXMesh_Desktop_2022_Win10.sln 77 | msbuildArgs: /p:PreferredToolArchitecture=x64 78 | platform: ARM64 79 | configuration: Release 80 | -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*.{yml}] 4 | indent_size = 2 5 | indent_style = space 6 | trim_trailing_whitespace = true 7 | insert_final_newline = true 8 | end_of_line = crlf 9 | charset = latin1 10 | 11 | [*.{fx,fxh,hlsl,hlsli}] 12 | indent_size = 4 13 | indent_style = space 14 | trim_trailing_whitespace = true 15 | insert_final_newline = true 16 | end_of_line = crlf 17 | charset = latin1 18 | cpp_space_before_function_open_parenthesis = remove 19 | cpp_space_around_binary_operator = ignore 20 | cpp_space_pointer_reference_alignment = ignore 21 | 22 | [*.{cpp,h,hpp,inl}] 23 | indent_size = 4 24 | indent_style = space 25 | trim_trailing_whitespace = true 26 | insert_final_newline = true 27 | end_of_line = crlf 28 | charset = latin1 29 | cpp_indent_braces = false 30 | cpp_indent_multi_line_relative_to = innermost_parenthesis 31 | cpp_indent_within_parentheses = indent 32 | cpp_indent_preserve_within_parentheses = false 33 | cpp_indent_case_contents = true 34 | cpp_indent_case_labels = false 35 | cpp_indent_case_contents_when_block = true 36 | cpp_indent_lambda_braces_when_parameter = true 37 | cpp_indent_preprocessor = one_left 38 | cpp_indent_access_specifiers = false 39 | cpp_indent_namespace_contents = true 40 | cpp_indent_preserve_comments = true 41 | cpp_new_line_before_open_brace_namespace = new_line 42 | cpp_new_line_before_open_brace_type = new_line 43 | cpp_new_line_before_open_brace_function = new_line 44 | cpp_new_line_before_open_brace_block = new_line 45 | cpp_new_line_before_open_brace_lambda = new_line 46 | cpp_new_line_scope_braces_on_separate_lines = true 47 | cpp_new_line_close_brace_same_line_empty_type = true 48 | cpp_new_line_close_brace_same_line_empty_function = true 49 | cpp_new_line_before_catch = true 50 | cpp_new_line_before_else = true 51 | cpp_new_line_before_while_in_do_while = true 52 | cpp_space_before_function_open_parenthesis = remove 53 | cpp_space_within_parameter_list_parentheses = false 54 | cpp_space_between_empty_parameter_list_parentheses = false 55 | cpp_space_after_keywords_in_control_flow_statements = true 56 | cpp_space_within_control_flow_statement_parentheses = false 57 | cpp_space_before_lambda_open_parenthesis = false 58 | cpp_space_within_cast_parentheses = false 59 | cpp_space_after_cast_close_parenthesis = false 60 | cpp_space_within_expression_parentheses = false 61 | cpp_space_before_initializer_list_open_brace = false 62 | cpp_space_within_initializer_list_braces = true 63 | cpp_space_before_open_square_bracket = false 64 | cpp_space_within_square_brackets = false 65 | cpp_space_before_empty_square_brackets = false 66 | cpp_space_between_empty_square_brackets = false 67 | cpp_space_group_square_brackets = true 68 | cpp_space_within_lambda_brackets = false 69 | cpp_space_between_empty_lambda_brackets = false 70 | cpp_space_before_comma = false 71 | cpp_space_after_comma = true 72 | cpp_space_remove_around_member_operators = true 73 | cpp_space_before_inheritance_colon = true 74 | cpp_space_before_constructor_colon = true 75 | cpp_space_remove_before_semicolon = true 76 | cpp_space_after_semicolon = false 77 | cpp_space_remove_around_unary_operator = false 78 | cpp_space_around_binary_operator = ignore 79 | cpp_space_around_assignment_operator = insert 80 | cpp_space_pointer_reference_alignment = ignore 81 | cpp_space_around_ternary_operator = insert 82 | cpp_wrap_preserve_blocks = one_liners 83 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto 3 | 4 | # Explicitly declare code/VS files as CRLF 5 | *.cpp eol=crlf 6 | *.h eol=crlf 7 | *.hlsl eol=crlf 8 | *.hlsli eol=crlf 9 | *.fx eol=crlf 10 | *.fxh eol=crlf 11 | *.inc eol=crlf 12 | *.inl eol=crlf 13 | *.vcxproj eol=crlf 14 | *.filters eol=crlf 15 | *.sln eol=crlf 16 | *.yml eol=crlf 17 | 18 | # Explicitly declare resource files as binary 19 | *.pdb binary 20 | -------------------------------------------------------------------------------- /.github/dependabot.yml: -------------------------------------------------------------------------------- 1 | version: 2 2 | updates: 3 | - package-ecosystem: github-actions 4 | directory: / 5 | schedule: 6 | interval: monthly 7 | -------------------------------------------------------------------------------- /.github/linters/.editorconfig-checker.json: -------------------------------------------------------------------------------- 1 | { 2 | "Format": "github-actions", 3 | "exclude": [ 4 | ".git", 5 | "LICENSE", 6 | "Tests" 7 | ] 8 | } 9 | -------------------------------------------------------------------------------- /.github/linters/.markdown-lint.yml: -------------------------------------------------------------------------------- 1 | # Copyright (c) Microsoft Corporation. 2 | # Licensed under the MIT License. 3 | 4 | # line-length 5 | MD013: false 6 | 7 | # blanks-around-headings 8 | MD022: false 9 | 10 | # blanks-around-lists 11 | MD032: false 12 | 13 | # no-inline-html 14 | MD033: false 15 | 16 | # no-bare-urls 17 | MD034: false 18 | 19 | # first-line-heading 20 | MD041: false 21 | -------------------------------------------------------------------------------- /.github/linters/.powershell-psscriptanalyzer.psd1: -------------------------------------------------------------------------------- 1 | # PSScriptAnalyzerSettings.psd1 2 | @{ 3 | Severity=@('Error','Warning') 4 | ExcludeRules=@('PSAvoidUsingWriteHost') 5 | } 6 | -------------------------------------------------------------------------------- /.github/linters/.yaml-lint.yml: -------------------------------------------------------------------------------- 1 | # Copyright (c) Microsoft Corporation. 2 | # Licensed under the MIT License. 3 | 4 | ignore-from-file: .gitignore 5 | 6 | extends: default 7 | 8 | rules: 9 | truthy: 10 | check-keys: false 11 | document-start: disable 12 | line-length: 13 | max: 160 14 | comments: 15 | min-spaces-from-content: 1 16 | new-lines: 17 | type: dos 18 | -------------------------------------------------------------------------------- /.github/workflows/bvt.yml: -------------------------------------------------------------------------------- 1 | # Copyright (c) Microsoft Corporation. 2 | # Licensed under the MIT License. 3 | # 4 | # https://go.microsoft.com/fwlink/?LinkID=324981 5 | 6 | name: 'CTest (BVTs)' 7 | 8 | on: 9 | push: 10 | branches: "main" 11 | paths-ignore: 12 | - '*.md' 13 | - LICENSE 14 | - '.azuredevops/**' 15 | - '.nuget/*' 16 | - build/*.cmd 17 | - build/*.props 18 | - build/*.ps1 19 | - build/*.targets 20 | - build/*.xvd 21 | pull_request: 22 | branches: "main" 23 | paths-ignore: 24 | - '*.md' 25 | - LICENSE 26 | - '.azuredevops/**' 27 | - '.nuget/*' 28 | - build/*.cmd 29 | - build/*.props 30 | - build/*.ps1 31 | - build/*.targets 32 | - build/*.xvd 33 | 34 | permissions: 35 | contents: read 36 | 37 | jobs: 38 | build: 39 | runs-on: windows-2022 40 | timeout-minutes: 20 41 | 42 | strategy: 43 | fail-fast: false 44 | 45 | matrix: 46 | toolver: ['14.29', '14'] 47 | build_type: [x64-Release] 48 | arch: [amd64] 49 | 50 | steps: 51 | - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 52 | 53 | - name: Clone test repository 54 | uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 55 | with: 56 | repository: walbourn/directxmeshtest 57 | path: Tests 58 | ref: main 59 | 60 | - name: 'Install Ninja' 61 | run: choco install ninja 62 | 63 | - uses: ilammy/msvc-dev-cmd@0b201ec74fa43914dc39ae48a89fd1d8cb592756 # v1.13.0 64 | with: 65 | arch: ${{ matrix.arch }} 66 | toolset: ${{ matrix.toolver }} 67 | 68 | - name: 'Configure CMake' 69 | working-directory: ${{ github.workspace }} 70 | run: > 71 | cmake --preset=${{ matrix.build_type }} 72 | -DBUILD_TESTING=ON -DBUILD_TOOLS=OFF -DBUILD_BVT=ON 73 | 74 | - name: 'Build' 75 | working-directory: ${{ github.workspace }} 76 | run: cmake --build out\build\${{ matrix.build_type }} 77 | 78 | - name: 'Run BVTs' 79 | working-directory: ${{ github.workspace }} 80 | run: ctest --preset=${{ matrix.build_type }} --output-on-failure 81 | -------------------------------------------------------------------------------- /.github/workflows/codeql.yml: -------------------------------------------------------------------------------- 1 | # Copyright (c) Microsoft Corporation. 2 | # Licensed under the MIT License. 3 | # 4 | # https://go.microsoft.com/fwlink/?LinkID=324981 5 | 6 | name: "CodeQL" 7 | 8 | on: 9 | push: 10 | branches: "main" 11 | paths-ignore: 12 | - '*.md' 13 | - LICENSE 14 | - '.azuredevops/**' 15 | - '.nuget/*' 16 | - build/*.cmd 17 | - build/*.props 18 | - build/*.ps1 19 | - build/*.targets 20 | - build/*.xvd 21 | pull_request: 22 | branches: "main" 23 | paths-ignore: 24 | - '*.md' 25 | - LICENSE 26 | - '.azuredevops/**' 27 | - '.nuget/*' 28 | - build/*.cmd 29 | - build/*.props 30 | - build/*.ps1 31 | - build/*.targets 32 | - build/*.xvd 33 | schedule: 34 | - cron: '34 18 * * 6' 35 | 36 | permissions: 37 | contents: read 38 | 39 | jobs: 40 | analyze: 41 | name: Analyze (C/C++) 42 | runs-on: windows-latest 43 | timeout-minutes: 360 44 | permissions: 45 | actions: read # for github/codeql-action/init to get workflow details 46 | contents: read # for actions/checkout to fetch code 47 | security-events: write # for github/codeql-action/autobuild to send a status report 48 | packages: read 49 | 50 | steps: 51 | - name: Checkout repository 52 | uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 53 | 54 | - name: 'Install Ninja' 55 | run: choco install ninja 56 | 57 | - uses: ilammy/msvc-dev-cmd@0b201ec74fa43914dc39ae48a89fd1d8cb592756 # v1.13.0 58 | 59 | - name: Initialize CodeQL 60 | uses: github/codeql-action/init@ff0a06e83cb2de871e5a09832bc6a81e7276941f # v3.28.18 61 | with: 62 | languages: c-cpp 63 | build-mode: manual 64 | 65 | - name: 'Configure CMake' 66 | working-directory: ${{ github.workspace }} 67 | run: cmake --preset=x64-Debug 68 | 69 | - name: 'Build' 70 | working-directory: ${{ github.workspace }} 71 | run: cmake --build out\build\x64-Debug 72 | 73 | - name: Perform CodeQL Analysis 74 | uses: github/codeql-action/analyze@ff0a06e83cb2de871e5a09832bc6a81e7276941f # v3.28.18 75 | with: 76 | category: "/language:c-cpp" 77 | -------------------------------------------------------------------------------- /.github/workflows/lint.yml: -------------------------------------------------------------------------------- 1 | # Copyright (c) Microsoft Corporation. 2 | # Licensed under the MIT License. 3 | # 4 | # https://go.microsoft.com/fwlink/?LinkID=324981 5 | 6 | name: Lint 7 | 8 | on: 9 | pull_request: 10 | branches: "main" 11 | paths-ignore: 12 | - LICENSE 13 | - '.nuget/*' 14 | - build/*.in 15 | 16 | permissions: {} 17 | 18 | jobs: 19 | analyze: 20 | permissions: 21 | contents: read 22 | packages: read 23 | statuses: write 24 | name: Lint 25 | runs-on: ubuntu-latest 26 | 27 | steps: 28 | - name: Checkout repository 29 | uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 30 | with: 31 | fetch-depth: 0 32 | 33 | - name: Lint Code Base 34 | uses: super-linter/super-linter@12150456a73e248bdc94d0794898f94e23127c88 # v7.4.0 35 | env: 36 | DEFAULT_BRANCH: origin/main 37 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 38 | IGNORE_GITIGNORED_FILES: true 39 | VALIDATE_ALL_CODEBASE: true 40 | VALIDATE_CHECKOV: true 41 | VALIDATE_EDITORCONFIG: true 42 | VALIDATE_GITHUB_ACTIONS: true 43 | VALIDATE_JSON: true 44 | VALIDATE_MARKDOWN: true 45 | VALIDATE_POWERSHELL: true 46 | VALIDATE_GITLEAKS: true 47 | VALIDATE_YAML: true 48 | -------------------------------------------------------------------------------- /.github/workflows/main.yml: -------------------------------------------------------------------------------- 1 | # Copyright (c) Microsoft Corporation. 2 | # Licensed under the MIT License. 3 | # 4 | # https://go.microsoft.com/fwlink/?LinkID=324981 5 | 6 | name: 'CMake (Windows)' 7 | 8 | on: 9 | push: 10 | branches: "main" 11 | paths-ignore: 12 | - '*.md' 13 | - LICENSE 14 | - '.azuredevops/**' 15 | - '.nuget/*' 16 | - build/*.cmd 17 | - build/*.props 18 | - build/*.ps1 19 | - build/*.targets 20 | - build/*.xvd 21 | pull_request: 22 | branches: "main" 23 | paths-ignore: 24 | - '*.md' 25 | - LICENSE 26 | - '.azuredevops/**' 27 | - '.nuget/*' 28 | - build/*.cmd 29 | - build/*.props 30 | - build/*.ps1 31 | - build/*.targets 32 | - build/*.xvd 33 | 34 | permissions: 35 | contents: read 36 | 37 | jobs: 38 | build: 39 | runs-on: windows-2022 40 | 41 | strategy: 42 | fail-fast: false 43 | 44 | matrix: 45 | toolver: ['14.29', '14'] 46 | build_type: [x64-Debug, x64-Release] 47 | arch: [amd64] 48 | include: 49 | - toolver: '14.29' 50 | build_type: x86-Debug 51 | arch: amd64_x86 52 | - toolver: '14.29' 53 | build_type: x86-Release 54 | arch: amd64_x86 55 | - toolver: '14' 56 | build_type: x86-Debug 57 | arch: amd64_x86 58 | - toolver: '14' 59 | build_type: x86-Release 60 | arch: amd64_x86 61 | - toolver: '14' 62 | build_type: arm64-Debug 63 | arch: amd64_arm64 64 | - toolver: '14' 65 | build_type: arm64-Release 66 | arch: amd64_arm64 67 | - toolver: '14' 68 | build_type: arm64ec-Debug 69 | arch: amd64_arm64 70 | - toolver: '14' 71 | build_type: arm64ec-Release 72 | arch: amd64_arm64 73 | - toolver: '14' 74 | build_type: x64-Debug-Win8 75 | arch: amd64 76 | - toolver: '14' 77 | build_type: x64-Release-Win8 78 | arch: amd64 79 | - toolver: '14' 80 | build_type: x64-Debug-Clang 81 | arch: amd64 82 | - toolver: '14' 83 | build_type: x64-Release-Clang 84 | arch: amd64 85 | - toolver: '14' 86 | build_type: x86-Debug-Clang 87 | arch: amd64_x86 88 | - toolver: '14' 89 | build_type: x86-Release-Clang 90 | arch: amd64_x86 91 | - toolver: '14' 92 | build_type: arm64-Debug-Clang 93 | arch: amd64_arm64 94 | - toolver: '14' 95 | build_type: arm64-Release-Clang 96 | arch: amd64_arm64 97 | 98 | steps: 99 | - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 100 | 101 | - name: 'Install Ninja' 102 | run: choco install ninja 103 | 104 | - uses: ilammy/msvc-dev-cmd@0b201ec74fa43914dc39ae48a89fd1d8cb592756 # v1.13.0 105 | with: 106 | arch: ${{ matrix.arch }} 107 | toolset: ${{ matrix.toolver }} 108 | 109 | - name: 'Configure CMake' 110 | working-directory: ${{ github.workspace }} 111 | run: cmake --preset=${{ matrix.build_type }} 112 | 113 | - name: 'Build' 114 | working-directory: ${{ github.workspace }} 115 | run: cmake --build out\build\${{ matrix.build_type }} 116 | 117 | - name: 'Clean up' 118 | working-directory: ${{ github.workspace }} 119 | run: Remove-Item -Path out -Recurse -Force 120 | 121 | - if: matrix.arch != 'amd64_arm64' 122 | name: 'Configure CMake (Spectre)' 123 | working-directory: ${{ github.workspace }} 124 | run: cmake --preset=${{ matrix.build_type }} -DENABLE_SPECTRE_MITIGATION=ON 125 | 126 | - if: matrix.arch != 'amd64_arm64' 127 | name: 'Build (Spectre)' 128 | working-directory: ${{ github.workspace }} 129 | run: cmake --build out\build\${{ matrix.build_type }} 130 | 131 | - if: matrix.arch != 'amd64_arm64' 132 | name: 'Clean up' 133 | working-directory: ${{ github.workspace }} 134 | run: Remove-Item -Path out -Recurse -Force 135 | 136 | - name: 'Configure CMake (DLL)' 137 | working-directory: ${{ github.workspace }} 138 | run: cmake --preset=${{ matrix.build_type }} -DBUILD_SHARED_LIBS=ON 139 | 140 | - name: 'Build (DLL)' 141 | working-directory: ${{ github.workspace }} 142 | run: cmake --build out\build\${{ matrix.build_type }} 143 | -------------------------------------------------------------------------------- /.github/workflows/msbuild.yml: -------------------------------------------------------------------------------- 1 | # Copyright (c) Microsoft Corporation. 2 | # Licensed under the MIT License. 3 | # 4 | # https://go.microsoft.com/fwlink/?LinkID=324981 5 | 6 | name: MSBuild 7 | 8 | on: 9 | push: 10 | branches: "main" 11 | paths-ignore: 12 | - '*.md' 13 | - LICENSE 14 | - '.azuredevops/**' 15 | - '.nuget/*' 16 | - build/* 17 | pull_request: 18 | branches: "main" 19 | paths-ignore: 20 | - '*.md' 21 | - LICENSE 22 | - '.azuredevops/**' 23 | - '.nuget/*' 24 | - build/* 25 | 26 | permissions: 27 | contents: read 28 | 29 | jobs: 30 | build: 31 | runs-on: windows-2022 # has v142 tools but not v142 spectre libs 32 | 33 | strategy: 34 | fail-fast: false 35 | 36 | matrix: 37 | vs: [2019, 2022] 38 | build_type: [Debug, Release] 39 | platform: [x86, x64, ARM64] 40 | exclude: 41 | - vs: 2019 42 | platform: ARM64 43 | 44 | steps: 45 | - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 46 | 47 | - name: Add MSBuild to PATH 48 | uses: microsoft/setup-msbuild@6fb02220983dee41ce7ae257b6f4d8f9bf5ed4ce # v2.0.0 49 | 50 | - if: matrix.platform != 'ARM64' 51 | name: Build 52 | working-directory: ${{ github.workspace }} 53 | run: > 54 | msbuild /m /p:Configuration=${{ matrix.build_type }} /p:Platform=${{ matrix.platform }} 55 | DirectXMesh_Desktop_${{ matrix.vs }}.sln 56 | 57 | - name: 'Build (Windows 10)' 58 | working-directory: ${{ github.workspace }} 59 | run: > 60 | msbuild /m /p:Configuration=${{ matrix.build_type }} /p:Platform=${{ matrix.platform }} 61 | DirectXMesh_Desktop_${{ matrix.vs }}_Win10.sln 62 | 63 | - if: matrix.vs == '2022' 64 | name: 'Build (UWP)' 65 | working-directory: ${{ github.workspace }} 66 | run: > 67 | msbuild /m /p:Configuration=${{ matrix.build_type }} /p:Platform=${{ matrix.platform }} 68 | DirectXMesh_Windows10_2022.sln 69 | 70 | - if: matrix.platform != 'ARM64' && matrix.vs != '2019' 71 | name: 'Build (Spectre)' 72 | working-directory: ${{ github.workspace }} 73 | run: > 74 | msbuild /m /p:Configuration=${{ matrix.build_type }} /p:Platform=${{ matrix.platform }} 75 | /p:SpectreMitigation=Spectre 76 | DirectXMesh_Desktop_${{ matrix.vs }}.sln 77 | 78 | - if: matrix.platform != 'ARM64' && matrix.vs != '2019' 79 | name: 'Build (Spectre Windows 10)' 80 | working-directory: ${{ github.workspace }} 81 | run: > 82 | msbuild /m /p:Configuration=${{ matrix.build_type }} /p:Platform=${{ matrix.platform }} 83 | /p:SpectreMitigation=Spectre 84 | DirectXMesh_Desktop_${{ matrix.vs }}_Win10.sln 85 | -------------------------------------------------------------------------------- /.github/workflows/msvc.yml: -------------------------------------------------------------------------------- 1 | # Copyright (c) Microsoft Corporation. 2 | # Licensed under the MIT License. 3 | # 4 | # https://go.microsoft.com/fwlink/?LinkID=324981 5 | 6 | name: Microsoft C++ Code Analysis 7 | 8 | on: 9 | push: 10 | branches: "main" 11 | paths-ignore: 12 | - '*.md' 13 | - LICENSE 14 | - '.azuredevops/**' 15 | - '.nuget/*' 16 | - build/*.cmd 17 | - build/*.props 18 | - build/*.ps1 19 | - build/*.targets 20 | - build/*.xvd 21 | pull_request: 22 | branches: "main" 23 | paths-ignore: 24 | - '*.md' 25 | - LICENSE 26 | - '.azuredevops/**' 27 | - '.nuget/*' 28 | - build/*.cmd 29 | - build/*.props 30 | - build/*.ps1 31 | - build/*.targets 32 | - build/*.xvd 33 | schedule: 34 | - cron: '31 18 * * 5' 35 | 36 | permissions: 37 | contents: read 38 | 39 | jobs: 40 | analyze: 41 | permissions: 42 | contents: read 43 | security-events: write 44 | actions: read 45 | name: Analyze 46 | runs-on: windows-latest 47 | 48 | steps: 49 | - name: Checkout repository 50 | uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 51 | 52 | - name: Configure CMake 53 | working-directory: ${{ github.workspace }} 54 | run: cmake -B out -DCMAKE_DISABLE_PRECOMPILE_HEADERS=ON 55 | 56 | - name: Initialize MSVC Code Analysis 57 | uses: microsoft/msvc-code-analysis-action@24c285ab36952c9e9182f4b78dfafbac38a7e5ee # v0.1.1 58 | id: run-analysis 59 | with: 60 | cmakeBuildDirectory: ./out 61 | buildConfiguration: Debug 62 | ruleset: NativeRecommendedRules.ruleset 63 | 64 | # Upload SARIF file to GitHub Code Scanning Alerts 65 | - name: Upload SARIF to GitHub 66 | uses: github/codeql-action/upload-sarif@ff0a06e83cb2de871e5a09832bc6a81e7276941f # v3.28.18 67 | with: 68 | sarif_file: ${{ steps.run-analysis.outputs.sarif }} 69 | -------------------------------------------------------------------------------- /.github/workflows/test.yml: -------------------------------------------------------------------------------- 1 | # Copyright (c) Microsoft Corporation. 2 | # Licensed under the MIT License. 3 | # 4 | # https://go.microsoft.com/fwlink/?LinkID=324981 5 | 6 | name: 'CTest (Windows)' 7 | 8 | on: 9 | push: 10 | branches: "main" 11 | paths-ignore: 12 | - '*.md' 13 | - LICENSE 14 | - '.azuredevops/**' 15 | - '.nuget/*' 16 | - build/*.cmd 17 | - build/*.props 18 | - build/*.ps1 19 | - build/*.targets 20 | - build/*.xvd 21 | pull_request: 22 | branches: "main" 23 | paths-ignore: 24 | - '*.md' 25 | - LICENSE 26 | - '.azuredevops/**' 27 | - '.nuget/*' 28 | - build/*.cmd 29 | - build/*.props 30 | - build/*.ps1 31 | - build/*.targets 32 | - build/*.xvd 33 | 34 | env: 35 | DIRECTXMESH_MEDIA_PATH: ${{ github.workspace }}/Media 36 | 37 | permissions: 38 | contents: read 39 | 40 | jobs: 41 | build: 42 | runs-on: windows-2022 43 | timeout-minutes: 20 44 | 45 | strategy: 46 | fail-fast: false 47 | 48 | matrix: 49 | toolver: ['14.29', '14'] 50 | build_type: [x64-Debug, x64-Release] 51 | arch: [amd64] 52 | include: 53 | - toolver: '14.29' 54 | build_type: x86-Debug 55 | arch: amd64_x86 56 | - toolver: '14.29' 57 | build_type: x86-Release 58 | arch: amd64_x86 59 | - toolver: '14' 60 | build_type: x86-Debug 61 | arch: amd64_x86 62 | - toolver: '14' 63 | build_type: x86-Release 64 | arch: amd64_x86 65 | - toolver: '14' 66 | build_type: x64-Debug-Clang 67 | arch: amd64 68 | - toolver: '14' 69 | build_type: x64-Release-Clang 70 | arch: amd64 71 | - toolver: '14' 72 | build_type: x86-Debug-Clang 73 | arch: amd64_x86 74 | - toolver: '14' 75 | build_type: x86-Release-Clang 76 | arch: amd64_x86 77 | - toolver: '14' 78 | build_type: arm64-Debug 79 | arch: amd64_arm64 80 | - toolver: '14' 81 | build_type: arm64-Release 82 | arch: amd64_arm64 83 | - toolver: '14' 84 | build_type: arm64ec-Debug 85 | arch: amd64_arm64 86 | - toolver: '14' 87 | build_type: arm64ec-Release 88 | arch: amd64_arm64 89 | 90 | steps: 91 | - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 92 | 93 | - name: Clone test repository 94 | uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 95 | with: 96 | repository: walbourn/directxmeshtest 97 | path: Tests 98 | ref: main 99 | 100 | - name: 'Install Ninja' 101 | run: choco install ninja 102 | 103 | - uses: ilammy/msvc-dev-cmd@0b201ec74fa43914dc39ae48a89fd1d8cb592756 # v1.13.0 104 | with: 105 | arch: ${{ matrix.arch }} 106 | toolset: ${{ matrix.toolver }} 107 | 108 | - name: 'Configure CMake' 109 | working-directory: ${{ github.workspace }} 110 | run: cmake --preset=${{ matrix.build_type }} -DBUILD_TESTING=ON -DBUILD_TOOLS=OFF 111 | 112 | - name: 'Build' 113 | working-directory: ${{ github.workspace }} 114 | run: cmake --build out\build\${{ matrix.build_type }} 115 | 116 | - name: 'Clean up' 117 | working-directory: ${{ github.workspace }} 118 | run: Remove-Item -Path out -Recurse -Force 119 | 120 | - name: 'Configure CMake (DLL)' 121 | working-directory: ${{ github.workspace }} 122 | run: cmake --preset=${{ matrix.build_type }} -DBUILD_TESTING=ON -DBUILD_TOOLS=OFF -DBUILD_SHARED_LIBS=ON 123 | 124 | - name: 'Build (DLL)' 125 | working-directory: ${{ github.workspace }} 126 | run: cmake --build out\build\${{ matrix.build_type }} 127 | -------------------------------------------------------------------------------- /.github/workflows/uwp.yml: -------------------------------------------------------------------------------- 1 | # Copyright (c) Microsoft Corporation. 2 | # Licensed under the MIT License. 3 | # 4 | # https://go.microsoft.com/fwlink/?LinkID=324981 5 | 6 | name: 'CMake (UWP)' 7 | 8 | on: 9 | push: 10 | branches: "main" 11 | paths-ignore: 12 | - '*.md' 13 | - LICENSE 14 | - '.azuredevops/**' 15 | - '.nuget/*' 16 | - build/*.cmd 17 | - build/*.props 18 | - build/*.ps1 19 | - build/*.targets 20 | - build/*.xvd 21 | pull_request: 22 | branches: "main" 23 | paths-ignore: 24 | - '*.md' 25 | - LICENSE 26 | - '.azuredevops/**' 27 | - '.nuget/*' 28 | - build/*.cmd 29 | - build/*.props 30 | - build/*.ps1 31 | - build/*.targets 32 | - build/*.xvd 33 | 34 | permissions: 35 | contents: read 36 | 37 | jobs: 38 | build: 39 | runs-on: windows-2022 40 | 41 | strategy: 42 | fail-fast: false 43 | 44 | matrix: 45 | build_type: [x64-Debug-UWP, x64-Release-UWP, x64-Debug-UWP-Clang, x64-Release-UWP-Clang] 46 | arch: [amd64] 47 | include: 48 | - build_type: x86-Debug-UWP 49 | arch: amd64_x86 50 | - build_type: x86-Release-UWP 51 | arch: amd64_x86 52 | - build_type: x86-Debug-UWP-Clang 53 | arch: amd64_x86 54 | - build_type: x86-Release-UWP-Clang 55 | arch: amd64_x86 56 | - build_type: arm64-Debug-UWP 57 | arch: amd64_arm64 58 | - build_type: arm64-Release-UWP 59 | arch: amd64_arm64 60 | - build_type: arm64-Debug-UWP-Clang 61 | arch: amd64_arm64 62 | - build_type: arm64-Release-UWP-Clang 63 | arch: amd64_arm64 64 | 65 | steps: 66 | - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 67 | 68 | - name: 'Install Ninja' 69 | run: choco install ninja 70 | 71 | - uses: ilammy/msvc-dev-cmd@0b201ec74fa43914dc39ae48a89fd1d8cb592756 # v1.13.0 72 | with: 73 | arch: ${{ matrix.arch }} 74 | uwp: true 75 | 76 | - name: 'Configure CMake' 77 | working-directory: ${{ github.workspace }} 78 | run: cmake --preset=${{ matrix.build_type }} 79 | 80 | - name: 'Build' 81 | working-directory: ${{ github.workspace }} 82 | run: cmake --build out\build\${{ matrix.build_type }} 83 | 84 | - name: 'Clean up' 85 | working-directory: ${{ github.workspace }} 86 | run: Remove-Item -Path out -Recurse -Force 87 | 88 | - name: 'Configure CMake (DLL)' 89 | working-directory: ${{ github.workspace }} 90 | run: cmake --preset=${{ matrix.build_type }} -DBUILD_SHARED_LIBS=ON 91 | 92 | - name: 'Build (DLL)' 93 | working-directory: ${{ github.workspace }} 94 | run: cmake --build out\build\${{ matrix.build_type }} 95 | -------------------------------------------------------------------------------- /.github/workflows/vcpkg.yml: -------------------------------------------------------------------------------- 1 | # Copyright (c) Microsoft Corporation. 2 | # Licensed under the MIT License. 3 | # 4 | # https://go.microsoft.com/fwlink/?LinkID=324981 5 | 6 | name: 'CMake (Windows using VCPKG)' 7 | 8 | on: 9 | push: 10 | branches: "main" 11 | paths-ignore: 12 | - '*.md' 13 | - LICENSE 14 | - '.azuredevops/**' 15 | - build/*.cmd 16 | - build/*.props 17 | - build/*.ps1 18 | - build/*.targets 19 | - build/*.xvd 20 | pull_request: 21 | branches: "main" 22 | paths-ignore: 23 | - '*.md' 24 | - LICENSE 25 | - '.azuredevops/**' 26 | - build/*.cmd 27 | - build/*.props 28 | - build/*.ps1 29 | - build/*.targets 30 | - build/*.xvd 31 | 32 | permissions: 33 | contents: read 34 | 35 | jobs: 36 | build: 37 | runs-on: windows-2022 38 | 39 | strategy: 40 | fail-fast: false 41 | 42 | matrix: 43 | toolver: ['14.29', '14'] 44 | build_type: [x64-Debug-VCPKG] 45 | arch: [amd64] 46 | shared: ['OFF'] 47 | include: 48 | - toolver: '14' 49 | build_type: x64-Debug-Clang-VCPKG 50 | arch: amd64 51 | shared: 'OFF' 52 | - toolver: '14' 53 | build_type: x86-Debug-VCPKG 54 | arch: amd64_x86 55 | shared: 'OFF' 56 | - toolver: '14' 57 | build_type: arm64-Debug-VCPKG 58 | arch: amd64_arm64 59 | shared: 'OFF' 60 | - toolver: '14' 61 | build_type: arm64ec-Debug-VCPKG 62 | arch: amd64_arm64 63 | shared: 'OFF' 64 | - toolver: '14' 65 | build_type: x64-Debug-MinGW 66 | arch: amd64 67 | shared: 'OFF' 68 | - toolver: '14' 69 | build_type: x64-Release-MinGW 70 | arch: amd64 71 | shared: 'OFF' 72 | - toolver: '14' 73 | build_type: x64-Debug-MinGW 74 | arch: amd64 75 | shared: 'ON' 76 | - toolver: '14' 77 | build_type: x64-Release-MinGW 78 | arch: amd64 79 | shared: 'ON' 80 | 81 | steps: 82 | - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 83 | 84 | - name: 'Install Ninja' 85 | run: choco install ninja 86 | 87 | - uses: ilammy/msvc-dev-cmd@0b201ec74fa43914dc39ae48a89fd1d8cb592756 # v1.13.0 88 | with: 89 | arch: ${{ matrix.arch }} 90 | toolset: ${{ matrix.toolver }} 91 | 92 | - name: 'Set triplet' 93 | shell: pwsh 94 | run: | 95 | if ("${{ matrix.arch }}" -eq "amd64") 96 | { 97 | if ("${{ matrix.build_type }}" -match "MinGW") 98 | { 99 | echo "VCPKG_DEFAULT_TRIPLET=x64-mingw-static" >> $env:GITHUB_ENV 100 | } 101 | else 102 | { 103 | echo "VCPKG_DEFAULT_TRIPLET=x64-windows" >> $env:GITHUB_ENV 104 | } 105 | } 106 | elseif ("${{ matrix.arch }}" -eq "amd64_x86") 107 | { 108 | echo "VCPKG_DEFAULT_TRIPLET=x86-windows" >> $env:GITHUB_ENV 109 | } 110 | elseif ("${{ matrix.arch }}" -eq "amd64_arm64") 111 | { 112 | if ("${{ matrix.build_type }}" -match "^arm64ec") 113 | { 114 | echo "VCPKG_DEFAULT_TRIPLET=arm64ec-windows" >> $env:GITHUB_ENV 115 | } 116 | else 117 | { 118 | echo "VCPKG_DEFAULT_TRIPLET=arm64-windows" >> $env:GITHUB_ENV 119 | } 120 | } 121 | else 122 | { 123 | echo "::error Unknown architecture/build-type triplet mapping" 124 | } 125 | 126 | - name: Get vcpkg commit hash 127 | shell: pwsh 128 | run: | 129 | if ($Env:vcpkgRelease) { 130 | echo "Using vcpkg commit from repo variable..." 131 | $VCPKG_COMMIT_ID = $Env:vcpkgRelease 132 | } 133 | else { 134 | echo "Fetching latest vcpkg commit hash..." 135 | $commit = (git ls-remote https://github.com/microsoft/vcpkg.git HEAD | Select-String -Pattern '([a-f0-9]{40})').Matches.Value 136 | $VCPKG_COMMIT_ID = $commit 137 | } 138 | Write-Host "VCPKG_COMMIT_ID=$VCPKG_COMMIT_ID" 139 | echo "VCPKG_COMMIT_ID=$VCPKG_COMMIT_ID" >> $env:GITHUB_ENV 140 | env: 141 | vcpkgRelease: '${{ vars.VCPKG_COMMIT_ID }}' 142 | 143 | - uses: lukka/run-vcpkg@7d259227a1fb6471a0253dd5ab7419835228f7d7 # v11 144 | with: 145 | runVcpkgInstall: true 146 | vcpkgJsonGlob: '**/build/vcpkg.json' 147 | vcpkgGitCommitId: '${{ env.VCPKG_COMMIT_ID }}' 148 | 149 | - name: 'Configure CMake' 150 | working-directory: ${{ github.workspace }} 151 | run: > 152 | cmake --preset=${{ matrix.build_type }} -DBUILD_TESTING=OFF 153 | -DBUILD_SHARED_LIBS=${{ matrix.shared }} 154 | -DCMAKE_TOOLCHAIN_FILE="${{ github.workspace }}/vcpkg/scripts/buildsystems/vcpkg.cmake" 155 | -DVCPKG_MANIFEST_DIR="${{ github.workspace }}/build" 156 | -DVCPKG_TARGET_TRIPLET="${env:VCPKG_DEFAULT_TRIPLET}" 157 | 158 | - name: 'Build' 159 | working-directory: ${{ github.workspace }} 160 | run: cmake --build out\build\${{ matrix.build_type }} 161 | -------------------------------------------------------------------------------- /.github/workflows/wsl.yml: -------------------------------------------------------------------------------- 1 | # Copyright (c) Microsoft Corporation. 2 | # Licensed under the MIT License. 3 | # 4 | # https://go.microsoft.com/fwlink/?LinkID=324981 5 | 6 | name: 'CMake (WSL)' 7 | 8 | on: 9 | push: 10 | branches: "main" 11 | paths-ignore: 12 | - '*.md' 13 | - LICENSE 14 | - '.azuredevops/**' 15 | - '.nuget/*' 16 | - build/*.cmd 17 | - build/*.props 18 | - build/*.ps1 19 | - build/*.targets 20 | - build/*.yml 21 | pull_request: 22 | branches: "main" 23 | paths-ignore: 24 | - '*.md' 25 | - LICENSE 26 | - '.azuredevops/**' 27 | - '.nuget/*' 28 | - build/*.cmd 29 | - build/*.props 30 | - build/*.ps1 31 | - build/*.targets 32 | - build/*.yml 33 | 34 | permissions: 35 | contents: read 36 | 37 | jobs: 38 | build: 39 | runs-on: ubuntu-latest 40 | 41 | strategy: 42 | fail-fast: false 43 | 44 | matrix: 45 | build_type: [x64-Debug-Linux, x64-Release-Linux] 46 | gcc: [12, 13, 14] 47 | 48 | steps: 49 | - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 50 | 51 | - uses: seanmiddleditch/gha-setup-ninja@3b1f8f94a2f8254bd26914c4ab9474d4f0015f67 # v6 52 | 53 | - name: Get vcpkg commit hash 54 | shell: pwsh 55 | run: | 56 | if ($Env:vcpkgRelease) { 57 | echo "Using vcpkg commit from repo variable..." 58 | $VCPKG_COMMIT_ID = $Env:vcpkgRelease 59 | } 60 | else { 61 | echo "Fetching latest vcpkg commit hash..." 62 | $commit = (git ls-remote https://github.com/microsoft/vcpkg.git HEAD | Select-String -Pattern '([a-f0-9]{40})').Matches.Value 63 | $VCPKG_COMMIT_ID = $commit 64 | } 65 | Write-Host "VCPKG_COMMIT_ID=$VCPKG_COMMIT_ID" 66 | echo "VCPKG_COMMIT_ID=$VCPKG_COMMIT_ID" >> $env:GITHUB_ENV 67 | env: 68 | vcpkgRelease: '${{ vars.VCPKG_COMMIT_ID }}' 69 | 70 | - uses: lukka/run-vcpkg@7d259227a1fb6471a0253dd5ab7419835228f7d7 # v11 71 | with: 72 | runVcpkgInstall: true 73 | vcpkgJsonGlob: '**/build/vcpkg.json' 74 | vcpkgGitCommitId: '${{ env.VCPKG_COMMIT_ID }}' 75 | 76 | - name: 'Configure CMake' 77 | working-directory: ${{ github.workspace }} 78 | run: > 79 | cmake --preset=${{ matrix.build_type }} 80 | -DCMAKE_TOOLCHAIN_FILE="${{ github.workspace }}/vcpkg/scripts/buildsystems/vcpkg.cmake" 81 | -DVCPKG_MANIFEST_DIR="${{ github.workspace }}/build" 82 | -DVCPKG_TARGET_TRIPLET="x64-linux" 83 | 84 | env: 85 | CC: gcc-${{ matrix.gcc }} 86 | CXX: g++-${{ matrix.gcc }} 87 | 88 | - name: 'Build' 89 | working-directory: ${{ github.workspace }} 90 | run: cmake --build out/build/${{ matrix.build_type }} 91 | 92 | - name: 'Clean up' 93 | working-directory: ${{ github.workspace }} 94 | run: rm -rf out 95 | 96 | - name: 'Configure CMake (-shared)' 97 | working-directory: ${{ github.workspace }} 98 | run: > 99 | cmake --preset=${{ matrix.build_type }} 100 | -DCMAKE_TOOLCHAIN_FILE="${{ github.workspace }}/vcpkg/scripts/buildsystems/vcpkg.cmake" 101 | -DVCPKG_MANIFEST_DIR="${{ github.workspace }}/build" 102 | -DVCPKG_TARGET_TRIPLET="x64-linux" -DBUILD_SHARED_LIBS=ON 103 | 104 | env: 105 | CC: gcc-${{ matrix.gcc }} 106 | CXX: g++-${{ matrix.gcc }} 107 | 108 | - name: 'Build (-shared)' 109 | working-directory: ${{ github.workspace }} 110 | run: cmake --build out/build/${{ matrix.build_type }} 111 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.psess 2 | *.vsp 3 | *.log 4 | *.err 5 | *.wrn 6 | *.suo 7 | *.sdf 8 | *.user 9 | *.i 10 | *.vspscc 11 | *.opensdf 12 | *.opendb 13 | *.ipch 14 | *.cache 15 | *.tlog 16 | *.lastbuildstate 17 | *.ilk 18 | *.VC.db 19 | *.nupkg 20 | .vs 21 | [Bb]in 22 | /ipch 23 | Debug 24 | Profile 25 | Release 26 | x64 27 | /Tests 28 | /wiki 29 | /out 30 | /CMakeUserPresets.json 31 | /build/vcpkg_installed 32 | -------------------------------------------------------------------------------- /.nuget/directxmesh_desktop_2019.nuspec: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | directxmesh_desktop_2019 5 | 0.0.0-SpecifyVersionOnCommandline 6 | DirectXMesh Library (VS 2019/2022 Win32) 7 | Microsoft 8 | microsoft,directxtk 9 | DirectXMesh geometry processing library 10 | This version is for Windows desktop applications using Visual Studio 2019 (16.11) or Visual Studio 2022 on Windows 8.1 or later. 11 | 12 | DirectXMesh, a shared source library for performing various geometry content processing operations including generating normals and tangent frames, triangle adjacency computations, vertex cache optimization, and meshlet generation. 13 | Matches the March 24, 2025 release on GitHub. 14 | http://go.microsoft.com/fwlink/?LinkID=324981 15 | 16 | images\icon.jpg 17 | docs\README.md 18 | MIT 19 | false 20 | © Microsoft Corporation. All rights reserved. 21 | DirectX DirectXMesh native nativepackage 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | -------------------------------------------------------------------------------- /.nuget/directxmesh_desktop_2019.targets: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Debug 6 | 7 | 8 | Release 9 | 10 | 11 | Release 12 | 13 | 14 | Release 15 | 16 | 17 | 18 | $(MSBuildThisFileDirectory)..\..\native\lib\$(PlatformTarget)\$(NuGetConfiguration) 19 | DirectXMesh_Spectre 20 | DirectXMesh 21 | 22 | 23 | 24 | 25 | $(directxmesh-LibPath);%(AdditionalLibraryDirectories) 26 | $(directxmesh-LibName).lib;%(AdditionalDependencies) 27 | 28 | 29 | 30 | 31 | 32 | HAS_DIRECTXMESH;%(PreprocessorDefinitions) 33 | $(MSBuildThisFileDirectory)..\..\include;%(AdditionalIncludeDirectories) 34 | 35 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /.nuget/directxmesh_desktop_win10.nuspec: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | directxmesh_desktop_win10 5 | 0.0.0-SpecifyVersionOnCommandline 6 | DirectXMesh Library (VS 2022 Win32 for Windows 10/11) 7 | Microsoft 8 | microsoft,directxtk 9 | DirectXMesh geometry processing library 10 | This version is for Windows desktop applications using Visual Studio 2022 on Windows 10 / Windows 11 including both DirectX 11 and DirectX 12. 11 | 12 | DirectXMesh, a shared source library for performing various geometry content processing operations including generating normals and tangent frames, triangle adjacency computations, vertex cache optimization, and meshlet generation. 13 | Matches the March 24, 2025 release on GitHub. 14 | http://go.microsoft.com/fwlink/?LinkID=324981 15 | 16 | images\icon.jpg 17 | docs\README.md 18 | MIT 19 | false 20 | © Microsoft Corporation. All rights reserved. 21 | DirectX DirectXMesh native nativepackage ARM64 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | -------------------------------------------------------------------------------- /.nuget/directxmesh_desktop_win10.targets: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Debug 6 | 7 | 8 | Release 9 | 10 | 11 | Release 12 | 13 | 14 | Release 15 | 16 | 17 | 18 | $(MSBuildThisFileDirectory)..\..\native\lib\$(PlatformTarget)\$(NuGetConfiguration) 19 | DirectXMesh_Spectre 20 | DirectXMesh 21 | 22 | 23 | 24 | 25 | $(directxmesh-LibPath);%(AdditionalLibraryDirectories) 26 | $(directxmesh-LibName).lib;%(AdditionalDependencies) 27 | 28 | 29 | 30 | 31 | 32 | HAS_DIRECTXMESH;%(PreprocessorDefinitions) 33 | $(MSBuildThisFileDirectory)..\..\include;%(AdditionalIncludeDirectories) 34 | 35 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /.nuget/directxmesh_uwp.nuspec: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | directxmesh_uwp 5 | 0.0.0-SpecifyVersionOnCommandline 6 | DirectXMesh Library (UWP) 7 | Microsoft 8 | microsoft,directxtk 9 | DirectXMesh geometry processing library 10 | This version is for Universal Windows Platform apps on Windows 10 / Windows 11 using Visual Studio 2022. 11 | 12 | DirectXMesh, a shared source library for performing various geometry content processing operations including generating normals and tangent frames, triangle adjacency computations, vertex cache optimization, and meshlet generation. 13 | Matches the March 24, 2025 release on GitHub. 14 | http://go.microsoft.com/fwlink/?LinkID=324981 15 | 16 | images\icon.jpg 17 | docs\README.md 18 | MIT 19 | false 20 | © Microsoft Corporation. All rights reserved. 21 | DirectX DirectXMesh native nativepackage ARM64 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | -------------------------------------------------------------------------------- /.nuget/directxmesh_uwp.targets: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Debug 6 | 7 | 8 | Release 9 | 10 | 11 | Release 12 | 13 | 14 | Release 15 | 16 | 17 | 18 | $(MSBuildThisFileDirectory)..\..\native\lib\$(PlatformTarget)\$(NuGetConfiguration) 19 | 20 | 21 | 22 | 23 | $(directxmesh-LibPath);%(AdditionalLibraryDirectories) 24 | DirectXMesh.lib;%(AdditionalDependencies) 25 | 26 | 27 | 28 | 29 | 30 | HAS_DIRECTXMESH;%(PreprocessorDefinitions) 31 | $(MSBuildThisFileDirectory)..\..\include;%(AdditionalIncludeDirectories) 32 | 33 | 34 | 35 | 36 | -------------------------------------------------------------------------------- /.nuget/icon.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/DirectXMesh/5be3c743d28c19e9c195c3ad916031733f0c2251/.nuget/icon.jpg -------------------------------------------------------------------------------- /.onefuzz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/DirectXMesh/5be3c743d28c19e9c195c3ad916031733f0c2251/.onefuzz -------------------------------------------------------------------------------- /CODE_OF_CONDUCT.md: -------------------------------------------------------------------------------- 1 | # Microsoft Open Source Code of Conduct 2 | 3 | This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). 4 | 5 | Resources: 6 | 7 | - [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/) 8 | - [Microsoft Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) 9 | - Contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with questions or concerns 10 | - Employees can reach out at [aka.ms/opensource/moderation-support](https://aka.ms/opensource/moderation-support) 11 | -------------------------------------------------------------------------------- /DirectXMesh/DirectXMesh.inl: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------------- 2 | // DirectXMesh.inl 3 | // 4 | // DirectX Mesh Geometry Library 5 | // 6 | // Copyright (c) Microsoft Corporation. 7 | // Licensed under the MIT License. 8 | // 9 | // http://go.microsoft.com/fwlink/?LinkID=324981 10 | //------------------------------------------------------------------------------------- 11 | 12 | #pragma once 13 | 14 | //===================================================================================== 15 | // Bitmask flags enumerator operators 16 | //===================================================================================== 17 | #ifdef __clang__ 18 | #pragma clang diagnostic push 19 | #pragma clang diagnostic ignored "-Wdeprecated-dynamic-exception-spec" 20 | #pragma clang diagnostic ignored "-Wextra-semi-stmt" 21 | #endif 22 | 23 | DEFINE_ENUM_FLAG_OPERATORS(CNORM_FLAGS); 24 | DEFINE_ENUM_FLAG_OPERATORS(VALIDATE_FLAGS); 25 | DEFINE_ENUM_FLAG_OPERATORS(MESHLET_FLAGS); 26 | 27 | #ifdef __clang__ 28 | #pragma clang diagnostic pop 29 | #endif 30 | 31 | //===================================================================================== 32 | // DXGI Format Utilities 33 | //===================================================================================== 34 | _Use_decl_annotations_ 35 | inline bool __cdecl IsValidVB(DXGI_FORMAT fmt) noexcept 36 | { 37 | return BytesPerElement(fmt) != 0; 38 | } 39 | 40 | _Use_decl_annotations_ 41 | constexpr bool __cdecl IsValidIB(DXGI_FORMAT fmt) noexcept 42 | { 43 | return (fmt == DXGI_FORMAT_R32_UINT || fmt == DXGI_FORMAT_R16_UINT) != 0; 44 | } 45 | -------------------------------------------------------------------------------- /DirectXMesh/DirectXMeshConcat.cpp: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------------- 2 | // DirectXMeshConcat.cpp 3 | // 4 | // DirectX Mesh Geometry Library - Concatenate mesh 5 | // 6 | // Copyright (c) Microsoft Corporation. 7 | // Licensed under the MIT License. 8 | // 9 | // http://go.microsoft.com/fwlink/?LinkID=324981 10 | //------------------------------------------------------------------------------------- 11 | 12 | #include "DirectXMeshP.h" 13 | 14 | using namespace DirectX; 15 | 16 | //===================================================================================== 17 | // Entry-points 18 | //===================================================================================== 19 | 20 | _Use_decl_annotations_ 21 | HRESULT __cdecl DirectX::ConcatenateMesh( 22 | size_t nFaces, 23 | size_t nVerts, 24 | uint32_t* faceDestMap, 25 | uint32_t* vertexDestMap, 26 | size_t& totalFaces, 27 | size_t& totalVerts) noexcept 28 | { 29 | if (!nFaces || !nVerts || !faceDestMap || !vertexDestMap) 30 | return E_INVALIDARG; 31 | 32 | if (nVerts >= UINT32_MAX) 33 | return E_INVALIDARG; 34 | 35 | if ((uint64_t(nFaces) * 3) >= UINT32_MAX) 36 | return HRESULT_E_ARITHMETIC_OVERFLOW; 37 | 38 | uint64_t newFaceCount = uint64_t(totalFaces) + nFaces; 39 | uint64_t newVertCount = uint64_t(totalVerts) + nVerts; 40 | 41 | if (newFaceCount >= UINT32_MAX || newVertCount >= UINT32_MAX) 42 | return E_FAIL; 43 | 44 | const auto baseFace = static_cast(totalFaces); 45 | for (size_t j = 0; j < nFaces; ++j) 46 | { 47 | faceDestMap[j] = baseFace + static_cast(j); 48 | } 49 | 50 | const auto baseVert = static_cast(totalVerts); 51 | for (size_t j = 0; j < nVerts; ++j) 52 | { 53 | vertexDestMap[j] = baseVert + static_cast(j); 54 | } 55 | 56 | totalFaces = static_cast(newFaceCount); 57 | totalVerts = static_cast(newVertCount); 58 | 59 | return S_OK; 60 | } 61 | -------------------------------------------------------------------------------- /DirectXMesh/DirectXMeshGSAdjacency.cpp: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------------- 2 | // DirectXMeshGSAdjacency.cpp 3 | // 4 | // DirectX Mesh Geometry Library - Geometry Shader adjacency computation 5 | // 6 | // Copyright (c) Microsoft Corporation. 7 | // Licensed under the MIT License. 8 | // 9 | // http://go.microsoft.com/fwlink/?LinkID=324981 10 | //------------------------------------------------------------------------------------- 11 | 12 | #include "DirectXMeshP.h" 13 | 14 | using namespace DirectX; 15 | 16 | // 17 | // Generates an IB triangle list with adjacency (D3D11_PRIMITIVE_TOPOLOGY_TRIANGLELIST_ADJ) 18 | // http://msdn.microsoft.com/en-us/library/windows/desktop/bb205124.aspx 19 | // 20 | 21 | namespace 22 | { 23 | template 24 | HRESULT GenerateGSAdjacencyImpl( 25 | _In_reads_(nFaces * 3) const index_t* indices, _In_ size_t nFaces, 26 | _In_reads_(nVerts) const uint32_t* pointRep, 27 | _In_reads_(nFaces * 3) const uint32_t* adjacency, _In_ size_t nVerts, 28 | _Out_writes_(nFaces * 6) index_t* indicesAdj) noexcept 29 | { 30 | if (!indices || !nFaces || !pointRep || !adjacency || !nVerts || !indicesAdj) 31 | return E_INVALIDARG; 32 | 33 | if (nVerts >= index_t(-1)) 34 | return E_INVALIDARG; 35 | 36 | if (indices == indicesAdj) 37 | { 38 | // Does not support in-place conversion of the index buffer 39 | return HRESULT_E_NOT_SUPPORTED; 40 | } 41 | 42 | if ((uint64_t(nFaces) * 3) >= UINT32_MAX) 43 | return HRESULT_E_ARITHMETIC_OVERFLOW; 44 | 45 | size_t inputi = 0; 46 | size_t outputi = 0; 47 | 48 | for (size_t face = 0; face < nFaces; ++face) 49 | { 50 | for (uint32_t point = 0; point < 3; ++point) 51 | { 52 | assert(outputi < (nFaces * 6)); 53 | _Analysis_assume_(outputi < (nFaces * 6)); 54 | 55 | indicesAdj[outputi] = indices[inputi]; 56 | ++outputi; 57 | ++inputi; 58 | 59 | assert(outputi < (nFaces * 6)); 60 | _Analysis_assume_(outputi < (nFaces * 6)); 61 | 62 | const uint32_t a = adjacency[face * 3 + point]; 63 | if (a == UNUSED32) 64 | { 65 | indicesAdj[outputi] = indices[face * 3 + ((point + 2) % 3)]; 66 | } 67 | else 68 | { 69 | uint32_t v1 = indices[face * 3 + point]; 70 | uint32_t v2 = indices[face * 3 + ((point + 1) % 3)]; 71 | 72 | if (v1 == index_t(-1) || v2 == index_t(-1)) 73 | { 74 | indicesAdj[outputi] = index_t(-1); 75 | } 76 | else 77 | { 78 | if (v1 >= nVerts 79 | || v2 >= nVerts) 80 | return E_UNEXPECTED; 81 | 82 | v1 = pointRep[v1]; 83 | v2 = pointRep[v2]; 84 | 85 | uint32_t vOther = UNUSED32; 86 | 87 | // find other vertex 88 | for (uint32_t k = 0; k < 3; ++k) 89 | { 90 | assert(a < nFaces); 91 | _Analysis_assume_(a < nFaces); 92 | const uint32_t ak = indices[a * 3 + k]; 93 | if (ak == index_t(-1)) 94 | break; 95 | 96 | if (ak >= nVerts) 97 | return E_UNEXPECTED; 98 | 99 | if (pointRep[ak] == v1) 100 | continue; 101 | 102 | if (pointRep[ak] == v2) 103 | continue; 104 | 105 | vOther = ak; 106 | } 107 | 108 | if (vOther == UNUSED32) 109 | { 110 | indicesAdj[outputi] = indices[face * 3 + ((point + 2) % 3)]; 111 | 112 | } 113 | else 114 | { 115 | indicesAdj[outputi] = index_t(vOther); 116 | } 117 | } 118 | } 119 | ++outputi; 120 | } 121 | } 122 | 123 | assert(inputi == (nFaces * 3)); 124 | assert(outputi == (nFaces * 6)); 125 | 126 | return S_OK; 127 | } 128 | } 129 | 130 | //===================================================================================== 131 | // Entry-points 132 | //===================================================================================== 133 | 134 | //------------------------------------------------------------------------------------- 135 | _Use_decl_annotations_ 136 | HRESULT DirectX::GenerateGSAdjacency( 137 | const uint16_t* indices, 138 | size_t nFaces, 139 | const uint32_t* pointRep, 140 | const uint32_t* adjacency, 141 | size_t nVerts, 142 | uint16_t* indicesAdj) noexcept 143 | { 144 | return GenerateGSAdjacencyImpl(indices, nFaces, pointRep, adjacency, nVerts, indicesAdj); 145 | } 146 | 147 | 148 | //------------------------------------------------------------------------------------- 149 | _Use_decl_annotations_ 150 | HRESULT DirectX::GenerateGSAdjacency( 151 | const uint32_t* indices, 152 | size_t nFaces, 153 | const uint32_t* pointRep, 154 | const uint32_t* adjacency, 155 | size_t nVerts, 156 | uint32_t* indicesAdj) noexcept 157 | { 158 | return GenerateGSAdjacencyImpl(indices, nFaces, pointRep, adjacency, nVerts, indicesAdj); 159 | } 160 | -------------------------------------------------------------------------------- /DirectXMesh/DirectXMeshOptimize.cpp: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------------- 2 | // DirectXMeshOptimize.cpp 3 | // 4 | // DirectX Mesh Geometry Library - Mesh optimization 5 | // 6 | // Copyright (c) Microsoft Corporation. 7 | // Licensed under the MIT License. 8 | // 9 | // http://go.microsoft.com/fwlink/?LinkID=324981 10 | //------------------------------------------------------------------------------------- 11 | 12 | #include "DirectXMeshP.h" 13 | 14 | using namespace DirectX; 15 | 16 | namespace 17 | { 18 | template 19 | HRESULT OptimizeVerticesImpl( 20 | _In_reads_(nFaces * 3) const index_t* indices, size_t nFaces, 21 | size_t nVerts, _Out_writes_(nVerts) uint32_t* vertexRemap, 22 | _Out_opt_ size_t* trailingUnused) noexcept 23 | { 24 | if (!indices || !nFaces || !nVerts || !vertexRemap) 25 | return E_INVALIDARG; 26 | 27 | if (nVerts >= index_t(-1)) 28 | return E_INVALIDARG; 29 | 30 | if (trailingUnused) 31 | { 32 | *trailingUnused = 0; 33 | } 34 | 35 | if ((uint64_t(nFaces) * 3) >= UINT32_MAX) 36 | return HRESULT_E_ARITHMETIC_OVERFLOW; 37 | 38 | std::unique_ptr tempRemap(new (std::nothrow) uint32_t[nVerts]); 39 | if (!tempRemap) 40 | return E_OUTOFMEMORY; 41 | 42 | memset(tempRemap.get(), 0xff, sizeof(uint32_t) * nVerts); 43 | 44 | uint32_t curvertex = 0; 45 | for (size_t j = 0; j < (nFaces * 3); ++j) 46 | { 47 | index_t curindex = indices[j]; 48 | if (curindex == index_t(-1)) 49 | continue; 50 | 51 | if (curindex >= nVerts) 52 | return E_UNEXPECTED; 53 | 54 | if (tempRemap[curindex] == UNUSED32) 55 | { 56 | tempRemap[curindex] = curvertex; 57 | ++curvertex; 58 | } 59 | } 60 | 61 | // inverse lookup 62 | memset(vertexRemap, 0xff, sizeof(uint32_t) * nVerts); 63 | 64 | size_t unused = 0; 65 | 66 | for (uint32_t j = 0; j < nVerts; ++j) 67 | { 68 | uint32_t vertindex = tempRemap[j]; 69 | if (vertindex == UNUSED32) 70 | { 71 | ++unused; 72 | } 73 | else 74 | { 75 | if (vertindex >= nVerts) 76 | return E_UNEXPECTED; 77 | 78 | vertexRemap[vertindex] = j; 79 | } 80 | } 81 | 82 | if (trailingUnused) 83 | { 84 | *trailingUnused = unused; 85 | } 86 | 87 | return S_OK; 88 | } 89 | } 90 | 91 | //===================================================================================== 92 | // Entry-points 93 | //===================================================================================== 94 | 95 | _Use_decl_annotations_ 96 | HRESULT DirectX::AttributeSort( 97 | size_t nFaces, 98 | uint32_t* attributes, 99 | uint32_t* faceRemap) 100 | { 101 | if (!nFaces || !attributes || !faceRemap) 102 | return E_INVALIDARG; 103 | 104 | if ((uint64_t(nFaces) * 3) >= UINT32_MAX) 105 | return HRESULT_E_ARITHMETIC_OVERFLOW; 106 | 107 | using intpair_t = std::pair; 108 | 109 | std::vector list; 110 | list.reserve(nFaces); 111 | for (size_t j = 0; j < nFaces; ++j) 112 | { 113 | list.emplace_back(intpair_t(attributes[j], static_cast(j))); 114 | } 115 | 116 | std::stable_sort(list.begin(), list.end(), [](const intpair_t& a, const intpair_t& b) noexcept -> bool 117 | { 118 | return (a.first < b.first); 119 | }); 120 | 121 | auto it = list.begin(); 122 | for (size_t j = 0; j < nFaces; ++j, ++it) 123 | { 124 | attributes[j] = it->first; 125 | faceRemap[j] = it->second; 126 | } 127 | 128 | return S_OK; 129 | } 130 | 131 | 132 | //------------------------------------------------------------------------------------- 133 | _Use_decl_annotations_ 134 | HRESULT DirectX::OptimizeVertices( 135 | const uint16_t* indices, 136 | size_t nFaces, 137 | size_t nVerts, 138 | uint32_t* vertexRemap, 139 | size_t* trailingUnused) noexcept 140 | { 141 | return OptimizeVerticesImpl(indices, nFaces, nVerts, vertexRemap, trailingUnused); 142 | } 143 | 144 | _Use_decl_annotations_ 145 | HRESULT DirectX::OptimizeVertices( 146 | const uint32_t* indices, 147 | size_t nFaces, 148 | size_t nVerts, 149 | uint32_t* vertexRemap, 150 | size_t* trailingUnused) noexcept 151 | { 152 | return OptimizeVerticesImpl(indices, nFaces, nVerts, vertexRemap, trailingUnused); 153 | } 154 | -------------------------------------------------------------------------------- /DirectXMesh/DirectXMesh_Desktop_2019.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | {d76fe36f-16db-490a-9ba9-13d02e13a65b} 6 | 7 | 8 | {d4f97b15-a8e2-4223-a242-ca68b901e1fb} 9 | 10 | 11 | 12 | 13 | Header Files 14 | 15 | 16 | Header Files 17 | 18 | 19 | Source Files 20 | 21 | 22 | Source Files 23 | 24 | 25 | Source Files 26 | 27 | 28 | Source Files 29 | 30 | 31 | Source Files 32 | 33 | 34 | Source Files 35 | 36 | 37 | 38 | 39 | Source Files 40 | 41 | 42 | Source Files 43 | 44 | 45 | Source Files 46 | 47 | 48 | Source Files 49 | 50 | 51 | Source Files 52 | 53 | 54 | Source Files 55 | 56 | 57 | Source Files 58 | 59 | 60 | Source Files 61 | 62 | 63 | Source Files 64 | 65 | 66 | Source Files 67 | 68 | 69 | Source Files 70 | 71 | 72 | 73 | 74 | Source Files 75 | 76 | 77 | 78 | 79 | -------------------------------------------------------------------------------- /DirectXMesh/DirectXMesh_Desktop_2019_Win10.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | {d76fe36f-16db-490a-9ba9-13d02e13a65b} 6 | 7 | 8 | {d4f97b15-a8e2-4223-a242-ca68b901e1fb} 9 | 10 | 11 | 12 | 13 | Header Files 14 | 15 | 16 | Header Files 17 | 18 | 19 | Source Files 20 | 21 | 22 | Source Files 23 | 24 | 25 | Source Files 26 | 27 | 28 | Source Files 29 | 30 | 31 | Source Files 32 | 33 | 34 | Source Files 35 | 36 | 37 | 38 | 39 | Source Files 40 | 41 | 42 | Source Files 43 | 44 | 45 | Source Files 46 | 47 | 48 | Source Files 49 | 50 | 51 | Source Files 52 | 53 | 54 | Source Files 55 | 56 | 57 | Source Files 58 | 59 | 60 | Source Files 61 | 62 | 63 | Source Files 64 | 65 | 66 | Source Files 67 | 68 | 69 | Source Files 70 | 71 | 72 | 73 | 74 | Source Files 75 | 76 | 77 | 78 | 79 | -------------------------------------------------------------------------------- /DirectXMesh/DirectXMesh_Desktop_2022.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | {d76fe36f-16db-490a-9ba9-13d02e13a65b} 6 | 7 | 8 | {d4f97b15-a8e2-4223-a242-ca68b901e1fb} 9 | 10 | 11 | 12 | 13 | Header Files 14 | 15 | 16 | Header Files 17 | 18 | 19 | Source Files 20 | 21 | 22 | Source Files 23 | 24 | 25 | Source Files 26 | 27 | 28 | Source Files 29 | 30 | 31 | Source Files 32 | 33 | 34 | Source Files 35 | 36 | 37 | 38 | 39 | Source Files 40 | 41 | 42 | Source Files 43 | 44 | 45 | Source Files 46 | 47 | 48 | Source Files 49 | 50 | 51 | Source Files 52 | 53 | 54 | Source Files 55 | 56 | 57 | Source Files 58 | 59 | 60 | Source Files 61 | 62 | 63 | Source Files 64 | 65 | 66 | Source Files 67 | 68 | 69 | Source Files 70 | 71 | 72 | 73 | 74 | Source Files 75 | 76 | 77 | 78 | 79 | -------------------------------------------------------------------------------- /DirectXMesh/DirectXMesh_Desktop_2022_Win10.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | {d76fe36f-16db-490a-9ba9-13d02e13a65b} 6 | 7 | 8 | {d4f97b15-a8e2-4223-a242-ca68b901e1fb} 9 | 10 | 11 | 12 | 13 | Header Files 14 | 15 | 16 | Header Files 17 | 18 | 19 | Source Files 20 | 21 | 22 | Source Files 23 | 24 | 25 | Source Files 26 | 27 | 28 | Source Files 29 | 30 | 31 | Source Files 32 | 33 | 34 | Source Files 35 | 36 | 37 | 38 | 39 | Source Files 40 | 41 | 42 | Source Files 43 | 44 | 45 | Source Files 46 | 47 | 48 | Source Files 49 | 50 | 51 | Source Files 52 | 53 | 54 | Source Files 55 | 56 | 57 | Source Files 58 | 59 | 60 | Source Files 61 | 62 | 63 | Source Files 64 | 65 | 66 | Source Files 67 | 68 | 69 | Source Files 70 | 71 | 72 | 73 | 74 | Source Files 75 | 76 | 77 | 78 | 79 | -------------------------------------------------------------------------------- /DirectXMesh/DirectXMesh_GDK_2019.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hpp;hxx;hm;inl;inc;xsd 11 | 12 | 13 | 14 | 15 | Header Files 16 | 17 | 18 | Source Files 19 | 20 | 21 | Header Files 22 | 23 | 24 | Source Files 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | Source Files 33 | 34 | 35 | Source Files 36 | 37 | 38 | Source Files 39 | 40 | 41 | Source Files 42 | 43 | 44 | Source Files 45 | 46 | 47 | Source Files 48 | 49 | 50 | Source Files 51 | 52 | 53 | Source Files 54 | 55 | 56 | Source Files 57 | 58 | 59 | Source Files 60 | 61 | 62 | Source Files 63 | 64 | 65 | Source Files 66 | 67 | 68 | Source Files 69 | 70 | 71 | Source Files 72 | 73 | 74 | Source Files 75 | 76 | 77 | Source Files 78 | 79 | 80 | -------------------------------------------------------------------------------- /DirectXMesh/DirectXMesh_GDK_2022.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hpp;hxx;hm;inl;inc;xsd 11 | 12 | 13 | 14 | 15 | Header Files 16 | 17 | 18 | Source Files 19 | 20 | 21 | Header Files 22 | 23 | 24 | Source Files 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | Source Files 33 | 34 | 35 | Source Files 36 | 37 | 38 | Source Files 39 | 40 | 41 | Source Files 42 | 43 | 44 | Source Files 45 | 46 | 47 | Source Files 48 | 49 | 50 | Source Files 51 | 52 | 53 | Source Files 54 | 55 | 56 | Source Files 57 | 58 | 59 | Source Files 60 | 61 | 62 | Source Files 63 | 64 | 65 | Source Files 66 | 67 | 68 | Source Files 69 | 70 | 71 | Source Files 72 | 73 | 74 | Source Files 75 | 76 | 77 | Source Files 78 | 79 | 80 | -------------------------------------------------------------------------------- /DirectXMesh/DirectXMesh_Windows10_2022.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | Source Files 6 | 7 | 8 | Source Files 9 | 10 | 11 | Source Files 12 | 13 | 14 | Source Files 15 | 16 | 17 | Source Files 18 | 19 | 20 | Source Files 21 | 22 | 23 | Source Files 24 | 25 | 26 | Source Files 27 | 28 | 29 | Source Files 30 | 31 | 32 | Source Files 33 | 34 | 35 | Source Files 36 | 37 | 38 | Source Files 39 | 40 | 41 | Source Files 42 | 43 | 44 | Source Files 45 | 46 | 47 | Source Files 48 | 49 | 50 | Source Files 51 | 52 | 53 | 54 | 55 | Header Files 56 | 57 | 58 | Source Files 59 | 60 | 61 | Source Files 62 | 63 | 64 | 65 | 66 | {0e8a37a4-6364-45e5-bc79-c24c97b7107c} 67 | 68 | 69 | {019eb570-a575-464f-9fa4-eae2fa7ff34c} 70 | 71 | 72 | 73 | 74 | Header Files 75 | 76 | 77 | -------------------------------------------------------------------------------- /DirectXMesh/scoped.h: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------------- 2 | // scoped.h 3 | // 4 | // Utility header with helper classes for exception-safe handling of resources 5 | // 6 | // Copyright (c) Microsoft Corporation. 7 | // Licensed under the MIT License. 8 | //------------------------------------------------------------------------------------- 9 | 10 | #pragma once 11 | 12 | #include 13 | #include 14 | #include 15 | #include 16 | #include 17 | 18 | #ifndef _WIN32 19 | #include 20 | 21 | struct aligned_deleter { void operator()(void* p) noexcept { free(p); } }; 22 | 23 | using ScopedAlignedArrayFloat = std::unique_ptr; 24 | 25 | inline ScopedAlignedArrayFloat make_AlignedArrayFloat(uint64_t count) 26 | { 27 | uint64_t size = sizeof(float) * count; 28 | size = (size + 15u) & ~0xF; 29 | if (size > static_cast(UINT32_MAX)) 30 | return nullptr; 31 | 32 | auto ptr = aligned_alloc(16, static_cast(size)); 33 | return ScopedAlignedArrayFloat(static_cast(ptr)); 34 | } 35 | 36 | using ScopedAlignedArrayXMVECTOR = std::unique_ptr; 37 | 38 | inline ScopedAlignedArrayXMVECTOR make_AlignedArrayXMVECTOR(uint64_t count) 39 | { 40 | uint64_t size = sizeof(DirectX::XMVECTOR) * count; 41 | if (size > static_cast(UINT32_MAX)) 42 | return nullptr; 43 | auto ptr = aligned_alloc(16, static_cast(size)); 44 | return ScopedAlignedArrayXMVECTOR(static_cast(ptr)); 45 | } 46 | 47 | #else // WIN32 48 | //--------------------------------------------------------------------------------- 49 | #include 50 | 51 | struct aligned_deleter { void operator()(void* p) noexcept { _aligned_free(p); } }; 52 | 53 | using ScopedAlignedArrayFloat = std::unique_ptr; 54 | 55 | inline ScopedAlignedArrayFloat make_AlignedArrayFloat(uint64_t count) 56 | { 57 | const uint64_t size = sizeof(float) * count; 58 | if (size > static_cast(UINT32_MAX)) 59 | return nullptr; 60 | auto ptr = _aligned_malloc(static_cast(size), 16); 61 | return ScopedAlignedArrayFloat(static_cast(ptr)); 62 | } 63 | 64 | using ScopedAlignedArrayXMVECTOR = std::unique_ptr; 65 | 66 | inline ScopedAlignedArrayXMVECTOR make_AlignedArrayXMVECTOR(uint64_t count) 67 | { 68 | const uint64_t size = sizeof(DirectX::XMVECTOR) * count; 69 | if (size > static_cast(UINT32_MAX)) 70 | return nullptr; 71 | auto ptr = _aligned_malloc(static_cast(size), 16); 72 | return ScopedAlignedArrayXMVECTOR(static_cast(ptr)); 73 | } 74 | 75 | //--------------------------------------------------------------------------------- 76 | struct handle_closer { void operator()(HANDLE h) noexcept { assert(h != INVALID_HANDLE_VALUE); if (h) CloseHandle(h); } }; 77 | 78 | using ScopedHandle = std::unique_ptr; 79 | 80 | inline HANDLE safe_handle(HANDLE h) noexcept { return (h == INVALID_HANDLE_VALUE) ? nullptr : h; } 81 | 82 | //--------------------------------------------------------------------------------- 83 | struct find_closer { void operator()(HANDLE h) noexcept { assert(h != INVALID_HANDLE_VALUE); if (h) FindClose(h); } }; 84 | 85 | using ScopedFindHandle = std::unique_ptr; 86 | 87 | //--------------------------------------------------------------------------------- 88 | class auto_delete_file 89 | { 90 | public: 91 | auto_delete_file(HANDLE hFile) noexcept : m_handle(hFile) {} 92 | 93 | auto_delete_file(const auto_delete_file&) = delete; 94 | auto_delete_file& operator=(const auto_delete_file&) = delete; 95 | 96 | ~auto_delete_file() 97 | { 98 | if (m_handle) 99 | { 100 | FILE_DISPOSITION_INFO info = {}; 101 | info.DeleteFile = TRUE; 102 | std::ignore = SetFileInformationByHandle(m_handle, FileDispositionInfo, &info, sizeof(info)); 103 | } 104 | } 105 | 106 | void clear() noexcept { m_handle = nullptr; } 107 | 108 | private: 109 | HANDLE m_handle; 110 | }; 111 | 112 | #endif // WIN32 113 | -------------------------------------------------------------------------------- /DirectXMesh_Desktop_2019.sln: -------------------------------------------------------------------------------- 1 | Microsoft Visual Studio Solution File, Format Version 12.00 2 | # Visual Studio Version 16 3 | VisualStudioVersion = 16.0.28621.142 4 | MinimumVisualStudioVersion = 10.0.40219.1 5 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "DirectXMesh", "DirectXMesh\DirectXMesh_Desktop_2019.vcxproj", "{6857F086-F6FE-4150-9ED7-7446F1C1C220}" 6 | EndProject 7 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "meshconvert", "Meshconvert\Meshconvert_Desktop_2019.vcxproj", "{6D4CFD0E-8772-462A-9AC1-7DBAD9C16880}" 8 | EndProject 9 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{D7B83B71-AA03-4455-8959-C90D06581953}" 10 | ProjectSection(SolutionItems) = preProject 11 | .editorconfig = .editorconfig 12 | EndProjectSection 13 | EndProject 14 | Global 15 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 16 | Debug|x86 = Debug|x86 17 | Debug|x64 = Debug|x64 18 | Profile|x86 = Profile|x86 19 | Profile|x64 = Profile|x64 20 | Release|x86 = Release|x86 21 | Release|x64 = Release|x64 22 | EndGlobalSection 23 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 24 | {6857F086-F6FE-4150-9ED7-7446F1C1C220}.Debug|x86.ActiveCfg = Debug|Win32 25 | {6857F086-F6FE-4150-9ED7-7446F1C1C220}.Debug|x86.Build.0 = Debug|Win32 26 | {6857F086-F6FE-4150-9ED7-7446F1C1C220}.Debug|x64.ActiveCfg = Debug|x64 27 | {6857F086-F6FE-4150-9ED7-7446F1C1C220}.Debug|x64.Build.0 = Debug|x64 28 | {6857F086-F6FE-4150-9ED7-7446F1C1C220}.Profile|x86.ActiveCfg = Profile|Win32 29 | {6857F086-F6FE-4150-9ED7-7446F1C1C220}.Profile|x86.Build.0 = Profile|Win32 30 | {6857F086-F6FE-4150-9ED7-7446F1C1C220}.Profile|x64.ActiveCfg = Profile|x64 31 | {6857F086-F6FE-4150-9ED7-7446F1C1C220}.Profile|x64.Build.0 = Profile|x64 32 | {6857F086-F6FE-4150-9ED7-7446F1C1C220}.Release|x86.ActiveCfg = Release|Win32 33 | {6857F086-F6FE-4150-9ED7-7446F1C1C220}.Release|x86.Build.0 = Release|Win32 34 | {6857F086-F6FE-4150-9ED7-7446F1C1C220}.Release|x64.ActiveCfg = Release|x64 35 | {6857F086-F6FE-4150-9ED7-7446F1C1C220}.Release|x64.Build.0 = Release|x64 36 | {6D4CFD0E-8772-462A-9AC1-7DBAD9C16880}.Debug|x86.ActiveCfg = Debug|Win32 37 | {6D4CFD0E-8772-462A-9AC1-7DBAD9C16880}.Debug|x86.Build.0 = Debug|Win32 38 | {6D4CFD0E-8772-462A-9AC1-7DBAD9C16880}.Debug|x64.ActiveCfg = Debug|x64 39 | {6D4CFD0E-8772-462A-9AC1-7DBAD9C16880}.Debug|x64.Build.0 = Debug|x64 40 | {6D4CFD0E-8772-462A-9AC1-7DBAD9C16880}.Profile|x86.ActiveCfg = Profile|Win32 41 | {6D4CFD0E-8772-462A-9AC1-7DBAD9C16880}.Profile|x86.Build.0 = Profile|Win32 42 | {6D4CFD0E-8772-462A-9AC1-7DBAD9C16880}.Profile|x64.ActiveCfg = Profile|x64 43 | {6D4CFD0E-8772-462A-9AC1-7DBAD9C16880}.Profile|x64.Build.0 = Profile|x64 44 | {6D4CFD0E-8772-462A-9AC1-7DBAD9C16880}.Release|x86.ActiveCfg = Release|Win32 45 | {6D4CFD0E-8772-462A-9AC1-7DBAD9C16880}.Release|x86.Build.0 = Release|Win32 46 | {6D4CFD0E-8772-462A-9AC1-7DBAD9C16880}.Release|x64.ActiveCfg = Release|x64 47 | {6D4CFD0E-8772-462A-9AC1-7DBAD9C16880}.Release|x64.Build.0 = Release|x64 48 | EndGlobalSection 49 | GlobalSection(SolutionProperties) = preSolution 50 | HideSolutionNode = FALSE 51 | EndGlobalSection 52 | GlobalSection(ExtensibilityGlobals) = postSolution 53 | SolutionGuid = {5C389688-21F3-4661-9802-2A73B2AD857F} 54 | EndGlobalSection 55 | EndGlobal 56 | -------------------------------------------------------------------------------- /DirectXMesh_Desktop_2019_Win10.sln: -------------------------------------------------------------------------------- 1 | Microsoft Visual Studio Solution File, Format Version 12.00 2 | # Visual Studio Version 16 3 | VisualStudioVersion = 16.0.29609.76 4 | MinimumVisualStudioVersion = 10.0.40219.1 5 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "DirectXMesh", "DirectXMesh\DirectXMesh_Desktop_2019_Win10.vcxproj", "{6857F086-F6FE-4150-9ED7-7446F1C1C220}" 6 | EndProject 7 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{C688B690-29CD-47AA-BF43-EF1BA44BC5AC}" 8 | ProjectSection(SolutionItems) = preProject 9 | .editorconfig = .editorconfig 10 | EndProjectSection 11 | EndProject 12 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "meshconvert", "Meshconvert\Meshconvert_Desktop_2019_Win10.vcxproj", "{6D4CFD0E-8772-462A-9AC1-7DBAD9C16880}" 13 | EndProject 14 | Global 15 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 16 | Debug|ARM64 = Debug|ARM64 17 | Debug|x64 = Debug|x64 18 | Debug|x86 = Debug|x86 19 | Profile|ARM64 = Profile|ARM64 20 | Profile|x64 = Profile|x64 21 | Profile|x86 = Profile|x86 22 | Release|ARM64 = Release|ARM64 23 | Release|x64 = Release|x64 24 | Release|x86 = Release|x86 25 | EndGlobalSection 26 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 27 | {6857F086-F6FE-4150-9ED7-7446F1C1C220}.Debug|ARM64.ActiveCfg = Debug|ARM64 28 | {6857F086-F6FE-4150-9ED7-7446F1C1C220}.Debug|ARM64.Build.0 = Debug|ARM64 29 | {6857F086-F6FE-4150-9ED7-7446F1C1C220}.Debug|x64.ActiveCfg = Debug|x64 30 | {6857F086-F6FE-4150-9ED7-7446F1C1C220}.Debug|x64.Build.0 = Debug|x64 31 | {6857F086-F6FE-4150-9ED7-7446F1C1C220}.Debug|x86.ActiveCfg = Debug|Win32 32 | {6857F086-F6FE-4150-9ED7-7446F1C1C220}.Debug|x86.Build.0 = Debug|Win32 33 | {6857F086-F6FE-4150-9ED7-7446F1C1C220}.Profile|ARM64.ActiveCfg = Profile|ARM64 34 | {6857F086-F6FE-4150-9ED7-7446F1C1C220}.Profile|ARM64.Build.0 = Profile|ARM64 35 | {6857F086-F6FE-4150-9ED7-7446F1C1C220}.Profile|x64.ActiveCfg = Profile|x64 36 | {6857F086-F6FE-4150-9ED7-7446F1C1C220}.Profile|x64.Build.0 = Profile|x64 37 | {6857F086-F6FE-4150-9ED7-7446F1C1C220}.Profile|x86.ActiveCfg = Profile|Win32 38 | {6857F086-F6FE-4150-9ED7-7446F1C1C220}.Profile|x86.Build.0 = Profile|Win32 39 | {6857F086-F6FE-4150-9ED7-7446F1C1C220}.Release|ARM64.ActiveCfg = Release|ARM64 40 | {6857F086-F6FE-4150-9ED7-7446F1C1C220}.Release|ARM64.Build.0 = Release|ARM64 41 | {6857F086-F6FE-4150-9ED7-7446F1C1C220}.Release|x64.ActiveCfg = Release|x64 42 | {6857F086-F6FE-4150-9ED7-7446F1C1C220}.Release|x64.Build.0 = Release|x64 43 | {6857F086-F6FE-4150-9ED7-7446F1C1C220}.Release|x86.ActiveCfg = Release|Win32 44 | {6857F086-F6FE-4150-9ED7-7446F1C1C220}.Release|x86.Build.0 = Release|Win32 45 | {6D4CFD0E-8772-462A-9AC1-7DBAD9C16880}.Debug|ARM64.ActiveCfg = Debug|ARM64 46 | {6D4CFD0E-8772-462A-9AC1-7DBAD9C16880}.Debug|ARM64.Build.0 = Debug|ARM64 47 | {6D4CFD0E-8772-462A-9AC1-7DBAD9C16880}.Debug|x64.ActiveCfg = Debug|x64 48 | {6D4CFD0E-8772-462A-9AC1-7DBAD9C16880}.Debug|x64.Build.0 = Debug|x64 49 | {6D4CFD0E-8772-462A-9AC1-7DBAD9C16880}.Debug|x86.ActiveCfg = Debug|Win32 50 | {6D4CFD0E-8772-462A-9AC1-7DBAD9C16880}.Debug|x86.Build.0 = Debug|Win32 51 | {6D4CFD0E-8772-462A-9AC1-7DBAD9C16880}.Profile|ARM64.ActiveCfg = Profile|ARM64 52 | {6D4CFD0E-8772-462A-9AC1-7DBAD9C16880}.Profile|ARM64.Build.0 = Profile|ARM64 53 | {6D4CFD0E-8772-462A-9AC1-7DBAD9C16880}.Profile|x64.ActiveCfg = Profile|x64 54 | {6D4CFD0E-8772-462A-9AC1-7DBAD9C16880}.Profile|x64.Build.0 = Profile|x64 55 | {6D4CFD0E-8772-462A-9AC1-7DBAD9C16880}.Profile|x86.ActiveCfg = Profile|Win32 56 | {6D4CFD0E-8772-462A-9AC1-7DBAD9C16880}.Profile|x86.Build.0 = Profile|Win32 57 | {6D4CFD0E-8772-462A-9AC1-7DBAD9C16880}.Release|ARM64.ActiveCfg = Release|ARM64 58 | {6D4CFD0E-8772-462A-9AC1-7DBAD9C16880}.Release|ARM64.Build.0 = Release|ARM64 59 | {6D4CFD0E-8772-462A-9AC1-7DBAD9C16880}.Release|x64.ActiveCfg = Release|x64 60 | {6D4CFD0E-8772-462A-9AC1-7DBAD9C16880}.Release|x64.Build.0 = Release|x64 61 | {6D4CFD0E-8772-462A-9AC1-7DBAD9C16880}.Release|x86.ActiveCfg = Release|Win32 62 | {6D4CFD0E-8772-462A-9AC1-7DBAD9C16880}.Release|x86.Build.0 = Release|Win32 63 | EndGlobalSection 64 | GlobalSection(SolutionProperties) = preSolution 65 | HideSolutionNode = FALSE 66 | EndGlobalSection 67 | GlobalSection(ExtensibilityGlobals) = postSolution 68 | SolutionGuid = {D04D9571-DDE4-4F6F-A7E1-0EBB08CFC482} 69 | EndGlobalSection 70 | EndGlobal 71 | -------------------------------------------------------------------------------- /DirectXMesh_Desktop_2022.sln: -------------------------------------------------------------------------------- 1 | Microsoft Visual Studio Solution File, Format Version 12.00 2 | # Visual Studio Version 17 3 | VisualStudioVersion = 16.0.28621.142 4 | MinimumVisualStudioVersion = 10.0.40219.1 5 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "DirectXMesh", "DirectXMesh\DirectXMesh_Desktop_2022.vcxproj", "{6857F086-F6FE-4150-9ED7-7446F1C1C220}" 6 | EndProject 7 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "meshconvert", "Meshconvert\Meshconvert_Desktop_2022.vcxproj", "{6D4CFD0E-8772-462A-9AC1-7DBAD9C16880}" 8 | EndProject 9 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{D7B83B71-AA03-4455-8959-C90D06581953}" 10 | ProjectSection(SolutionItems) = preProject 11 | .editorconfig = .editorconfig 12 | EndProjectSection 13 | EndProject 14 | Global 15 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 16 | Debug|x86 = Debug|x86 17 | Debug|x64 = Debug|x64 18 | Profile|x86 = Profile|x86 19 | Profile|x64 = Profile|x64 20 | Release|x86 = Release|x86 21 | Release|x64 = Release|x64 22 | EndGlobalSection 23 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 24 | {6857F086-F6FE-4150-9ED7-7446F1C1C220}.Debug|x86.ActiveCfg = Debug|Win32 25 | {6857F086-F6FE-4150-9ED7-7446F1C1C220}.Debug|x86.Build.0 = Debug|Win32 26 | {6857F086-F6FE-4150-9ED7-7446F1C1C220}.Debug|x64.ActiveCfg = Debug|x64 27 | {6857F086-F6FE-4150-9ED7-7446F1C1C220}.Debug|x64.Build.0 = Debug|x64 28 | {6857F086-F6FE-4150-9ED7-7446F1C1C220}.Profile|x86.ActiveCfg = Profile|Win32 29 | {6857F086-F6FE-4150-9ED7-7446F1C1C220}.Profile|x86.Build.0 = Profile|Win32 30 | {6857F086-F6FE-4150-9ED7-7446F1C1C220}.Profile|x64.ActiveCfg = Profile|x64 31 | {6857F086-F6FE-4150-9ED7-7446F1C1C220}.Profile|x64.Build.0 = Profile|x64 32 | {6857F086-F6FE-4150-9ED7-7446F1C1C220}.Release|x86.ActiveCfg = Release|Win32 33 | {6857F086-F6FE-4150-9ED7-7446F1C1C220}.Release|x86.Build.0 = Release|Win32 34 | {6857F086-F6FE-4150-9ED7-7446F1C1C220}.Release|x64.ActiveCfg = Release|x64 35 | {6857F086-F6FE-4150-9ED7-7446F1C1C220}.Release|x64.Build.0 = Release|x64 36 | {6D4CFD0E-8772-462A-9AC1-7DBAD9C16880}.Debug|x86.ActiveCfg = Debug|Win32 37 | {6D4CFD0E-8772-462A-9AC1-7DBAD9C16880}.Debug|x86.Build.0 = Debug|Win32 38 | {6D4CFD0E-8772-462A-9AC1-7DBAD9C16880}.Debug|x64.ActiveCfg = Debug|x64 39 | {6D4CFD0E-8772-462A-9AC1-7DBAD9C16880}.Debug|x64.Build.0 = Debug|x64 40 | {6D4CFD0E-8772-462A-9AC1-7DBAD9C16880}.Profile|x86.ActiveCfg = Profile|Win32 41 | {6D4CFD0E-8772-462A-9AC1-7DBAD9C16880}.Profile|x86.Build.0 = Profile|Win32 42 | {6D4CFD0E-8772-462A-9AC1-7DBAD9C16880}.Profile|x64.ActiveCfg = Profile|x64 43 | {6D4CFD0E-8772-462A-9AC1-7DBAD9C16880}.Profile|x64.Build.0 = Profile|x64 44 | {6D4CFD0E-8772-462A-9AC1-7DBAD9C16880}.Release|x86.ActiveCfg = Release|Win32 45 | {6D4CFD0E-8772-462A-9AC1-7DBAD9C16880}.Release|x86.Build.0 = Release|Win32 46 | {6D4CFD0E-8772-462A-9AC1-7DBAD9C16880}.Release|x64.ActiveCfg = Release|x64 47 | {6D4CFD0E-8772-462A-9AC1-7DBAD9C16880}.Release|x64.Build.0 = Release|x64 48 | EndGlobalSection 49 | GlobalSection(SolutionProperties) = preSolution 50 | HideSolutionNode = FALSE 51 | EndGlobalSection 52 | GlobalSection(ExtensibilityGlobals) = postSolution 53 | SolutionGuid = {5C389688-21F3-4661-9802-2A73B2AD857F} 54 | EndGlobalSection 55 | EndGlobal 56 | -------------------------------------------------------------------------------- /DirectXMesh_Desktop_2022_Win10.sln: -------------------------------------------------------------------------------- 1 | Microsoft Visual Studio Solution File, Format Version 12.00 2 | # Visual Studio Version 17 3 | VisualStudioVersion = 17.5.33516.290 4 | MinimumVisualStudioVersion = 10.0.40219.1 5 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "DirectXMesh", "DirectXMesh\DirectXMesh_Desktop_2022_Win10.vcxproj", "{6857F086-F6FE-4150-9ED7-7446F1C1C220}" 6 | EndProject 7 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{C688B690-29CD-47AA-BF43-EF1BA44BC5AC}" 8 | ProjectSection(SolutionItems) = preProject 9 | .editorconfig = .editorconfig 10 | EndProjectSection 11 | EndProject 12 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "meshconvert", "Meshconvert\Meshconvert_Desktop_2022_Win10.vcxproj", "{6D4CFD0E-8772-462A-9AC1-7DBAD9C16880}" 13 | EndProject 14 | Global 15 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 16 | Debug|ARM64 = Debug|ARM64 17 | Debug|x64 = Debug|x64 18 | Debug|x86 = Debug|x86 19 | Profile|ARM64 = Profile|ARM64 20 | Profile|x64 = Profile|x64 21 | Profile|x86 = Profile|x86 22 | Release|ARM64 = Release|ARM64 23 | Release|x64 = Release|x64 24 | Release|x86 = Release|x86 25 | EndGlobalSection 26 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 27 | {6857F086-F6FE-4150-9ED7-7446F1C1C220}.Debug|ARM64.ActiveCfg = Debug|ARM64 28 | {6857F086-F6FE-4150-9ED7-7446F1C1C220}.Debug|ARM64.Build.0 = Debug|ARM64 29 | {6857F086-F6FE-4150-9ED7-7446F1C1C220}.Debug|x64.ActiveCfg = Debug|x64 30 | {6857F086-F6FE-4150-9ED7-7446F1C1C220}.Debug|x64.Build.0 = Debug|x64 31 | {6857F086-F6FE-4150-9ED7-7446F1C1C220}.Debug|x86.ActiveCfg = Debug|Win32 32 | {6857F086-F6FE-4150-9ED7-7446F1C1C220}.Debug|x86.Build.0 = Debug|Win32 33 | {6857F086-F6FE-4150-9ED7-7446F1C1C220}.Profile|ARM64.ActiveCfg = Profile|ARM64 34 | {6857F086-F6FE-4150-9ED7-7446F1C1C220}.Profile|ARM64.Build.0 = Profile|ARM64 35 | {6857F086-F6FE-4150-9ED7-7446F1C1C220}.Profile|x64.ActiveCfg = Profile|x64 36 | {6857F086-F6FE-4150-9ED7-7446F1C1C220}.Profile|x64.Build.0 = Profile|x64 37 | {6857F086-F6FE-4150-9ED7-7446F1C1C220}.Profile|x86.ActiveCfg = Profile|Win32 38 | {6857F086-F6FE-4150-9ED7-7446F1C1C220}.Profile|x86.Build.0 = Profile|Win32 39 | {6857F086-F6FE-4150-9ED7-7446F1C1C220}.Release|ARM64.ActiveCfg = Release|ARM64 40 | {6857F086-F6FE-4150-9ED7-7446F1C1C220}.Release|ARM64.Build.0 = Release|ARM64 41 | {6857F086-F6FE-4150-9ED7-7446F1C1C220}.Release|x64.ActiveCfg = Release|x64 42 | {6857F086-F6FE-4150-9ED7-7446F1C1C220}.Release|x64.Build.0 = Release|x64 43 | {6857F086-F6FE-4150-9ED7-7446F1C1C220}.Release|x86.ActiveCfg = Release|Win32 44 | {6857F086-F6FE-4150-9ED7-7446F1C1C220}.Release|x86.Build.0 = Release|Win32 45 | {6D4CFD0E-8772-462A-9AC1-7DBAD9C16880}.Debug|ARM64.ActiveCfg = Debug|ARM64 46 | {6D4CFD0E-8772-462A-9AC1-7DBAD9C16880}.Debug|ARM64.Build.0 = Debug|ARM64 47 | {6D4CFD0E-8772-462A-9AC1-7DBAD9C16880}.Debug|x64.ActiveCfg = Debug|x64 48 | {6D4CFD0E-8772-462A-9AC1-7DBAD9C16880}.Debug|x64.Build.0 = Debug|x64 49 | {6D4CFD0E-8772-462A-9AC1-7DBAD9C16880}.Debug|x86.ActiveCfg = Debug|Win32 50 | {6D4CFD0E-8772-462A-9AC1-7DBAD9C16880}.Debug|x86.Build.0 = Debug|Win32 51 | {6D4CFD0E-8772-462A-9AC1-7DBAD9C16880}.Profile|ARM64.ActiveCfg = Profile|ARM64 52 | {6D4CFD0E-8772-462A-9AC1-7DBAD9C16880}.Profile|ARM64.Build.0 = Profile|ARM64 53 | {6D4CFD0E-8772-462A-9AC1-7DBAD9C16880}.Profile|x64.ActiveCfg = Profile|x64 54 | {6D4CFD0E-8772-462A-9AC1-7DBAD9C16880}.Profile|x64.Build.0 = Profile|x64 55 | {6D4CFD0E-8772-462A-9AC1-7DBAD9C16880}.Profile|x86.ActiveCfg = Profile|Win32 56 | {6D4CFD0E-8772-462A-9AC1-7DBAD9C16880}.Profile|x86.Build.0 = Profile|Win32 57 | {6D4CFD0E-8772-462A-9AC1-7DBAD9C16880}.Release|ARM64.ActiveCfg = Release|ARM64 58 | {6D4CFD0E-8772-462A-9AC1-7DBAD9C16880}.Release|ARM64.Build.0 = Release|ARM64 59 | {6D4CFD0E-8772-462A-9AC1-7DBAD9C16880}.Release|x64.ActiveCfg = Release|x64 60 | {6D4CFD0E-8772-462A-9AC1-7DBAD9C16880}.Release|x64.Build.0 = Release|x64 61 | {6D4CFD0E-8772-462A-9AC1-7DBAD9C16880}.Release|x86.ActiveCfg = Release|Win32 62 | {6D4CFD0E-8772-462A-9AC1-7DBAD9C16880}.Release|x86.Build.0 = Release|Win32 63 | EndGlobalSection 64 | GlobalSection(SolutionProperties) = preSolution 65 | HideSolutionNode = FALSE 66 | EndGlobalSection 67 | GlobalSection(ExtensibilityGlobals) = postSolution 68 | SolutionGuid = {D04D9571-DDE4-4F6F-A7E1-0EBB08CFC482} 69 | EndGlobalSection 70 | EndGlobal 71 | -------------------------------------------------------------------------------- /DirectXMesh_GDK_2019.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio Version 16 4 | VisualStudioVersion = 16.0.30404.54 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "DirectXMesh_GDK_2019", "DirectXMesh\DirectXMesh_GDK_2019.vcxproj", "{0B019AFB-D02B-430A-9331-B2A9D6D9C0C3}" 7 | EndProject 8 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{DBC86AB6-3D3C-4879-8DD7-3CFC505ABAC4}" 9 | ProjectSection(SolutionItems) = preProject 10 | .editorconfig = .editorconfig 11 | EndProjectSection 12 | EndProject 13 | Global 14 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 15 | Debug|Gaming.Desktop.x64 = Debug|Gaming.Desktop.x64 16 | Debug|Gaming.Xbox.Scarlett.x64 = Debug|Gaming.Xbox.Scarlett.x64 17 | Debug|Gaming.Xbox.XboxOne.x64 = Debug|Gaming.Xbox.XboxOne.x64 18 | Profile|Gaming.Desktop.x64 = Profile|Gaming.Desktop.x64 19 | Profile|Gaming.Xbox.Scarlett.x64 = Profile|Gaming.Xbox.Scarlett.x64 20 | Profile|Gaming.Xbox.XboxOne.x64 = Profile|Gaming.Xbox.XboxOne.x64 21 | Release|Gaming.Desktop.x64 = Release|Gaming.Desktop.x64 22 | Release|Gaming.Xbox.Scarlett.x64 = Release|Gaming.Xbox.Scarlett.x64 23 | Release|Gaming.Xbox.XboxOne.x64 = Release|Gaming.Xbox.XboxOne.x64 24 | EndGlobalSection 25 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 26 | {0B019AFB-D02B-430A-9331-B2A9D6D9C0C3}.Debug|Gaming.Desktop.x64.ActiveCfg = Debug|Gaming.Desktop.x64 27 | {0B019AFB-D02B-430A-9331-B2A9D6D9C0C3}.Debug|Gaming.Desktop.x64.Build.0 = Debug|Gaming.Desktop.x64 28 | {0B019AFB-D02B-430A-9331-B2A9D6D9C0C3}.Debug|Gaming.Xbox.Scarlett.x64.ActiveCfg = Debug|Gaming.Xbox.Scarlett.x64 29 | {0B019AFB-D02B-430A-9331-B2A9D6D9C0C3}.Debug|Gaming.Xbox.Scarlett.x64.Build.0 = Debug|Gaming.Xbox.Scarlett.x64 30 | {0B019AFB-D02B-430A-9331-B2A9D6D9C0C3}.Debug|Gaming.Xbox.XboxOne.x64.ActiveCfg = Debug|Gaming.Xbox.XboxOne.x64 31 | {0B019AFB-D02B-430A-9331-B2A9D6D9C0C3}.Debug|Gaming.Xbox.XboxOne.x64.Build.0 = Debug|Gaming.Xbox.XboxOne.x64 32 | {0B019AFB-D02B-430A-9331-B2A9D6D9C0C3}.Profile|Gaming.Desktop.x64.ActiveCfg = Profile|Gaming.Desktop.x64 33 | {0B019AFB-D02B-430A-9331-B2A9D6D9C0C3}.Profile|Gaming.Desktop.x64.Build.0 = Profile|Gaming.Desktop.x64 34 | {0B019AFB-D02B-430A-9331-B2A9D6D9C0C3}.Profile|Gaming.Xbox.Scarlett.x64.ActiveCfg = Profile|Gaming.Xbox.Scarlett.x64 35 | {0B019AFB-D02B-430A-9331-B2A9D6D9C0C3}.Profile|Gaming.Xbox.Scarlett.x64.Build.0 = Profile|Gaming.Xbox.Scarlett.x64 36 | {0B019AFB-D02B-430A-9331-B2A9D6D9C0C3}.Profile|Gaming.Xbox.XboxOne.x64.ActiveCfg = Profile|Gaming.Xbox.XboxOne.x64 37 | {0B019AFB-D02B-430A-9331-B2A9D6D9C0C3}.Profile|Gaming.Xbox.XboxOne.x64.Build.0 = Profile|Gaming.Xbox.XboxOne.x64 38 | {0B019AFB-D02B-430A-9331-B2A9D6D9C0C3}.Release|Gaming.Desktop.x64.ActiveCfg = Release|Gaming.Desktop.x64 39 | {0B019AFB-D02B-430A-9331-B2A9D6D9C0C3}.Release|Gaming.Desktop.x64.Build.0 = Release|Gaming.Desktop.x64 40 | {0B019AFB-D02B-430A-9331-B2A9D6D9C0C3}.Release|Gaming.Xbox.Scarlett.x64.ActiveCfg = Release|Gaming.Xbox.Scarlett.x64 41 | {0B019AFB-D02B-430A-9331-B2A9D6D9C0C3}.Release|Gaming.Xbox.Scarlett.x64.Build.0 = Release|Gaming.Xbox.Scarlett.x64 42 | {0B019AFB-D02B-430A-9331-B2A9D6D9C0C3}.Release|Gaming.Xbox.XboxOne.x64.ActiveCfg = Release|Gaming.Xbox.XboxOne.x64 43 | {0B019AFB-D02B-430A-9331-B2A9D6D9C0C3}.Release|Gaming.Xbox.XboxOne.x64.Build.0 = Release|Gaming.Xbox.XboxOne.x64 44 | EndGlobalSection 45 | GlobalSection(SolutionProperties) = preSolution 46 | HideSolutionNode = FALSE 47 | EndGlobalSection 48 | GlobalSection(ExtensibilityGlobals) = postSolution 49 | SolutionGuid = {7C261958-9DC2-41CC-A677-D8507C24FCDF} 50 | EndGlobalSection 51 | EndGlobal 52 | -------------------------------------------------------------------------------- /DirectXMesh_GDK_2022.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio Version 17 4 | VisualStudioVersion = 16.0.30404.54 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "DirectXMesh_GDK_2022", "DirectXMesh\DirectXMesh_GDK_2022.vcxproj", "{0B019AFB-D02B-430A-9331-B2A9D6D9C0C3}" 7 | EndProject 8 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{DBC86AB6-3D3C-4879-8DD7-3CFC505ABAC4}" 9 | ProjectSection(SolutionItems) = preProject 10 | .editorconfig = .editorconfig 11 | EndProjectSection 12 | EndProject 13 | Global 14 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 15 | Debug|Gaming.Desktop.x64 = Debug|Gaming.Desktop.x64 16 | Debug|Gaming.Xbox.Scarlett.x64 = Debug|Gaming.Xbox.Scarlett.x64 17 | Debug|Gaming.Xbox.XboxOne.x64 = Debug|Gaming.Xbox.XboxOne.x64 18 | Profile|Gaming.Desktop.x64 = Profile|Gaming.Desktop.x64 19 | Profile|Gaming.Xbox.Scarlett.x64 = Profile|Gaming.Xbox.Scarlett.x64 20 | Profile|Gaming.Xbox.XboxOne.x64 = Profile|Gaming.Xbox.XboxOne.x64 21 | Release|Gaming.Desktop.x64 = Release|Gaming.Desktop.x64 22 | Release|Gaming.Xbox.Scarlett.x64 = Release|Gaming.Xbox.Scarlett.x64 23 | Release|Gaming.Xbox.XboxOne.x64 = Release|Gaming.Xbox.XboxOne.x64 24 | EndGlobalSection 25 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 26 | {0B019AFB-D02B-430A-9331-B2A9D6D9C0C3}.Debug|Gaming.Desktop.x64.ActiveCfg = Debug|Gaming.Desktop.x64 27 | {0B019AFB-D02B-430A-9331-B2A9D6D9C0C3}.Debug|Gaming.Desktop.x64.Build.0 = Debug|Gaming.Desktop.x64 28 | {0B019AFB-D02B-430A-9331-B2A9D6D9C0C3}.Debug|Gaming.Xbox.Scarlett.x64.ActiveCfg = Debug|Gaming.Xbox.Scarlett.x64 29 | {0B019AFB-D02B-430A-9331-B2A9D6D9C0C3}.Debug|Gaming.Xbox.Scarlett.x64.Build.0 = Debug|Gaming.Xbox.Scarlett.x64 30 | {0B019AFB-D02B-430A-9331-B2A9D6D9C0C3}.Debug|Gaming.Xbox.XboxOne.x64.ActiveCfg = Debug|Gaming.Xbox.XboxOne.x64 31 | {0B019AFB-D02B-430A-9331-B2A9D6D9C0C3}.Debug|Gaming.Xbox.XboxOne.x64.Build.0 = Debug|Gaming.Xbox.XboxOne.x64 32 | {0B019AFB-D02B-430A-9331-B2A9D6D9C0C3}.Profile|Gaming.Desktop.x64.ActiveCfg = Profile|Gaming.Desktop.x64 33 | {0B019AFB-D02B-430A-9331-B2A9D6D9C0C3}.Profile|Gaming.Desktop.x64.Build.0 = Profile|Gaming.Desktop.x64 34 | {0B019AFB-D02B-430A-9331-B2A9D6D9C0C3}.Profile|Gaming.Xbox.Scarlett.x64.ActiveCfg = Profile|Gaming.Xbox.Scarlett.x64 35 | {0B019AFB-D02B-430A-9331-B2A9D6D9C0C3}.Profile|Gaming.Xbox.Scarlett.x64.Build.0 = Profile|Gaming.Xbox.Scarlett.x64 36 | {0B019AFB-D02B-430A-9331-B2A9D6D9C0C3}.Profile|Gaming.Xbox.XboxOne.x64.ActiveCfg = Profile|Gaming.Xbox.XboxOne.x64 37 | {0B019AFB-D02B-430A-9331-B2A9D6D9C0C3}.Profile|Gaming.Xbox.XboxOne.x64.Build.0 = Profile|Gaming.Xbox.XboxOne.x64 38 | {0B019AFB-D02B-430A-9331-B2A9D6D9C0C3}.Release|Gaming.Desktop.x64.ActiveCfg = Release|Gaming.Desktop.x64 39 | {0B019AFB-D02B-430A-9331-B2A9D6D9C0C3}.Release|Gaming.Desktop.x64.Build.0 = Release|Gaming.Desktop.x64 40 | {0B019AFB-D02B-430A-9331-B2A9D6D9C0C3}.Release|Gaming.Xbox.Scarlett.x64.ActiveCfg = Release|Gaming.Xbox.Scarlett.x64 41 | {0B019AFB-D02B-430A-9331-B2A9D6D9C0C3}.Release|Gaming.Xbox.Scarlett.x64.Build.0 = Release|Gaming.Xbox.Scarlett.x64 42 | {0B019AFB-D02B-430A-9331-B2A9D6D9C0C3}.Release|Gaming.Xbox.XboxOne.x64.ActiveCfg = Release|Gaming.Xbox.XboxOne.x64 43 | {0B019AFB-D02B-430A-9331-B2A9D6D9C0C3}.Release|Gaming.Xbox.XboxOne.x64.Build.0 = Release|Gaming.Xbox.XboxOne.x64 44 | EndGlobalSection 45 | GlobalSection(SolutionProperties) = preSolution 46 | HideSolutionNode = FALSE 47 | EndGlobalSection 48 | GlobalSection(ExtensibilityGlobals) = postSolution 49 | SolutionGuid = {7C261958-9DC2-41CC-A677-D8507C24FCDF} 50 | EndGlobalSection 51 | EndGlobal 52 | -------------------------------------------------------------------------------- /DirectXMesh_Windows10_2022.sln: -------------------------------------------------------------------------------- 1 | Microsoft Visual Studio Solution File, Format Version 12.00 2 | # Visual Studio Version 17 3 | VisualStudioVersion = 17.7.34009.444 4 | MinimumVisualStudioVersion = 10.0.40219.1 5 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "DirectXMesh", "DirectXMesh\DirectXMesh_Windows10_2022.vcxproj", "{107A408E-C148-4594-B469-075FE0ADB7A5}" 6 | EndProject 7 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{2562D7DA-2CF1-432C-9CC8-DAF8C477CF14}" 8 | ProjectSection(SolutionItems) = preProject 9 | .editorconfig = .editorconfig 10 | EndProjectSection 11 | EndProject 12 | Global 13 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 14 | Debug|ARM64 = Debug|ARM64 15 | Debug|x64 = Debug|x64 16 | Debug|x86 = Debug|x86 17 | Release|ARM64 = Release|ARM64 18 | Release|x64 = Release|x64 19 | Release|x86 = Release|x86 20 | EndGlobalSection 21 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 22 | {107A408E-C148-4594-B469-075FE0ADB7A5}.Debug|ARM64.ActiveCfg = Debug|ARM64 23 | {107A408E-C148-4594-B469-075FE0ADB7A5}.Debug|ARM64.Build.0 = Debug|ARM64 24 | {107A408E-C148-4594-B469-075FE0ADB7A5}.Debug|x64.ActiveCfg = Debug|x64 25 | {107A408E-C148-4594-B469-075FE0ADB7A5}.Debug|x64.Build.0 = Debug|x64 26 | {107A408E-C148-4594-B469-075FE0ADB7A5}.Debug|x86.ActiveCfg = Debug|Win32 27 | {107A408E-C148-4594-B469-075FE0ADB7A5}.Debug|x86.Build.0 = Debug|Win32 28 | {107A408E-C148-4594-B469-075FE0ADB7A5}.Release|ARM64.ActiveCfg = Release|ARM64 29 | {107A408E-C148-4594-B469-075FE0ADB7A5}.Release|ARM64.Build.0 = Release|ARM64 30 | {107A408E-C148-4594-B469-075FE0ADB7A5}.Release|x64.ActiveCfg = Release|x64 31 | {107A408E-C148-4594-B469-075FE0ADB7A5}.Release|x64.Build.0 = Release|x64 32 | {107A408E-C148-4594-B469-075FE0ADB7A5}.Release|x86.ActiveCfg = Release|Win32 33 | {107A408E-C148-4594-B469-075FE0ADB7A5}.Release|x86.Build.0 = Release|Win32 34 | EndGlobalSection 35 | GlobalSection(SolutionProperties) = preSolution 36 | HideSolutionNode = FALSE 37 | EndGlobalSection 38 | GlobalSection(ExtensibilityGlobals) = postSolution 39 | SolutionGuid = {FDDF6E4C-931A-428D-B05C-23AE1228CFF6} 40 | EndGlobalSection 41 | EndGlobal 42 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) Microsoft Corporation. 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE 22 | -------------------------------------------------------------------------------- /Meshconvert/CMO.h: -------------------------------------------------------------------------------- 1 | //-------------------------------------------------------------------------------------- 2 | // File: CMO.h 3 | // 4 | // .CMO files are built by Visual Studio's MeshContentTask and an example renderer was 5 | // provided in the VS Direct3D Starter Kit 6 | // https://devblogs.microsoft.com/cppblog/developing-an-app-with-the-visual-studio-3d-starter-kit-part-1-of-3/ 7 | // https://devblogs.microsoft.com/cppblog/developing-an-app-with-the-visual-studio-3d-starter-kit-part-2-of-3/ 8 | // https://devblogs.microsoft.com/cppblog/developing-an-app-with-the-visual-studio-3d-starter-kit-part-3-of-3/ 9 | // 10 | // Copyright (c) Microsoft Corporation. 11 | // Licensed under the MIT License. 12 | // 13 | // http://go.microsoft.com/fwlink/?LinkId=248929 14 | // http://go.microsoft.com/fwlink/?LinkID=615561 15 | //-------------------------------------------------------------------------------------- 16 | 17 | #pragma once 18 | 19 | #include 20 | 21 | #include 22 | 23 | 24 | namespace VSD3DStarter 25 | { 26 | // .CMO files 27 | 28 | // UINT - Mesh count 29 | // { [Mesh count] 30 | // UINT - Length of name 31 | // wchar_t[] - Name of mesh (if length > 0) 32 | // UINT - Material count 33 | // { [Material count] 34 | // UINT - Length of material name 35 | // wchar_t[] - Name of material (if length > 0) 36 | // Material structure 37 | // UINT - Length of pixel shader name 38 | // wchar_t[] - Name of pixel shader (if length > 0) 39 | // { [8] 40 | // UINT - Length of texture name 41 | // wchar_t[] - Name of texture (if length > 0) 42 | // } 43 | // } 44 | // BYTE - 1 if there is skeletal animation data present 45 | // UINT - SubMesh count 46 | // { [SubMesh count] 47 | // SubMesh structure 48 | // } 49 | // UINT - IB Count 50 | // { [IB Count] 51 | // UINT - Number of USHORTs in IB 52 | // USHORT[] - Array of indices 53 | // } 54 | // UINT - VB Count 55 | // { [VB Count] 56 | // UINT - Number of verts in VB 57 | // Vertex[] - Array of vertices 58 | // } 59 | // UINT - Skinning VB Count 60 | // { [Skinning VB Count] 61 | // UINT - Number of verts in Skinning VB 62 | // SkinningVertex[] - Array of skinning verts 63 | // } 64 | // MeshExtents structure 65 | // [If skeleton animation data is not present, file ends here] 66 | // UINT - Bone count 67 | // { [Bone count] 68 | // UINT - Length of bone name 69 | // wchar_t[] - Bone name (if length > 0) 70 | // Bone structure 71 | // } 72 | // UINT - Animation clip count 73 | // { [Animation clip count] 74 | // UINT - Length of clip name 75 | // wchar_t[] - Clip name (if length > 0) 76 | // float - Start time 77 | // float - End time 78 | // UINT - Keyframe count 79 | // { [Keyframe count] 80 | // Keyframe structure 81 | // } 82 | // } 83 | // } 84 | 85 | #pragma pack(push,1) 86 | 87 | struct Material 88 | { 89 | DirectX::XMFLOAT4 Ambient; 90 | DirectX::XMFLOAT4 Diffuse; 91 | DirectX::XMFLOAT4 Specular; 92 | float SpecularPower; 93 | DirectX::XMFLOAT4 Emissive; 94 | DirectX::XMFLOAT4X4 UVTransform; 95 | }; 96 | 97 | constexpr uint32_t MAX_TEXTURE = 8; 98 | 99 | struct SubMesh 100 | { 101 | uint32_t MaterialIndex; 102 | uint32_t IndexBufferIndex; 103 | uint32_t VertexBufferIndex; 104 | uint32_t StartIndex; 105 | uint32_t PrimCount; 106 | }; 107 | 108 | constexpr uint32_t NUM_BONE_INFLUENCES = 4; 109 | 110 | // Vertex struct for Visual Studio Shader Designer (DGSL) holding position, normal, 111 | // tangent, color (RGBA), and texture mapping information 112 | struct Vertex 113 | { 114 | DirectX::XMFLOAT3 position; 115 | DirectX::XMFLOAT3 normal; 116 | DirectX::XMFLOAT4 tangent; 117 | uint32_t color; 118 | DirectX::XMFLOAT2 textureCoordinate; 119 | }; 120 | 121 | struct SkinningVertex 122 | { 123 | uint32_t boneIndex[NUM_BONE_INFLUENCES]; 124 | float boneWeight[NUM_BONE_INFLUENCES]; 125 | }; 126 | 127 | struct MeshExtents 128 | { 129 | float CenterX, CenterY, CenterZ; 130 | float Radius; 131 | 132 | float MinX, MinY, MinZ; 133 | float MaxX, MaxY, MaxZ; 134 | }; 135 | 136 | struct Bone 137 | { 138 | int32_t ParentIndex; 139 | DirectX::XMFLOAT4X4 InvBindPos; 140 | DirectX::XMFLOAT4X4 BindPos; 141 | DirectX::XMFLOAT4X4 LocalTransform; 142 | }; 143 | 144 | struct Clip 145 | { 146 | float StartTime; 147 | float EndTime; 148 | uint32_t keys; 149 | }; 150 | 151 | struct Keyframe 152 | { 153 | uint32_t BoneIndex; 154 | float Time; 155 | DirectX::XMFLOAT4X4 Transform; 156 | }; 157 | 158 | #pragma pack(pop) 159 | 160 | const Material s_defMaterial = 161 | { 162 | { 0.2f, 0.2f, 0.2f, 1.f }, 163 | { 0.8f, 0.8f, 0.8f, 1.f }, 164 | { 0.0f, 0.0f, 0.0f, 1.f }, 165 | 1.f, 166 | { 0.0f, 0.0f, 0.0f, 1.0f }, 167 | { 168 | 1.f, 0.f, 0.f, 0.f, 169 | 0.f, 1.f, 0.f, 0.f, 170 | 0.f, 0.f, 1.f, 0.f, 171 | 0.f, 0.f, 0.f, 1.f 172 | }, 173 | }; 174 | } // namespace 175 | 176 | static_assert(sizeof(VSD3DStarter::Material) == 132, "CMO Mesh structure size incorrect"); 177 | static_assert(sizeof(VSD3DStarter::SubMesh) == 20, "CMO Mesh structure size incorrect"); 178 | static_assert(sizeof(VSD3DStarter::Vertex) == 52, "CMO Mesh structure size incorrect"); 179 | static_assert(sizeof(VSD3DStarter::SkinningVertex) == 32, "CMO Mesh structure size incorrect"); 180 | static_assert(sizeof(VSD3DStarter::MeshExtents) == 40, "CMO Mesh structure size incorrect"); 181 | static_assert(sizeof(VSD3DStarter::Bone) == 196, "CMO Mesh structure size incorrect"); 182 | static_assert(sizeof(VSD3DStarter::Clip) == 12, "CMO Mesh structure size incorrect"); 183 | static_assert(sizeof(VSD3DStarter::Keyframe) == 72, "CMO Mesh structure size incorrect"); 184 | -------------------------------------------------------------------------------- /Meshconvert/Meshconvert_Desktop_2019.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | {8e114980-c1a3-4ada-ad7c-83caadf5daeb} 6 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe 7 | 8 | 9 | {a500efbf-87f7-4c3b-b7c4-a3505a25d342} 10 | 11 | 12 | {c34e0783-33ff-49df-9307-2da35f336fd6} 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | Wavefront OBJ 21 | 22 | 23 | 24 | 25 | Wavefront OBJ 26 | 27 | 28 | 29 | RuntimeFormats 30 | 31 | 32 | RuntimeFormats 33 | 34 | 35 | RuntimeFormats 36 | 37 | 38 | 39 | 40 | Resource Files 41 | 42 | 43 | 44 | 45 | Resource Files 46 | 47 | 48 | -------------------------------------------------------------------------------- /Meshconvert/Meshconvert_Desktop_2019_Win10.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | {8e114980-c1a3-4ada-ad7c-83caadf5daeb} 6 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe 7 | 8 | 9 | {a500efbf-87f7-4c3b-b7c4-a3505a25d342} 10 | 11 | 12 | {55d98cd5-56f5-47f0-92b5-d0bd37b58095} 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | Wavefront OBJ 21 | 22 | 23 | 24 | 25 | Wavefront OBJ 26 | 27 | 28 | 29 | RuntimeFormats 30 | 31 | 32 | RuntimeFormats 33 | 34 | 35 | RuntimeFormats 36 | 37 | 38 | 39 | 40 | Resource Files 41 | 42 | 43 | 44 | 45 | Resource Files 46 | 47 | 48 | -------------------------------------------------------------------------------- /Meshconvert/Meshconvert_Desktop_2022.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | {8e114980-c1a3-4ada-ad7c-83caadf5daeb} 6 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe 7 | 8 | 9 | {a500efbf-87f7-4c3b-b7c4-a3505a25d342} 10 | 11 | 12 | {9c6384ab-2dc4-49f8-bda8-8df27eb66f4e} 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | Wavefront OBJ 21 | 22 | 23 | 24 | 25 | Wavefront OBJ 26 | 27 | 28 | 29 | RuntimeFormats 30 | 31 | 32 | RuntimeFormats 33 | 34 | 35 | RuntimeFormats 36 | 37 | 38 | 39 | 40 | Resource Files 41 | 42 | 43 | 44 | 45 | Resource Files 46 | 47 | 48 | -------------------------------------------------------------------------------- /Meshconvert/Meshconvert_Desktop_2022_Win10.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | {8e114980-c1a3-4ada-ad7c-83caadf5daeb} 6 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe 7 | 8 | 9 | {a500efbf-87f7-4c3b-b7c4-a3505a25d342} 10 | 11 | 12 | {ff7519a3-689d-4b30-829a-ffdacd003375} 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | Wavefront OBJ 21 | 22 | 23 | 24 | 25 | Wavefront OBJ 26 | 27 | 28 | 29 | RuntimeFormats 30 | 31 | 32 | RuntimeFormats 33 | 34 | 35 | RuntimeFormats 36 | 37 | 38 | 39 | 40 | Resource Files 41 | 42 | 43 | 44 | 45 | Resource Files 46 | 47 | 48 | -------------------------------------------------------------------------------- /Meshconvert/directx.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/DirectXMesh/5be3c743d28c19e9c195c3ad916031733f0c2251/Meshconvert/directx.ico -------------------------------------------------------------------------------- /Meshconvert/meshconvert.rc: -------------------------------------------------------------------------------- 1 | // Microsoft Visual C++ generated resource script. 2 | // 3 | 4 | #define APSTUDIO_READONLY_SYMBOLS 5 | ///////////////////////////////////////////////////////////////////////////// 6 | // 7 | // Generated from the TEXTINCLUDE 2 resource. 8 | // 9 | #define IDC_STATIC -1 10 | #include 11 | 12 | 13 | 14 | ///////////////////////////////////////////////////////////////////////////// 15 | #undef APSTUDIO_READONLY_SYMBOLS 16 | 17 | ///////////////////////////////////////////////////////////////////////////// 18 | // English (United States) resources 19 | 20 | #if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) 21 | LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US 22 | #pragma code_page(1252) 23 | 24 | ///////////////////////////////////////////////////////////////////////////// 25 | // 26 | // Icon 27 | // 28 | 29 | // Icon with lowest ID value placed first to ensure application icon 30 | // remains consistent on all systems. 31 | IDI_MAIN_ICON ICON "directx.ico" 32 | 33 | 34 | #ifdef APSTUDIO_INVOKED 35 | ///////////////////////////////////////////////////////////////////////////// 36 | // 37 | // TEXTINCLUDE 38 | // 39 | 40 | 1 TEXTINCLUDE 41 | BEGIN 42 | "resource.h\0" 43 | END 44 | 45 | 2 TEXTINCLUDE 46 | BEGIN 47 | "#define IDC_STATIC -1\r\n" 48 | "#include \r\n" 49 | "\r\n" 50 | "\r\n" 51 | "\0" 52 | END 53 | 54 | 3 TEXTINCLUDE 55 | BEGIN 56 | "\r\n" 57 | "\0" 58 | END 59 | 60 | #endif // APSTUDIO_INVOKED 61 | 62 | 63 | ///////////////////////////////////////////////////////////////////////////// 64 | // 65 | // Version 66 | // 67 | 68 | VS_VERSION_INFO VERSIONINFO 69 | FILEVERSION 1,0,0,0 70 | PRODUCTVERSION 1,0,0,0 71 | FILEFLAGSMASK 0x3fL 72 | #ifdef _DEBUG 73 | FILEFLAGS 0x1L 74 | #else 75 | FILEFLAGS 0x0L 76 | #endif 77 | FILEOS 0x40004L 78 | FILETYPE 0x1L 79 | FILESUBTYPE 0x0L 80 | BEGIN 81 | BLOCK "StringFileInfo" 82 | BEGIN 83 | BLOCK "040904b0" 84 | BEGIN 85 | VALUE "CompanyName", "Microsoft Corp" 86 | VALUE "FileDescription", "Mesh conversion command-line tool" 87 | VALUE "FileVersion", "1.0.0.0" 88 | VALUE "InternalName", "meshconvert.exe" 89 | VALUE "LegalCopyright", "Copyright (c) Microsoft Corp." 90 | VALUE "OriginalFilename", "meshconvert.exe" 91 | VALUE "ProductName", "DirectXMesh" 92 | VALUE "ProductVersion", "1.0.0.0" 93 | END 94 | END 95 | BLOCK "VarFileInfo" 96 | BEGIN 97 | VALUE "Translation", 0x409, 1200 98 | END 99 | END 100 | 101 | #endif // English (United States) resources 102 | ///////////////////////////////////////////////////////////////////////////// 103 | 104 | 105 | 106 | #ifndef APSTUDIO_INVOKED 107 | ///////////////////////////////////////////////////////////////////////////// 108 | // 109 | // Generated from the TEXTINCLUDE 3 resource. 110 | // 111 | 112 | 113 | ///////////////////////////////////////////////////////////////////////////// 114 | #endif // not APSTUDIO_INVOKED 115 | 116 | -------------------------------------------------------------------------------- /Meshconvert/settings.manifest: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | true 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /Meshconvert/vbo.h: -------------------------------------------------------------------------------- 1 | //-------------------------------------------------------------------------------------- 2 | // File: vbo.h 3 | // 4 | // The VBO file format was introduced in the Windows 8.0 ResourceLoading sample. It's 5 | // a simple binary file containing a 16-bit index buffer and a fixed-format vertex buffer. 6 | // 7 | // The meshconvert sample tool for DirectXMesh can produce this file type 8 | // http://go.microsoft.com/fwlink/?LinkID=324981 9 | // 10 | // Copyright (c) Microsoft Corporation. 11 | // Licensed under the MIT License. 12 | // 13 | // http://go.microsoft.com/fwlink/?LinkId=248929 14 | // http://go.microsoft.com/fwlink/?LinkID=615561 15 | //-------------------------------------------------------------------------------------- 16 | 17 | #pragma once 18 | 19 | #include 20 | 21 | namespace VBO 22 | { 23 | #pragma pack(push,1) 24 | 25 | struct header_t 26 | { 27 | uint32_t numVertices; 28 | uint32_t numIndices; 29 | }; 30 | 31 | struct vertex_t 32 | { 33 | DirectX::XMFLOAT3 position; 34 | DirectX::XMFLOAT3 normal; 35 | DirectX::XMFLOAT2 textureCoordinate; 36 | }; 37 | 38 | #pragma pack(pop) 39 | 40 | } // namespace 41 | 42 | static_assert(sizeof(VBO::header_t) == 8, "VBO header size mismatch"); 43 | static_assert(sizeof(VBO::vertex_t) == 32, "VBO vertex size mismatch"); 44 | -------------------------------------------------------------------------------- /SECURITY.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | ## Security 4 | 5 | Microsoft takes the security of our software products and services seriously, which includes all source code repositories managed through our GitHub organizations, which include [Microsoft](https://github.com/Microsoft), [Azure](https://github.com/Azure), [DotNet](https://github.com/dotnet), [AspNet](https://github.com/aspnet) and [Xamarin](https://github.com/xamarin). 6 | 7 | If you believe you have found a security vulnerability in any Microsoft-owned repository that meets [Microsoft's definition of a security vulnerability](https://aka.ms/security.md/definition), please report it to us as described below. 8 | 9 | ## Reporting Security Issues 10 | 11 | **Please do not report security vulnerabilities through public GitHub issues.** 12 | 13 | Instead, please report them to the Microsoft Security Response Center (MSRC) at [https://msrc.microsoft.com/create-report](https://aka.ms/security.md/msrc/create-report). 14 | 15 | If you prefer to submit without logging in, send email to [secure@microsoft.com](mailto:secure@microsoft.com). If possible, encrypt your message with our PGP key; please download it from the [Microsoft Security Response Center PGP Key page](https://aka.ms/security.md/msrc/pgp). 16 | 17 | You should receive a response within 24 hours. If for some reason you do not, please follow up via email to ensure we received your original message. Additional information can be found at [microsoft.com/msrc](https://www.microsoft.com/msrc). 18 | 19 | Please include the requested information listed below (as much as you can provide) to help us better understand the nature and scope of the possible issue: 20 | 21 | * Type of issue (e.g. buffer overflow, SQL injection, cross-site scripting, etc.) 22 | * Full paths of source file(s) related to the manifestation of the issue 23 | * The location of the affected source code (tag/branch/commit or direct URL) 24 | * Any special configuration required to reproduce the issue 25 | * Step-by-step instructions to reproduce the issue 26 | * Proof-of-concept or exploit code (if possible) 27 | * Impact of the issue, including how an attacker might exploit the issue 28 | 29 | This information will help us triage your report more quickly. 30 | 31 | If you are reporting for a bug bounty, more complete reports can contribute to a higher bounty award. Please visit our [Microsoft Bug Bounty Program](https://aka.ms/security.md/msrc/bounty) page for more details about our active programs. 32 | 33 | ## Preferred Languages 34 | 35 | We prefer all communications to be in English. 36 | 37 | ## Policy 38 | 39 | Microsoft follows the principle of [Coordinated Vulnerability Disclosure](https://aka.ms/security.md/cvd). 40 | 41 | 42 | -------------------------------------------------------------------------------- /build/CopyASan.targets: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | .drop 6 | 7 | $(VsInstallRoot)\ 8 | $(VSInstallDir)VC\ 9 | $(VCInstallDir)Auxiliary\Build\Microsoft.VCToolsVersion.default.props 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /build/DirectXMesh-config.cmake.in: -------------------------------------------------------------------------------- 1 | @PACKAGE_INIT@ 2 | 3 | if ((NOT directxmesh_FIND_COMPONENTS) OR ("library" IN_LIST directxmesh_FIND_COMPONENTS)) 4 | include(${CMAKE_CURRENT_LIST_DIR}/@PROJECT_NAME@-targets.cmake) 5 | endif() 6 | 7 | if ("utils" IN_LIST directxmesh_FIND_COMPONENTS) 8 | include(${CMAKE_CURRENT_LIST_DIR}/Utilities-targets.cmake) 9 | endif() 10 | 11 | include(CMakeFindDependencyMacro) 12 | 13 | if(MINGW OR (NOT WIN32)) 14 | find_dependency(directx-headers) 15 | find_dependency(directxmath) 16 | else() 17 | find_package(directx-headers CONFIG QUIET) 18 | find_package(directxmath CONFIG QUIET) 19 | endif() 20 | 21 | check_required_components("@PROJECT_NAME@") 22 | -------------------------------------------------------------------------------- /build/DirectXMesh.pc.in: -------------------------------------------------------------------------------- 1 | prefix=@CMAKE_INSTALL_PREFIX@ 2 | libdir=@DIRECTXMESH_LIBDIR_FOR_PKG_CONFIG@ 3 | includedir=@DIRECTXMESH_INCLUDEDIR_FOR_PKG_CONFIG@ 4 | 5 | Name: @PROJECT_NAME@ 6 | Description: @PROJECT_DESCRIPTION@ 7 | URL: @PROJECT_HOMEPAGE_URL@ 8 | Version: @PROJECT_VERSION@ 9 | Requires:@DIRECTXMESH_DEP@ 10 | Cflags: -I${includedir} 11 | Libs: -l@PROJECT_NAME@ 12 | -------------------------------------------------------------------------------- /build/DirectXMesh.rc.in: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | VS_VERSION_INFO VERSIONINFO 4 | FILEVERSION 1,0,0,0 5 | PRODUCTVERSION @PROJECT_VERSION_MAJOR@,@PROJECT_VERSION_MINOR@,@PROJECT_VERSION_PATCH@,0 6 | FILEFLAGSMASK 0x3fL 7 | #ifdef _DEBUG 8 | FILEFLAGS 0x1L 9 | #else 10 | FILEFLAGS 0x0L 11 | #endif 12 | FILEOS 0x40004L 13 | FILETYPE 0x1L 14 | FILESUBTYPE 0x0L 15 | BEGIN 16 | BLOCK "StringFileInfo" 17 | BEGIN 18 | BLOCK "040904b0" 19 | BEGIN 20 | VALUE "CompanyName", "Microsoft Corp" 21 | VALUE "FileDescription", "DirectXMesh geometry processing library" 22 | VALUE "FileVersion", "1.0.0.0" 23 | VALUE "InternalName", "directxmesh.dll" 24 | VALUE "LegalCopyright", "Copyright (c) Microsoft Corp." 25 | VALUE "OriginalFilename", "directxmesh.dll" 26 | VALUE "ProductName", "DirectXMesh" 27 | VALUE "ProductVersion", "@PROJECT_VERSION_MAJOR@.@PROJECT_VERSION_MINOR@.@PROJECT_VERSION_PATCH@" 28 | END 29 | END 30 | BLOCK "VarFileInfo" 31 | BEGIN 32 | VALUE "Translation", 0x409, 1200 33 | END 34 | END 35 | -------------------------------------------------------------------------------- /build/JoinPaths.cmake: -------------------------------------------------------------------------------- 1 | # This module provides function for joining paths 2 | # known from most languages 3 | # 4 | # SPDX-License-Identifier: (MIT OR CC0-1.0) 5 | # Copyright 2020 Jan Tojnar 6 | # https://github.com/jtojnar/cmake-snips 7 | # 8 | # Modelled after Python’s os.path.join 9 | # https://docs.python.org/3.7/library/os.path.html#os.path.join 10 | # Windows not supported 11 | function(join_paths joined_path first_path_segment) 12 | set(temp_path "${first_path_segment}") 13 | foreach(current_segment IN LISTS ARGN) 14 | if(NOT ("${current_segment}" STREQUAL "")) 15 | if(IS_ABSOLUTE "${current_segment}") 16 | set(temp_path "${current_segment}") 17 | else() 18 | set(temp_path "${temp_path}/${current_segment}") 19 | endif() 20 | endif() 21 | endforeach() 22 | set(${joined_path} "${temp_path}" PARENT_SCOPE) 23 | endfunction() 24 | -------------------------------------------------------------------------------- /build/OneFuzzConfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "ConfigVersion": 3, 3 | "Entries": [ 4 | { 5 | "MinAvailableMemoryMB": 50, 6 | "JobNotificationEmail": "directxtkdev@microsoft.com", 7 | "Skip": false, 8 | "Fuzzer": { 9 | "$type": "libfuzzer", 10 | "FuzzingHarnessExecutableName": "fuzzloaders.exe", 11 | "FuzzingTargetBinaries": [ 12 | "fuzzloaders.exe" 13 | ] 14 | }, 15 | "RebootAfterSetup": false, 16 | "OneFuzzJobs": [ 17 | { 18 | "ProjectName": "Direct3D", 19 | "TargetName": "DirectXMesh", 20 | "TargetOptions": [ 21 | " -rss_limit_mb=4096" 22 | ], 23 | "TargetEnv": { 24 | "ASAN_OPTIONS": "allocator_may_return_null=1" 25 | } 26 | } 27 | ], 28 | "JobDependencies": [ 29 | "fuzzloaders.exe", 30 | "fuzzloaders.pdb", 31 | "clang_rt.asan_dynamic-x86_64.dll", 32 | "msdia140.dll", 33 | "setup.ps1" 34 | ], 35 | "AdoTemplate": { 36 | "Org": "microsoft", 37 | "Project": "OS", 38 | "AssignedTo": "chuckw@microsoft.com", 39 | "AreaPath": "OS\\Core\\SiGMa\\GRFX-Graphics", 40 | "IterationPath": "OS\\Future" 41 | }, 42 | "CodeCoverage": { 43 | "Org": "mscodehub", 44 | "Project": "DirectXMesh", 45 | "PipelineId": "3712" 46 | } 47 | } 48 | ] 49 | } -------------------------------------------------------------------------------- /build/SetupBWOI.cmd: -------------------------------------------------------------------------------- 1 | @echo off 2 | rem Copyright (c) Microsoft Corporation. 3 | rem Licensed under the MIT License. 4 | 5 | if %1.==. goto needpackage 6 | if %2.==. goto needgdk 7 | if %3.==PC. goto haveparams 8 | if %3.==XboxOne. goto haveparams 9 | if %3.==Scarlett. goto haveparams 10 | goto needconsole 11 | 12 | :haveparams 13 | set GXDKEDITION=%2 14 | echo GXDKEDITION: %GXDKEDITION% 15 | 16 | set PCNUGET=%1\Microsoft.GDK.PC.%GXDKEDITION%\ 17 | if NOT EXIST %PCNUGET% goto missingpcnuget 18 | 19 | set GRDKLatest=%PCNUGET%native\%GXDKEDITION%\GRDK\ 20 | echo GRDKLatest: %GRDKLatest% 21 | 22 | if %3.==PC. goto grdkonly 23 | 24 | set XBOXNUGET=%1\Microsoft.gdk.xbox.%GXDKEDITION%\ 25 | if NOT EXIST %XBOXNUGET% goto missingxboxnuget 26 | 27 | set GXDKLatest=%XBOXNUGET%native\%GXDKEDITION%\GXDK\ 28 | echo GXDKLatest: %GXDKLatest% 29 | 30 | set GameDK=%XBOXNUGET%native\ 31 | set GameDKLatest=%XBOXNUGET%native\%GXDKEDITION%\ 32 | 33 | set ADDBIN=%GXDKLatest%bin\%3;%PCNUGET%native\bin;%XBOXNUGET%native\bin 34 | set ADDINCLUDE=%GXDKLatest%gamekit\include\%3;%GXDKLatest%gamekit\include;%GRDKLatest%gamekit\include 35 | set ADDLIB=%GXDKLatest%gamekit\lib\amd64\%3;%GXDKLatest%gamekit\lib\amd64;%GRDKLatest%gamekit\lib\amd64 36 | goto continue 37 | 38 | :grdkonly 39 | set GameDK=%PCNUGET%native\ 40 | set GameDKLatest=%PCNUGET%native\%GXDKEDITION%\ 41 | 42 | set ADDBIN=%PCNUGET%native\bin 43 | set ADDINCLUDE=%GRDKLatest%gamekit\include 44 | set ADDLIB=%GRDKLatest%gamekit\lib\amd64 45 | 46 | :continue 47 | echo GameDK: %GameDK% 48 | echo GameDKLatest: %GameDKLatest% 49 | echo ADDBIN: %ADDBIN% 50 | echo ADDINCLUDE: %ADDINCLUDE% 51 | echo ADDLIB: %ADDLIB% 52 | 53 | set PATH=%ADDBIN%;%PATH% 54 | set INCLUDE=%INCLUDE%;%ADDINCLUDE% 55 | set LIB=%LIB%;%ADDLIB% 56 | exit /b 0 57 | 58 | :needpackage 59 | echo Usage: This script requires the path to the installed NuGet packages as the first parameter. 60 | exit /b 1 61 | 62 | :needgdk 63 | echo Usage: This script requires the GDK edition number in YYMMQQ format as the second parameter 64 | exit /b 1 65 | 66 | :needconsole 67 | echo Usage: This script requires the target type of PC, Scarlett, or XboxOne in the third parameter 68 | exit /b 1 69 | 70 | :missingpcnuget 71 | echo ERROR - Cannot find Microsoft.GDK.PC. installed at '%1' 72 | exit /b 1 73 | 74 | :missingxboxnuget 75 | echo ERROR - Cannot find Microsoft.GDK.Xbox. installed at '%1' 76 | exit /b 1 77 | -------------------------------------------------------------------------------- /build/onefuzz-setup.ps1: -------------------------------------------------------------------------------- 1 | <# 2 | Copyright (c) Microsoft Corporation. 3 | Licensed under the MIT License. 4 | #> 5 | 6 | function Invoke-Setup { 7 | # Temporary work-around while OneFuzz does not run script from setup dir 8 | Set-Location -Path $PSScriptRoot 9 | 10 | Write-OneFuzzLog "Executing custom setup script in $(Get-Location)" 11 | 12 | # Exclude any uploaded DLL from known DLLs 13 | Get-ChildItem -filter '*.dll' | Add-Exclude-Library 14 | 15 | # Done. Useful to know that the script did not prematurely error out 16 | Write-OneFuzzLog 'Setup script finished successfully' 17 | } 18 | 19 | # Write log statements into the event log. 20 | function Write-OneFuzzLog { 21 | Param( 22 | [Parameter(Position=0, 23 | Mandatory, 24 | ValueFromPipeline, 25 | ValueFromRemainingArguments)] 26 | [String[]] $Messages) 27 | Begin { 28 | $EventSource = 'onefuzz-setup.ps1' 29 | $EventLog = 'Application' 30 | if (![System.Diagnostics.EventLog]::SourceExists($EventSource)) { 31 | New-EventLog -LogName $EventLog -Source $EventSource 32 | } 33 | } 34 | Process { 35 | $Messages.ForEach({ 36 | Write-EventLog -LogName $EventLog -Source $EventSource -EventId 0 -EntryType Information -Message $_ 37 | }) 38 | } 39 | End {} 40 | } 41 | 42 | # This function is used to exclude DLL's that the fuzzer is dependent on. The dependent DLL's 43 | # have been built with ASan and copied into the setup directory along with the fuzzer. 44 | function Add-Exclude-Library { 45 | Param( 46 | [Parameter(Position=0, 47 | Mandatory, 48 | ValueFromPipeline, 49 | ValueFromRemainingArguments)] 50 | [String[]] $Libraries) 51 | Begin { 52 | $Path = 'HKLM:System\CurrentControlSet\Control\Session Manager' 53 | $Name = 'ExcludeFromKnownDLLs' 54 | } 55 | Process { 56 | # Get existing excluded libraries 57 | $ExistingProperty = Get-ItemProperty -Path $Path -Name $Name -ErrorAction SilentlyContinue 58 | $ExistingExclusions = @() 59 | 60 | # Normalize DLL name to lowercase for comparison 61 | if ($null -ne $ExistingProperty) { 62 | $ExistingExclusions = $ExistingProperty.$Name.ForEach("ToLower") 63 | } 64 | 65 | # Normalize DLL name to lowercase for comparison, remove duplicates 66 | $Libs = $Libraries.ForEach("ToLower") | Select-Object -Unique 67 | Write-OneFuzzLog "Excluding libraries $Libs" 68 | 69 | # Discard empty strings and libraries already excluded 70 | $Libs = $Libs.Where({$_.Length -gt 0 -and !($ExistingExclusions.Contains($_))}) 71 | 72 | # If anything remains either add or update registry key 73 | if ($Libs.Length -gt 0) { 74 | if ($null -eq $ExistingProperty) { 75 | # Create registry key to exclude DLLs 76 | New-ItemProperty -Path $Path -Name $Name -PropertyType MultiString -Value $Libs 77 | Write-OneFuzzLog "Created known DLLs exclusions with $Libs" 78 | } else { 79 | # Update registry key to exclude DLLs 80 | Set-ItemProperty -Path $Path -Name $Name -Value ($ExistingProperty.$Name + $Libs) 81 | Write-OneFuzzLog "Updated known DLLs exclusions with $Libs" 82 | } 83 | } else { 84 | # DLLs already excluded 85 | Write-OneFuzzLog "Known DLL exclusions already exist for $Libraries" 86 | } 87 | } 88 | End {} 89 | } 90 | 91 | Invoke-Setup 92 | -------------------------------------------------------------------------------- /build/placeholder.xvd: -------------------------------------------------------------------------------- 1 | This file is a placeholder for gameos.xvd to speed up ADO pipeline builds. -------------------------------------------------------------------------------- /build/preparerelease.ps1: -------------------------------------------------------------------------------- 1 | <# 2 | 3 | .NOTES 4 | Copyright (c) Microsoft Corporation. 5 | Licensed under the MIT License. 6 | 7 | .SYNOPSIS 8 | Prepares a PR for release 9 | 10 | .DESCRIPTION 11 | This script is used to do the edits required for preparing a release PR. 12 | 13 | .PARAMETER BaseBranch 14 | This the branch to use as the base of the release. Defaults to 'main'. 15 | 16 | .PARAMETER TargetBranch 17 | This is the name of the newly created branch for the release PR. Defaults to 'release'. If set to 'none', then no branch is created. 18 | 19 | .PARAMETER UpdateVersion 20 | This is a $true or $false value that indicates if the library version number should be incremented. Defaults to $true. 21 | 22 | .LINK 23 | https://github.com/microsoft/DirectXMesh/wiki 24 | 25 | #> 26 | 27 | param( 28 | [string]$BaseBranch = "main", 29 | [string]$TargetBranch = $null, 30 | [bool]$UpdateVersion = $true 31 | ) 32 | 33 | $reporoot = Split-Path -Path $PSScriptRoot -Parent 34 | $cmake = $reporoot + "\CMakeLists.txt" 35 | $header = $reporoot + "\DirectXMesh\DirectXMesh.h" 36 | $readme = $reporoot + "\README.md" 37 | $history = $reporoot + "\CHANGELOG.md" 38 | 39 | if ((-Not (Test-Path $cmake)) -Or (-Not (Test-Path $header)) -Or (-Not (Test-Path $readme)) -Or (-Not (Test-Path $history))) { 40 | Write-Error "ERROR: Unexpected location of script file!" -ErrorAction Stop 41 | } 42 | 43 | $branch = git branch --show-current 44 | if ($branch -ne $BaseBranch) { 45 | Write-Error "ERROR: Must be in the $BaseBranch branch!" -ErrorAction Stop 46 | } 47 | 48 | git pull -q 49 | if ($LastExitCode -ne 0) { 50 | Write-Error "ERROR: Failed to sync branch!" -ErrorAction Stop 51 | } 52 | 53 | $version = Get-Content ($cmake) | Select-String -Pattern "set\(DIRECTXMESH_VERSION" -CaseSensitive 54 | if (-Not ($version -match "([0-9]?\.[0-9]?\.[0-9]?)")) { 55 | Write-Error "ERROR: Failed to current version!" -ErrorAction Stop 56 | } 57 | $version = $Matches.0 58 | $rawversion = $version.replace('.','') 59 | 60 | $newreleasedate = Get-Date -Format "MMMM d, yyyy" 61 | $newreleasetag = (Get-Date -Format "MMMyyyy").ToLower() 62 | 63 | if($UpdateVersion) { 64 | [string]$newrawversion = ([int]$rawversion + 1) 65 | } 66 | else { 67 | $newrawversion = $rawversion 68 | } 69 | 70 | $newversion = $newrawversion[0] + "." + $newrawversion[1] + "." + $newrawversion[2] 71 | 72 | $rawreleasedate = $(Get-Content $readme) | Select-String -Pattern "\*\*[A-Z][a-z]+\S.\d+,?\S.\d\d\d\d\*\*" 73 | if ([string]::IsNullOrEmpty($rawreleasedate)) { 74 | Write-Error "ERROR: Failed to current release date!" -ErrorAction Stop 75 | } 76 | $releasedate = $rawreleasedate -replace '\*','' 77 | 78 | if($releasedate -eq $newreleasedate) { 79 | Write-Error ("ERROR: Release "+$releasedate+" already exists!") -ErrorAction Stop 80 | } 81 | 82 | if ($TargetBranch -ne 'none') { 83 | if ([string]::IsNullOrEmpty($TargetBranch)) { 84 | $TargetBranch = $newreleasetag + "release" 85 | } 86 | 87 | git checkout -b $TargetBranch 88 | if ($LastExitCode -ne 0) { 89 | Write-Error "ERROR: Failed to create new topic branch!" -ErrorAction Stop 90 | } 91 | } 92 | 93 | Write-Host " Old Version: " $version 94 | Write-Host "Old Release Date: " $releasedate 95 | Write-Host "->" 96 | Write-Host " Release Date: " $newreleasedate 97 | Write-Host " Release Tag: " $newreleasetag 98 | Write-Host " Release Version: " $newversion 99 | 100 | if($UpdateVersion) { 101 | (Get-Content $cmake).Replace("set(DIRECTXMESH_VERSION $version)","set(DIRECTXMESH_VERSION $newversion)") | Set-Content $cmake 102 | (Get-Content $header).Replace("#define DIRECTX_MESH_VERSION $rawversion","#define DIRECTX_MESH_VERSION $newrawversion") | Set-Content $header 103 | } 104 | 105 | (Get-Content $readme).Replace("$rawreleasedate", "**$newreleasedate**") | Set-Content $readme 106 | 107 | Get-ChildItem -Path ($reporoot + "\.nuget") -Filter *.nuspec | Foreach-Object { 108 | (Get-Content -Path $_.Fullname).Replace("$releasedate", "$newreleasedate") | Set-Content -Path $_.Fullname -Encoding utf8 109 | } 110 | 111 | [System.Collections.ArrayList]$file = Get-Content $history 112 | $inserthere = @() 113 | 114 | for ($i=0; $i -lt $file.count; $i++) { 115 | if ($file[$i] -match "## Release History") { 116 | $inserthere += $i + 1 117 | } 118 | } 119 | 120 | $file.insert($inserthere[0], "`n### $newreleasedate`n* change history here") 121 | Set-Content -Path $history -Value $file 122 | 123 | code $history $readme 124 | if ($LastExitCode -ne 0) { 125 | Write-Error "ERROR: Failed to launch VS Code!" -ErrorAction Stop 126 | } 127 | -------------------------------------------------------------------------------- /build/vcpkg.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://raw.githubusercontent.com/microsoft/vcpkg-tool/main/docs/vcpkg.schema.json", 3 | "dependencies": [ 4 | "directxmath", 5 | "directx-headers" 6 | ] 7 | } -------------------------------------------------------------------------------- /build/versioninfo.ps1: -------------------------------------------------------------------------------- 1 | <# 2 | Copyright (c) Microsoft Corporation. 3 | Licensed under the MIT License. 4 | #> 5 | 6 | param( 7 | [string]$version 8 | ) 9 | $versionComma = $version.Replace(".", ",") 10 | $files = 'Meshconvert\meshconvert.rc', 'build\DirectXMesh.rc.in' 11 | foreach ($file in $files) { (Get-Content $file).replace('1,0,0,0', $versionComma).replace('1.0.0.0', $version) | Set-Content $file } 12 | --------------------------------------------------------------------------------