Revert "Add more flexible SpirvToolsDisassemble interface to allow specifying spv_tar...
authorJohn Kessenich <cepheus@frii.com>
Mon, 28 Sep 2020 00:15:41 +0000 (18:15 -0600)
committerJohn Kessenich <cepheus@frii.com>
Mon, 28 Sep 2020 00:15:41 +0000 (18:15 -0600)
This reverts commit 2eed8236d07d50f35c466d723651d86284c60161.

SPIRV/SpvTools.cpp
SPIRV/SpvTools.h
StandAlone/CMakeLists.txt
gtests/CMakeLists.txt

index fce1fb9..112ac33 100644 (file)
@@ -44,6 +44,7 @@
 
 #include "SpvTools.h"
 #include "spirv-tools/optimizer.hpp"
+#include "spirv-tools/libspirv.h"
 
 namespace glslang {
 
@@ -113,18 +114,11 @@ void OptimizerMesssageConsumer(spv_message_level_t level, const char *source,
     out << std::endl;
 }
 
-// Use the SPIRV-Tools disassembler to print SPIR-V using a SPV_ENV_UNIVERSAL_1_3 environment.
+// Use the SPIRV-Tools disassembler to print SPIR-V.
 void SpirvToolsDisassemble(std::ostream& out, const std::vector<unsigned int>& spirv)
 {
-    SpirvToolsDisassemble(out, spirv, SPV_ENV_UNIVERSAL_1_3);
-}
-
-// Use the SPIRV-Tools disassembler to print SPIR-V with a provided SPIR-V environment.
-void SpirvToolsDisassemble(std::ostream& out, const std::vector<unsigned int>& spirv,
-                           spv_target_env requested_context)
-{
     // disassemble
-    spv_context context = spvContextCreate(requested_context);
+    spv_context context = spvContextCreate(SPV_ENV_UNIVERSAL_1_3);
     spv_text text;
     spv_diagnostic diagnostic = nullptr;
     spvBinaryToText(context, spirv.data(), spirv.size(),
index 691c9ef..7779dfa 100644 (file)
@@ -44,7 +44,6 @@
 #ifdef ENABLE_OPT
 #include <vector>
 #include <ostream>
-#include "spirv-tools/libspirv.h"
 #endif
 
 #include "glslang/MachineIndependent/localintermediate.h"
@@ -65,13 +64,9 @@ struct SpvOptions {
 
 #ifdef ENABLE_OPT
 
-// Use the SPIRV-Tools disassembler to print SPIR-V using a SPV_ENV_UNIVERSAL_1_3 environment.
+// Use the SPIRV-Tools disassembler to print SPIR-V.
 void SpirvToolsDisassemble(std::ostream& out, const std::vector<unsigned int>& spirv);
 
-// Use the SPIRV-Tools disassembler to print SPIR-V with a provided SPIR-V environment.
-void SpirvToolsDisassemble(std::ostream& out, const std::vector<unsigned int>& spirv,
-                           spv_target_env requested_context);
-
 // Apply the SPIRV-Tools validator to generated SPIR-V.
 void SpirvToolsValidate(const glslang::TIntermediate& intermediate, std::vector<unsigned int>& spirv,
                         spv::SpvBuildLogger*, bool prelegalization);
index decfac5..8038c04 100644 (file)
@@ -70,12 +70,6 @@ target_include_directories(glslangValidator PUBLIC
     $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/../External>
     $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/External>)
 
-if(ENABLE_OPT)
-target_include_directories(glslangValidator PUBLIC
-    $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/../External/spirv-tools/include>
-    $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/External/spirv-tools/include>)
-endif()
-
 if(ENABLE_SPVREMAPPER)
     set(REMAPPER_SOURCES spirv-remap.cpp)
     add_executable(spirv-remap ${REMAPPER_SOURCES})
index f489c9d..6c48d9c 100644 (file)
@@ -83,12 +83,6 @@ if(BUILD_TESTING)
                                    ${gmock_SOURCE_DIR}/include
                                    ${gtest_SOURCE_DIR}/include)
 
-        if(ENABLE_OPT)
-            target_include_directories(glslangtests PUBLIC
-                $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/../External/spirv-tools/include>
-                $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/External/spirv-tools/include>)
-        endif()
-
         set(LIBRARIES
             glslang OSDependent OGLCompiler glslang
             SPIRV glslang-default-resource-limits)