Skip to content

Commit

Permalink
Remove GlslangToSpv.h dependency on SpvTools.h
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
arcady-lunarg committed Nov 11, 2023
1 parent 62de186 commit 6f9ab3c
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 14 deletions.
1 change: 1 addition & 0 deletions SPIRV/GlslangToSpv.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
14 changes: 12 additions & 2 deletions SPIRV/GlslangToSpv.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,6 @@

#pragma once

#include "SpvTools.h"

#include <string>
#include <vector>

Expand All @@ -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<unsigned int>& spirv,
Expand Down
13 changes: 1 addition & 12 deletions SPIRV/SpvTools.h
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
1 change: 1 addition & 0 deletions StandAlone/StandAlone.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
1 change: 1 addition & 0 deletions gtests/TestFixture.h
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down

0 comments on commit 6f9ab3c

Please sign in to comment.