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

Move SPIRV into glslang #3837

Open
wants to merge 4 commits into
base: main
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
58 changes: 29 additions & 29 deletions BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -117,34 +117,34 @@ template("glslang_sources_common") {
}

sources = [
"SPIRV/GLSL.ext.AMD.h",
"SPIRV/GLSL.ext.EXT.h",
"SPIRV/GLSL.ext.KHR.h",
"SPIRV/GLSL.ext.NV.h",
"SPIRV/GLSL.ext.ARM.h",
"SPIRV/GLSL.ext.QCOM.h",
"SPIRV/GLSL.std.450.h",
"SPIRV/GlslangToSpv.cpp",
"SPIRV/GlslangToSpv.h",
"SPIRV/InReadableOrder.cpp",
"SPIRV/Logger.cpp",
"SPIRV/Logger.h",
"SPIRV/NonSemanticDebugPrintf.h",
"SPIRV/NonSemanticShaderDebugInfo100.h",
"SPIRV/SPVRemapper.cpp",
"SPIRV/SPVRemapper.h",
"SPIRV/SpvBuilder.cpp",
"SPIRV/SpvBuilder.h",
"SPIRV/SpvPostProcess.cpp",
"SPIRV/SpvTools.h",
"SPIRV/bitutils.h",
"SPIRV/disassemble.cpp",
"SPIRV/disassemble.h",
"SPIRV/doc.cpp",
"SPIRV/doc.h",
"SPIRV/hex_float.h",
"SPIRV/spirv.hpp",
"SPIRV/spvIR.h",
"glslang/SPIRV/GLSL.ext.AMD.h",
"glslang/SPIRV/GLSL.ext.EXT.h",
"glslang/SPIRV/GLSL.ext.KHR.h",
"glslang/SPIRV/GLSL.ext.NV.h",
"glslang/SPIRV/GLSL.ext.ARM.h",
"glslang/SPIRV/GLSL.ext.QCOM.h",
"glslang/SPIRV/GLSL.std.450.h",
"glslang/SPIRV/GlslangToSpv.cpp",
"glslang/SPIRV/GlslangToSpv.h",
"glslang/SPIRV/InReadableOrder.cpp",
"glslang/SPIRV/Logger.cpp",
"glslang/SPIRV/Logger.h",
"glslang/SPIRV/NonSemanticDebugPrintf.h",
"glslang/SPIRV/NonSemanticShaderDebugInfo100.h",
"glslang/SPIRV/SPVRemapper.cpp",
"glslang/SPIRV/SPVRemapper.h",
"glslang/SPIRV/SpvBuilder.cpp",
"glslang/SPIRV/SpvBuilder.h",
"glslang/SPIRV/SpvPostProcess.cpp",
"glslang/SPIRV/SpvTools.h",
"glslang/SPIRV/bitutils.h",
"glslang/SPIRV/disassemble.cpp",
"glslang/SPIRV/disassemble.h",
"glslang/SPIRV/doc.cpp",
"glslang/SPIRV/doc.h",
"glslang/SPIRV/hex_float.h",
"glslang/SPIRV/spirv.hpp",
"glslang/SPIRV/spvIR.h",
"glslang/GenericCodeGen/CodeGen.cpp",
"glslang/GenericCodeGen/Link.cpp",
"glslang/Include/BaseTypes.h",
Expand Down Expand Up @@ -237,7 +237,7 @@ template("glslang_sources_common") {

defines = [ "ENABLE_SPIRV=1" ]
if (invoker.enable_opt) {
sources += [ "SPIRV/SpvTools.cpp" ]
sources += [ "glslang/SPIRV/SpvTools.cpp" ]
defines += [ "ENABLE_OPT=1" ]
}

Expand Down
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,7 @@ else()
endif()

if(ENABLE_SPIRV)
add_subdirectory(SPIRV)
add_subdirectory(glslang/SPIRV)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you move this to glslang/CMakeLists.txt?

endif()
add_subdirectory(glslang)
if(ENABLE_GLSLANG_BINARIES)
Expand Down
10 changes: 5 additions & 5 deletions StandAlone/StandAlone.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,11 @@
#include "glslang/Public/ResourceLimits.h"
#include "Worklist.h"
#include "DirStackFileIncluder.h"
#include "./../glslang/Public/ShaderLang.h"
#include "../glslang/MachineIndependent/localintermediate.h"
#include "../SPIRV/GlslangToSpv.h"
#include "../SPIRV/GLSL.std.450.h"
#include "../SPIRV/disassemble.h"
#include "glslang/Public/ShaderLang.h"
#include "glslang/MachineIndependent/localintermediate.h"
#include "glslang/SPIRV/GlslangToSpv.h"
#include "glslang/SPIRV/GLSL.std.450.h"
#include "glslang/SPIRV/disassemble.h"

#include <array>
#include <atomic>
Expand Down
2 changes: 1 addition & 1 deletion StandAlone/spirv-remap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
//
// Include remapper
//
#include "../SPIRV/SPVRemapper.h"
#include "glslang/SPIRV/SPVRemapper.h"

namespace {

Expand Down
4 changes: 2 additions & 2 deletions glslang/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -242,8 +242,8 @@ if(WIN32)
source_group("MachineIndependent\\Preprocessor" REGULAR_EXPRESSION "MachineIndependent/preprocessor/*")
source_group("HLSL" REGULAR_EXPRESSION "HLSL/*")
source_group("CInterface" REGULAR_EXPRESSION "CInterface/*")
source_group("SPIRV" REGULAR_EXPRESSION "SPIRV/[^/]*")
source_group("SPIRV\\CInterface" REGULAR_EXPRESSION "SPIRV/CInterface/*")
source_group("SPIRV" REGULAR_EXPRESSION "glslang/SPIRV/[^/]*")
source_group("SPIRV\\CInterface" REGULAR_EXPRESSION "glslang/SPIRV/CInterface/*")
endif()

################################################################################
Expand Down
4 changes: 2 additions & 2 deletions glslang/OSDependent/Web/glslang.js.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@
#include <emscripten.h>
#endif

#include "../../../SPIRV/GlslangToSpv.h"
#include "../../../glslang/Public/ShaderLang.h"
#include "glslang/SPIRV/GlslangToSpv.h"
#include "glslang/Public/ShaderLang.h"

#ifndef __EMSCRIPTEN__
#define EMSCRIPTEN_KEEPALIVE
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

#include <cstring>
#include "glslang/Public/ShaderLang.h"
#include "SPIRV/GlslangToSpv.h"
#include "SPIRV/Logger.h"
#include "SPIRV/SpvTools.h"
#include "glslang/SPIRV/GlslangToSpv.h"
#include "glslang/SPIRV/Logger.h"
#include "glslang/SPIRV/SpvTools.h"

static_assert(sizeof(glslang_spv_options_t) == sizeof(glslang::SpvOptions), "");

Expand Down
2 changes: 1 addition & 1 deletion SPIRV/CMakeLists.txt → glslang/SPIRV/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ set(PUBLIC_HEADERS
SPVRemapper.h
SpvTools.h)

add_library(SPIRV ${LIB_TYPE} ${CMAKE_CURRENT_SOURCE_DIR}/../glslang/stub.cpp)
add_library(SPIRV ${LIB_TYPE} ${CMAKE_CURRENT_SOURCE_DIR}/../stub.cpp)
add_library(glslang::SPIRV ALIAS SPIRV)
set_target_properties(SPIRV PROPERTIES
FOLDER glslang
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
6 changes: 3 additions & 3 deletions SPIRV/GlslangToSpv.cpp → glslang/SPIRV/GlslangToSpv.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,9 @@ namespace spv {
}

// Glslang includes
#include "../glslang/MachineIndependent/localintermediate.h"
#include "../glslang/MachineIndependent/SymbolTable.h"
#include "../glslang/Include/Common.h"
#include "glslang/MachineIndependent/localintermediate.h"
#include "glslang/MachineIndependent/SymbolTable.h"
#include "glslang/Include/Common.h"

// Build-time generated includes
#include "glslang/build_info.h"
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion gtests/HexFloat.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
#include <tuple>

#include <gmock/gmock.h>
#include "SPIRV/hex_float.h"
#include "glslang/SPIRV/hex_float.h"

namespace {
using ::testing::Eq;
Expand Down
10 changes: 5 additions & 5 deletions gtests/TestFixture.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,10 @@

#include <gtest/gtest.h>

#include "SPIRV/GlslangToSpv.h"
#include "SPIRV/disassemble.h"
#include "SPIRV/doc.h"
#include "SPIRV/SPVRemapper.h"
#include "glslang/SPIRV/GlslangToSpv.h"
#include "glslang/SPIRV/disassemble.h"
#include "glslang/SPIRV/doc.h"
#include "glslang/SPIRV/SPVRemapper.h"
#include "glslang/Include/Types.h"
#include "glslang/Public/ResourceLimits.h"
#include "glslang/Public/ShaderLang.h"
Expand Down Expand Up @@ -378,7 +378,7 @@ class GlslangTest : public GT {

glslang::TProgram program;
program.addShader(&shader);

success &= program.link(controls);
if (success)
program.mapIO();
Expand Down
8 changes: 4 additions & 4 deletions license-checker.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,10 @@
"Test/**",
"External/spirv-tools/**",

"SPIRV/GLSL.*.h",
"SPIRV/NonSemanticDebugPrintf.h",
"SPIRV/NonSemanticShaderDebugInfo100.h",
"SPIRV/spirv.hpp"
"glslang/SPIRV/GLSL.*.h",
"glslang/SPIRV/NonSemanticDebugPrintf.h",
"glslang/SPIRV/NonSemanticShaderDebugInfo100.h",
"glslang/SPIRV/spirv.hpp"
]
}
]
Expand Down
2 changes: 1 addition & 1 deletion ndk_test/test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#include "SPIRV/GlslangToSpv.h"
#include "glslang/SPIRV/GlslangToSpv.h"

void android_main(struct android_app* state) {
int version = glslang::GetSpirvGeneratorVersion();
Expand Down