includer.pushExternalLocalDirectory(dir); });
if (Options & EOptionOutputPreprocessed) {
std::string str;
- if (shader->preprocess(&Resources, defaultVersion, ENoProfile, false, false,
- messages, &str, includer)) {
+ if (shader->preprocess(&Resources, defaultVersion, ENoProfile, false, false, messages, &str, includer)) {
PutsIfNonEmpty(str.c_str());
} else {
CompileFailed = true;
StderrIfNonEmpty(shader->getInfoDebugLog());
continue;
}
+
if (! shader->parse(&Resources, defaultVersion, false, messages, includer))
CompileFailed = true;
ProcessConfigFile();
+ if ((Options & EOptionReadHlsl) && !((Options & EOptionOutputPreprocessed) || (Options & EOptionSpv)))
+ Error("ERROR: HLSL requires SPIR-V code generation (or preprocessing only)");
+
//
// Two modes:
// 1) linking all arguments together, single-threaded, new C++ interface
// 2) independent arguments, can be tackled by multiple asynchronous threads, for testing thread safety, using the old handle interface
//
- if (Options & EOptionLinkProgram ||
- Options & EOptionOutputPreprocessed) {
+ if (Options & (EOptionLinkProgram | EOptionOutputPreprocessed)) {
glslang::InitializeProcess();
glslang::InitializeProcess(); // also test reference counting of users
glslang::InitializeProcess(); // also test reference counting of users
#
# Testing hlsl_functionality1
#
+echo "Testing hlsl_functionality1"
$EXE -H -e main -D -Od -fhlsl_functionality1 hlsl.structbuffer.incdec.frag > \
$TARGETDIR/hlsl.structbuffer.incdec.frag.hlslfun1.out
diff -b $BASEDIR/hlsl.structbuffer.incdec.frag.hlslfun1.out $TARGETDIR/hlsl.structbuffer.incdec.frag.hlslfun1.out || HASERROR=1
#
# Testing HLSL-specific PP feature expansion
#
+echo "Testing HLSL-specific PP feature expansion"
$EXE -D -E hlsl.pp.expand.frag > $TARGETDIR/hlsl.pp.expand.frag.out 2> $TARGETDIR/hlsl.pp.expand.frag.err
diff -b $BASEDIR/hlsl.pp.expand.frag.out $TARGETDIR/hlsl.pp.expand.frag.out || HASERROR=1
diff -b $BASEDIR/hlsl.pp.expand.frag.err $TARGETDIR/hlsl.pp.expand.frag.err || HASERROR=1
if (language == EShLangGeometry)
globalOutputDefaults.layoutStream = 0;
-
- if (spvVersion.spv == 0 || spvVersion.vulkan == 0)
- infoSink.info << "ERROR: HLSL currently only supported when requesting SPIR-V for Vulkan.\n";
}
HlslParseContext::~HlslParseContext()