This commit is contained in:
Chuck Walbourn 2023-11-15 15:42:41 -08:00 коммит произвёл GitHub
Родитель 89e9a68015
Коммит ef57c4e480
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
15 изменённых файлов: 69 добавлений и 46 удалений

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

@ -39,9 +39,9 @@ namespace
_Out_writes_(nVerts) uint32_t *index,
_In_reads_(nVerts) const XMFLOAT3* positions, size_t nVerts) noexcept
{
for (uint32_t vert = 0; vert < nVerts; ++vert)
for (size_t vert = 0; vert < nVerts; ++vert)
{
index[vert] = vert;
index[vert] = static_cast<uint32_t>(vert);
}
if (nVerts > 1)

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

@ -42,15 +42,15 @@ HRESULT __cdecl DirectX::ConcatenateMesh(
return E_FAIL;
auto const baseFace = static_cast<uint32_t>(totalFaces);
for (uint32_t j = 0; j < nFaces; ++j)
for (size_t j = 0; j < nFaces; ++j)
{
faceDestMap[j] = baseFace + j;
faceDestMap[j] = baseFace + static_cast<uint32_t>(j);
}
auto const baseVert = static_cast<uint32_t>(totalVerts);
for (uint32_t j = 0; j < nVerts; ++j)
for (size_t j = 0; j < nVerts; ++j)
{
vertexDestMap[j] = baseVert + j;
vertexDestMap[j] = baseVert + static_cast<uint32_t>(j);
}
totalFaces = static_cast<size_t>(newFaceCount);

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

@ -108,9 +108,9 @@ HRESULT DirectX::AttributeSort(
std::vector<intpair_t> list;
list.reserve(nFaces);
for (uint32_t j = 0; j < nFaces; ++j)
for (size_t j = 0; j < nFaces; ++j)
{
list.emplace_back(intpair_t(attributes[j], j));
list.emplace_back(intpair_t(attributes[j], static_cast<uint32_t>(j)));
}
std::stable_sort(list.begin(), list.end(), [](const intpair_t& a, const intpair_t& b) noexcept -> bool
@ -119,7 +119,7 @@ HRESULT DirectX::AttributeSort(
});
auto it = list.begin();
for (uint32_t j = 0; j < nFaces; ++j, ++it)
for (size_t j = 0; j < nFaces; ++j, ++it)
{
attributes[j] = it->first;
faceRemap[j] = it->second;

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

@ -570,12 +570,12 @@ namespace
// inverse remap
memset(faceRemap, 0xff, sizeof(uint32_t) * nFaces);
for (uint32_t j = 0; j < nFaces; ++j)
for (size_t j = 0; j < nFaces; ++j)
{
uint32_t f = faceRemapInverse[j];
if (f < nFaces)
{
faceRemap[f] = j;
faceRemap[f] = static_cast<uint32_t>(j);
}
}
@ -751,12 +751,12 @@ namespace
// inverse remap
memset(faceRemap, 0xff, sizeof(uint32_t) * nFaces);
for (uint32_t j = 0; j < nFaces; ++j)
for (size_t j = 0; j < nFaces; ++j)
{
uint32_t f = faceRemapInverse[j];
if (f < nFaces)
{
faceRemap[f] = j;
faceRemap[f] = static_cast<uint32_t>(j);
}
}

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

@ -853,7 +853,7 @@ HRESULT DirectX::FinalizeVBAndPointReps(
HRESULT hr = SwapVertices(vb, stride, nVerts, pointRep, vertexRemap);
// clean up point reps for any removed vertices
for (uint32_t i = 0; i < nVerts; ++i)
for (size_t i = 0; i < nVerts; ++i)
{
if (vertexRemap[i] == UNUSED32)
{

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

@ -164,7 +164,7 @@ HRESULT VBReader::Impl::Initialize(const InputElementDesc* vbDecl, size_t nDecl)
ComputeInputLayout(reinterpret_cast<const D3D11_INPUT_ELEMENT_DESC*>(vbDecl), nDecl, offsets, mDefaultStrides);
#endif
for (uint32_t j = 0; j < nDecl; ++j)
for (size_t j = 0; j < nDecl; ++j)
{
if (vbDecl[j].InputSlotClass == PER_INSTANCE_DATA)
{
@ -177,18 +177,18 @@ HRESULT VBReader::Impl::Initialize(const InputElementDesc* vbDecl, size_t nDecl)
mInputDesc[j].AlignedByteOffset = offsets[j];
auto decl = SemanticMap::value_type(vbDecl[j].SemanticName, j);
auto decl = SemanticMap::value_type(vbDecl[j].SemanticName, static_cast<uint32_t>(j));
mSemantics.insert(decl);
// Add common aliases
if (_stricmp(vbDecl[j].SemanticName, "POSITION") == 0)
{
auto decl2 = SemanticMap::value_type("SV_Position", j);
auto decl2 = SemanticMap::value_type("SV_Position", static_cast<uint32_t>(j));
mSemantics.insert(decl2);
}
else if (_stricmp(vbDecl[j].SemanticName, "SV_Position") == 0)
{
auto decl2 = SemanticMap::value_type("POSITION", j);
auto decl2 = SemanticMap::value_type("POSITION", static_cast<uint32_t>(j));
mSemantics.insert(decl2);
}
}

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

@ -163,7 +163,7 @@ HRESULT VBWriter::Impl::Initialize(const InputElementDesc* vbDecl, size_t nDecl)
ComputeInputLayout(reinterpret_cast<const D3D11_INPUT_ELEMENT_DESC*>(vbDecl), nDecl, offsets, mDefaultStrides);
#endif
for (uint32_t j = 0; j < nDecl; ++j)
for (size_t j = 0; j < nDecl; ++j)
{
if (vbDecl[j].InputSlotClass == PER_INSTANCE_DATA)
{
@ -176,18 +176,18 @@ HRESULT VBWriter::Impl::Initialize(const InputElementDesc* vbDecl, size_t nDecl)
mInputDesc[j].AlignedByteOffset = offsets[j];
auto decl = SemanticMap::value_type(vbDecl[j].SemanticName, j);
auto decl = SemanticMap::value_type(vbDecl[j].SemanticName, static_cast<uint32_t>(j));
mSemantics.insert(decl);
// Add common aliases
if (_stricmp(vbDecl[j].SemanticName, "POSITION") == 0)
{
auto decl2 = SemanticMap::value_type("SV_Position", j);
auto decl2 = SemanticMap::value_type("SV_Position", static_cast<uint32_t>(j));
mSemantics.insert(decl2);
}
else if (_stricmp(vbDecl[j].SemanticName, "SV_Position") == 0)
{
auto decl2 = SemanticMap::value_type("POSITION", j);
auto decl2 = SemanticMap::value_type("POSITION", static_cast<uint32_t>(j));
mSemantics.insert(decl2);
}
}

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

@ -114,7 +114,7 @@ namespace
return S_FALSE;
// Apply map to indices
for (uint32_t j = 0; j < nFaces * 3; ++j)
for (size_t j = 0; j < nFaces * 3; ++j)
{
index_t i = indices[j];
if (i == index_t(-1))

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

@ -26,6 +26,9 @@
#pragma warning(pop)
#include <Windows.h>
#ifdef __MINGW32__
#include <unknwn.h>
#endif
#else // !WIN32
#include <wsl/winadapter.h>
#include <wsl/wrladapter.h>
@ -103,6 +106,7 @@ public:
for (;; )
{
std::wstring strCommand;
InFile.width(MAX_PATH);
InFile >> strCommand;
if (!InFile)
break;
@ -327,12 +331,14 @@ public:
else if (0 == wcscmp(strCommand.c_str(), L"mtllib"))
{
// Material library
InFile.width(MAX_PATH);
InFile >> strMaterialFilename;
}
else if (0 == wcscmp(strCommand.c_str(), L"usemtl"))
{
// Material
wchar_t strName[MAX_PATH] = {};
InFile.width(MAX_PATH);
InFile >> strName;
bool bFound = false;
@ -429,6 +435,7 @@ public:
{
// Switching active materials
wchar_t strName[MAX_PATH] = {};
InFile.width(MAX_PATH);
InFile >> strName;
curMaterial = materials.end();

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

@ -62,7 +62,7 @@ jobs:
# We can use the preinstalled vcpkg instead of the latest when MS Hosted updates their vcpkg to the newer DirectX-Headers
displayName: Fetch VCPKG
inputs:
script: git clone --quiet https://%GITHUB_PAT%@github.com/microsoft/vcpkg.git
script: git clone --quiet --no-tags https://%GITHUB_PAT%@github.com/microsoft/vcpkg.git
workingDirectory: $(Build.SourcesDirectory)
- task: CmdLine@2
displayName: VCPKG Bootstrap
@ -135,12 +135,12 @@ jobs:
- task: CmdLine@2
displayName: Fetch VCPKG
inputs:
script: git clone --quiet https://%GITHUB_PAT%@github.com/microsoft/vcpkg.git
script: git clone --quiet --no-tags https://%GITHUB_PAT%@github.com/microsoft/vcpkg.git
workingDirectory: $(Build.SourcesDirectory)
- task: CmdLine@2
displayName: Fetch tests
inputs:
script: git clone --quiet https://%GITHUB_PAT%@github.com/walbourn/directxmeshtest.git Tests
script: git clone --quiet --no-tags https://%GITHUB_PAT%@github.com/walbourn/directxmeshtest.git Tests
- task: CmdLine@2
displayName: VCPKG Bootstrap
inputs:

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

@ -32,7 +32,7 @@ variables:
jobs:
- job: DESKTOP_BUILD
displayName: 'Win32 Desktop for x64/x86'
timeoutInMinutes: 120
timeoutInMinutes: 60
cancelTimeoutInMinutes: 1
steps:
- checkout: self
@ -48,7 +48,7 @@ jobs:
- task: CmdLine@2
displayName: Fetch Tests
inputs:
script: git clone --quiet https://%GITHUB_PAT%@github.com/walbourn/directxmeshtest.git Tests
script: git clone --quiet --no-tags https://%GITHUB_PAT%@github.com/walbourn/directxmeshtest.git Tests
workingDirectory: $(Build.SourcesDirectory)
failOnStderr: true
- task: VSBuild@1
@ -144,7 +144,7 @@ jobs:
- job: CMAKE_BUILD
displayName: 'CMake BUILD_TESTING=ON'
timeoutInMinutes: 120
timeoutInMinutes: 60
steps:
- checkout: self
clean: true
@ -159,7 +159,7 @@ jobs:
- task: CmdLine@2
displayName: Fetch Tests
inputs:
script: git clone --quiet https://%GITHUB_PAT%@github.com/walbourn/directxmeshtest.git Tests
script: git clone --quiet --no-tags https://%GITHUB_PAT%@github.com/walbourn/directxmeshtest.git Tests
workingDirectory: $(Build.SourcesDirectory)
failOnStderr: true
- task: ChocolateyCommand@0
@ -194,6 +194,9 @@ jobs:
inputs:
cwd: '$(Build.SourcesDirectory)'
cmakeArgs: --build out/build/x64-Debug -v
- task: DeleteFiles@1
inputs:
Contents: 'out'
- task: CMake@1
displayName: CMake (MSVC; x64-Release) Config
inputs:
@ -204,6 +207,9 @@ jobs:
inputs:
cwd: '$(Build.SourcesDirectory)'
cmakeArgs: --build out/build/x64-Release -v
- task: DeleteFiles@1
inputs:
Contents: 'out'
- task: CMake@1
displayName: CMake (clang/LLVM; x64-Debug) Config
inputs:
@ -214,6 +220,9 @@ jobs:
inputs:
cwd: '$(Build.SourcesDirectory)'
cmakeArgs: --build out/build/x64-Debug-Clang -v
- task: DeleteFiles@1
inputs:
Contents: 'out'
- task: CMake@1
displayName: CMake (clang/LLVM; x64-Release) Config
inputs:
@ -224,6 +233,9 @@ jobs:
inputs:
cwd: '$(Build.SourcesDirectory)'
cmakeArgs: --build out/build/x64-Release-Clang -v
- task: DeleteFiles@1
inputs:
Contents: 'out'
- task: CmdLine@2
displayName: Set LIB for ARM64
inputs:
@ -245,6 +257,9 @@ jobs:
inputs:
cwd: '$(Build.SourcesDirectory)'
cmakeArgs: --build out/build/arm64-Debug-Clang -v
- task: DeleteFiles@1
inputs:
Contents: 'out'
- task: CMake@1
displayName: CMake (clang/LLVM; arm64-Release) Config
inputs:

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

@ -67,7 +67,7 @@ jobs:
- task: CmdLine@2
displayName: Fetch Tests
inputs:
script: git clone --quiet https://%GITHUB_PAT%@github.com/walbourn/directxmeshtest.git Tests
script: git clone --quiet --no-tags https://%GITHUB_PAT%@github.com/walbourn/directxmeshtest.git Tests
workingDirectory: $(Build.SourcesDirectory)
failOnStderr: true
- task: VSBuild@1

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

@ -42,7 +42,7 @@ jobs:
- task: CmdLine@2
displayName: Fetch directx-headers
inputs:
script: git clone --quiet https://%GITHUB_PAT%@github.com/microsoft/DirectX-Headers.git directx-headers
script: git clone --quiet --no-tags https://%GITHUB_PAT%@github.com/microsoft/DirectX-Headers.git directx-headers
- task: CMake@1
displayName: CMake DirectX-Headers
inputs:
@ -61,7 +61,7 @@ jobs:
- task: CmdLine@2
displayName: Fetch directxmath
inputs:
script: git clone --quiet https://%GITHUB_PAT%@github.com/microsoft/DirectXMath.git directxmath
script: git clone --quiet --no-tags https://%GITHUB_PAT%@github.com/microsoft/DirectXMath.git directxmath
- task: CMake@1
displayName: CMake DirectXMath
inputs:

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

@ -61,7 +61,7 @@ jobs:
- task: CmdLine@2
displayName: Fetch directx-headers
inputs:
script: git clone --quiet https://%GITHUB_PAT%@github.com/microsoft/DirectX-Headers.git directx-headers
script: git clone --quiet --no-tags https://%GITHUB_PAT%@github.com/microsoft/DirectX-Headers.git directx-headers
- task: CMake@1
displayName: CMake DirectX-Headers
inputs:
@ -80,7 +80,7 @@ jobs:
- task: CmdLine@2
displayName: Fetch directxmath
inputs:
script: git clone --quiet https://%GITHUB_PAT%@github.com/microsoft/DirectXMath.git directxmath
script: git clone --quiet --no-tags https://%GITHUB_PAT%@github.com/microsoft/DirectXMath.git directxmath
- task: CMake@1
displayName: CMake DirectXMath
inputs:

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

@ -58,18 +58,19 @@ jobs:
inputs:
cwd: '$(Build.SourcesDirectory)'
cmakeArgs: '-G "$(VS_GENERATOR)" -A x64 -B out -DENABLE_SPECTRE_MITIGATION=ON'
- task: Semmle@1
displayName: 'Run CodeQL (Semmle) (C++)'
env:
SYSTEM_ACCESSTOKEN: $(System.AccessToken)
- task: CodeQL3000Init@0
inputs:
sourceCodeDirectory: '$(Build.SourcesDirectory)'
language: 'cpp'
querySuite: 'Recommended'
timeout: '1800'
ram: '16384'
addProjectDirToScanningExclusionList: true
buildCommandsString: '"%ProgramFiles%\Microsoft Visual Studio\2022\Enterprise\Common7\Tools\VsMSBuildCmd.bat" && msbuild $(Build.SourcesDirectory)/out/DirectXMesh.sln /p:Configuration=Release'
Enabled: true
- task: VSBuild@1
displayName: 'Build C++ with CodeQL'
inputs:
solution: '$(Build.SourcesDirectory)/out/DirectXMesh.sln'
vsVersion: 17.0
platform: x64
configuration: Release
msbuildArchitecture: x64
- task: CodeQL3000Finalize@0
condition: always()
- task: CMake@1
displayName: 'CMake (MSVC): Build x64 Release'
inputs: