HLSL: Emit the OpSource HLSL instruction for HLSL, using new headers.

This commit is contained in:
John Kessenich
2017-04-07 15:33:08 -06:00
parent 7962bda334
commit 6fa17641b5
214 changed files with 611 additions and 433 deletions

View File

@@ -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.1981"
#define GLSLANG_DATE "06-Apr-2017"
#define GLSLANG_REVISION "Overload400-PrecQual.1985"
#define GLSLANG_DATE "07-Apr-2017"

View File

@@ -920,7 +920,7 @@ bool TIntermediate::canImplicitlyPromote(TBasicType from, TBasicType to, TOperat
case EbtUint:
switch (from) {
case EbtInt:
return version >= 400;
return version >= 400 || (source == EShSourceHlsl);
case EbtUint:
return true;
case EbtBool:

View File

@@ -175,7 +175,7 @@ bool TInputScanner::scanVersion(int& version, EProfile& profile, bool& notFirstT
bool versionNotFirst = false; // means not first WRT comments and white space, nothing more
notFirstToken = false; // means not first WRT to real tokens
version = 0; // means not found
version = 0; // means not found
profile = ENoProfile;
bool foundNonSpaceTab = false;

View File

@@ -442,7 +442,7 @@ bool DeduceVersionProfile(TInfoSink& infoSink, EShLanguage stage, bool versionNo
bool correct = true;
if (source == EShSourceHlsl) {
version = 450; // TODO: GLSL parser is still used for builtins.
version = 500; // shader model; currently a characteristic of glslang, not the input
profile = ECoreProfile; // allow doubles in prototype parsing
return correct;
}
@@ -679,13 +679,13 @@ bool ProcessDeferred(
// First, without using the preprocessor or parser, find the #version, so we know what
// symbol tables, processing rules, etc. to set up. This does not need the extra strings
// outlined above, just the user shader.
int version;
EProfile profile;
glslang::TInputScanner userInput(numStrings, &strings[numPre], &lengths[numPre]); // no preamble
bool versionNotFirstToken;
bool versionNotFirst = userInput.scanVersion(version, profile, versionNotFirstToken);
int version = 0;
EProfile profile = ENoProfile;
bool versionNotFirstToken = false;
bool versionNotFirst = (messages & EShMsgReadHlsl) ? true : userInput.scanVersion(version, profile, versionNotFirstToken);
bool versionNotFound = version == 0;
if (forceDefaultVersionAndProfile) {
if (forceDefaultVersionAndProfile && (messages & EShMsgReadHlsl) == 0) {
if (! (messages & EShMsgSuppressWarnings) && ! versionNotFound &&
(version != defaultVersion || profile != defaultProfile)) {
compiler->infoSink.info << "Warning, (version, profile) forced to be ("