endif ()
if (EXISTS ${GLSLANG_ABS_PATH}/glslang/GenericCodeGen/CodeGen.cpp)
- message(STATUS "glslang found; building with DEQP_HAVE_GLSLANG")
+ message(STATUS "glslang found")
# Disable glslang install as part of cmake install.
set(SKIP_GLSLANG_INSTALL OFF CACHE BOOL "" FORCE)
set(GLSLANG_INCLUDE_PATH ${GLSLANG_ABS_PATH} PARENT_SCOPE)
set(GLSLANG_LIBRARIES glslang SPIRV SPVRemapper PARENT_SCOPE)
- set(DEQP_HAVE_GLSLANG ON PARENT_SCOPE)
-
else ()
- message(STATUS "glslang not found; GLSL to SPIR-V compilation not available")
-
- set(DEQP_HAVE_GLSLANG OFF PARENT_SCOPE)
-
+ message(FATAL_ERROR "glslang not found")
endif ()
)
# Add glslang
-if (DEQP_HAVE_GLSLANG)
- include_directories(${GLSLANG_INCLUDE_PATH})
- add_definitions(-DDEQP_HAVE_GLSLANG=1)
+include_directories(${GLSLANG_INCLUDE_PATH})
- # \note Code interfacing with glslang needs to include third-party headers
- # that cause all sorts of warnings to appear.
- if (DE_COMPILER_IS_GCC OR DE_COMPILER_IS_CLANG)
- set_source_files_properties(
- FILES glcSpirvUtils.cpp
- PROPERTIES COMPILE_FLAGS "${DE_3RD_PARTY_CXX_FLAGS}")
- endif ()
-
- set(GLCTS_COMMON_LIBS ${GLCTS_COMMON_LIBS} ${GLSLANG_LIBRARIES})
+# \note Code interfacing with glslang needs to include third-party headers
+# that cause all sorts of warnings to appear.
+if (DE_COMPILER_IS_GCC OR DE_COMPILER_IS_CLANG)
+ set_source_files_properties(
+ FILES glcSpirvUtils.cpp
+ PROPERTIES COMPILE_FLAGS "${DE_3RD_PARTY_CXX_FLAGS}")
endif ()
+set(GLCTS_COMMON_LIBS ${GLCTS_COMMON_LIBS} ${GLSLANG_LIBRARIES})
+
# Add spirv-tools
-if(DEQP_HAVE_SPIRV_TOOLS)
- include_directories(${spirv-tools_SOURCE_DIR}/include)
- include_directories(${spirv-tools_SOURCE_DIR}/external/include)
+include_directories(${spirv-tools_SOURCE_DIR}/include)
+include_directories(${spirv-tools_SOURCE_DIR}/external/include)
- add_definitions(-DDEQP_HAVE_SPIRV_TOOLS=1)
- set(GLCTS_COMMON_LIBS ${GLCTS_COMMON_LIBS} SPIRV-Tools)
-endif()
+set(GLCTS_COMMON_LIBS ${GLCTS_COMMON_LIBS} SPIRV-Tools)
PCH(GLCTS_COMMON_SRCS ../pch.cpp)
#include "gluContextInfo.hpp"
#include "tcuTestLog.hpp"
-#if defined DEQP_HAVE_GLSLANG
#include "SPIRV/GlslangToSpv.h"
#include "SPIRV/disassemble.h"
#include "SPIRV/doc.h"
#include "glslang/MachineIndependent/localintermediate.h"
#include "glslang/Public/ShaderLang.h"
-#endif // DEQP_HAVE_GLSLANG
-#if defined DEQP_HAVE_SPIRV_TOOLS
#include "spirv-tools/libspirv.hpp"
#include "spirv-tools/optimizer.hpp"
-#endif // DEQP_HAVE_SPIRV_TOOLS
using namespace glu;
TCU_THROW(NotSupportedError, "GL 4.6 or GL_ARB_gl_spirv is not supported");
}
-#if defined DEQP_HAVE_GLSLANG
-
EShLanguage getGlslangStage(glu::ShaderType type)
{
static const EShLanguage stageMap[] = {
return false;
}
-#else // DEQP_HAVE_GLSLANG
-
-bool compileGlslToSpirV(tcu::TestLog& log, std::string source, glu::ShaderType type, ShaderBinaryDataType* dst, SpirvVersion version)
-{
- DE_UNREF(log);
- DE_UNREF(source);
- DE_UNREF(type);
- DE_UNREF(dst);
- DE_UNREF(version);
-
- TCU_THROW(InternalError, "Glslang not available.");
-
- return false;
-}
-
-#endif // DEQP_HAVE_GLSLANG
-
-#if defined DEQP_HAVE_SPIRV_TOOLS
-
void consumer(spv_message_level_t, const char*, const spv_position_t&, const char* m)
{
std::cerr << "error: " << m << std::endl;
return true;
}
-#else //DEQP_HAVE_SPIRV_TOOLS
-
-void spirvAssemble(ShaderBinaryDataType& dst, const std::string& src)
-{
- DE_UNREF(dst);
- DE_UNREF(src);
-
- TCU_THROW(InternalError, "Spirv-tools not available.");
-}
-
-void spirvDisassemble(std::string& dst, ShaderBinaryDataType& src)
-{
- DE_UNREF(dst);
- DE_UNREF(src);
-
- TCU_THROW(InternalError, "Spirv-tools not available.");
-}
-
-bool spirvValidate(ShaderBinaryDataType& dst, bool throwOnError)
-{
- DE_UNREF(dst);
- DE_UNREF(throwOnError);
-
- TCU_THROW(InternalError, "Spirv-tools not available.");
-}
-
-#endif // DEQP_HAVE_SPIRV_TOOLS
-
ShaderBinary makeSpirV(tcu::TestLog& log, ShaderSource source, SpirvVersion version)
{
ShaderBinary binary;
} // namespace spirvUtils
-} // namespace glc
\ No newline at end of file
+} // namespace glc
tcutil
)
-if (DEQP_HAVE_GLSLANG)
- add_definitions(-DDEQP_HAVE_GLSLANG=1)
-endif ()
-
-if(DEQP_HAVE_SPIRV_TOOLS)
- add_definitions(-DDEQP_HAVE_SPIRV_TOOLS=1)
-endif()
-
if (DEQP_GTF_AVAILABLE)
list(APPEND GLCTS_GL_LIBS glcts-gtf)
endif ()
}
else if (it == ITERATE_SPIRV)
{
-#if defined DEQP_HAVE_GLSLANG
ProgramBinaries binaries;
binaries << spirvUtils::makeSpirV(m_context.getTestContext().getLog(), VertexSource(m_vertex));
binaries << spirvUtils::makeSpirV(m_context.getTestContext().getLog(),
binaries << spirvUtils::makeSpirV(m_context.getTestContext().getLog(), GeometrySource(m_geometry));
binaries << spirvUtils::makeSpirV(m_context.getTestContext().getLog(), FragmentSource(m_fragment));
program = new ShaderProgram(gl, binaries);
-#else // DEQP_HAVE_GLSLANG
- tcu::Archive& archive = m_testCtx.getArchive();
- ProgramBinaries binaries;
- binaries << commonUtils::readSpirV(archive.getResource("spirv/modules_positive/vertex.nspv"));
- binaries << commonUtils::readSpirV(archive.getResource("spirv/modules_positive/tess_control.nspv"));
- binaries << commonUtils::readSpirV(archive.getResource("spirv/modules_positive/tess_evaluation.nspv"));
- binaries << commonUtils::readSpirV(archive.getResource("spirv/modules_positive/geometry.nspv"));
- binaries << commonUtils::readSpirV(archive.getResource("spirv/modules_positive/fragment.nspv"));
- program = new ShaderProgram(gl, binaries);
-#endif // DEQP_HAVE_GLSLANG
}
if (!program->isOk())
gl.bufferData(GL_ARRAY_BUFFER, 9 * sizeof(GLfloat), (GLvoid*)vertices, GL_DYNAMIC_DRAW);
GLU_EXPECT_NO_ERROR(gl.getError(), "glBufferData");
-#if defined DEQP_HAVE_SPIRV_TOOLS
ShaderBinary binary;
binary << SHADERTYPE_VERTEX << "mainv";
binary << SHADERTYPE_FRAGMENT << "mainf";
spirvUtils::spirvAssemble(binary.binary, m_spirv);
spirvUtils::spirvValidate(binary.binary, true);
-#else // DEQP_HAVE_SPIRV_TOOLS
- tcu::Archive& archive = m_testCtx.getArchive();
- ShaderBinary binary = commonUtils::readSpirV(
- archive.getResource("spirv/spirv_modules_shader_binary_multiple_shader_objects/binary.nspv"));
-#endif // DEQP_HAVE_SPIRV_TOOLS
ProgramBinaries binaries;
binaries << binary;
ProgramBinaries binaries;
ShaderBinary vertexBinary;
-#if defined DEQP_HAVE_GLSLANG && DEQP_HAVE_SPIRV_TOOLS
{
vertexBinary = spirvUtils::makeSpirV(m_context.getTestContext().getLog(), VertexSource(m_vertex));
spirvUtils::spirvAssemble(vertexBinary.binary, input);
spirvUtils::spirvValidate(vertexBinary.binary, true);
}
-#else // DEQP_HAVE_GLSLANG && DEQP_HAVE_SPIRV_TOOLS
- tcu::Archive& archive = m_testCtx.getArchive();
- vertexBinary = commonUtils::readSpirV(archive.getResource("spirv/modules_state_queries/vertex.nspv"));
-#endif // DEQP_HAVE_GLSLANG && DEQP_HAVE_SPIRV_TOOLS
binaries << vertexBinary;
ShaderProgram program(gl, binaries);
ShaderBinary vertexBinary;
-#if defined DEQP_HAVE_GLSLANG
vertexBinary = spirvUtils::makeSpirV(m_context.getTestContext().getLog(), VertexSource(m_vertex));
-#else // DEQP_HAVE_GLSLANG
- tcu::Archive& archive = m_testCtx.getArchive();
- vertexBinary = commonUtils::readSpirV(archive.getResource("spirv/modules_error_verification/vertex.nspv"));
-#endif // DEQP_HAVE_GLSLANG
gl.shaderSource(m_glslShaderId, 1, &shaderSrc, &shaderLen);
GLU_EXPECT_NO_ERROR(gl.getError(), "shaderSource");
tcu::TestNode::IterateResult SpirvGlslToSpirVEnableTest::iterate()
{
-#if defined DEQP_HAVE_GLSLANG && DEQP_HAVE_SPIRV_TOOLS
{
const Functions& gl = m_context.getRenderContext().getFunctions();
m_testCtx.setTestResult(QP_TEST_RESULT_PASS, "Pass");
}
-#else // DEQP_HAVE_GLSLANG && DEQP_HAVE_SPIRV_TOOLS
-
- TCU_THROW(InternalError, "Either glslang or spirv-tools not available.");
-
-#endif // DEQP_HAVE_GLSLANG && DEQP_HAVE_SPIRV_TOOLS
return STOP;
}
sources << vertexSource;
ShaderBinary vertexBinary;
-#if defined DEQP_HAVE_GLSLANG
vertexBinary = spirvUtils::makeSpirV(m_context.getTestContext().getLog(), vertexSource);
-#else // DEQP_HAVE_GLSLANG
- tcu::Archive& archive = m_testCtx.getArchive();
- vertexBinary =
- commonUtils::readSpirV(archive.getResource("spirv/glsl_to_spirv_builtin_functions/common_vertex.nspv"));
-#endif //DEQP_HAVE_GLSLANG
binaries << vertexBinary;
}
ShaderBinary shaderBinary;
std::string spirvSource;
-#if defined DEQP_HAVE_GLSLANG
shaderBinary = spirvUtils::makeSpirV(m_context.getTestContext().getLog(), shaderSource);
-#else // DEQP_HAVE_GLSLANG
- {
- std::stringstream ss;
- ss << "spirv/glsl_to_spirv_builtin_functions/binary_" << i << ".nspv";
- tcu::Archive& archive = m_testCtx.getArchive();
- shaderBinary = commonUtils::readSpirV(archive.getResource(ss.str().c_str()));
- }
-#endif // DEQP_HAVE_GLSLANG
-
-#if defined DEQP_HAVE_SPIRV_TOOLS
{
spirvUtils::spirvDisassemble(spirvSource, shaderBinary.binary);
TCU_THROW(InternalError, "Mappings for shader failed.");
}
}
-#else // DEQP_HAVE_SPIRV_TOOLS
- spirvSource = "Could not disassemble Spir-V module. SPIRV-TOOLS not available.";
-#endif // DEQP_HAVE_SPIRV_TOOLS
binaries << shaderBinary;
sources << tessEvalSource;
ShaderBinary tessEvalBinary;
-#if defined DEQP_HAVE_GLSLANG
tessEvalBinary = spirvUtils::makeSpirV(m_context.getTestContext().getLog(), tessEvalSource);
-#else // DEQP_HAVE_GLSLANG
- tcu::Archive& archive = m_testCtx.getArchive();
- tessEvalBinary = commonUtils::readSpirV(
- archive.getResource("spirv/glsl_to_spirv_builtin_functions/common_tesseval.nspv"));
-#endif // DEQP_HAVE_GLSLANG
binaries << tessEvalBinary;
}
ShaderBinary vertexBinary;
ShaderBinary fragmentBinary;
-#if defined DEQP_HAVE_GLSLANG
{
vertexBinary = spirvUtils::makeSpirV(m_context.getTestContext().getLog(), VertexSource(m_vertex));
fragmentBinary = spirvUtils::makeSpirV(m_context.getTestContext().getLog(), FragmentSource(m_fragment));
}
-#else // DEQP_HAVE_GLSLANG
- {
- tcu::Archive& archive = m_testCtx.getArchive();
- vertexBinary =
- commonUtils::readSpirV(archive.getResource("spirv/glsl_to_spirv_specialization_constants/vertex.nspv"));
- fragmentBinary =
- commonUtils::readSpirV(archive.getResource("spirv/glsl_to_spirv_specialization_constants/fragment.nspv"));
- }
-#endif // DEQP_HAVE_GLSLANG
fragmentBinary << SpecializationData(10, 128);
ProgramBinaries binaries;
{
std::vector<ShaderBinary> binariesVec;
-#if defined DEQP_HAVE_GLSLANG
ProgramBinaries binaries;
for (int s = 0; s < (signed)m_validations[v].shaders.size(); ++s)
{
binariesVec.push_back(shaderBinary);
binaries << shaderBinary;
}
-#else // DEQP_HAVE_GLSLANG
- tcu::Archive& archive = m_testCtx.getArchive();
- ProgramBinaries binaries;
- for (int s = 0; s < (signed)m_validations[v].shaders.size(); ++s)
- {
- std::stringstream ss;
- ss << "spirv/spirv_validation_builtin_variable_decorations/shader_" << v << "_" << s << ".nspv";
-
- ShaderBinary shaderBinary = commonUtils::readSpirV(archive.getResource(ss.str().c_str()));
- binariesVec.push_back(shaderBinary);
- binaries << shaderBinary;
- }
-#endif // DEQP_HAVE_GLSLANG
program = new ShaderProgram(gl, binaries);
-#if defined DEQP_HAVE_SPIRV_TOOLS
std::string spirvSource;
for (int s = 0; s < (signed)m_validations[v].shaders.size(); ++s)
TCU_THROW(InternalError, "Mappings for shader failed.");
}
}
-#endif // DEQP_HAVE_SPIRV_TOOLS
}
if (!program->isOk())
for (int s = 0; s < (signed)pipeline.size(); ++s)
{
ShaderStage& stage = pipeline[s];
-#if defined DEQP_HAVE_GLSLANG
stage.binary = spirvUtils::makeSpirV(m_context.getTestContext().getLog(), stage.source);
std::stringstream ssw;
if (stage.name.empty())
else
ssw << "gl_cts/data/spirv/spirv_validation_capabilities/" << stage.name << ".nspv";
commonUtils::writeSpirV(ssw.str().c_str(), stage.binary);
-#else // DEQP_HAVE_GLSLANG
- tcu::Archive& archive = m_testCtx.getArchive();
- std::stringstream ss;
- if (stage.name.empty())
- ss << "spirv/spirv_validation_capabilities/binary_p" << p << "s" << s << ".nspv";
- else
- ss << "spirv/spirv_validation_capabilities/" << stage.name << ".nspv";
- stage.binary = commonUtils::readSpirV(archive.getResource(ss.str().c_str()));
-#endif // DEQP_HAVE_GLSLANG
programBinaries << stage.binary;
}
return STOP;
}
-#if defined DEQP_HAVE_SPIRV_TOOLS
for (int s = 0; s < (signed)pipeline.size(); ++s)
{
ShaderStage stage = pipeline[s];
}
}
}
-#endif // DEQP_HAVE_SPIRV_TOOLS
}
m_testCtx.setTestResult(QP_TEST_RESULT_PASS, "Pass");
if (EXISTS ${SPIRV_TOOLS_ABS_PATH}/source/opcode.cpp AND
EXISTS ${SPIRV_HEADERS_ABS_PATH}/include/spirv/1.0/spirv.h)
- message(STATUS "spirv-tools found; building with DEQP_HAVE_SPIRV_TOOLS")
+ message(STATUS "spirv-tools found")
set(CMAKE_C_FLAGS ${DE_3RD_PARTY_C_FLAGS})
set(CMAKE_CXX_FLAGS ${DE_3RD_PARTY_CXX_FLAGS})
# SPIR-V tools requires SPIRV-Headers
set(SPIRV-Headers_SOURCE_DIR ${SPIRV_HEADERS_ABS_PATH})
- set(DEQP_HAVE_SPIRV_TOOLS ON PARENT_SCOPE)
set(SPIRV_SKIP_EXECUTABLES ON CACHE BOOL "" FORCE)
add_subdirectory(${SPIRV_TOOLS_ABS_PATH} spirv-tools)
else ()
- message(STATUS "spirv-tools not found; SPIR-V assembly not available")
- set(DEQP_HAVE_SPIRV_TOOLS OFF PARENT_SCOPE)
+ message(FATAL_ERROR "spirv-tools not found")
endif ()
python <vulkancts>/external/vulkancts/scripts/build_mustpass.py
-Pre-compiling SPIR-V binaries
------------------------------
-
-For distribution, and platforms that don't support GLSL to SPIR-V compilation,
-SPIR-V binaries can be pre-built with following command:
-
- python external/vulkancts/scripts/build_spirv_binaries.py
-
-By default the script builds SPIR-V binaries for Vulkan 1.1.
-Binaries for other Vulkan versions can be requested by supplying
-an extra command line option:
-
- python external/vulkancts/scripts/build_spirv_binaries.py --target-vulkan-version <Vulkan version>
-
-Binaries will be written to `external/vulkancts/data/vulkan/prebuilt/`.
-
-Test modules (or in case of Android, the APK) must be re-built after building
-SPIR-V programs in order for the binaries to be available.
-
-
Running CTS
-----------
vkutilnoshader
)
-if (DEQP_HAVE_GLSLANG)
- include_directories(${GLSLANG_INCLUDE_PATH})
- add_definitions(-DDEQP_HAVE_GLSLANG=1)
+include_directories(${GLSLANG_INCLUDE_PATH})
- # \note Code interfacing with glslang needs to include third-party headers
- # that cause all sorts of warnings to appear.
- if (DE_COMPILER_IS_GCC OR DE_COMPILER_IS_CLANG)
- set_source_files_properties(
- FILES vkShaderToSpirV.cpp
- PROPERTIES COMPILE_FLAGS "${DE_3RD_PARTY_CXX_FLAGS}")
- endif ()
-
- set(VKUTIL_LIBS ${VKUTIL_LIBS} ${GLSLANG_LIBRARIES})
+# \note Code interfacing with glslang needs to include third-party headers
+# that cause all sorts of warnings to appear.
+if (DE_COMPILER_IS_GCC OR DE_COMPILER_IS_CLANG)
+ set_source_files_properties(
+ FILES vkShaderToSpirV.cpp
+ PROPERTIES COMPILE_FLAGS "${DE_3RD_PARTY_CXX_FLAGS}")
endif ()
-if(DEQP_HAVE_SPIRV_TOOLS)
- include_directories(${spirv-tools_SOURCE_DIR}/include)
- include_directories(${spirv-tools_SOURCE_DIR}/external/include)
+set(VKUTIL_LIBS ${VKUTIL_LIBS} ${GLSLANG_LIBRARIES})
+
+include_directories(${spirv-tools_SOURCE_DIR}/include)
+include_directories(${spirv-tools_SOURCE_DIR}/external/include)
- # \note Code interfacing with spirv-opt needs to include third-party headers
- # that cause all sorts of warnings to appear.
- if (DE_COMPILER_IS_GCC OR DE_COMPILER_IS_CLANG)
- set_source_files_properties(
- FILES vkPrograms.cpp
- PROPERTIES COMPILE_FLAGS "${DE_3RD_PARTY_CXX_FLAGS}")
- endif ()
+# \note Code interfacing with spirv-opt needs to include third-party headers
+# that cause all sorts of warnings to appear.
+if (DE_COMPILER_IS_GCC OR DE_COMPILER_IS_CLANG)
+ set_source_files_properties(
+ FILES vkPrograms.cpp
+ PROPERTIES COMPILE_FLAGS "${DE_3RD_PARTY_CXX_FLAGS}")
+endif ()
- add_definitions(-DDEQP_HAVE_SPIRV_TOOLS=1)
- set(VKUTIL_LIBS ${VKUTIL_LIBS} SPIRV-Tools SPIRV-Tools-opt)
-endif()
+set(VKUTIL_LIBS ${VKUTIL_LIBS} SPIRV-Tools SPIRV-Tools-opt)
PCH(VKUTILNOSHADER_SRCS ../../modules/vulkan/pch.cpp)
PCH(VKUTIL_SRCS ../../modules/vulkan/pch.cpp)
* \brief Program utilities.
*//*--------------------------------------------------------------------*/
-#if defined(DEQP_HAVE_SPIRV_TOOLS)
#include "spirv-tools/optimizer.hpp"
-#endif
#include "qpInfo.h"
using std::vector;
using std::map;
-#if defined(DE_DEBUG) && defined(DEQP_HAVE_SPIRV_TOOLS)
+#if defined(DE_DEBUG)
# define VALIDATE_BINARIES true
#else
# define VALIDATE_BINARIES false
return true;
}
-#if defined(DEQP_HAVE_SPIRV_TOOLS)
-
void optimizeCompiledBinary (vector<deUint32>& binary, int optimizationRecipe, const SpirvVersion spirvVersion)
{
spv_target_env targetEnv = SPV_ENV_VULKAN_1_0;
TCU_THROW(InternalError, "SPIR-V endianness translation not supported");
}
-#endif // defined(DEQP_HAVE_SPIRV_TOOLS)
-
} // anonymous
-#if defined(DEQP_HAVE_SPIRV_TOOLS)
-
void validateCompiledBinary(const vector<deUint32>& binary, glu::ShaderProgramInfo* buildInfo, const SpirvValidatorOptions& options)
{
std::ostringstream validationLog;
return res;
}
-#else // !DEQP_HAVE_SPIRV_TOOLS
-
-ProgramBinary* buildProgram (const GlslSource&, glu::ShaderProgramInfo*, const tcu::CommandLine&)
-{
- TCU_THROW(NotSupportedError, "GLSL to SPIR-V compilation not supported (DEQP_HAVE_GLSLANG not defined)");
-}
-
-ProgramBinary* buildProgram (const HlslSource&, glu::ShaderProgramInfo*, const tcu::CommandLine&)
-{
- TCU_THROW(NotSupportedError, "HLSL to SPIR-V compilation not supported (DEQP_HAVE_GLSLANG not defined)");
-}
-
-ProgramBinary* assembleProgram (const SpirVAsmSource&, SpirVProgramInfo*, const tcu::CommandLine&)
-{
- TCU_THROW(NotSupportedError, "SPIR-V assembly not supported (DEQP_HAVE_SPIRV_TOOLS not defined)");
-}
-#endif
-
void disassembleProgram (const ProgramBinary& program, std::ostream* dst)
{
if (program.getFormat() == PROGRAM_FORMAT_SPIRV)
#include "deClock.h"
#include "qpDebugOut.h"
-#if defined(DEQP_HAVE_GLSLANG)
-# include "SPIRV/GlslangToSpv.h"
-# include "SPIRV/disassemble.h"
-# include "SPIRV/SPVRemapper.h"
-# include "SPIRV/doc.h"
-# include "glslang/Include/InfoSink.h"
-# include "glslang/Include/ShHandle.h"
-# include "glslang/MachineIndependent/localintermediate.h"
-# include "glslang/Public/ShaderLang.h"
-#endif
+#include "SPIRV/GlslangToSpv.h"
+#include "SPIRV/disassemble.h"
+#include "SPIRV/SPVRemapper.h"
+#include "SPIRV/doc.h"
+#include "glslang/Include/InfoSink.h"
+#include "glslang/Include/ShHandle.h"
+#include "glslang/MachineIndependent/localintermediate.h"
+#include "glslang/Public/ShaderLang.h"
namespace vk
{
using std::string;
using std::vector;
-#if defined(DEQP_HAVE_GLSLANG)
-
namespace
{
remapper.remap(*dst, spv::spirvbin_base_t::STRIP);
}
-#else // defined(DEQP_HAVE_GLSLANG)
-
-bool compileGlslToSpirV (const GlslSource&, std::vector<deUint32>*, glu::ShaderProgramInfo*)
-{
- TCU_THROW(NotSupportedError, "GLSL to SPIR-V compilation not supported (DEQP_HAVE_GLSLANG not defined)");
-}
-
-bool compileHlslToSpirV (const HlslSource&, std::vector<deUint32>*, glu::ShaderProgramInfo*)
-{
- TCU_THROW(NotSupportedError, "HLSL to SPIR-V compilation not supported (DEQP_HAVE_GLSLANG not defined)");
-}
-
-void stripSpirVDebugInfo (const size_t, const deUint32*, std::vector<deUint32>*)
-{
- TCU_THROW(NotSupportedError, "SPIR-V stripping not supported (DEQP_HAVE_GLSLANG not defined)");
-}
-
-#endif // defined(DEQP_HAVE_GLSLANG)
-
} // vk
#include <algorithm>
-#if defined(DEQP_HAVE_SPIRV_TOOLS)
-# include "spirv-tools/libspirv.h"
-#endif
+#include "spirv-tools/libspirv.h"
namespace vk
{
using std::string;
using std::vector;
-#if defined(DEQP_HAVE_SPIRV_TOOLS)
-
// Returns the SPIRV-Tools target environment enum for the given dEQP Spirv validator options object.
// Do this here instead of as a method on SpirvValidatorOptions because only this file has access to
// the SPIRV-Tools headers.
}
}
-#else // defined(DEQP_HAVE_SPIRV_TOOLS)
-
-bool assembleSpirV (const SpirVAsmSource*, std::vector<deUint32>*, SpirVProgramInfo*, SpirvVersion)
-{
- TCU_THROW(NotSupportedError, "SPIR-V assembly not supported (DEQP_HAVE_SPIRV_TOOLS not defined)");
-}
-
-void disassembleSpirV (size_t, const deUint32*, std::ostream*, SpirvVersion)
-{
- TCU_THROW(NotSupportedError, "SPIR-V disassembling not supported (DEQP_HAVE_SPIRV_TOOLS not defined)");
-}
-
-bool validateSpirV (size_t, const deUint32*, std::ostream*, const SpirvValidatorOptions&)
-{
- TCU_THROW(NotSupportedError, "SPIR-V validation not supported (DEQP_HAVE_SPIRV_TOOLS not defined)");
-}
-
-#endif
-
} // vk