Skip to content

Commit 2b77059

Browse files
committed
Revert "Add new SpirvToolsDisassemble API interface + Improve Doc on existing API interface (KhronosGroup#2408)"
See issue KhronosGroup#2413. This reverts commit d1929f3.
1 parent d1929f3 commit 2b77059

File tree

4 files changed

+7
-29
lines changed

4 files changed

+7
-29
lines changed

SPIRV/SpvTools.cpp

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@
4444

4545
#include "SpvTools.h"
4646
#include "spirv-tools/optimizer.hpp"
47+
#include "spirv-tools/libspirv.h"
4748

4849
namespace glslang {
4950

@@ -113,18 +114,11 @@ void OptimizerMesssageConsumer(spv_message_level_t level, const char *source,
113114
out << std::endl;
114115
}
115116

116-
// Use the SPIRV-Tools disassembler to print SPIR-V using a SPV_ENV_UNIVERSAL_1_3 environment.
117+
// Use the SPIRV-Tools disassembler to print SPIR-V.
117118
void SpirvToolsDisassemble(std::ostream& out, const std::vector<unsigned int>& spirv)
118-
{
119-
SpirvToolsDisassemble(out, spirv, spv_target_env::SPV_ENV_UNIVERSAL_1_3);
120-
}
121-
122-
// Use the SPIRV-Tools disassembler to print SPIR-V with a provided SPIR-V environment.
123-
void SpirvToolsDisassemble(std::ostream& out, const std::vector<unsigned int>& spirv,
124-
spv_target_env requested_context)
125119
{
126120
// disassemble
127-
spv_context context = spvContextCreate(requested_context);
121+
spv_context context = spvContextCreate(SPV_ENV_UNIVERSAL_1_3);
128122
spv_text text;
129123
spv_diagnostic diagnostic = nullptr;
130124
spvBinaryToText(context, spirv.data(), spirv.size(),

SPIRV/SpvTools.h

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,9 @@
4141
#ifndef GLSLANG_SPV_TOOLS_H
4242
#define GLSLANG_SPV_TOOLS_H
4343

44-
#if ENABLE_OPT
44+
#ifdef ENABLE_OPT
4545
#include <vector>
4646
#include <ostream>
47-
#include "spirv-tools/libspirv.h"
4847
#endif
4948

5049
#include "glslang/MachineIndependent/localintermediate.h"
@@ -63,15 +62,11 @@ struct SpvOptions {
6362
bool validate;
6463
};
6564

66-
#if ENABLE_OPT
65+
#ifdef ENABLE_OPT
6766

68-
// Use the SPIRV-Tools disassembler to print SPIR-V using a SPV_ENV_UNIVERSAL_1_3 environment.
67+
// Use the SPIRV-Tools disassembler to print SPIR-V.
6968
void SpirvToolsDisassemble(std::ostream& out, const std::vector<unsigned int>& spirv);
7069

71-
// Use the SPIRV-Tools disassembler to print SPIR-V with a provided SPIR-V environment.
72-
void SpirvToolsDisassemble(std::ostream& out, const std::vector<unsigned int>& spirv,
73-
spv_target_env requested_context);
74-
7570
// Apply the SPIRV-Tools validator to generated SPIR-V.
7671
void SpirvToolsValidate(const glslang::TIntermediate& intermediate, std::vector<unsigned int>& spirv,
7772
spv::SpvBuildLogger*, bool prelegalization);

StandAlone/CMakeLists.txt

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ target_include_directories(glslang-default-resource-limits
4141
PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
4242
PUBLIC $<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}>)
4343

44+
4445
set(SOURCES StandAlone.cpp DirStackFileIncluder.h)
4546

4647
add_executable(glslangValidator ${SOURCES})
@@ -69,12 +70,6 @@ target_include_directories(glslangValidator PUBLIC
6970
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/../External>
7071
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/External>)
7172

72-
if(ENABLE_OPT)
73-
target_include_directories(glslangValidator
74-
PRIVATE ${spirv-tools_SOURCE_DIR}/include
75-
)
76-
endif(ENABLE_OPT)
77-
7873
if(ENABLE_SPVREMAPPER)
7974
set(REMAPPER_SOURCES spirv-remap.cpp)
8075
add_executable(spirv-remap ${REMAPPER_SOURCES})

gtests/CMakeLists.txt

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -83,12 +83,6 @@ if(BUILD_TESTING)
8383
${gmock_SOURCE_DIR}/include
8484
${gtest_SOURCE_DIR}/include)
8585

86-
if(ENABLE_OPT)
87-
target_include_directories(glslangtests
88-
PRIVATE ${spirv-tools_SOURCE_DIR}/include
89-
)
90-
endif(ENABLE_OPT)
91-
9286
set(LIBRARIES
9387
glslang OSDependent OGLCompiler glslang
9488
SPIRV glslang-default-resource-limits)

0 commit comments

Comments
 (0)