diff --git a/CMakeLists.txt b/CMakeLists.txt index 02d6916d86fc..b01019235310 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -533,9 +533,11 @@ if (_M_X86) endif() add_subdirectory(Externals/cpp-optparse) add_subdirectory(Externals/fmt EXCLUDE_FROM_ALL) -add_subdirectory(Externals/glslang) add_subdirectory(Externals/imgui) +include_directories(Externals/glslang) +add_subdirectory(Externals/glslang) + find_package(pugixml) if(NOT pugixml_FOUND) message(STATUS "Using static pugixml from Externals") diff --git a/Externals/glslang/CMakeLists.txt b/Externals/glslang/CMakeLists.txt index e531534a9641..e2fbd61849b4 100644 --- a/Externals/glslang/CMakeLists.txt +++ b/Externals/glslang/CMakeLists.txt @@ -35,7 +35,9 @@ set(SRCS SPIRV/InReadableOrder.cpp SPIRV/Logger.cpp SPIRV/SpvBuilder.cpp + SPIRV/SpvPostProcess.cpp SPIRV/SPVRemapper.cpp + StandAlone/ResourceLimits.cpp ) if(WIN32) diff --git a/Externals/glslang/glslang.vcxproj b/Externals/glslang/glslang.vcxproj index 8db1bd2b9f2e..6e0b810a0a58 100644 --- a/Externals/glslang/glslang.vcxproj +++ b/Externals/glslang/glslang.vcxproj @@ -81,7 +81,9 @@ + + @@ -92,7 +94,6 @@ - @@ -126,6 +127,7 @@ + @@ -133,4 +135,4 @@ - \ No newline at end of file + diff --git a/Externals/glslang/glslang.vcxproj.filters b/Externals/glslang/glslang.vcxproj.filters index 65acdecdcd0d..c92a56ed2574 100644 --- a/Externals/glslang/glslang.vcxproj.filters +++ b/Externals/glslang/glslang.vcxproj.filters @@ -103,9 +103,15 @@ SPIRV + + SPIRV + SPIRV + + StandAlone + OGLCompilersDLL @@ -117,8 +123,8 @@ - - glslang\Include + + StandAlone glslang\Include @@ -281,4 +287,4 @@ glslang\MachineIndependant - + diff --git a/Source/Core/VideoBackends/Vulkan/CMakeLists.txt b/Source/Core/VideoBackends/Vulkan/CMakeLists.txt index 87628030e990..7282454161de 100644 --- a/Source/Core/VideoBackends/Vulkan/CMakeLists.txt +++ b/Source/Core/VideoBackends/Vulkan/CMakeLists.txt @@ -57,6 +57,7 @@ PRIVATE # Silence warnings on glslang by flagging it as a system include target_include_directories(videovulkan SYSTEM PRIVATE + ${CMAKE_SOURCE_DIR}/Externals/glslang/StandAlone ${CMAKE_SOURCE_DIR}/Externals/glslang/glslang/Public ${CMAKE_SOURCE_DIR}/Externals/glslang/SPIRV ) diff --git a/Source/Core/VideoBackends/Vulkan/ShaderCompiler.cpp b/Source/Core/VideoBackends/Vulkan/ShaderCompiler.cpp index 7b6beb11b08f..ffebe8ed59a6 100644 --- a/Source/Core/VideoBackends/Vulkan/ShaderCompiler.cpp +++ b/Source/Core/VideoBackends/Vulkan/ShaderCompiler.cpp @@ -14,6 +14,7 @@ // glslang includes #include "GlslangToSpv.h" +#include "ResourceLimits.h" #include "ShaderLang.h" #include "disassemble.h" @@ -259,103 +260,7 @@ bool InitializeGlslang() const TBuiltInResource* GetCompilerResourceLimits() { - static const TBuiltInResource limits = {/* .MaxLights = */ 32, - /* .MaxClipPlanes = */ 6, - /* .MaxTextureUnits = */ 32, - /* .MaxTextureCoords = */ 32, - /* .MaxVertexAttribs = */ 64, - /* .MaxVertexUniformComponents = */ 4096, - /* .MaxVaryingFloats = */ 64, - /* .MaxVertexTextureImageUnits = */ 32, - /* .MaxCombinedTextureImageUnits = */ 80, - /* .MaxTextureImageUnits = */ 32, - /* .MaxFragmentUniformComponents = */ 4096, - /* .MaxDrawBuffers = */ 32, - /* .MaxVertexUniformVectors = */ 128, - /* .MaxVaryingVectors = */ 8, - /* .MaxFragmentUniformVectors = */ 16, - /* .MaxVertexOutputVectors = */ 16, - /* .MaxFragmentInputVectors = */ 15, - /* .MinProgramTexelOffset = */ -8, - /* .MaxProgramTexelOffset = */ 7, - /* .MaxClipDistances = */ 8, - /* .MaxComputeWorkGroupCountX = */ 65535, - /* .MaxComputeWorkGroupCountY = */ 65535, - /* .MaxComputeWorkGroupCountZ = */ 65535, - /* .MaxComputeWorkGroupSizeX = */ 1024, - /* .MaxComputeWorkGroupSizeY = */ 1024, - /* .MaxComputeWorkGroupSizeZ = */ 64, - /* .MaxComputeUniformComponents = */ 1024, - /* .MaxComputeTextureImageUnits = */ 16, - /* .MaxComputeImageUniforms = */ 8, - /* .MaxComputeAtomicCounters = */ 8, - /* .MaxComputeAtomicCounterBuffers = */ 1, - /* .MaxVaryingComponents = */ 60, - /* .MaxVertexOutputComponents = */ 64, - /* .MaxGeometryInputComponents = */ 64, - /* .MaxGeometryOutputComponents = */ 128, - /* .MaxFragmentInputComponents = */ 128, - /* .MaxImageUnits = */ 8, - /* .MaxCombinedImageUnitsAndFragmentOutputs = */ 8, - /* .MaxCombinedShaderOutputResources = */ 8, - /* .MaxImageSamples = */ 0, - /* .MaxVertexImageUniforms = */ 0, - /* .MaxTessControlImageUniforms = */ 0, - /* .MaxTessEvaluationImageUniforms = */ 0, - /* .MaxGeometryImageUniforms = */ 0, - /* .MaxFragmentImageUniforms = */ 8, - /* .MaxCombinedImageUniforms = */ 8, - /* .MaxGeometryTextureImageUnits = */ 16, - /* .MaxGeometryOutputVertices = */ 256, - /* .MaxGeometryTotalOutputComponents = */ 1024, - /* .MaxGeometryUniformComponents = */ 1024, - /* .MaxGeometryVaryingComponents = */ 64, - /* .MaxTessControlInputComponents = */ 128, - /* .MaxTessControlOutputComponents = */ 128, - /* .MaxTessControlTextureImageUnits = */ 16, - /* .MaxTessControlUniformComponents = */ 1024, - /* .MaxTessControlTotalOutputComponents = */ 4096, - /* .MaxTessEvaluationInputComponents = */ 128, - /* .MaxTessEvaluationOutputComponents = */ 128, - /* .MaxTessEvaluationTextureImageUnits = */ 16, - /* .MaxTessEvaluationUniformComponents = */ 1024, - /* .MaxTessPatchComponents = */ 120, - /* .MaxPatchVertices = */ 32, - /* .MaxTessGenLevel = */ 64, - /* .MaxViewports = */ 16, - /* .MaxVertexAtomicCounters = */ 0, - /* .MaxTessControlAtomicCounters = */ 0, - /* .MaxTessEvaluationAtomicCounters = */ 0, - /* .MaxGeometryAtomicCounters = */ 0, - /* .MaxFragmentAtomicCounters = */ 8, - /* .MaxCombinedAtomicCounters = */ 8, - /* .MaxAtomicCounterBindings = */ 1, - /* .MaxVertexAtomicCounterBuffers = */ 0, - /* .MaxTessControlAtomicCounterBuffers = */ 0, - /* .MaxTessEvaluationAtomicCounterBuffers = */ 0, - /* .MaxGeometryAtomicCounterBuffers = */ 0, - /* .MaxFragmentAtomicCounterBuffers = */ 1, - /* .MaxCombinedAtomicCounterBuffers = */ 1, - /* .MaxAtomicCounterBufferSize = */ 16384, - /* .MaxTransformFeedbackBuffers = */ 4, - /* .MaxTransformFeedbackInterleavedComponents = */ 64, - /* .MaxCullDistances = */ 8, - /* .MaxCombinedClipAndCullDistances = */ 8, - /* .MaxSamples = */ 4, - /* .limits = */ - { - /* .nonInductiveForLoops = */ 1, - /* .whileLoops = */ 1, - /* .doWhileLoops = */ 1, - /* .generalUniformIndexing = */ 1, - /* .generalAttributeMatrixVectorIndexing = */ 1, - /* .generalVaryingIndexing = */ 1, - /* .generalSamplerIndexing = */ 1, - /* .generalVariableIndexing = */ 1, - /* .generalConstantMatrixVectorIndexing = */ 1, - }}; - - return &limits; + return &glslang::DefaultTBuiltInResource; } std::optional CompileVertexShader(std::string_view source_code) diff --git a/Source/VSProps/Base.props b/Source/VSProps/Base.props index ef85a44f7b80..d0fcedf3f7e7 100644 --- a/Source/VSProps/Base.props +++ b/Source/VSProps/Base.props @@ -43,7 +43,7 @@ $(ExternalsDir)ffmpeg\include;%(AdditionalIncludeDirectories) $(ExternalsDir)fmt\include;%(AdditionalIncludeDirectories) $(ExternalsDir)GL;%(AdditionalIncludeDirectories) - $(ExternalsDir)glslang\glslang\Public;$(ExternalsDir)glslang\SPIRV;%(AdditionalIncludeDirectories) + $(ExternalsDir)glslang;$(ExternalsDir)glslang\StandAlone;$(ExternalsDir)glslang\glslang\Public;$(ExternalsDir)glslang\SPIRV;%(AdditionalIncludeDirectories) $(ExternalsDir)imgui;%(AdditionalIncludeDirectories) $(ExternalsDir)libpng;%(AdditionalIncludeDirectories) $(ExternalsDir)libusb\libusb;%(AdditionalIncludeDirectories)