Merge branch 'amdrexu-feature'
This commit is contained in:
		
						commit
						9c82dd10cf
					
				@ -156,6 +156,7 @@ const char* entryPointName = nullptr;
 | 
				
			|||||||
const char* sourceEntryPointName = nullptr;
 | 
					const char* sourceEntryPointName = nullptr;
 | 
				
			||||||
const char* shaderStageName = nullptr;
 | 
					const char* shaderStageName = nullptr;
 | 
				
			||||||
const char* variableName = nullptr;
 | 
					const char* variableName = nullptr;
 | 
				
			||||||
 | 
					bool HlslEnable16BitTypes = false;
 | 
				
			||||||
std::vector<std::string> IncludeDirectoryList;
 | 
					std::vector<std::string> IncludeDirectoryList;
 | 
				
			||||||
int ClientInputSemanticsVersion = 100;                  // maps to, say, #define VULKAN 100
 | 
					int ClientInputSemanticsVersion = 100;                  // maps to, say, #define VULKAN 100
 | 
				
			||||||
glslang::EshTargetClientVersion VulkanClientVersion =
 | 
					glslang::EshTargetClientVersion VulkanClientVersion =
 | 
				
			||||||
@ -453,6 +454,8 @@ void ProcessArguments(std::vector<std::unique_ptr<glslang::TWorkItem>>& workItem
 | 
				
			|||||||
                               lowerword == "hlsl-iomapper" ||
 | 
					                               lowerword == "hlsl-iomapper" ||
 | 
				
			||||||
                               lowerword == "hlsl-iomapping") {
 | 
					                               lowerword == "hlsl-iomapping") {
 | 
				
			||||||
                        Options |= EOptionHlslIoMapping;
 | 
					                        Options |= EOptionHlslIoMapping;
 | 
				
			||||||
 | 
					                    } else if (lowerword == "hlsl-enable-16bit-types") {
 | 
				
			||||||
 | 
					                        HlslEnable16BitTypes = true;
 | 
				
			||||||
                    } else if (lowerword == "invert-y" ||  // synonyms
 | 
					                    } else if (lowerword == "invert-y" ||  // synonyms
 | 
				
			||||||
                               lowerword == "iy") {
 | 
					                               lowerword == "iy") {
 | 
				
			||||||
                        Options |= EOptionInvertY;
 | 
					                        Options |= EOptionInvertY;
 | 
				
			||||||
@ -520,7 +523,7 @@ void ProcessArguments(std::vector<std::unique_ptr<glslang::TWorkItem>>& workItem
 | 
				
			|||||||
                                setOpenGlSpv();
 | 
					                                setOpenGlSpv();
 | 
				
			||||||
                                OpenGLClientVersion = glslang::EShTargetOpenGL_450;
 | 
					                                OpenGLClientVersion = glslang::EShTargetOpenGL_450;
 | 
				
			||||||
                            } else
 | 
					                            } else
 | 
				
			||||||
                                Error("--target-env expected vulkan1.0 or opengl");
 | 
					                                Error("--target-env expected vulkan1.0, opengl, or hlsl-16bit-types");
 | 
				
			||||||
                        }
 | 
					                        }
 | 
				
			||||||
                        bumpArg();
 | 
					                        bumpArg();
 | 
				
			||||||
                    } else if (lowerword == "variable-name" || // synonyms
 | 
					                    } else if (lowerword == "variable-name" || // synonyms
 | 
				
			||||||
@ -708,6 +711,8 @@ void SetMessageOptions(EShMessages& messages)
 | 
				
			|||||||
        messages = (EShMessages)(messages | EShMsgHlslOffsets);
 | 
					        messages = (EShMessages)(messages | EShMsgHlslOffsets);
 | 
				
			||||||
    if (Options & EOptionDebug)
 | 
					    if (Options & EOptionDebug)
 | 
				
			||||||
        messages = (EShMessages)(messages | EShMsgDebugInfo);
 | 
					        messages = (EShMessages)(messages | EShMsgDebugInfo);
 | 
				
			||||||
 | 
					    if (HlslEnable16BitTypes)
 | 
				
			||||||
 | 
					        messages = (EShMessages)(messages | EShMsgHlslEnable16BitTypes);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
//
 | 
					//
 | 
				
			||||||
@ -1341,6 +1346,7 @@ void usage()
 | 
				
			|||||||
           "  --hlsl-offsets                       Allow block offsets to follow HLSL rules\n"
 | 
					           "  --hlsl-offsets                       Allow block offsets to follow HLSL rules\n"
 | 
				
			||||||
           "                                       Works independently of source language\n"
 | 
					           "                                       Works independently of source language\n"
 | 
				
			||||||
           "  --hlsl-iomap                         Perform IO mapping in HLSL register space\n"
 | 
					           "  --hlsl-iomap                         Perform IO mapping in HLSL register space\n"
 | 
				
			||||||
 | 
					           "  --hlsl-enable-16bit-types            Allow use of 16-bit types in SPIR-V for HLSL\n"
 | 
				
			||||||
           "  --invert-y | --iy                    invert position.Y output in vertex shader\n"
 | 
					           "  --invert-y | --iy                    invert position.Y output in vertex shader\n"
 | 
				
			||||||
           "  --keep-uncalled                      don't eliminate uncalled functions\n"
 | 
					           "  --keep-uncalled                      don't eliminate uncalled functions\n"
 | 
				
			||||||
           "  --ku                                 synonym for --keep-uncalled\n"
 | 
					           "  --ku                                 synonym for --keep-uncalled\n"
 | 
				
			||||||
 | 
				
			|||||||
@ -1,3 +1,3 @@
 | 
				
			|||||||
// This header is generated by the make-revision script.
 | 
					// This header is generated by the make-revision script.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#define GLSLANG_PATCH_LEVEL 2601
 | 
					#define GLSLANG_PATCH_LEVEL 2604
 | 
				
			||||||
 | 
				
			|||||||
@ -119,6 +119,7 @@ public:
 | 
				
			|||||||
    bool relaxedErrors()    const { return (messages & EShMsgRelaxedErrors) != 0; }
 | 
					    bool relaxedErrors()    const { return (messages & EShMsgRelaxedErrors) != 0; }
 | 
				
			||||||
    bool suppressWarnings() const { return (messages & EShMsgSuppressWarnings) != 0; }
 | 
					    bool suppressWarnings() const { return (messages & EShMsgSuppressWarnings) != 0; }
 | 
				
			||||||
    bool isReadingHLSL()    const { return (messages & EShMsgReadHlsl) == EShMsgReadHlsl; }
 | 
					    bool isReadingHLSL()    const { return (messages & EShMsgReadHlsl) == EShMsgReadHlsl; }
 | 
				
			||||||
 | 
					    bool hlslEnable16BitTypes() const { return (messages & EShMsgHlslEnable16BitTypes) != 0; }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    TInfoSink& infoSink;
 | 
					    TInfoSink& infoSink;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
@ -70,7 +70,7 @@
 | 
				
			|||||||
// This should always increase, as some paths to do not consume
 | 
					// This should always increase, as some paths to do not consume
 | 
				
			||||||
// a more major number.
 | 
					// a more major number.
 | 
				
			||||||
// It should increment by one when new functionality is added.
 | 
					// It should increment by one when new functionality is added.
 | 
				
			||||||
#define GLSLANG_MINOR_VERSION 2
 | 
					#define GLSLANG_MINOR_VERSION 3
 | 
				
			||||||
 | 
					
 | 
				
			||||||
//
 | 
					//
 | 
				
			||||||
// Call before doing any other compiler/linker operations.
 | 
					// Call before doing any other compiler/linker operations.
 | 
				
			||||||
@ -211,6 +211,7 @@ enum EShMessages {
 | 
				
			|||||||
    EShMsgKeepUncalled     = (1 << 8),  // for testing, don't eliminate uncalled functions
 | 
					    EShMsgKeepUncalled     = (1 << 8),  // for testing, don't eliminate uncalled functions
 | 
				
			||||||
    EShMsgHlslOffsets      = (1 << 9),  // allow block offsets to follow HLSL rules instead of GLSL rules
 | 
					    EShMsgHlslOffsets      = (1 << 9),  // allow block offsets to follow HLSL rules instead of GLSL rules
 | 
				
			||||||
    EShMsgDebugInfo        = (1 << 10), // save debug information
 | 
					    EShMsgDebugInfo        = (1 << 10), // save debug information
 | 
				
			||||||
 | 
					    EShMsgHlslEnable16BitTypes  = (1 << 11), // enable use of 16-bit types in SPIR-V for HLSL
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
//
 | 
					//
 | 
				
			||||||
 | 
				
			|||||||
@ -1379,12 +1379,23 @@ bool HlslGrammar::acceptType(TType& type, TIntermNode*& nodeList)
 | 
				
			|||||||
{
 | 
					{
 | 
				
			||||||
    // Basic types for min* types, broken out here in case of future
 | 
					    // Basic types for min* types, broken out here in case of future
 | 
				
			||||||
    // changes, e.g, to use native halfs.
 | 
					    // changes, e.g, to use native halfs.
 | 
				
			||||||
 | 
					#ifdef AMD_EXTENSIONS
 | 
				
			||||||
 | 
					    bool enable16BitTypes = parseContext.hlslEnable16BitTypes();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    const TBasicType min16float_bt = enable16BitTypes ? EbtFloat16 : EbtFloat;
 | 
				
			||||||
 | 
					    const TBasicType min10float_bt = enable16BitTypes ? EbtFloat16 : EbtFloat;
 | 
				
			||||||
 | 
					    const TBasicType half_bt       = enable16BitTypes ? EbtFloat16 : EbtFloat;
 | 
				
			||||||
 | 
					    const TBasicType min16int_bt   = enable16BitTypes ? EbtInt16   : EbtInt;
 | 
				
			||||||
 | 
					    const TBasicType min12int_bt   = enable16BitTypes ? EbtInt16   : EbtInt;
 | 
				
			||||||
 | 
					    const TBasicType min16uint_bt  = enable16BitTypes ? EbtUint16  : EbtUint;
 | 
				
			||||||
 | 
					#else
 | 
				
			||||||
    static const TBasicType min16float_bt = EbtFloat;
 | 
					    static const TBasicType min16float_bt = EbtFloat;
 | 
				
			||||||
    static const TBasicType min10float_bt = EbtFloat;
 | 
					    static const TBasicType min10float_bt = EbtFloat;
 | 
				
			||||||
    static const TBasicType half_bt       = EbtFloat;
 | 
					    static const TBasicType half_bt       = EbtFloat;
 | 
				
			||||||
    static const TBasicType min16int_bt   = EbtInt;
 | 
					    static const TBasicType min16int_bt   = EbtInt;
 | 
				
			||||||
    static const TBasicType min12int_bt   = EbtInt;
 | 
					    static const TBasicType min12int_bt   = EbtInt;
 | 
				
			||||||
    static const TBasicType min16uint_bt  = EbtUint;
 | 
					    static const TBasicType min16uint_bt  = EbtUint;
 | 
				
			||||||
 | 
					#endif
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    // Some types might have turned into identifiers. Take the hit for checking
 | 
					    // Some types might have turned into identifiers. Take the hit for checking
 | 
				
			||||||
    // when this has happened.
 | 
					    // when this has happened.
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user