diff --git a/Externals/glslang/CMakeLists.txt b/Externals/glslang/CMakeLists.txt index e531534a96..7a4ab7cba0 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) @@ -62,3 +64,8 @@ endif() endif() add_library(glslang STATIC ${SRCS}) + +target_include_directories(glslang +PRIVATE + ${CMAKE_SOURCE_DIR}/Externals/glslang +) diff --git a/Externals/glslang/glslang.vcxproj b/Externals/glslang/glslang.vcxproj index 8db1bd2b9f..6e0b810a0a 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 65acdecdcd..c92a56ed25 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 87628030e9..40966f191d 100644 --- a/Source/Core/VideoBackends/Vulkan/CMakeLists.txt +++ b/Source/Core/VideoBackends/Vulkan/CMakeLists.txt @@ -57,6 +57,8 @@ 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 + ${CMAKE_SOURCE_DIR}/Externals/glslang ) diff --git a/Source/Core/VideoBackends/Vulkan/ShaderCompiler.cpp b/Source/Core/VideoBackends/Vulkan/ShaderCompiler.cpp index fb267b9319..8d6a4653e2 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" @@ -261,103 +262,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 a02b3b0574..6d95d05cf5 100644 --- a/Source/VSProps/Base.props +++ b/Source/VSProps/Base.props @@ -45,7 +45,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)liblzma\api;%(AdditionalIncludeDirectories) $(ExternalsDir)libpng;%(AdditionalIncludeDirectories)