Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Reflection] Implement SPIR-V shader reflection #73

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 17 additions & 5 deletions BuildAll.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,9 @@ def FindVS2017OrUpFolder(programFilesFolder, vsVersion, vsName):
LogError("Could NOT find VS%s.\n" % vsName)
return ""

def FindVS2022Folder(programFilesFolder):
return FindVS2017OrUpFolder(programFilesFolder, 17, "2022")

def FindVS2019Folder(programFilesFolder):
return FindVS2017OrUpFolder(programFilesFolder, 16, "2019")

Expand Down Expand Up @@ -132,7 +135,9 @@ def Build(hostPlatform, hostArch, buildSys, compiler, arch, configuration, tblge
batCmd = BatchCommand(hostPlatform)
if hostPlatform == "win":
programFilesFolder = FindProgramFilesFolder()
if (buildSys == "vs2019") or ((buildSys == "ninja") and (compiler == "vc142")):
if (buildSys == "vs2022") or ((buildSys == "ninja") and (compiler == "vc143")):
vsFolder = FindVS2022Folder(programFilesFolder)
elif (buildSys == "vs2019") or ((buildSys == "ninja") and (compiler == "vc142")):
vsFolder = FindVS2019Folder(programFilesFolder)
elif (buildSys == "vs2017") or ((buildSys == "ninja") and (compiler == "vc141")):
vsFolder = FindVS2017Folder(programFilesFolder)
Expand All @@ -153,10 +158,13 @@ def Build(hostPlatform, hostArch, buildSys, compiler, arch, configuration, tblge
else:
LogError("Unsupported architecture.\n")
vcToolset = ""
if (buildSys == "vs2019") and (compiler == "vc141"):
if (buildSys == "vs2022") and (compiler == "vc142"):
vcOption += " -vcvars_ver=14.2"
vcToolset = "v142,"
elif ((buildSys == "vs2022") or (buildSys == "vs2019")) and (compiler == "vc141"):
vcOption += " -vcvars_ver=14.1"
vcToolset = "v141,"
elif ((buildSys == "vs2019") or (buildSys == "vs2017")) and (compiler == "vc140"):
elif ((buildSys == "vs2022") or (buildSys == "vs2019") or (buildSys == "vs2017")) and (compiler == "vc140"):
vcOption += " -vcvars_ver=14.0"
vcToolset = "v140,"
batCmd.AddCommand("@call \"%sVCVARSALL.BAT\" %s" % (vsFolder, vcOption))
Expand All @@ -176,7 +184,9 @@ def Build(hostPlatform, hostArch, buildSys, compiler, arch, configuration, tblge
else:
batCmd.AddCommand("ninja -j%d" % parallel)
else:
if buildSys == "vs2019":
if buildSys == "vs2022":
generator = "\"Visual Studio 17\""
elif buildSys == "vs2019":
generator = "\"Visual Studio 16\""
elif buildSys == "vs2017":
generator = "\"Visual Studio 15\""
Expand Down Expand Up @@ -240,7 +250,9 @@ def Build(hostPlatform, hostArch, buildSys, compiler, arch, configuration, tblge
if (argc > 2):
compiler = sys.argv[2]
else:
if buildSys == "vs2019":
if buildSys == "vs2022":
compiler = "vc143"
elif buildSys == "vs2019":
compiler = "vc142"
elif buildSys == "vs2017":
compiler = "vc141"
Expand Down
6 changes: 6 additions & 0 deletions CI/AzurePipelines/ContinuousBuild.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@ steps:
git config --global user.name "Dummy Name"
displayName: 'Config git'

- task: UsePythonVersion@0
inputs:
versionSpec: '3.x'
addToPath: true
architecture: 'x64'

- task: PythonScript@0
displayName: 'Build'
inputs:
Expand Down
4 changes: 4 additions & 0 deletions External/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.

if(NOT EXISTS ${git_executable})
unset(git_executable CACHE)
endif()

find_program(git_executable NAMES git git.exe git.cmd)
if(NOT git_executable)
message(FATAL_ERROR "Failed to find git.")
Expand Down
10 changes: 7 additions & 3 deletions External/DirectXShaderCompiler.cmake
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.

set(DirectXShaderCompiler_REV "634a23537df7e85512437a4976f9bf9fcd095e18")
set(DirectXShaderCompiler_REV "cc50c79df1272a358fbf8b16e85dc6a9e5bc2ead")

UpdateExternalLib("DirectXShaderCompiler" "https://github.com/Microsoft/DirectXShaderCompiler.git" ${DirectXShaderCompiler_REV})

Expand Down Expand Up @@ -40,6 +40,7 @@ endif()
set(SPIRV_BUILD_TESTS OFF CACHE BOOL "" FORCE)
set(SPIRV_SKIP_EXECUTABLES ON CACHE BOOL "" FORCE)
set(SPIRV_SKIP_TESTS ON CACHE BOOL "" FORCE)

add_subdirectory(DirectXShaderCompiler EXCLUDE_FROM_ALL)
foreach(target
"clang" "dxc"
Expand All @@ -53,9 +54,12 @@ foreach(target
"ClangDiagnosticAnalysis" "ClangDiagnosticAST" "ClangDiagnosticComment" "ClangDiagnosticCommon" "ClangDiagnosticDriver"
"ClangDiagnosticFrontend" "ClangDiagnosticGroups" "ClangDiagnosticIndexName" "ClangDiagnosticLex" "ClangDiagnosticParse"
"ClangDiagnosticSema" "ClangDiagnosticSerialization" "ClangStmtNodes"
"LLVMAnalysis" "LLVMAsmParser" "LLVMBitReader" "LLVMBitWriter" "LLVMCore" "LLVMDxcSupport" "LLVMDXIL" "LLVMDxilContainer"
"DxcDisassembler" "DxcOptimizer" "DxilConstants" "DxilCounters" "DxilDocs" "DxilInstructions" "DxilIntrinsicTables"
"DxilMetadata" "DxilOperations" "DxilPIXPasses" "DxilShaderModel" "DxilShaderModelInc" "DxilSigPoint" "DxilValidation" "DxilValidationInc"
"HCTGen" "HLSLIntrinsicOp" "HLSLOptions"
"LLVMAnalysis" "LLVMAsmParser" "LLVMBitReader" "LLVMBitWriter" "LLVMCore" "LLVMDxcBindingTable" "LLVMDxcSupport" "LLVMDXIL" "LLVMDxilContainer"
"LLVMDxilPIXPasses" "LLVMDxilRootSignature" "LLVMDxrFallback" "LLVMHLSL" "LLVMInstCombine" "LLVMipa" "LLVMipo" "LLVMIRReader"
"LLVMLinker" "LLVMLTO" "LLVMMSSupport" "LLVMOption" "LLVMPasses" "LLVMPassPrinters" "LLVMProfileData" "LLVMScalarOpts" "LLVMSupport"
"LLVMLinker" "LLVMMiniz" "LLVMMSSupport" "LLVMOption" "LLVMPasses" "LLVMPassPrinters" "LLVMProfileData" "LLVMScalarOpts" "LLVMSupport"
"LLVMTableGen" "LLVMTarget" "LLVMTransformUtils" "LLVMVectorize"
"ClangDriverOptions" "DxcEtw" "intrinsics_gen" "TablegenHLSLOptions"
"clang-tblgen" "llvm-tblgen" "hlsl_dxcversion_autogen" "hlsl_version_autogen")
Expand Down
4 changes: 3 additions & 1 deletion External/SPIRV-Cross.cmake
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.

set(SPIRV_Cross_REV "8891bd35120ca91c252a66ccfdc3f9a9d03c70cd")
set(SPIRV_Cross_REV "37dfb3f45f4fc47c841f81e618c602f6f3de0f17")

UpdateExternalLib("SPIRV-Cross" "https://github.com/KhronosGroup/SPIRV-Cross.git" ${SPIRV_Cross_REV})

set(SPIRV_CROSS_ENABLE_TESTS OFF CACHE BOOL "" FORCE)

add_subdirectory(SPIRV-Cross EXCLUDE_FROM_ALL)
foreach(target
"spirv-cross" "spirv-cross-core" "spirv-cross-cpp" "spirv-cross-glsl" "spirv-cross-hlsl" "spirv-cross-msl" "spirv-cross-reflect"
Expand Down
2 changes: 1 addition & 1 deletion External/SPIRV-Header.cmake
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.

set(SPIRV_Headers_REV "3fdabd0da2932c276b25b9b4a988ba134eba1aa6")
set(SPIRV_Headers_REV "29817199b7069bac971e5365d180295d4b077ebe")

UpdateExternalLib("SPIRV-Headers" "https://github.com/KhronosGroup/SPIRV-Headers.git" ${SPIRV_Headers_REV})

Expand Down
16 changes: 13 additions & 3 deletions External/SPIRV-Tools.cmake
Original file line number Diff line number Diff line change
@@ -1,19 +1,29 @@
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.

set(SPIRV_Tools_REV "c341f7a6cd441d05ca1347ee39f2f03f32225c59")
set(SPIRV_Tools_REV "1589720e1065bd163fb8e812f268413b13755f7c")

UpdateExternalLib("SPIRV-Tools" "https://github.com/KhronosGroup/SPIRV-Tools.git" ${SPIRV_Tools_REV})

set(SPIRV_SKIP_EXECUTABLES ON CACHE BOOL "" FORCE)
add_subdirectory(SPIRV-Tools EXCLUDE_FROM_ALL)

if(MSVC)
target_compile_options(SPIRV-Tools-static
PRIVATE
/wd4819
)
endif()

foreach(target
"core_tables" "enum_string_mapping" "extinst_tables"
"spirv-tools-pkg-config" "spirv-tools-shared-pkg-config"
"spirv-tools-build-version" "spirv-tools-header-DebugInfo"
"SPIRV-Tools-link" "SPIRV-Tools-shared"
"spirv-tools-header-OpenCLDebugInfo100" "spirv-tools-vimsyntax" "spv-tools-cldi100" "spv-tools-clspvreflection" "spv-tools-debuginfo" "spv-tools-spv-amd-gs"
"spv-tools-spv-amd-sb" "spv-tools-spv-amd-sevp" "spv-tools-spv-amd-stm")
"spirv-tools-header-OpenCLDebugInfo100" "spirv-tools-header-NonSemanticShaderDebugInfo100"
"spirv-tools-vimsyntax" "spv-tools-cldi100" "spv-tools-shdi100" "spv-tools-clspvreflection"
"spv-tools-debuginfo" "spv-tools-spv-amd-gs" "spv-tools-spv-amd-sb" "spv-tools-spv-amd-sevp"
"spv-tools-spv-amd-stm")
get_target_property(vsFolder ${target} FOLDER)
if(NOT vsFolder)
set(vsFolder "")
Expand Down
Loading