diff options
author | John Kessenich <cepheus@frii.com> | 2016-11-26 13:45:18 -0700 |
---|---|---|
committer | John Kessenich <cepheus@frii.com> | 2016-11-26 13:45:18 -0700 |
commit | e50dc536ff76310bd24fa222397cca9d0b6acacf (patch) | |
tree | 0f26741558c551dba51662ba07bd1e5f1b297862 | |
parent | 517fe7a6ad7c61c6890fa7d1bec15e6ebe5509c2 (diff) | |
download | glslang-e50dc536ff76310bd24fa222397cca9d0b6acacf.tar.gz |
Warn on HLSL not finding entry point. Issue #588.
-rw-r--r-- | Test/baseResults/hlsl.array.implicit-size.frag.out | 1 | ||||
-rwxr-xr-x | Test/baseResults/hlsl.float1.frag.out | 1 | ||||
-rwxr-xr-x | Test/baseResults/hlsl.float4.frag.out | 1 | ||||
-rw-r--r-- | Test/baseResults/hlsl.intrinsics.vert.out | 1 | ||||
-rwxr-xr-x | Test/baseResults/hlsl.layout.frag.out | 1 | ||||
-rwxr-xr-x | Test/baseResults/hlsl.matType.frag.out | 1 | ||||
-rwxr-xr-x | Test/baseResults/hlsl.shapeConv.frag.out | 1 | ||||
-rwxr-xr-x | Test/baseResults/hlsl.swizzle.frag.out | 1 | ||||
-rwxr-xr-x | Test/baseResults/hlsl.typedef.frag.out | 1 | ||||
-rw-r--r-- | glslang/Include/revision.h | 2 | ||||
-rw-r--r-- | glslang/MachineIndependent/linkValidate.cpp | 15 | ||||
-rw-r--r-- | glslang/MachineIndependent/localintermediate.h | 1 |
12 files changed, 24 insertions, 3 deletions
diff --git a/Test/baseResults/hlsl.array.implicit-size.frag.out b/Test/baseResults/hlsl.array.implicit-size.frag.out index ffa1c3ee..5674cb47 100644 --- a/Test/baseResults/hlsl.array.implicit-size.frag.out +++ b/Test/baseResults/hlsl.array.implicit-size.frag.out @@ -81,6 +81,7 @@ gl_FragCoord origin is upper left Linked fragment stage: +WARNING: Linking fragment stage: Entry point not found Shader version: 450 gl_FragCoord origin is upper left diff --git a/Test/baseResults/hlsl.float1.frag.out b/Test/baseResults/hlsl.float1.frag.out index a2e3cefb..641febd7 100755 --- a/Test/baseResults/hlsl.float1.frag.out +++ b/Test/baseResults/hlsl.float1.frag.out @@ -32,6 +32,7 @@ gl_FragCoord origin is upper left Linked fragment stage: +WARNING: Linking fragment stage: Entry point not found Shader version: 450 gl_FragCoord origin is upper left diff --git a/Test/baseResults/hlsl.float4.frag.out b/Test/baseResults/hlsl.float4.frag.out index 600b4a10..27c9a5c6 100755 --- a/Test/baseResults/hlsl.float4.frag.out +++ b/Test/baseResults/hlsl.float4.frag.out @@ -22,6 +22,7 @@ gl_FragCoord origin is upper left Linked fragment stage: +WARNING: Linking fragment stage: Entry point not found Shader version: 450 gl_FragCoord origin is upper left diff --git a/Test/baseResults/hlsl.intrinsics.vert.out b/Test/baseResults/hlsl.intrinsics.vert.out index 255e3334..bcf911bc 100644 --- a/Test/baseResults/hlsl.intrinsics.vert.out +++ b/Test/baseResults/hlsl.intrinsics.vert.out @@ -1396,6 +1396,7 @@ Shader version: 450 Linked vertex stage: +WARNING: Linking vertex stage: Entry point not found Shader version: 450 0:? Sequence diff --git a/Test/baseResults/hlsl.layout.frag.out b/Test/baseResults/hlsl.layout.frag.out index 538a26a1..0c12435a 100755 --- a/Test/baseResults/hlsl.layout.frag.out +++ b/Test/baseResults/hlsl.layout.frag.out @@ -33,6 +33,7 @@ gl_FragCoord origin is upper left Linked fragment stage: +WARNING: Linking fragment stage: Entry point not found Shader version: 450 gl_FragCoord origin is upper left diff --git a/Test/baseResults/hlsl.matType.frag.out b/Test/baseResults/hlsl.matType.frag.out index 468387b0..038ca738 100755 --- a/Test/baseResults/hlsl.matType.frag.out +++ b/Test/baseResults/hlsl.matType.frag.out @@ -15,6 +15,7 @@ gl_FragCoord origin is upper left Linked fragment stage: +WARNING: Linking fragment stage: Entry point not found Shader version: 450 gl_FragCoord origin is upper left diff --git a/Test/baseResults/hlsl.shapeConv.frag.out b/Test/baseResults/hlsl.shapeConv.frag.out index 451bf886..a15caac5 100755 --- a/Test/baseResults/hlsl.shapeConv.frag.out +++ b/Test/baseResults/hlsl.shapeConv.frag.out @@ -115,6 +115,7 @@ gl_FragCoord origin is upper left Linked fragment stage: +WARNING: Linking fragment stage: Entry point not found Shader version: 450 gl_FragCoord origin is upper left diff --git a/Test/baseResults/hlsl.swizzle.frag.out b/Test/baseResults/hlsl.swizzle.frag.out index cf4be74c..54fc662e 100755 --- a/Test/baseResults/hlsl.swizzle.frag.out +++ b/Test/baseResults/hlsl.swizzle.frag.out @@ -38,6 +38,7 @@ gl_FragCoord origin is upper left Linked fragment stage: +WARNING: Linking fragment stage: Entry point not found Shader version: 450 gl_FragCoord origin is upper left diff --git a/Test/baseResults/hlsl.typedef.frag.out b/Test/baseResults/hlsl.typedef.frag.out index 10b3413f..565f45fd 100755 --- a/Test/baseResults/hlsl.typedef.frag.out +++ b/Test/baseResults/hlsl.typedef.frag.out @@ -39,6 +39,7 @@ gl_FragCoord origin is upper left Linked fragment stage: +WARNING: Linking fragment stage: Entry point not found Shader version: 450 gl_FragCoord origin is upper left diff --git a/glslang/Include/revision.h b/glslang/Include/revision.h index 77c4eed4..57a322e4 100644 --- a/glslang/Include/revision.h +++ b/glslang/Include/revision.h @@ -2,5 +2,5 @@ // For the version, it uses the latest git tag followed by the number of commits. // For the date, it uses the current date (when then script is run). -#define GLSLANG_REVISION "Overload400-PrecQual.1660" +#define GLSLANG_REVISION "Overload400-PrecQual.1661" #define GLSLANG_DATE "26-Nov-2016" diff --git a/glslang/MachineIndependent/linkValidate.cpp b/glslang/MachineIndependent/linkValidate.cpp index 2e101347..bc473abc 100644 --- a/glslang/MachineIndependent/linkValidate.cpp +++ b/glslang/MachineIndependent/linkValidate.cpp @@ -60,6 +60,13 @@ void TIntermediate::error(TInfoSink& infoSink, const char* message) ++numErrors; } +// Link-time warning. +void TIntermediate::warn(TInfoSink& infoSink, const char* message) +{ + infoSink.info.prefix(EPrefixWarning); + infoSink.info << "Linking " << StageName(language) << " stage: " << message << "\n"; +} + // TODO: 4.4 offset/align: "Two blocks linked together in the same program with the same block // name must have the exact same set of members qualified with offset and their integral-constant // expression values must be the same, or a link-time error results." @@ -370,8 +377,12 @@ void TIntermediate::mergeErrorCheck(TInfoSink& infoSink, const TIntermSymbol& sy // void TIntermediate::finalCheck(TInfoSink& infoSink) { - if (source == EShSourceGlsl && numEntryPoints < 1) - error(infoSink, "Missing entry point: Each stage requires one entry point"); + if (numEntryPoints < 1) { + if (source == EShSourceGlsl) + error(infoSink, "Missing entry point: Each stage requires one entry point"); + else + warn(infoSink, "Entry point not found"); + } if (numPushConstants > 1) error(infoSink, "Only one push_constant block is allowed per stage"); diff --git a/glslang/MachineIndependent/localintermediate.h b/glslang/MachineIndependent/localintermediate.h index 6a4cfd08..e8608240 100644 --- a/glslang/MachineIndependent/localintermediate.h +++ b/glslang/MachineIndependent/localintermediate.h @@ -385,6 +385,7 @@ public: protected: TIntermSymbol* addSymbol(int Id, const TString&, const TType&, const TConstUnionArray&, TIntermTyped* subtree, const TSourceLoc&); void error(TInfoSink& infoSink, const char*); + void warn(TInfoSink& infoSink, const char*); void mergeBodies(TInfoSink&, TIntermSequence& globals, const TIntermSequence& unitGlobals); void mergeLinkerObjects(TInfoSink&, TIntermSequence& linkerObjects, const TIntermSequence& unitLinkerObjects); void mergeImplicitArraySizes(TType&, const TType&); |