From 6f9ab3c2deb6aca924141e8f64351687b6464436 Mon Sep 17 00:00:00 2001 From: Arcady Goldmints-Orlov Date: Wed, 8 Nov 2023 18:13:08 -0700 Subject: [PATCH] Remove GlslangToSpv.h dependency on SpvTools.h The dependency was only because of the SpvOptions struct which is used in both, but really is part of the glslang public interface and should be in the public GlslangToSpv.h header. --- SPIRV/GlslangToSpv.cpp | 1 + SPIRV/GlslangToSpv.h | 14 ++++++++++++-- SPIRV/SpvTools.h | 13 +------------ StandAlone/StandAlone.cpp | 1 + gtests/TestFixture.h | 1 + 5 files changed, 16 insertions(+), 14 deletions(-) diff --git a/SPIRV/GlslangToSpv.cpp b/SPIRV/GlslangToSpv.cpp index 25a39777..acda1923 100755 --- a/SPIRV/GlslangToSpv.cpp +++ b/SPIRV/GlslangToSpv.cpp @@ -43,6 +43,7 @@ #include "spirv.hpp" #include "GlslangToSpv.h" #include "SpvBuilder.h" +#include "SpvTools.h" namespace spv { #include "GLSL.std.450.h" #include "GLSL.ext.KHR.h" diff --git a/SPIRV/GlslangToSpv.h b/SPIRV/GlslangToSpv.h index 55a30dea..1b9ef3c5 100644 --- a/SPIRV/GlslangToSpv.h +++ b/SPIRV/GlslangToSpv.h @@ -35,8 +35,6 @@ #pragma once -#include "SpvTools.h" - #include #include @@ -45,6 +43,18 @@ namespace glslang { class TIntermediate; +struct SpvOptions { + bool generateDebugInfo {false}; + bool stripDebugInfo {false}; + bool disableOptimizer {true}; + bool optimizeSize {false}; + bool disassemble {false}; + bool validate {false}; + bool emitNonSemanticShaderDebugInfo {false}; + bool emitNonSemanticShaderDebugSource{ false }; + bool compileOnly{false}; +}; + void GetSpirvVersion(std::string&); int GetSpirvGeneratorVersion(); void GlslangToSpv(const glslang::TIntermediate& intermediate, std::vector& spirv, diff --git a/SPIRV/SpvTools.h b/SPIRV/SpvTools.h index a4ce11b8..eabde466 100644 --- a/SPIRV/SpvTools.h +++ b/SPIRV/SpvTools.h @@ -48,22 +48,11 @@ #endif #include "glslang/MachineIndependent/localintermediate.h" +#include "GlslangToSpv.h" #include "Logger.h" namespace glslang { -struct SpvOptions { - bool generateDebugInfo {false}; - bool stripDebugInfo {false}; - bool disableOptimizer {true}; - bool optimizeSize {false}; - bool disassemble {false}; - bool validate {false}; - bool emitNonSemanticShaderDebugInfo {false}; - bool emitNonSemanticShaderDebugSource{ false }; - bool compileOnly{false}; -}; - #if ENABLE_OPT // Translate glslang's view of target versioning to what SPIRV-Tools uses. diff --git a/StandAlone/StandAlone.cpp b/StandAlone/StandAlone.cpp index 28565365..ed3deccd 100644 --- a/StandAlone/StandAlone.cpp +++ b/StandAlone/StandAlone.cpp @@ -46,6 +46,7 @@ #include "DirStackFileIncluder.h" #include "./../glslang/Include/ShHandle.h" #include "./../glslang/Public/ShaderLang.h" +#include "../glslang/MachineIndependent/localintermediate.h" #include "../SPIRV/GlslangToSpv.h" #include "../SPIRV/GLSL.std.450.h" #include "../SPIRV/doc.h" diff --git a/gtests/TestFixture.h b/gtests/TestFixture.h index df3433bf..b23ba304 100644 --- a/gtests/TestFixture.h +++ b/gtests/TestFixture.h @@ -48,6 +48,7 @@ #include "SPIRV/disassemble.h" #include "SPIRV/doc.h" #include "SPIRV/SPVRemapper.h" +#include "glslang/Include/Types.h" #include "glslang/Public/ResourceLimits.h" #include "glslang/Public/ShaderLang.h"