diff --git a/3rdparty/glslang/CMakeLists.txt b/3rdparty/glslang/CMakeLists.txt index e7b22e5ef..d45372016 100644 --- a/3rdparty/glslang/CMakeLists.txt +++ b/3rdparty/glslang/CMakeLists.txt @@ -6,6 +6,8 @@ option(ENABLE_GLSLANG_BINARIES "Builds glslangValidator and spirv-remap" ON) option(ENABLE_NV_EXTENSIONS "Enables support of Nvidia-specific extensions" ON) +option(ENABLE_HLSL "Enables HLSL input support" ON) + enable_testing() set(CMAKE_INSTALL_PREFIX "install" CACHE STRING "prefix") @@ -20,6 +22,10 @@ if(ENABLE_NV_EXTENSIONS) add_definitions(-DNV_EXTENSIONS) endif(ENABLE_NV_EXTENSIONS) +if(ENABLE_HLSL) + add_definitions(-DENABLE_HLSL) +endif(ENABLE_HLSL) + if(WIN32) set(CMAKE_DEBUG_POSTFIX "d") include(ChooseMSVCCRT.cmake) @@ -63,5 +69,7 @@ if(ENABLE_GLSLANG_BINARIES) add_subdirectory(StandAlone) endif() add_subdirectory(SPIRV) -add_subdirectory(hlsl) +if(ENABLE_HLSL) + add_subdirectory(hlsl) +endif(ENABLE_HLSL) add_subdirectory(gtests) diff --git a/3rdparty/glslang/OGLCompilersDLL/InitializeDll.cpp b/3rdparty/glslang/OGLCompilersDLL/InitializeDll.cpp index e47988152..2eb912c42 100644 --- a/3rdparty/glslang/OGLCompilersDLL/InitializeDll.cpp +++ b/3rdparty/glslang/OGLCompilersDLL/InitializeDll.cpp @@ -1,10 +1,10 @@ // -//Copyright (C) 2002-2005 3Dlabs Inc. Ltd. -//All rights reserved. +// Copyright (C) 2002-2005 3Dlabs Inc. Ltd. +// All rights reserved. // -//Redistribution and use in source and binary forms, with or without -//modification, are permitted provided that the following conditions -//are met: +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: // // Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. @@ -18,18 +18,18 @@ // contributors may be used to endorse or promote products derived // from this software without specific prior written permission. // -//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -//"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS -//FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE -//COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, -//INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -//BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -//LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -//CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -//LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN -//ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -//POSSIBILITY OF SUCH DAMAGE. +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +// COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. // #define SH_EXPORTING diff --git a/3rdparty/glslang/OGLCompilersDLL/InitializeDll.h b/3rdparty/glslang/OGLCompilersDLL/InitializeDll.h index 2d2455743..60b2b1593 100644 --- a/3rdparty/glslang/OGLCompilersDLL/InitializeDll.h +++ b/3rdparty/glslang/OGLCompilersDLL/InitializeDll.h @@ -1,10 +1,10 @@ // -//Copyright (C) 2002-2005 3Dlabs Inc. Ltd. -//All rights reserved. +// Copyright (C) 2002-2005 3Dlabs Inc. Ltd. +// All rights reserved. // -//Redistribution and use in source and binary forms, with or without -//modification, are permitted provided that the following conditions -//are met: +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: // // Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. @@ -18,23 +18,22 @@ // contributors may be used to endorse or promote products derived // from this software without specific prior written permission. // -//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -//"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS -//FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE -//COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, -//INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -//BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -//LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -//CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -//LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN -//ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -//POSSIBILITY OF SUCH DAMAGE. +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +// COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. // #ifndef __INITIALIZEDLL_H #define __INITIALIZEDLL_H - #include "../glslang/OSDependent/osinclude.h" namespace glslang { diff --git a/3rdparty/glslang/SPIRV/GlslangToSpv.cpp b/3rdparty/glslang/SPIRV/GlslangToSpv.cpp index 3c287a7ef..5c439faa3 100755 --- a/3rdparty/glslang/SPIRV/GlslangToSpv.cpp +++ b/3rdparty/glslang/SPIRV/GlslangToSpv.cpp @@ -1,12 +1,12 @@ // -//Copyright (C) 2014-2016 LunarG, Inc. -//Copyright (C) 2015-2016 Google, Inc. +// Copyright (C) 2014-2016 LunarG, Inc. +// Copyright (C) 2015-2016 Google, Inc. // -//All rights reserved. +// All rights reserved. // -//Redistribution and use in source and binary forms, with or without -//modification, are permitted provided that the following conditions -//are met: +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: // // Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. @@ -20,18 +20,18 @@ // contributors may be used to endorse or promote products derived // from this software without specific prior written permission. // -//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -//"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS -//FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE -//COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, -//INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -//BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -//LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -//CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -//LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN -//ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -//POSSIBILITY OF SUCH DAMAGE. +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +// COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. // // Visit the nodes in the glslang intermediate tree representation to @@ -221,7 +221,7 @@ spv::SourceLanguage TranslateSourceLanguage(glslang::EShSource source, EProfile return spv::SourceLanguageUnknown; } case glslang::EShSourceHlsl: - //Use SourceLanguageUnknown instead of SourceLanguageHLSL for now, until Vulkan knows what HLSL is + // Use SourceLanguageUnknown instead of SourceLanguageHLSL for now, until Vulkan knows what HLSL is return spv::SourceLanguageUnknown; default: return spv::SourceLanguageUnknown; @@ -439,7 +439,6 @@ spv::Decoration TranslateNoContractionDecoration(const glslang::TQualifier& qual return spv::DecorationMax; } - // Translate a glslang built-in variable to a SPIR-V built in decoration. Also generate // associated capabilities when required. For some built-in variables, a capability // is generated only when using the variable in an executable instruction, but not when @@ -1410,7 +1409,7 @@ bool TGlslangToSpvTraverser::visitAggregate(glslang::TVisit visit, glslang::TInt { if (node->isUserDefined()) result = handleUserFunctionCall(node); - //assert(result); // this can happen for bad shaders because the call graph completeness checking is not yet done + // assert(result); // this can happen for bad shaders because the call graph completeness checking is not yet done if (result) { builder.clearAccessChain(); builder.setAccessChainRValue(result); @@ -1633,7 +1632,7 @@ bool TGlslangToSpvTraverser::visitAggregate(glslang::TVisit visit, glslang::TInt // Does it need a swizzle inversion? If so, evaluation is inverted; // operate first on the swizzle base, then apply the swizzle. - if (glslangOperands[0]->getAsOperator() && + if (glslangOperands[0]->getAsOperator() && glslangOperands[0]->getAsOperator()->getOp() == glslang::EOpVectorSwizzle) invertedType = convertGlslangToSpvType(glslangOperands[0]->getAsBinaryNode()->getLeft()->getType()); } @@ -1960,7 +1959,7 @@ spv::Id TGlslangToSpvTraverser::getSampledType(const glslang::TSampler& sampler) // is applied. spv::Id TGlslangToSpvTraverser::getInvertedSwizzleType(const glslang::TIntermTyped& node) { - if (node.getAsOperator() && + if (node.getAsOperator() && node.getAsOperator()->getOp() == glslang::EOpVectorSwizzle) return convertGlslangToSpvType(node.getAsBinaryNode()->getLeft()->getType()); else @@ -2139,7 +2138,6 @@ spv::Id TGlslangToSpvTraverser::convertGlslangToSpvType(const glslang::TType& ty return spvType; } - // Do full recursive conversion of a glslang structure (or block) type to a SPIR-V Id. // explicitLayout can be kept the same throughout the hierarchical recursive walk. // Mutually recursive with convertGlslangToSpvType(). @@ -3012,7 +3010,7 @@ spv::Id TGlslangToSpvTraverser::createImageTextureFunctionCall(glslang::TIntermO } // copy the projective coordinate if we have to if (projTargetComp != projSourceComp) { - spv::Id projComp = builder.createCompositeExtract(params.coords, + spv::Id projComp = builder.createCompositeExtract(params.coords, builder.getScalarTypeId(builder.getTypeId(params.coords)), projSourceComp); params.coords = builder.createCompositeInsert(projComp, params.coords, @@ -4731,7 +4729,7 @@ spv::Id TGlslangToSpvTraverser::getSymbolId(const glslang::TIntermSymbol* symbol if (builtIn != spv::BuiltInMax) addDecoration(id, spv::DecorationBuiltIn, (int)builtIn); -#ifdef NV_EXTENSIONS +#ifdef NV_EXTENSIONS if (builtIn == spv::BuiltInSampleMask) { spv::Decoration decoration; // GL_NV_sample_mask_override_coverage extension diff --git a/3rdparty/glslang/SPIRV/GlslangToSpv.h b/3rdparty/glslang/SPIRV/GlslangToSpv.h index 428cfb6a7..ceb23b5a5 100644 --- a/3rdparty/glslang/SPIRV/GlslangToSpv.h +++ b/3rdparty/glslang/SPIRV/GlslangToSpv.h @@ -1,11 +1,11 @@ // -//Copyright (C) 2014 LunarG, Inc. +// Copyright (C) 2014 LunarG, Inc. // -//All rights reserved. +// All rights reserved. // -//Redistribution and use in source and binary forms, with or without -//modification, are permitted provided that the following conditions -//are met: +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: // // Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. @@ -19,18 +19,18 @@ // contributors may be used to endorse or promote products derived // from this software without specific prior written permission. // -//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -//"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS -//FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE -//COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, -//INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -//BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -//LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -//CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -//LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN -//ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -//POSSIBILITY OF SUCH DAMAGE. +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +// COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. #if _MSC_VER >= 1900 #pragma warning(disable : 4464) // relative include path contains '..' diff --git a/3rdparty/glslang/SPIRV/InReadableOrder.cpp b/3rdparty/glslang/SPIRV/InReadableOrder.cpp index 86aae6d05..4bb3d772c 100644 --- a/3rdparty/glslang/SPIRV/InReadableOrder.cpp +++ b/3rdparty/glslang/SPIRV/InReadableOrder.cpp @@ -1,11 +1,11 @@ // -//Copyright (C) 2016 Google, Inc. +// Copyright (C) 2016 Google, Inc. // -//All rights reserved. +// All rights reserved. // -//Redistribution and use in source and binary forms, with or without -//modification, are permitted provided that the following conditions -//are met: +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: // // Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. @@ -19,18 +19,18 @@ // contributors may be used to endorse or promote products derived // from this software without specific prior written permission. // -//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -//"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS -//FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE -//COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, -//INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -//BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -//LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -//CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -//LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN -//ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -//POSSIBILITY OF SUCH DAMAGE. +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +// COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. // The SPIR-V spec requires code blocks to appear in an order satisfying the // dominator-tree direction (ie, dominator before the dominated). This is, diff --git a/3rdparty/glslang/SPIRV/SPVRemapper.cpp b/3rdparty/glslang/SPIRV/SPVRemapper.cpp index f30963b13..9b1270501 100755 --- a/3rdparty/glslang/SPIRV/SPVRemapper.cpp +++ b/3rdparty/glslang/SPIRV/SPVRemapper.cpp @@ -1,11 +1,11 @@ // -//Copyright (C) 2015 LunarG, Inc. +// Copyright (C) 2015 LunarG, Inc. // -//All rights reserved. +// All rights reserved. // -//Redistribution and use in source and binary forms, with or without -//modification, are permitted provided that the following conditions -//are met: +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: // // Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. @@ -19,18 +19,18 @@ // contributors may be used to endorse or promote products derived // from this software without specific prior written permission. // -//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -//"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS -//FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE -//COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, -//INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -//BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -//LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -//CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -//LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN -//ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -//POSSIBILITY OF SUCH DAMAGE. +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +// COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. // #include "SPVRemapper.h" @@ -103,10 +103,10 @@ namespace spv { switch (opCode) { case spv::OpTypeVector: // fall through - case spv::OpTypeMatrix: // ... - case spv::OpTypeSampler: // ... - case spv::OpTypeArray: // ... - case spv::OpTypeRuntimeArray: // ... + case spv::OpTypeMatrix: // ... + case spv::OpTypeSampler: // ... + case spv::OpTypeArray: // ... + case spv::OpTypeRuntimeArray: // ... case spv::OpTypePipe: return range_t(2, 3); case spv::OpTypeStruct: // fall through case spv::OpTypeFunction: return range_t(2, maxCount); @@ -286,7 +286,6 @@ namespace spv { return literal; } - void spirvbin_t::applyMap() { msg(3, 2, std::string("Applying map: ")); @@ -300,7 +299,6 @@ namespace spv { ); } - // Find free IDs for anything we haven't mapped void spirvbin_t::mapRemainder() { @@ -355,7 +353,7 @@ namespace spv { if (idPosR.find(asId(start+1)) == idPosR.end()) stripInst(start); break; - default: + default: break; // leave it alone } @@ -399,7 +397,7 @@ namespace spv { if (spv::InstructionDesc[opCode].hasResult()) { const spv::Id resultId = asId(word++); idPosR[resultId] = start; - + if (typeId != spv::NoResult) { const unsigned idTypeSize = typeSizeInWords(typeId); @@ -462,7 +460,6 @@ namespace spv { error("bad schema, must be 0"); } - int spirvbin_t::processInstruction(unsigned word, instfn_t instFn, idfn_t idFn) { const auto instructionStart = word; @@ -902,7 +899,7 @@ namespace spv { }, // If local var id used anywhere else, don't eliminate - [&](spv::Id& id) { + [&](spv::Id& id) { if (fnLocalVars.count(id) > 0) { fnLocalVars.erase(id); idMap.erase(id); @@ -1079,7 +1076,6 @@ namespace spv { } } - #ifdef NOTDEF bool spirvbin_t::matchType(const spirvbin_t::globaltypes_t& globalTypes, spv::Id lt, spv::Id gt) const { @@ -1139,7 +1135,6 @@ namespace spv { } } - // Look for an equivalent type in the globalTypes map spv::Id spirvbin_t::findType(const spirvbin_t::globaltypes_t& globalTypes, spv::Id lt) const { @@ -1261,7 +1256,6 @@ namespace spv { } } - // Strip a single binary by removing ranges given in stripRange void spirvbin_t::strip() { diff --git a/3rdparty/glslang/SPIRV/SPVRemapper.h b/3rdparty/glslang/SPIRV/SPVRemapper.h index 77c965821..f9f369a37 100755 --- a/3rdparty/glslang/SPIRV/SPVRemapper.h +++ b/3rdparty/glslang/SPIRV/SPVRemapper.h @@ -1,11 +1,11 @@ // -//Copyright (C) 2015 LunarG, Inc. +// Copyright (C) 2015 LunarG, Inc. // -//All rights reserved. +// All rights reserved. // -//Redistribution and use in source and binary forms, with or without -//modification, are permitted provided that the following conditions -//are met: +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: // // Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. @@ -19,18 +19,18 @@ // contributors may be used to endorse or promote products derived // from this software without specific prior written permission. // -//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -//"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS -//FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE -//COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, -//INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -//BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -//LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -//CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -//LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN -//ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -//POSSIBILITY OF SUCH DAMAGE. +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +// COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. // #ifndef SPIRVREMAPPER_H @@ -112,7 +112,8 @@ class spirvbin_t : public spirvbin_base_t { public: spirvbin_t(int verbose = 0) : entryPoint(spv::NoResult), largestNewId(0), verbose(verbose) { } - + virtual ~spirvbin_t() { } + // remap on an existing binary in memory void remap(std::vector& spv, std::uint32_t opts = DO_EVERYTHING); @@ -175,7 +176,7 @@ private: range_t constRange(spv::Op opCode) const; unsigned typeSizeInWords(spv::Id id) const; unsigned idTypeSizeInWords(spv::Id id) const; - + spv::Id& asId(unsigned word) { return spv[word]; } const spv::Id& asId(unsigned word) const { return spv[word]; } spv::Op asOpCode(unsigned word) const { return opOpCode(spv[word]); } @@ -242,7 +243,7 @@ private: void stripDebug(); // strip all debug info void stripDeadRefs(); // strips debug info for now-dead references after DCE void strip(); // remove debug symbols - + std::vector spv; // SPIR words namemap_t nameMap; // ID names from OpName @@ -268,11 +269,11 @@ private: // Which functions are called, anywhere in the module, with a call count std::unordered_map fnCalls; - + posmap_t typeConstPos; // word positions that define types & consts (ordered) posmap_rev_t idPosR; // reverse map from IDs to positions typesize_map_t idTypeSizeMap; // maps each ID to its type size, if known. - + std::vector idMapL; // ID {M}ap from {L}ocal to {G}lobal IDs spv::Id entryPoint; // module entry point diff --git a/3rdparty/glslang/SPIRV/SpvBuilder.cpp b/3rdparty/glslang/SPIRV/SpvBuilder.cpp index b0b74b243..720eac2ff 100644 --- a/3rdparty/glslang/SPIRV/SpvBuilder.cpp +++ b/3rdparty/glslang/SPIRV/SpvBuilder.cpp @@ -1,12 +1,12 @@ // -//Copyright (C) 2014-2015 LunarG, Inc. -//Copyright (C) 2015-2016 Google, Inc. +// Copyright (C) 2014-2015 LunarG, Inc. +// Copyright (C) 2015-2016 Google, Inc. // -//All rights reserved. +// All rights reserved. // -//Redistribution and use in source and binary forms, with or without -//modification, are permitted provided that the following conditions -//are met: +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: // // Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. @@ -20,18 +20,18 @@ // contributors may be used to endorse or promote products derived // from this software without specific prior written permission. // -//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -//"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS -//FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE -//COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, -//INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -//BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -//LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -//CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -//LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN -//ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -//POSSIBILITY OF SUCH DAMAGE. +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +// COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. // // Helper for making SPIR-V IR. Generally, this is documented in the header @@ -79,7 +79,7 @@ Id Builder::import(const char* name) { Instruction* import = new Instruction(getUniqueId(), NoType, OpExtInstImport); import->addStringOperand(name); - + imports.push_back(std::unique_ptr(import)); return import->getResultId(); } @@ -246,7 +246,7 @@ Id Builder::makeStructResultType(Id type0, Id type1) type = groupedTypes[OpTypeStruct][t]; if (type->getNumOperands() != 2) continue; - if (type->getIdOperand(0) != type0 || + if (type->getIdOperand(0) != type0 || type->getIdOperand(1) != type1) continue; return type->getResultId(); @@ -628,7 +628,7 @@ Id Builder::findScalarConstant(Op typeClass, Op opcode, Id typeId, unsigned v1, bool Builder::isConstantOpCode(Op opcode) const { switch (opcode) { - case OpUndef: + case OpUndef: case OpConstantTrue: case OpConstantFalse: case OpConstant: @@ -1936,7 +1936,6 @@ Id Builder::createMatrixConstructor(Decoration precision, const std::vector& } } - // Step 2: Construct a matrix from that array. // First make the column vectors, then make the matrix. @@ -2492,7 +2491,7 @@ void Builder::createAndSetNoPredecessorBlock(const char* /*name*/) buildPoint->getParent().addBlock(block); setBuildPoint(block); - //if (name) + // if (name) // addName(block->getId(), name); } diff --git a/3rdparty/glslang/SPIRV/SpvBuilder.h b/3rdparty/glslang/SPIRV/SpvBuilder.h index e8524b2b1..331f0e00f 100755 --- a/3rdparty/glslang/SPIRV/SpvBuilder.h +++ b/3rdparty/glslang/SPIRV/SpvBuilder.h @@ -1,12 +1,12 @@ // -//Copyright (C) 2014-2015 LunarG, Inc. -//Copyright (C) 2015-2016 Google, Inc. +// Copyright (C) 2014-2015 LunarG, Inc. +// Copyright (C) 2015-2016 Google, Inc. // -//All rights reserved. +// All rights reserved. // -//Redistribution and use in source and binary forms, with or without -//modification, are permitted provided that the following conditions -//are met: +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: // // Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. @@ -20,18 +20,18 @@ // contributors may be used to endorse or promote products derived // from this software without specific prior written permission. // -//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -//"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS -//FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE -//COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, -//INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -//BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -//LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -//CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -//LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN -//ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -//POSSIBILITY OF SUCH DAMAGE. +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +// COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. // // "Builder" is an interface to fully build SPIR-V IR. Allocate one of diff --git a/3rdparty/glslang/SPIRV/disassemble.cpp b/3rdparty/glslang/SPIRV/disassemble.cpp index cbc9a9b6c..a8049b876 100644 --- a/3rdparty/glslang/SPIRV/disassemble.cpp +++ b/3rdparty/glslang/SPIRV/disassemble.cpp @@ -1,11 +1,11 @@ // -//Copyright (C) 2014-2015 LunarG, Inc. +// Copyright (C) 2014-2015 LunarG, Inc. // -//All rights reserved. +// All rights reserved. // -//Redistribution and use in source and binary forms, with or without -//modification, are permitted provided that the following conditions -//are met: +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: // // Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. @@ -19,18 +19,18 @@ // contributors may be used to endorse or promote products derived // from this software without specific prior written permission. // -//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -//"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS -//FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE -//COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, -//INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -//BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -//LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -//CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -//LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN -//ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -//POSSIBILITY OF SUCH DAMAGE. +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +// COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. // // Disassembler for SPIR-V. diff --git a/3rdparty/glslang/SPIRV/disassemble.h b/3rdparty/glslang/SPIRV/disassemble.h index f5d0bc23b..47cef65a5 100755 --- a/3rdparty/glslang/SPIRV/disassemble.h +++ b/3rdparty/glslang/SPIRV/disassemble.h @@ -1,11 +1,11 @@ // -//Copyright (C) 2014-2015 LunarG, Inc. +// Copyright (C) 2014-2015 LunarG, Inc. // -//All rights reserved. +// All rights reserved. // -//Redistribution and use in source and binary forms, with or without -//modification, are permitted provided that the following conditions -//are met: +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: // // Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. @@ -19,18 +19,18 @@ // contributors may be used to endorse or promote products derived // from this software without specific prior written permission. // -//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -//"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS -//FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE -//COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, -//INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -//BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -//LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -//CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -//LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN -//ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -//POSSIBILITY OF SUCH DAMAGE. +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +// COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. // // Disassembler for SPIR-V. diff --git a/3rdparty/glslang/SPIRV/doc.cpp b/3rdparty/glslang/SPIRV/doc.cpp index b20944fc8..de401c73f 100755 --- a/3rdparty/glslang/SPIRV/doc.cpp +++ b/3rdparty/glslang/SPIRV/doc.cpp @@ -1,11 +1,11 @@ // -//Copyright (C) 2014-2015 LunarG, Inc. +// Copyright (C) 2014-2015 LunarG, Inc. // -//All rights reserved. +// All rights reserved. // -//Redistribution and use in source and binary forms, with or without -//modification, are permitted provided that the following conditions -//are met: +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: // // Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. @@ -19,18 +19,18 @@ // contributors may be used to endorse or promote products derived // from this software without specific prior written permission. // -//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -//"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS -//FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE -//COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, -//INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -//BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -//LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -//CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -//LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN -//ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -//POSSIBILITY OF SUCH DAMAGE. +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +// COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. // // 1) Programmatically fill in instruction/operand information. diff --git a/3rdparty/glslang/SPIRV/doc.h b/3rdparty/glslang/SPIRV/doc.h index 743896ff4..7dcc51dd3 100644 --- a/3rdparty/glslang/SPIRV/doc.h +++ b/3rdparty/glslang/SPIRV/doc.h @@ -1,11 +1,11 @@ // -//Copyright (C) 2014-2015 LunarG, Inc. +// Copyright (C) 2014-2015 LunarG, Inc. // -//All rights reserved. +// All rights reserved. // -//Redistribution and use in source and binary forms, with or without -//modification, are permitted provided that the following conditions -//are met: +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: // // Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. @@ -19,18 +19,18 @@ // contributors may be used to endorse or promote products derived // from this software without specific prior written permission. // -//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -//"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS -//FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE -//COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, -//INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -//BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -//LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -//CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -//LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN -//ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -//POSSIBILITY OF SUCH DAMAGE. +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +// COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. // // Parameterize the SPIR-V enumerants. diff --git a/3rdparty/glslang/SPIRV/spvIR.h b/3rdparty/glslang/SPIRV/spvIR.h index c584c9dcb..8cfef9e14 100755 --- a/3rdparty/glslang/SPIRV/spvIR.h +++ b/3rdparty/glslang/SPIRV/spvIR.h @@ -1,11 +1,11 @@ // -//Copyright (C) 2014 LunarG, Inc. +// Copyright (C) 2014 LunarG, Inc. // -//All rights reserved. +// All rights reserved. // -//Redistribution and use in source and binary forms, with or without -//modification, are permitted provided that the following conditions -//are met: +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: // // Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. @@ -19,26 +19,26 @@ // contributors may be used to endorse or promote products derived // from this software without specific prior written permission. // -//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -//"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS -//FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE -//COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, -//INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -//BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -//LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -//CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -//LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN -//ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -//POSSIBILITY OF SUCH DAMAGE. +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +// COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. // SPIRV-IR // // Simple in-memory representation (IR) of SPIRV. Just for holding // Each function's CFG of blocks. Has this hierarchy: -// - Module, which is a list of -// - Function, which is a list of -// - Block, which is a list of +// - Module, which is a list of +// - Function, which is a list of +// - Block, which is a list of // - Instruction // @@ -65,7 +65,7 @@ const Id NoResult = 0; const Id NoType = 0; const Decoration NoPrecision = DecorationMax; -const MemorySemanticsMask MemorySemanticsAllMemory = +const MemorySemanticsMask MemorySemanticsAllMemory = (MemorySemanticsMask)(MemorySemanticsSequentiallyConsistentMask | MemorySemanticsUniformMemoryMask | MemorySemanticsSubgroupMemoryMask | @@ -229,7 +229,7 @@ protected: std::vector > localVariables; Function& parent; - // track whether this block is known to be uncreachable (not necessarily + // track whether this block is known to be uncreachable (not necessarily // true for all unreachable blocks, but should be set at least // for the extraneous ones introduced by the builder). bool unreachable; diff --git a/3rdparty/glslang/StandAlone/CMakeLists.txt b/3rdparty/glslang/StandAlone/CMakeLists.txt index 231ba277a..597d81300 100644 --- a/3rdparty/glslang/StandAlone/CMakeLists.txt +++ b/3rdparty/glslang/StandAlone/CMakeLists.txt @@ -22,11 +22,14 @@ set(LIBRARIES glslang OGLCompiler OSDependent - HLSL SPIRV SPVRemapper glslang-default-resource-limits) +if(ENABLE_HLSL) + set(LIBRARIES ${LIBRARIES} HLSL) +endif(ENABLE_HLSL) + if(WIN32) set(LIBRARIES ${LIBRARIES} psapi) elseif(UNIX) diff --git a/3rdparty/glslang/StandAlone/StandAlone.cpp b/3rdparty/glslang/StandAlone/StandAlone.cpp index d40673c15..d133b5948 100644 --- a/3rdparty/glslang/StandAlone/StandAlone.cpp +++ b/3rdparty/glslang/StandAlone/StandAlone.cpp @@ -1,12 +1,12 @@ // -//Copyright (C) 2002-2005 3Dlabs Inc. Ltd. -//Copyright (C) 2013-2016 LunarG, Inc. +// Copyright (C) 2002-2005 3Dlabs Inc. Ltd. +// Copyright (C) 2013-2016 LunarG, Inc. // -//All rights reserved. +// All rights reserved. // -//Redistribution and use in source and binary forms, with or without -//modification, are permitted provided that the following conditions -//are met: +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: // // Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. @@ -20,18 +20,18 @@ // contributors may be used to endorse or promote products derived // from this software without specific prior written permission. // -//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -//"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS -//FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE -//COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, -//INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -//BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -//LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -//CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -//LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN -//ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -//POSSIBILITY OF SUCH DAMAGE. +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +// COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. // // this only applies to the standalone wrapper, not the front end in general @@ -229,7 +229,7 @@ void ProcessBindingBase(int& argc, char**& argv, std::array= 1; argc--, argv++) { if (argv[0][0] == '-') { switch (argv[0][1]) { @@ -292,7 +292,7 @@ void ProcessArguments(int argc, char* argv[]) lowerword == "sub") { ProcessBindingBase(argc, argv, baseUboBinding); } else if (lowerword == "auto-map-bindings" || // synonyms - lowerword == "auto-map-binding" || + lowerword == "auto-map-binding" || lowerword == "amb") { Options |= EOptionAutoMapBindings; } else if (lowerword == "flatten-uniform-arrays" || // synonyms @@ -575,14 +575,14 @@ void CompileAndLinkShaderUnits(std::vector compUnits) if (Options & EOptionAutoMapBindings) shader->setAutoMapBindings(true); - + shaders.push_back(shader); const int defaultVersion = Options & EOptionDefaultDesktop? 110: 100; if (Options & EOptionOutputPreprocessed) { std::string str; - glslang::TShader::ForbidInclude includer; + glslang::TShader::ForbidIncluder includer; if (shader->preprocess(&Resources, defaultVersion, ENoProfile, false, false, messages, &str, includer)) { PutsIfNonEmpty(str.c_str()); @@ -619,7 +619,7 @@ void CompileAndLinkShaderUnits(std::vector compUnits) if (!program.mapIO()) LinkFailed = true; } - + // Report if (! (Options & EOptionSuppressInfolog) && ! (Options & EOptionMemoryLeakMode)) { @@ -863,7 +863,7 @@ EShLanguage FindLanguage(const std::string& name, bool parseSuffix) } // -// Read a file's data into a string, and compile it using the old interface ShCompile, +// Read a file's data into a string, and compile it using the old interface ShCompile, // for non-linkable results. // void CompileFile(const char* fileName, ShHandle compiler) @@ -887,16 +887,16 @@ void CompileFile(const char* fileName, ShHandle compiler) EShMessages messages = EShMsgDefault; SetMessageOptions(messages); - + for (int i = 0; i < ((Options & EOptionMemoryLeakMode) ? 100 : 1); ++i) { for (int j = 0; j < ((Options & EOptionMemoryLeakMode) ? 100 : 1); ++j) { - //ret = ShCompile(compiler, shaderStrings, NumShaderStrings, lengths, EShOptNone, &Resources, Options, (Options & EOptionDefaultDesktop) ? 110 : 100, false, messages); + // ret = ShCompile(compiler, shaderStrings, NumShaderStrings, lengths, EShOptNone, &Resources, Options, (Options & EOptionDefaultDesktop) ? 110 : 100, false, messages); ret = ShCompile(compiler, shaderStrings, NumShaderStrings, nullptr, EShOptNone, &Resources, Options, (Options & EOptionDefaultDesktop) ? 110 : 100, false, messages); - //const char* multi[12] = { "# ve", "rsion", " 300 e", "s", "\n#err", - // "or should be l", "ine 1", "string 5\n", "float glo", "bal", + // const char* multi[12] = { "# ve", "rsion", " 300 e", "s", "\n#err", + // "or should be l", "ine 1", "string 5\n", "float glo", "bal", // ";\n#error should be line 2\n void main() {", "global = 2.3;}" }; - //const char* multi[7] = { "/", "/", "\\", "\n", "\n", "#", "version 300 es" }; - //ret = ShCompile(compiler, multi, 7, nullptr, EShOptNone, &Resources, Options, (Options & EOptionDefaultDesktop) ? 110 : 100, false, messages); + // const char* multi[7] = { "/", "/", "\\", "\n", "\n", "#", "version 300 es" }; + // ret = ShCompile(compiler, multi, 7, nullptr, EShOptNone, &Resources, Options, (Options & EOptionDefaultDesktop) ? 110 : 100, false, messages); } if (Options & EOptionMemoryLeakMode) @@ -1024,7 +1024,7 @@ int fopen_s( // // Malloc a string of sufficient size and read a string into it. // -char** ReadFileData(const char* fileName) +char** ReadFileData(const char* fileName) { FILE *in = nullptr; int errorCode = fopen_s(&in, fileName, "r"); @@ -1035,7 +1035,7 @@ char** ReadFileData(const char* fileName) if (errorCode || in == nullptr) Error("unable to open input file"); - + while (fgetc(in) != EOF) count++; @@ -1080,7 +1080,7 @@ char** ReadFileData(const char* fileName) break; } len = count; - } + } ++i; } diff --git a/3rdparty/glslang/StandAlone/Worklist.h b/3rdparty/glslang/StandAlone/Worklist.h index 57dc0db7b..2a14294e8 100644 --- a/3rdparty/glslang/StandAlone/Worklist.h +++ b/3rdparty/glslang/StandAlone/Worklist.h @@ -1,11 +1,11 @@ // -//Copyright (C) 2013 LunarG, Inc. +// Copyright (C) 2013 LunarG, Inc. // -//All rights reserved. +// All rights reserved. // -//Redistribution and use in source and binary forms, with or without -//modification, are permitted provided that the following conditions -//are met: +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: // // Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. @@ -19,18 +19,18 @@ // contributors may be used to endorse or promote products derived // from this software without specific prior written permission. // -//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -//"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS -//FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE -//COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, -//INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -//BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -//LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -//CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -//LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN -//ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -//POSSIBILITY OF SUCH DAMAGE. +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +// COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. // #ifndef WORKLIST_H_INCLUDED #define WORKLIST_H_INCLUDED @@ -59,21 +59,21 @@ namespace glslang { void add(TWorkItem* item) { GetGlobalLock(); - + worklist.push_back(item); - + ReleaseGlobalLock(); } - + bool remove(TWorkItem*& item) { GetGlobalLock(); - + if (worklist.empty()) return false; item = worklist.front(); worklist.pop_front(); - + ReleaseGlobalLock(); return true; diff --git a/3rdparty/glslang/StandAlone/spirv-remap.cpp b/3rdparty/glslang/StandAlone/spirv-remap.cpp index f35b58eda..998f7428a 100644 --- a/3rdparty/glslang/StandAlone/spirv-remap.cpp +++ b/3rdparty/glslang/StandAlone/spirv-remap.cpp @@ -1,11 +1,11 @@ // -//Copyright (C) 2015 LunarG, Inc. +// Copyright (C) 2015 LunarG, Inc. // -//All rights reserved. +// All rights reserved. // -//Redistribution and use in source and binary forms, with or without -//modification, are permitted provided that the following conditions -//are met: +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: // // Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. @@ -19,18 +19,18 @@ // contributors may be used to endorse or promote products derived // from this software without specific prior written permission. // -//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -//"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS -//FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE -//COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, -//INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -//BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -//LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -//CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -//LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN -//ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -//POSSIBILITY OF SUCH DAMAGE. +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +// COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. // #include @@ -143,8 +143,8 @@ namespace { << " [--map (all|types|names|funcs)]" << " [--dce (all|types|funcs)]" << " [--opt (all|loadstore)]" - << " [--strip-all | --strip all | -s]" - << " [--do-everything]" + << " [--strip-all | --strip all | -s]" + << " [--do-everything]" << " --input | -i file1 [file2...] --output|-o DESTDIR" << std::endl; @@ -311,7 +311,6 @@ namespace { } // namespace - int main(int argc, char** argv) { std::vector inputFile; diff --git a/3rdparty/glslang/Test/baseResults/hlsl.init2.frag.out b/3rdparty/glslang/Test/baseResults/hlsl.init2.frag.out index 9b53e3049..d8d2d371f 100644 --- a/3rdparty/glslang/Test/baseResults/hlsl.init2.frag.out +++ b/3rdparty/glslang/Test/baseResults/hlsl.init2.frag.out @@ -29,29 +29,147 @@ gl_FragCoord origin is upper left 0:20 8.000000 0:20 9.000000 0:20 10.000000 -0:26 Function Definition: main( (temp structure{temp 4-component vector of float color}) -0:26 Function Parameters: +0:22 Constant: +0:22 10.000000 +0:25 Sequence +0:25 move second child to first child (temp float) +0:25 'n' (temp float) +0:25 Constant: +0:25 0.000000 +0:26 Sequence +0:26 move second child to first child (temp 8-element array of 3-component vector of float) +0:26 'a' (const (read only) 8-element array of 3-component vector of float) +0:26 Construct vec3 (temp 8-element array of 3-component vector of float) +0:27 vector-scale (temp 3-component vector of float) +0:? Constant: +0:? 0.577350 +0:? 0.577350 +0:? 0.577350 +0:27 add second child into first child (temp float) +0:27 'n' (temp float) +0:27 Constant: +0:27 1.000000 +0:28 vector-scale (temp 3-component vector of float) +0:? Constant: +0:? -0.577350 +0:? -0.577350 +0:? -0.577350 +0:28 add second child into first child (temp float) +0:28 'n' (temp float) +0:28 Constant: +0:28 1.000000 +0:29 vector-scale (temp 3-component vector of float) +0:? Constant: +0:? -0.577350 +0:? -0.577350 +0:? 0.577350 +0:29 add second child into first child (temp float) +0:29 'n' (temp float) +0:29 Constant: +0:29 1.000000 +0:30 vector-scale (temp 3-component vector of float) +0:? Constant: +0:? -0.577350 +0:? 0.577350 +0:? -0.577350 +0:30 add second child into first child (temp float) +0:30 'n' (temp float) +0:30 Constant: +0:30 1.000000 +0:31 vector-scale (temp 3-component vector of float) +0:? Constant: +0:? -0.577350 +0:? 0.577350 +0:? 0.577350 +0:31 add second child into first child (temp float) +0:31 'n' (temp float) +0:31 Constant: +0:31 1.000000 +0:32 vector-scale (temp 3-component vector of float) +0:? Constant: +0:? 0.577350 +0:? -0.577350 +0:? -0.577350 +0:32 add second child into first child (temp float) +0:32 'n' (temp float) +0:32 Constant: +0:32 1.000000 +0:33 vector-scale (temp 3-component vector of float) +0:? Constant: +0:? 0.577350 +0:? -0.577350 +0:? 0.577350 +0:33 add second child into first child (temp float) +0:33 'n' (temp float) +0:33 Constant: +0:33 1.000000 +0:34 vector-scale (temp 3-component vector of float) +0:? Constant: +0:? 0.577350 +0:? 0.577350 +0:? -0.577350 +0:34 add second child into first child (temp float) +0:34 'n' (temp float) +0:34 Constant: +0:34 1.000000 +0:36 Sequence +0:36 move second child to first child (temp structure{temp 3-component vector of float a}) +0:36 'oneNonConst' (const (read only) structure{temp 3-component vector of float a}) +0:36 Construct structure (temp structure{temp 3-component vector of float a}) +0:36 vector-scale (temp 3-component vector of float) +0:? Constant: +0:? -0.577350 +0:? 0.577350 +0:? 0.577350 +0:36 add second child into first child (temp float) +0:36 'n' (temp float) +0:36 Constant: +0:36 1.000000 +0:38 Sequence +0:38 move second child to first child (temp structure{temp 3-component vector of float a, temp 3-component vector of float b}) +0:38 'twoNonConst' (const (read only) structure{temp 3-component vector of float a, temp 3-component vector of float b}) +0:38 Construct structure (temp structure{temp 3-component vector of float a, temp 3-component vector of float b}) +0:38 vector-scale (temp 3-component vector of float) +0:? Constant: +0:? -0.577350 +0:? 0.577350 +0:? 0.577350 +0:38 add second child into first child (temp float) +0:38 'n' (temp float) +0:38 Constant: +0:38 1.000000 +0:39 vector-scale (temp 3-component vector of float) +0:? Constant: +0:? -0.577350 +0:? 0.577350 +0:? 0.577350 +0:39 add second child into first child (temp float) +0:39 'n' (temp float) +0:39 Constant: +0:39 1.000000 +0:45 Function Definition: main( (temp structure{temp 4-component vector of float color}) +0:45 Function Parameters: 0:? Sequence -0:27 Function Call: Test1( (temp void) -0:30 move second child to first child (temp 4-component vector of float) -0:30 color: direct index for structure (temp 4-component vector of float) -0:30 'ps_output' (temp structure{temp 4-component vector of float color}) -0:30 Constant: -0:30 0 (const int) -0:30 Constant: -0:30 1.000000 -0:30 1.000000 -0:30 1.000000 -0:30 1.000000 -0:31 Sequence -0:31 Sequence -0:31 move second child to first child (temp 4-component vector of float) +0:46 Function Call: Test1( (temp void) +0:49 move second child to first child (temp 4-component vector of float) +0:49 color: direct index for structure (temp 4-component vector of float) +0:49 'ps_output' (temp structure{temp 4-component vector of float color}) +0:49 Constant: +0:49 0 (const int) +0:49 Constant: +0:49 1.000000 +0:49 1.000000 +0:49 1.000000 +0:49 1.000000 +0:50 Sequence +0:50 Sequence +0:50 move second child to first child (temp 4-component vector of float) 0:? 'color' (layout(location=0 ) out 4-component vector of float) -0:31 color: direct index for structure (temp 4-component vector of float) -0:31 'ps_output' (temp structure{temp 4-component vector of float color}) -0:31 Constant: -0:31 0 (const int) -0:31 Branch: Return +0:50 color: direct index for structure (temp 4-component vector of float) +0:50 'ps_output' (temp structure{temp 4-component vector of float color}) +0:50 Constant: +0:50 0 (const int) +0:50 Branch: Return 0:? Linker Objects 0:? 'color' (layout(location=0 ) out 4-component vector of float) @@ -89,40 +207,158 @@ gl_FragCoord origin is upper left 0:20 8.000000 0:20 9.000000 0:20 10.000000 -0:26 Function Definition: main( (temp structure{temp 4-component vector of float color}) -0:26 Function Parameters: +0:22 Constant: +0:22 10.000000 +0:25 Sequence +0:25 move second child to first child (temp float) +0:25 'n' (temp float) +0:25 Constant: +0:25 0.000000 +0:26 Sequence +0:26 move second child to first child (temp 8-element array of 3-component vector of float) +0:26 'a' (const (read only) 8-element array of 3-component vector of float) +0:26 Construct vec3 (temp 8-element array of 3-component vector of float) +0:27 vector-scale (temp 3-component vector of float) +0:? Constant: +0:? 0.577350 +0:? 0.577350 +0:? 0.577350 +0:27 add second child into first child (temp float) +0:27 'n' (temp float) +0:27 Constant: +0:27 1.000000 +0:28 vector-scale (temp 3-component vector of float) +0:? Constant: +0:? -0.577350 +0:? -0.577350 +0:? -0.577350 +0:28 add second child into first child (temp float) +0:28 'n' (temp float) +0:28 Constant: +0:28 1.000000 +0:29 vector-scale (temp 3-component vector of float) +0:? Constant: +0:? -0.577350 +0:? -0.577350 +0:? 0.577350 +0:29 add second child into first child (temp float) +0:29 'n' (temp float) +0:29 Constant: +0:29 1.000000 +0:30 vector-scale (temp 3-component vector of float) +0:? Constant: +0:? -0.577350 +0:? 0.577350 +0:? -0.577350 +0:30 add second child into first child (temp float) +0:30 'n' (temp float) +0:30 Constant: +0:30 1.000000 +0:31 vector-scale (temp 3-component vector of float) +0:? Constant: +0:? -0.577350 +0:? 0.577350 +0:? 0.577350 +0:31 add second child into first child (temp float) +0:31 'n' (temp float) +0:31 Constant: +0:31 1.000000 +0:32 vector-scale (temp 3-component vector of float) +0:? Constant: +0:? 0.577350 +0:? -0.577350 +0:? -0.577350 +0:32 add second child into first child (temp float) +0:32 'n' (temp float) +0:32 Constant: +0:32 1.000000 +0:33 vector-scale (temp 3-component vector of float) +0:? Constant: +0:? 0.577350 +0:? -0.577350 +0:? 0.577350 +0:33 add second child into first child (temp float) +0:33 'n' (temp float) +0:33 Constant: +0:33 1.000000 +0:34 vector-scale (temp 3-component vector of float) +0:? Constant: +0:? 0.577350 +0:? 0.577350 +0:? -0.577350 +0:34 add second child into first child (temp float) +0:34 'n' (temp float) +0:34 Constant: +0:34 1.000000 +0:36 Sequence +0:36 move second child to first child (temp structure{temp 3-component vector of float a}) +0:36 'oneNonConst' (const (read only) structure{temp 3-component vector of float a}) +0:36 Construct structure (temp structure{temp 3-component vector of float a}) +0:36 vector-scale (temp 3-component vector of float) +0:? Constant: +0:? -0.577350 +0:? 0.577350 +0:? 0.577350 +0:36 add second child into first child (temp float) +0:36 'n' (temp float) +0:36 Constant: +0:36 1.000000 +0:38 Sequence +0:38 move second child to first child (temp structure{temp 3-component vector of float a, temp 3-component vector of float b}) +0:38 'twoNonConst' (const (read only) structure{temp 3-component vector of float a, temp 3-component vector of float b}) +0:38 Construct structure (temp structure{temp 3-component vector of float a, temp 3-component vector of float b}) +0:38 vector-scale (temp 3-component vector of float) +0:? Constant: +0:? -0.577350 +0:? 0.577350 +0:? 0.577350 +0:38 add second child into first child (temp float) +0:38 'n' (temp float) +0:38 Constant: +0:38 1.000000 +0:39 vector-scale (temp 3-component vector of float) +0:? Constant: +0:? -0.577350 +0:? 0.577350 +0:? 0.577350 +0:39 add second child into first child (temp float) +0:39 'n' (temp float) +0:39 Constant: +0:39 1.000000 +0:45 Function Definition: main( (temp structure{temp 4-component vector of float color}) +0:45 Function Parameters: 0:? Sequence -0:27 Function Call: Test1( (temp void) -0:30 move second child to first child (temp 4-component vector of float) -0:30 color: direct index for structure (temp 4-component vector of float) -0:30 'ps_output' (temp structure{temp 4-component vector of float color}) -0:30 Constant: -0:30 0 (const int) -0:30 Constant: -0:30 1.000000 -0:30 1.000000 -0:30 1.000000 -0:30 1.000000 -0:31 Sequence -0:31 Sequence -0:31 move second child to first child (temp 4-component vector of float) +0:46 Function Call: Test1( (temp void) +0:49 move second child to first child (temp 4-component vector of float) +0:49 color: direct index for structure (temp 4-component vector of float) +0:49 'ps_output' (temp structure{temp 4-component vector of float color}) +0:49 Constant: +0:49 0 (const int) +0:49 Constant: +0:49 1.000000 +0:49 1.000000 +0:49 1.000000 +0:49 1.000000 +0:50 Sequence +0:50 Sequence +0:50 move second child to first child (temp 4-component vector of float) 0:? 'color' (layout(location=0 ) out 4-component vector of float) -0:31 color: direct index for structure (temp 4-component vector of float) -0:31 'ps_output' (temp structure{temp 4-component vector of float color}) -0:31 Constant: -0:31 0 (const int) -0:31 Branch: Return +0:50 color: direct index for structure (temp 4-component vector of float) +0:50 'ps_output' (temp structure{temp 4-component vector of float color}) +0:50 Constant: +0:50 0 (const int) +0:50 Branch: Return 0:? Linker Objects 0:? 'color' (layout(location=0 ) out 4-component vector of float) // Module Version 10000 // Generated by (magic number): 80001 -// Id's are bound by 47 +// Id's are bound by 107 Capability Shader 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 - EntryPoint Fragment 4 "main" 43 + EntryPoint Fragment 4 "main" 103 ExecutionMode 4 OriginUpperLeft Name 4 "main" Name 6 "Test1(" @@ -136,11 +372,20 @@ gl_FragCoord origin is upper left MemberName 25(mystruct2) 1 "b" MemberName 25(mystruct2) 2 "c" Name 27 "test5" - Name 34 "PS_OUTPUT" - MemberName 34(PS_OUTPUT) 0 "color" - Name 36 "ps_output" - Name 43 "color" - Decorate 43(color) Location 0 + Name 32 "n" + Name 39 "a" + Name 75 "one" + MemberName 75(one) 0 "a" + Name 77 "oneNonConst" + Name 82 "two" + MemberName 82(two) 0 "a" + MemberName 82(two) 1 "b" + Name 84 "twoNonConst" + Name 94 "PS_OUTPUT" + MemberName 94(PS_OUTPUT) 0 "color" + Name 96 "ps_output" + Name 103 "color" + Decorate 103(color) Location 0 2: TypeVoid 3: TypeFunction 2 8: TypeFloat 32 @@ -163,24 +408,44 @@ gl_FragCoord origin is upper left 29: 8(float) Constant 1091567616 30: 8(float) Constant 1092616192 31:25(mystruct2) ConstantComposite 28 29 30 - 33: TypeVector 8(float) 4 - 34(PS_OUTPUT): TypeStruct 33(fvec4) - 35: TypePointer Function 34(PS_OUTPUT) - 37: TypeInt 32 1 - 38: 37(int) Constant 0 - 39: 33(fvec4) ConstantComposite 13 13 13 13 - 40: TypePointer Function 33(fvec4) - 42: TypePointer Output 33(fvec4) - 43(color): 42(ptr) Variable Output + 33: 8(float) Constant 0 + 34: TypeVector 8(float) 3 + 35: TypeInt 32 0 + 36: 35(int) Constant 8 + 37: TypeArray 34(fvec3) 36 + 38: TypePointer Function 37 + 40: 8(float) Constant 1058262330 + 41: 34(fvec3) ConstantComposite 40 40 40 + 45: 8(float) Constant 3205745978 + 46: 34(fvec3) ConstantComposite 45 45 45 + 50: 34(fvec3) ConstantComposite 45 45 40 + 54: 34(fvec3) ConstantComposite 45 40 45 + 58: 34(fvec3) ConstantComposite 45 40 40 + 62: 34(fvec3) ConstantComposite 40 45 45 + 66: 34(fvec3) ConstantComposite 40 45 40 + 70: 34(fvec3) ConstantComposite 40 40 45 + 75(one): TypeStruct 34(fvec3) + 76: TypePointer Function 75(one) + 82(two): TypeStruct 34(fvec3) 34(fvec3) + 83: TypePointer Function 82(two) + 93: TypeVector 8(float) 4 + 94(PS_OUTPUT): TypeStruct 93(fvec4) + 95: TypePointer Function 94(PS_OUTPUT) + 97: TypeInt 32 1 + 98: 97(int) Constant 0 + 99: 93(fvec4) ConstantComposite 13 13 13 13 + 100: TypePointer Function 93(fvec4) + 102: TypePointer Output 93(fvec4) + 103(color): 102(ptr) Variable Output 4(main): 2 Function None 3 5: Label - 36(ps_output): 35(ptr) Variable Function - 32: 2 FunctionCall 6(Test1() - 41: 40(ptr) AccessChain 36(ps_output) 38 - Store 41 39 - 44: 40(ptr) AccessChain 36(ps_output) 38 - 45: 33(fvec4) Load 44 - Store 43(color) 45 + 96(ps_output): 95(ptr) Variable Function + 92: 2 FunctionCall 6(Test1() + 101: 100(ptr) AccessChain 96(ps_output) 98 + Store 101 99 + 104: 100(ptr) AccessChain 96(ps_output) 98 + 105: 93(fvec4) Load 104 + Store 103(color) 105 Return FunctionEnd 6(Test1(): 2 Function None 3 @@ -189,9 +454,64 @@ gl_FragCoord origin is upper left 17(test2): 11(ptr) Variable Function 23(test4): 22(ptr) Variable Function 27(test5): 26(ptr) Variable Function + 32(n): 22(ptr) Variable Function + 39(a): 38(ptr) Variable Function + 77(oneNonConst): 76(ptr) Variable Function + 84(twoNonConst): 83(ptr) Variable Function Store 12(test1) 16 Store 17(test2) 21 Store 23(test4) 24 Store 27(test5) 31 + Store 32(n) 33 + 42: 8(float) Load 32(n) + 43: 8(float) FAdd 42 13 + Store 32(n) 43 + 44: 34(fvec3) VectorTimesScalar 41 43 + 47: 8(float) Load 32(n) + 48: 8(float) FAdd 47 13 + Store 32(n) 48 + 49: 34(fvec3) VectorTimesScalar 46 48 + 51: 8(float) Load 32(n) + 52: 8(float) FAdd 51 13 + Store 32(n) 52 + 53: 34(fvec3) VectorTimesScalar 50 52 + 55: 8(float) Load 32(n) + 56: 8(float) FAdd 55 13 + Store 32(n) 56 + 57: 34(fvec3) VectorTimesScalar 54 56 + 59: 8(float) Load 32(n) + 60: 8(float) FAdd 59 13 + Store 32(n) 60 + 61: 34(fvec3) VectorTimesScalar 58 60 + 63: 8(float) Load 32(n) + 64: 8(float) FAdd 63 13 + Store 32(n) 64 + 65: 34(fvec3) VectorTimesScalar 62 64 + 67: 8(float) Load 32(n) + 68: 8(float) FAdd 67 13 + Store 32(n) 68 + 69: 34(fvec3) VectorTimesScalar 66 68 + 71: 8(float) Load 32(n) + 72: 8(float) FAdd 71 13 + Store 32(n) 72 + 73: 34(fvec3) VectorTimesScalar 70 72 + 74: 37 CompositeConstruct 44 49 53 57 61 65 69 73 + Store 39(a) 74 + 78: 8(float) Load 32(n) + 79: 8(float) FAdd 78 13 + Store 32(n) 79 + 80: 34(fvec3) VectorTimesScalar 58 79 + 81: 75(one) CompositeConstruct 80 + Store 77(oneNonConst) 81 + 85: 8(float) Load 32(n) + 86: 8(float) FAdd 85 13 + Store 32(n) 86 + 87: 34(fvec3) VectorTimesScalar 58 86 + 88: 8(float) Load 32(n) + 89: 8(float) FAdd 88 13 + Store 32(n) 89 + 90: 34(fvec3) VectorTimesScalar 58 89 + 91: 82(two) CompositeConstruct 87 90 + Store 84(twoNonConst) 91 Return FunctionEnd diff --git a/3rdparty/glslang/Test/baseResults/hlsl.rw.swizzle.frag.out b/3rdparty/glslang/Test/baseResults/hlsl.rw.swizzle.frag.out new file mode 100644 index 000000000..807fa681e --- /dev/null +++ b/3rdparty/glslang/Test/baseResults/hlsl.rw.swizzle.frag.out @@ -0,0 +1,286 @@ +hlsl.rw.swizzle.frag +Shader version: 450 +gl_FragCoord origin is upper left +0:? Sequence +0:4 Function Definition: SomeValue( (temp 3-component vector of float) +0:4 Function Parameters: +0:? Sequence +0:4 Branch: Return with expression +0:? Constant: +0:? 1.000000 +0:? 2.000000 +0:? 3.000000 +0:7 Function Definition: main( (temp 4-component vector of float) +0:7 Function Parameters: +0:? Sequence +0:8 Sequence +0:8 move second child to first child (temp 2-component vector of int) +0:8 'tc2' (temp 2-component vector of int) +0:8 Constant: +0:8 0 (const int) +0:8 0 (const int) +0:9 Sequence +0:9 move second child to first child (temp int) +0:9 'tc' (temp int) +0:9 Constant: +0:9 0 (const int) +0:12 Sequence +0:12 move second child to first child (temp 3-component vector of float) +0:12 vector swizzle (temp 3-component vector of float) +0:12 'storeTemp' (temp 3-component vector of float) +0:12 Sequence +0:12 Constant: +0:12 2 (const int) +0:12 Constant: +0:12 1 (const int) +0:12 Constant: +0:12 0 (const int) +0:? Constant: +0:? 1.000000 +0:? 2.000000 +0:? 3.000000 +0:12 imageStore (temp void) +0:12 'rwtx' (layout(rgba32f ) uniform image2D) +0:12 'tc2' (temp 2-component vector of int) +0:12 'storeTemp' (temp 3-component vector of float) +0:12 'storeTemp' (temp 3-component vector of float) +0:13 Sequence +0:13 move second child to first child (temp 3-component vector of float) +0:13 vector swizzle (temp 3-component vector of float) +0:13 'storeTemp' (temp 3-component vector of float) +0:13 Sequence +0:13 Constant: +0:13 2 (const int) +0:13 Constant: +0:13 1 (const int) +0:13 Constant: +0:13 0 (const int) +0:13 Function Call: SomeValue( (temp 3-component vector of float) +0:13 imageStore (temp void) +0:13 'rwtx' (layout(rgba32f ) uniform image2D) +0:13 'tc2' (temp 2-component vector of int) +0:13 'storeTemp' (temp 3-component vector of float) +0:13 'storeTemp' (temp 3-component vector of float) +0:14 Sequence +0:14 move second child to first child (temp 3-component vector of float) +0:14 vector swizzle (temp 3-component vector of float) +0:14 'storeTemp' (temp 3-component vector of float) +0:14 Sequence +0:14 Constant: +0:14 2 (const int) +0:14 Constant: +0:14 1 (const int) +0:14 Constant: +0:14 0 (const int) +0:14 Constant: +0:14 2.000000 +0:14 2.000000 +0:14 2.000000 +0:14 imageStore (temp void) +0:14 'rwtx' (layout(rgba32f ) uniform image2D) +0:14 'tc2' (temp 2-component vector of int) +0:14 'storeTemp' (temp 3-component vector of float) +0:14 'storeTemp' (temp 3-component vector of float) +0:27 Sequence +0:27 move second child to first child (temp 4-component vector of float) +0:? '@entryPointOutput' (layout(location=0 ) out 4-component vector of float) +0:27 Constant: +0:27 0.000000 +0:27 0.000000 +0:27 0.000000 +0:27 0.000000 +0:27 Branch: Return +0:? Linker Objects +0:? '@entryPointOutput' (layout(location=0 ) out 4-component vector of float) +0:? 'rwtx' (layout(rgba32f ) uniform image2D) +0:? 'buf' (layout(rgba32f ) uniform imageBuffer) + + +Linked fragment stage: + + +Shader version: 450 +gl_FragCoord origin is upper left +0:? Sequence +0:4 Function Definition: SomeValue( (temp 3-component vector of float) +0:4 Function Parameters: +0:? Sequence +0:4 Branch: Return with expression +0:? Constant: +0:? 1.000000 +0:? 2.000000 +0:? 3.000000 +0:7 Function Definition: main( (temp 4-component vector of float) +0:7 Function Parameters: +0:? Sequence +0:8 Sequence +0:8 move second child to first child (temp 2-component vector of int) +0:8 'tc2' (temp 2-component vector of int) +0:8 Constant: +0:8 0 (const int) +0:8 0 (const int) +0:9 Sequence +0:9 move second child to first child (temp int) +0:9 'tc' (temp int) +0:9 Constant: +0:9 0 (const int) +0:12 Sequence +0:12 move second child to first child (temp 3-component vector of float) +0:12 vector swizzle (temp 3-component vector of float) +0:12 'storeTemp' (temp 3-component vector of float) +0:12 Sequence +0:12 Constant: +0:12 2 (const int) +0:12 Constant: +0:12 1 (const int) +0:12 Constant: +0:12 0 (const int) +0:? Constant: +0:? 1.000000 +0:? 2.000000 +0:? 3.000000 +0:12 imageStore (temp void) +0:12 'rwtx' (layout(rgba32f ) uniform image2D) +0:12 'tc2' (temp 2-component vector of int) +0:12 'storeTemp' (temp 3-component vector of float) +0:12 'storeTemp' (temp 3-component vector of float) +0:13 Sequence +0:13 move second child to first child (temp 3-component vector of float) +0:13 vector swizzle (temp 3-component vector of float) +0:13 'storeTemp' (temp 3-component vector of float) +0:13 Sequence +0:13 Constant: +0:13 2 (const int) +0:13 Constant: +0:13 1 (const int) +0:13 Constant: +0:13 0 (const int) +0:13 Function Call: SomeValue( (temp 3-component vector of float) +0:13 imageStore (temp void) +0:13 'rwtx' (layout(rgba32f ) uniform image2D) +0:13 'tc2' (temp 2-component vector of int) +0:13 'storeTemp' (temp 3-component vector of float) +0:13 'storeTemp' (temp 3-component vector of float) +0:14 Sequence +0:14 move second child to first child (temp 3-component vector of float) +0:14 vector swizzle (temp 3-component vector of float) +0:14 'storeTemp' (temp 3-component vector of float) +0:14 Sequence +0:14 Constant: +0:14 2 (const int) +0:14 Constant: +0:14 1 (const int) +0:14 Constant: +0:14 0 (const int) +0:14 Constant: +0:14 2.000000 +0:14 2.000000 +0:14 2.000000 +0:14 imageStore (temp void) +0:14 'rwtx' (layout(rgba32f ) uniform image2D) +0:14 'tc2' (temp 2-component vector of int) +0:14 'storeTemp' (temp 3-component vector of float) +0:14 'storeTemp' (temp 3-component vector of float) +0:27 Sequence +0:27 move second child to first child (temp 4-component vector of float) +0:? '@entryPointOutput' (layout(location=0 ) out 4-component vector of float) +0:27 Constant: +0:27 0.000000 +0:27 0.000000 +0:27 0.000000 +0:27 0.000000 +0:27 Branch: Return +0:? Linker Objects +0:? '@entryPointOutput' (layout(location=0 ) out 4-component vector of float) +0:? 'rwtx' (layout(rgba32f ) uniform image2D) +0:? 'buf' (layout(rgba32f ) uniform imageBuffer) + +// Module Version 10000 +// Generated by (magic number): 80001 +// Id's are bound by 58 + + Capability Shader + Capability SampledBuffer + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" 51 + ExecutionMode 4 OriginUpperLeft + Name 4 "main" + Name 9 "SomeValue(" + Name 20 "tc2" + Name 24 "tc" + Name 26 "storeTemp" + Name 31 "rwtx" + Name 35 "storeTemp" + Name 42 "storeTemp" + Name 51 "@entryPointOutput" + Name 57 "buf" + Decorate 31(rwtx) DescriptorSet 0 + Decorate 51(@entryPointOutput) Location 0 + Decorate 57(buf) DescriptorSet 0 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 3 + 8: TypeFunction 7(fvec3) + 11: 6(float) Constant 1065353216 + 12: 6(float) Constant 1073741824 + 13: 6(float) Constant 1077936128 + 14: 7(fvec3) ConstantComposite 11 12 13 + 17: TypeInt 32 1 + 18: TypeVector 17(int) 2 + 19: TypePointer Function 18(ivec2) + 21: 17(int) Constant 0 + 22: 18(ivec2) ConstantComposite 21 21 + 23: TypePointer Function 17(int) + 25: TypePointer Function 7(fvec3) + 29: TypeImage 6(float) 2D nonsampled format:Rgba32f + 30: TypePointer UniformConstant 29 + 31(rwtx): 30(ptr) Variable UniformConstant + 43: 7(fvec3) ConstantComposite 12 12 12 + 49: TypeVector 6(float) 4 + 50: TypePointer Output 49(fvec4) +51(@entryPointOutput): 50(ptr) Variable Output + 52: 6(float) Constant 0 + 53: 49(fvec4) ConstantComposite 52 52 52 52 + 55: TypeImage 6(float) Buffer nonsampled format:Rgba32f + 56: TypePointer UniformConstant 55 + 57(buf): 56(ptr) Variable UniformConstant + 4(main): 2 Function None 3 + 5: Label + 20(tc2): 19(ptr) Variable Function + 24(tc): 23(ptr) Variable Function + 26(storeTemp): 25(ptr) Variable Function + 35(storeTemp): 25(ptr) Variable Function + 42(storeTemp): 25(ptr) Variable Function + Store 20(tc2) 22 + Store 24(tc) 21 + 27: 7(fvec3) Load 26(storeTemp) + 28: 7(fvec3) VectorShuffle 27 14 5 4 3 + Store 26(storeTemp) 28 + 32: 29 Load 31(rwtx) + 33: 18(ivec2) Load 20(tc2) + 34: 7(fvec3) Load 26(storeTemp) + ImageWrite 32 33 34 + 36: 7(fvec3) FunctionCall 9(SomeValue() + 37: 7(fvec3) Load 35(storeTemp) + 38: 7(fvec3) VectorShuffle 37 36 5 4 3 + Store 35(storeTemp) 38 + 39: 29 Load 31(rwtx) + 40: 18(ivec2) Load 20(tc2) + 41: 7(fvec3) Load 35(storeTemp) + ImageWrite 39 40 41 + 44: 7(fvec3) Load 42(storeTemp) + 45: 7(fvec3) VectorShuffle 44 43 5 4 3 + Store 42(storeTemp) 45 + 46: 29 Load 31(rwtx) + 47: 18(ivec2) Load 20(tc2) + 48: 7(fvec3) Load 42(storeTemp) + ImageWrite 46 47 48 + Store 51(@entryPointOutput) 53 + Return + FunctionEnd + 9(SomeValue(): 7(fvec3) Function None 8 + 10: Label + ReturnValue 14 + FunctionEnd diff --git a/3rdparty/glslang/Test/baseResults/preprocessor.include.disabled.vert.err b/3rdparty/glslang/Test/baseResults/preprocessor.include.disabled.vert.err index da1704796..14192046a 100644 --- a/3rdparty/glslang/Test/baseResults/preprocessor.include.disabled.vert.err +++ b/3rdparty/glslang/Test/baseResults/preprocessor.include.disabled.vert.err @@ -3,11 +3,11 @@ ERROR: 0:8000: '#include' : must be followed by a header name ERROR: 0:8001: '#include' : required extension not requested: GL_GOOGLE_include_directive ERROR: 0:8001: '#include' : must be followed by a header name ERROR: 0:8002: '#include' : required extension not requested: GL_GOOGLE_include_directive -ERROR: 0:8002: '#include' : unexpected include directive +ERROR: 0:8002: '#include' : Could not process include directive for header name: foo ERROR: 0:8003: '#include' : required extension not requested: GL_GOOGLE_include_directive -ERROR: 0:8003: '#include' : extra content after header name +ERROR: 0:8003: '#include' : extra content after header name: foo ERROR: 0:8004: '#include' : required extension not requested: GL_GOOGLE_include_directive -ERROR: 0:8004: '#include' : expected newline +ERROR: 0:8004: '#include' : expected newline after header name: no-eol ERROR: 10 compilation errors. No code generated. diff --git a/3rdparty/glslang/Test/baseResults/preprocessor.include.enabled.vert.err b/3rdparty/glslang/Test/baseResults/preprocessor.include.enabled.vert.err index b19b835cf..252e661f0 100644 --- a/3rdparty/glslang/Test/baseResults/preprocessor.include.enabled.vert.err +++ b/3rdparty/glslang/Test/baseResults/preprocessor.include.enabled.vert.err @@ -1,13 +1,20 @@ ERROR: 0:8000: '#include' : must be followed by a header name ERROR: 0:8001: '#include' : must be followed by a header name -ERROR: 0:8002: '#include' : unexpected include directive -ERROR: 0:8003: '#include' : unexpected include directive -ERROR: 0:8004: '#include' : extra content after header name -ERROR: 0:8005: '#include' : extra content after header name -ERROR: 0:8007: '#include' : unexpected include directive -ERROR: 0:8009: '' : header name too long -ERROR: 0:8009: '#include' : unexpected include directive -ERROR: 0:8010: '#include' : expected newline -ERROR: 10 compilation errors. No code generated. +ERROR: 0:8002: '#include' : Could not process include directive for header name: foo.oeu +ERROR: 0:8003: '#include' : Could not process include directive for header name: foo.oeu/ao eu/ao.h +ERROR: 0:8004: '#include' : Could not process include directive for header name: foo +ERROR: 0:8006: '#include' : Could not process include directive for header name: foo.oe +ERROR: 0:8007: '#include' : Could not process include directive for header name: foo"bar" +ERROR: 0:8008: '#include' : Could not process include directive for header name: foo\bar +ERROR: 0:8009: '#include' : Could not process include directive for header name: foo.oe> +ERROR: 0:8010: '#include' : Could not process include directive for header name: foo +ERROR: 0:8011: '#include' : extra content after header name: foo2.h +ERROR: 0:8012: '#include' : extra content after header name: foo.h +ERROR: 0:8014: '#include' : Could not process include directive for header name: ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789 +ERROR: 0:8016: '' : header name too long +ERROR: 0:8016: '#include' : Could not process include directive for header name: ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789 +ERROR: 0:8017: '#include' : expected newline after header name: no-eol +ERROR: 17 compilation errors. No code generated. diff --git a/3rdparty/glslang/Test/hlsl.init2.frag b/3rdparty/glslang/Test/hlsl.init2.frag index 789f1a065..2b9b7e688 100644 --- a/3rdparty/glslang/Test/hlsl.init2.frag +++ b/3rdparty/glslang/Test/hlsl.init2.frag @@ -18,6 +18,25 @@ void Test1() struct mystruct2 { float a; float b; float c; }; mystruct2 test5 = { {8,}, {9,}, {10}, }; + const mystruct2 constTest5 = { {8,}, {9,}, {10}, }; + constTest5.c; + + const float step = 1.f; + float n = 0; + const float3 a[8] = { + normalize(float3(1, 1, 1)) * (n += step), + normalize(float3(-1, -1, -1)) * (n += step), + normalize(float3(-1, -1, 1)) * (n += step), + normalize(float3(-1, 1, -1)) * (n += step), + normalize(float3(-1, 1, 1)) * (n += step), + normalize(float3(1, -1, -1)) * (n += step), + normalize(float3(1, -1, 1)) * (n += step), + normalize(float3(1, 1, -1)) * (n += step) }; + + const struct one { float3 a; } oneNonConst = { normalize(float3(-1, 1, 1)) * (n += step) }; + const struct two { float3 a; + float3 b; } twoNonConst = { normalize(float3(-1, 1, 1)) * (n += step), + normalize(float3(-1, 1, 1)) * (n += step) }; } struct PS_OUTPUT { float4 color : SV_Target0; }; diff --git a/3rdparty/glslang/Test/hlsl.rw.swizzle.frag b/3rdparty/glslang/Test/hlsl.rw.swizzle.frag new file mode 100644 index 000000000..356ed73dd --- /dev/null +++ b/3rdparty/glslang/Test/hlsl.rw.swizzle.frag @@ -0,0 +1,28 @@ +RWTexture2D rwtx; +RWBuffer buf; + +float3 SomeValue() { return float3(1,2,3); } + +float4 main() : SV_Target0 +{ + int2 tc2 = { 0, 0 }; + int tc = 0; + + // Test swizzles and partial updates of L-values when writing to buffers and writable textures. + rwtx[tc2].zyx = float3(1,2,3); // full swizzle, simple RHS + rwtx[tc2].zyx = SomeValue(); // full swizzle, complex RHS + rwtx[tc2].zyx = 2; // full swizzle, modify op + + // Partial updates not yet supported. + // Partial values, which will use swizzles. + // buf[tc].yz = 42; // partial swizzle, simple RHS + // buf[tc].yz = SomeValue().x; // partial swizzle, complex RHS + // buf[tc].yz += 43; // partial swizzle, modify op + + // // Partial values, which will use index. + // buf[tc].y = 44; // single index, simple RHS + // buf[tc].y = SomeValue().x; // single index, complex RHS + // buf[tc].y += 45; // single index, modify op + + return 0.0; +} diff --git a/3rdparty/glslang/Test/preprocessor.include.enabled.vert b/3rdparty/glslang/Test/preprocessor.include.enabled.vert index 6d64b2301..985eae2ce 100644 --- a/3rdparty/glslang/Test/preprocessor.include.enabled.vert +++ b/3rdparty/glslang/Test/preprocessor.include.enabled.vert @@ -2,10 +2,17 @@ #line 8000 #include #include 123 -#include "foo" +#include "foo.oeu" +#include "foo.oeu/ao eu/ao.h" +#include "foo" +#include +#include +#include +#include "foo.oe>" #include -#include "foo" garbage -#include garbage +#include "foo2.h" garbage +#include garbage // max length #include // too long diff --git a/3rdparty/glslang/glslang/GenericCodeGen/CodeGen.cpp b/3rdparty/glslang/glslang/GenericCodeGen/CodeGen.cpp index dc78342ac..b3c7226df 100644 --- a/3rdparty/glslang/glslang/GenericCodeGen/CodeGen.cpp +++ b/3rdparty/glslang/glslang/GenericCodeGen/CodeGen.cpp @@ -1,10 +1,10 @@ // -//Copyright (C) 2002-2005 3Dlabs Inc. Ltd. -//All rights reserved. +// Copyright (C) 2002-2005 3Dlabs Inc. Ltd. +// All rights reserved. // -//Redistribution and use in source and binary forms, with or without -//modification, are permitted provided that the following conditions -//are met: +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: // // Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. @@ -18,18 +18,18 @@ // contributors may be used to endorse or promote products derived // from this software without specific prior written permission. // -//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -//"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS -//FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE -//COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, -//INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -//BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -//LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -//CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -//LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN -//ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -//POSSIBILITY OF SUCH DAMAGE. +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +// COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. // #include "../Include/Common.h" diff --git a/3rdparty/glslang/glslang/GenericCodeGen/Link.cpp b/3rdparty/glslang/glslang/GenericCodeGen/Link.cpp index 8da88bda7..c38db0f69 100644 --- a/3rdparty/glslang/glslang/GenericCodeGen/Link.cpp +++ b/3rdparty/glslang/glslang/GenericCodeGen/Link.cpp @@ -1,10 +1,10 @@ // -//Copyright (C) 2002-2005 3Dlabs Inc. Ltd. -//All rights reserved. +// Copyright (C) 2002-2005 3Dlabs Inc. Ltd. +// All rights reserved. // -//Redistribution and use in source and binary forms, with or without -//modification, are permitted provided that the following conditions -//are met: +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: // // Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. @@ -18,18 +18,18 @@ // contributors may be used to endorse or promote products derived // from this software without specific prior written permission. // -//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -//"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS -//FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE -//COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, -//INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -//BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -//LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -//CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -//LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN -//ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -//POSSIBILITY OF SUCH DAMAGE. +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +// COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. // // diff --git a/3rdparty/glslang/glslang/Include/BaseTypes.h b/3rdparty/glslang/glslang/Include/BaseTypes.h index f70744067..f3648a64b 100644 --- a/3rdparty/glslang/glslang/Include/BaseTypes.h +++ b/3rdparty/glslang/glslang/Include/BaseTypes.h @@ -1,12 +1,12 @@ // -//Copyright (C) 2002-2005 3Dlabs Inc. Ltd. -//Copyright (C) 2012-2013 LunarG, Inc. +// Copyright (C) 2002-2005 3Dlabs Inc. Ltd. +// Copyright (C) 2012-2013 LunarG, Inc. // -//All rights reserved. +// All rights reserved. // -//Redistribution and use in source and binary forms, with or without -//modification, are permitted provided that the following conditions -//are met: +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: // // Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. @@ -20,18 +20,18 @@ // contributors may be used to endorse or promote products derived // from this software without specific prior written permission. // -//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -//"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS -//FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE -//COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, -//INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -//BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -//LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -//CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -//LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN -//ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -//POSSIBILITY OF SUCH DAMAGE. +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +// COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. // #ifndef _BASICTYPES_INCLUDED_ @@ -84,7 +84,7 @@ enum TStorageQualifier { EvqUniform, // read only, shared with app EvqBuffer, // read/write, shared with app EvqShared, // compute shader's read/write 'shared' qualifier - + // parameters EvqIn, // also, for 'in' in the grammar before we know if it's a pipeline input or an 'in' parameter EvqOut, // also, for 'out' in the grammar before we know if it's a pipeline output or an 'out' parameter @@ -212,7 +212,7 @@ enum TBuiltInVariable { }; // These will show up in error messages -__inline const char* GetStorageQualifierString(TStorageQualifier q) +__inline const char* GetStorageQualifierString(TStorageQualifier q) { switch (q) { case EvqTemporary: return "temp"; break; diff --git a/3rdparty/glslang/glslang/Include/Common.h b/3rdparty/glslang/glslang/Include/Common.h index 1433770cf..17c2bd984 100644 --- a/3rdparty/glslang/glslang/Include/Common.h +++ b/3rdparty/glslang/glslang/Include/Common.h @@ -1,12 +1,12 @@ // -//Copyright (C) 2002-2005 3Dlabs Inc. Ltd. -//Copyright (C) 2012-2013 LunarG, Inc. +// Copyright (C) 2002-2005 3Dlabs Inc. Ltd. +// Copyright (C) 2012-2013 LunarG, Inc. // -//All rights reserved. +// All rights reserved. // -//Redistribution and use in source and binary forms, with or without -//modification, are permitted provided that the following conditions -//are met: +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: // // Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. @@ -20,18 +20,18 @@ // contributors may be used to endorse or promote products derived // from this software without specific prior written permission. // -//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -//"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS -//FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE -//COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, -//INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -//BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -//LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -//CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -//LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN -//ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -//POSSIBILITY OF SUCH DAMAGE. +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +// COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. // #ifndef _COMMON_INCLUDED_ @@ -66,7 +66,7 @@ std::string to_string(const T& val) { #if defined(_MSC_VER) && _MSC_VER < 1700 inline long long int strtoll (const char* str, char** endptr, int base) { - return _strtoi64(str, endptr, base); + return _strtoi64(str, endptr, base); } inline unsigned long long int strtoull (const char* str, char** endptr, int base) { @@ -178,7 +178,7 @@ public: template class TList : public std::list > { }; -template > +template > class TMap : public std::map > > { }; @@ -212,14 +212,14 @@ inline const TString String(const int i, const int base = 10) inline const TString String(const int i, const int /*base*/ = 10) { char text[16]; // 32 bit ints are at most 10 digits in base 10 - + // we assume base 10 for all cases snprintf(text, sizeof(text), "%d", i); return text; } #endif - + struct TSourceLoc { void init() { name = nullptr; string = 0; line = 0; column = 0; } // Returns the name if it exists. Otherwise, returns the string number. diff --git a/3rdparty/glslang/glslang/Include/ConstantUnion.h b/3rdparty/glslang/glslang/Include/ConstantUnion.h index ec6aff117..b95bc25a0 100644 --- a/3rdparty/glslang/glslang/Include/ConstantUnion.h +++ b/3rdparty/glslang/glslang/Include/ConstantUnion.h @@ -1,12 +1,12 @@ // -//Copyright (C) 2002-2005 3Dlabs Inc. Ltd. -//Copyright (C) 2013 LunarG, Inc. +// Copyright (C) 2002-2005 3Dlabs Inc. Ltd. +// Copyright (C) 2013 LunarG, Inc. // -//All rights reserved. +// All rights reserved. // -//Redistribution and use in source and binary forms, with or without -//modification, are permitted provided that the following conditions -//are met: +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: // // Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. @@ -20,18 +20,18 @@ // contributors may be used to endorse or promote products derived // from this software without specific prior written permission. // -//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -//"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS -//FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE -//COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, -//INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -//BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -//LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -//CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -//LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN -//ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -//POSSIBILITY OF SUCH DAMAGE. +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +// COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. // #ifndef _CONSTANT_UNION_INCLUDED_ @@ -46,14 +46,14 @@ public: TConstUnion() : iConst(0), type(EbtInt) { } void setIConst(int i) - { - iConst = i; + { + iConst = i; type = EbtInt; } void setUConst(unsigned int u) { - uConst = u; + uConst = u; type = EbtUint; } @@ -71,13 +71,13 @@ public: void setDConst(double d) { - dConst = d; + dConst = d; type = EbtDouble; } void setBConst(bool b) { - bConst = b; + bConst = b; type = EbtBool; } @@ -215,7 +215,7 @@ public: } bool operator>(const TConstUnion& constant) const - { + { assert(type == constant.type); switch (type) { case EbtInt: @@ -250,7 +250,7 @@ public: } bool operator<(const TConstUnion& constant) const - { + { assert(type == constant.type); switch (type) { case EbtInt: @@ -285,7 +285,7 @@ public: } TConstUnion operator+(const TConstUnion& constant) const - { + { TConstUnion returnValue; assert(type == constant.type); switch (type) { @@ -301,7 +301,7 @@ public: } TConstUnion operator-(const TConstUnion& constant) const - { + { TConstUnion returnValue; assert(type == constant.type); switch (type) { @@ -317,7 +317,7 @@ public: } TConstUnion operator*(const TConstUnion& constant) const - { + { TConstUnion returnValue; assert(type == constant.type); switch (type) { @@ -325,7 +325,7 @@ public: case EbtInt64: returnValue.setI64Const(i64Const * constant.i64Const); break; case EbtUint: returnValue.setUConst(uConst * constant.uConst); break; case EbtUint64: returnValue.setU64Const(u64Const * constant.u64Const); break; - case EbtDouble: returnValue.setDConst(dConst * constant.dConst); break; + case EbtDouble: returnValue.setDConst(dConst * constant.dConst); break; default: assert(false && "Default missing"); } @@ -333,7 +333,7 @@ public: } TConstUnion operator%(const TConstUnion& constant) const - { + { TConstUnion returnValue; assert(type == constant.type); switch (type) { @@ -348,7 +348,7 @@ public: } TConstUnion operator>>(const TConstUnion& constant) const - { + { TConstUnion returnValue; switch (type) { case EbtInt: @@ -394,7 +394,7 @@ public: } TConstUnion operator<<(const TConstUnion& constant) const - { + { TConstUnion returnValue; switch (type) { case EbtInt: @@ -440,7 +440,7 @@ public: } TConstUnion operator&(const TConstUnion& constant) const - { + { TConstUnion returnValue; assert(type == constant.type); switch (type) { @@ -455,7 +455,7 @@ public: } TConstUnion operator|(const TConstUnion& constant) const - { + { TConstUnion returnValue; assert(type == constant.type); switch (type) { @@ -470,7 +470,7 @@ public: } TConstUnion operator^(const TConstUnion& constant) const - { + { TConstUnion returnValue; assert(type == constant.type); switch (type) { @@ -485,7 +485,7 @@ public: } TConstUnion operator~() const - { + { TConstUnion returnValue; switch (type) { case EbtInt: returnValue.setIConst(~iConst); break; @@ -499,7 +499,7 @@ public: } TConstUnion operator&&(const TConstUnion& constant) const - { + { TConstUnion returnValue; assert(type == constant.type); switch (type) { @@ -511,7 +511,7 @@ public: } TConstUnion operator||(const TConstUnion& constant) const - { + { TConstUnion returnValue; assert(type == constant.type); switch (type) { @@ -544,7 +544,7 @@ private: // One convenience is being able to use [] to go inside the array, instead // of C++ assuming it as an array of pointers to vectors. // -// General usage is that the size is known up front, and it is +// General usage is that the size is known up front, and it is // created once with the proper size. // class TConstUnionArray { diff --git a/3rdparty/glslang/glslang/Include/InfoSink.h b/3rdparty/glslang/glslang/Include/InfoSink.h index 0cbd99bda..dceb603cf 100644 --- a/3rdparty/glslang/glslang/Include/InfoSink.h +++ b/3rdparty/glslang/glslang/Include/InfoSink.h @@ -1,10 +1,10 @@ // -//Copyright (C) 2002-2005 3Dlabs Inc. Ltd. -//All rights reserved. +// Copyright (C) 2002-2005 3Dlabs Inc. Ltd. +// All rights reserved. // -//Redistribution and use in source and binary forms, with or without -//modification, are permitted provided that the following conditions -//are met: +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: // // Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. @@ -18,18 +18,18 @@ // contributors may be used to endorse or promote products derived // from this software without specific prior written permission. // -//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -//"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS -//FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE -//COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, -//INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -//BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -//LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -//CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -//LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN -//ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -//POSSIBILITY OF SUCH DAMAGE. +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +// COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. // #ifndef _INFOSINK_INCLUDED_ @@ -74,9 +74,9 @@ public: TInfoSinkBase& operator<<(const char* s) { append(s); return *this; } TInfoSinkBase& operator<<(int n) { append(String(n)); return *this; } TInfoSinkBase& operator<<(unsigned int n) { append(String(n)); return *this; } - TInfoSinkBase& operator<<(float n) { const int size = 40; char buf[size]; + TInfoSinkBase& operator<<(float n) { const int size = 40; char buf[size]; snprintf(buf, size, (fabs(n) > 1e-8 && fabs(n) < 1e8) || n == 0.0f ? "%f" : "%g", n); - append(buf); + append(buf); return *this; } TInfoSinkBase& operator+(const TPersistString& t) { append(t); return *this; } TInfoSinkBase& operator+(const TString& t) { append(t); return *this; } @@ -113,20 +113,20 @@ public: append(s); append("\n"); } - + void setOutputStream(int output = 4) { outputStream = output; } protected: - void append(const char* s); + void append(const char* s); void append(int count, char c); void append(const TPersistString& t); void append(const TString& t); - void checkMem(size_t growth) { if (sink.capacity() < sink.size() + growth + 2) + void checkMem(size_t growth) { if (sink.capacity() < sink.size() + growth + 2) sink.reserve(sink.capacity() + sink.capacity() / 2); } void appendToStream(const char* s); TPersistString sink; diff --git a/3rdparty/glslang/glslang/Include/InitializeGlobals.h b/3rdparty/glslang/glslang/Include/InitializeGlobals.h index 6c9f54a03..4cf2dca7c 100644 --- a/3rdparty/glslang/glslang/Include/InitializeGlobals.h +++ b/3rdparty/glslang/glslang/Include/InitializeGlobals.h @@ -1,10 +1,10 @@ // -//Copyright (C) 2002-2005 3Dlabs Inc. Ltd. -//All rights reserved. +// Copyright (C) 2002-2005 3Dlabs Inc. Ltd. +// All rights reserved. // -//Redistribution and use in source and binary forms, with or without -//modification, are permitted provided that the following conditions -//are met: +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: // // Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. @@ -18,18 +18,18 @@ // contributors may be used to endorse or promote products derived // from this software without specific prior written permission. // -//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -//"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS -//FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE -//COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, -//INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -//BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -//LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -//CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -//LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN -//ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -//POSSIBILITY OF SUCH DAMAGE. +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +// COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. // #ifndef __INITIALIZE_GLOBALS_INCLUDED_ diff --git a/3rdparty/glslang/glslang/Include/PoolAlloc.h b/3rdparty/glslang/glslang/Include/PoolAlloc.h index 635be79ef..100c7d0b5 100644 --- a/3rdparty/glslang/glslang/Include/PoolAlloc.h +++ b/3rdparty/glslang/glslang/Include/PoolAlloc.h @@ -1,12 +1,12 @@ // -//Copyright (C) 2002-2005 3Dlabs Inc. Ltd. -//Copyright (C) 2012-2013 LunarG, Inc. +// Copyright (C) 2002-2005 3Dlabs Inc. Ltd. +// Copyright (C) 2012-2013 LunarG, Inc. // -//All rights reserved. +// All rights reserved. // -//Redistribution and use in source and binary forms, with or without -//modification, are permitted provided that the following conditions -//are met: +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: // // Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. @@ -20,18 +20,18 @@ // contributors may be used to endorse or promote products derived // from this software without specific prior written permission. // -//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -//"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS -//FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE -//COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, -//INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -//BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -//LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -//CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -//LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN -//ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -//POSSIBILITY OF SUCH DAMAGE. +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +// COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. // #ifndef _POOLALLOC_INCLUDED_ @@ -43,8 +43,8 @@ // // This header defines an allocator that can be used to efficiently -// allocate a large number of small requests for heap memory, with the -// intention that they are not individually deallocated, but rather +// allocate a large number of small requests for heap memory, with the +// intention that they are not individually deallocated, but rather // collectively deallocated at one time. // // This simultaneously @@ -70,7 +70,7 @@ namespace glslang { // If we are using guard blocks, we must track each individual // allocation. If we aren't using guard blocks, these // never get instantiated, so won't have any impact. -// +// class TAllocation { public: @@ -87,7 +87,7 @@ public: memset(postGuard(), guardBlockEndVal, guardBlockSize); # endif } - + void check() const { checkGuardBlock(preGuard(), guardBlockBeginVal, "before"); checkGuardBlock(postGuard(), guardBlockEndVal, "after"); @@ -100,7 +100,7 @@ public: inline static size_t allocationSize(size_t size) { return size + 2 * guardBlockSize + headerSize(); } - + // Offset from surrounding buffer to get to user data buffer. inline static unsigned char* offsetAllocation(unsigned char* m) { return m + guardBlockSize + headerSize(); @@ -123,16 +123,16 @@ private: const static unsigned char userDataFill; const static size_t guardBlockSize; -# ifdef GUARD_BLOCKS +# ifdef GUARD_BLOCKS inline static size_t headerSize() { return sizeof(TAllocation); } # else inline static size_t headerSize() { return 0; } # endif }; - + // // There are several stacks. One is to track the pushing and popping -// of the user, and not yet implemented. The others are simply a +// of the user, and not yet implemented. The others are simply a // repositories of free pages or used pages. // // Page stacks are linked together with a simple header at the beginning @@ -141,7 +141,7 @@ private: // re-use. // // The "page size" used is not, nor must it match, the underlying OS -// page size. But, having it be about that size or equal to a set of +// page size. But, having it be about that size or equal to a set of // pages is likely most optimal. // class TPoolAllocator { @@ -185,7 +185,7 @@ public: protected: friend struct tHeader; - + struct tHeader { tHeader(tHeader* nextPage, size_t pageCount) : #ifdef GUARD_BLOCKS @@ -227,7 +227,7 @@ protected: } size_t pageSize; // granularity of allocation from the OS - size_t alignment; // all returned allocations will be aligned at + size_t alignment; // all returned allocations will be aligned at // this granularity, which will be a power of 2 size_t alignmentMask; size_t headerSkip; // amount of memory to skip to make room for the @@ -245,7 +245,6 @@ private: TPoolAllocator(const TPoolAllocator&); // don't allow default copy constructor }; - // // There could potentially be many pools with pops happening at // different times. But a simple use is to have a global pop @@ -278,7 +277,7 @@ public: typedef T& reference; typedef const T& const_reference; typedef T value_type; - template + template struct rebind { typedef pool_allocator other; }; @@ -292,9 +291,9 @@ public: template pool_allocator(const pool_allocator& p) : allocator(p.getAllocator()) { } - pointer allocate(size_type n) { + pointer allocate(size_type n) { return reinterpret_cast(getAllocator().allocate(n * sizeof(T))); } - pointer allocate(size_type n, const void*) { + pointer allocate(size_type n, const void*) { return reinterpret_cast(getAllocator().allocate(n * sizeof(T))); } void deallocate(void*, size_type) { } diff --git a/3rdparty/glslang/glslang/Include/ResourceLimits.h b/3rdparty/glslang/glslang/Include/ResourceLimits.h index e8c743d6b..0d07b8c84 100644 --- a/3rdparty/glslang/glslang/Include/ResourceLimits.h +++ b/3rdparty/glslang/glslang/Include/ResourceLimits.h @@ -1,12 +1,12 @@ // -//Copyright (C) 2002-2005 3Dlabs Inc. Ltd. -//Copyright (C) 2013 LunarG, Inc. +// Copyright (C) 2002-2005 3Dlabs Inc. Ltd. +// Copyright (C) 2013 LunarG, Inc. // -//All rights reserved. +// All rights reserved. // -//Redistribution and use in source and binary forms, with or without -//modification, are permitted provided that the following conditions -//are met: +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: // // Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. @@ -20,18 +20,18 @@ // contributors may be used to endorse or promote products derived // from this software without specific prior written permission. // -//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -//"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS -//FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE -//COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, -//INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -//BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -//LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -//CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -//LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN -//ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -//POSSIBILITY OF SUCH DAMAGE. +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +// COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. // #ifndef _RESOURCE_LIMITS_INCLUDED_ @@ -81,7 +81,7 @@ struct TBuiltInResource { int maxComputeImageUniforms; int maxComputeAtomicCounters; int maxComputeAtomicCounterBuffers; - int maxVaryingComponents; + int maxVaryingComponents; int maxVertexOutputComponents; int maxGeometryInputComponents; int maxGeometryOutputComponents; diff --git a/3rdparty/glslang/glslang/Include/ShHandle.h b/3rdparty/glslang/glslang/Include/ShHandle.h index bfc97db8b..64ba6d636 100644 --- a/3rdparty/glslang/glslang/Include/ShHandle.h +++ b/3rdparty/glslang/glslang/Include/ShHandle.h @@ -1,10 +1,10 @@ // -//Copyright (C) 2002-2005 3Dlabs Inc. Ltd. -//All rights reserved. +// Copyright (C) 2002-2005 3Dlabs Inc. Ltd. +// All rights reserved. // -//Redistribution and use in source and binary forms, with or without -//modification, are permitted provided that the following conditions -//are met: +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: // // Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. @@ -18,18 +18,18 @@ // contributors may be used to endorse or promote products derived // from this software without specific prior written permission. // -//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -//"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS -//FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE -//COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, -//INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -//BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -//LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -//CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -//LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN -//ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -//POSSIBILITY OF SUCH DAMAGE. +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +// COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. // #ifndef _SHHANDLE_INCLUDED_ @@ -42,8 +42,7 @@ // This should not be included by driver code. // - -#define SH_EXPORTING +#define SH_EXPORTING #include "../Public/ShaderLang.h" #include "../MachineIndependent/Versions.h" #include "InfoSink.h" @@ -73,7 +72,7 @@ public: TUniformMap() { } virtual ~TUniformMap() { } virtual TUniformMap* getAsUniformMap() { return this; } - virtual int getLocation(const char* name) = 0; + virtual int getLocation(const char* name) = 0; virtual TInfoSink& getInfoSink() { return infoSink; } TInfoSink infoSink; }; @@ -95,7 +94,7 @@ public: virtual TCompiler* getAsCompiler() { return this; } virtual bool linkable() { return haveValidObjectCode; } - + TInfoSink& infoSink; protected: TCompiler& operator=(TCompiler&); @@ -117,9 +116,9 @@ typedef glslang::TVector THandleList; class TLinker : public TShHandleBase { public: - TLinker(EShExecutable e, TInfoSink& iSink) : + TLinker(EShExecutable e, TInfoSink& iSink) : infoSink(iSink), - executable(e), + executable(e), haveReturnableObjectCode(false), appAttributeBindings(0), fixedAttributeBindings(0), @@ -147,7 +146,7 @@ protected: const ShBindingTable* fixedAttributeBindings; const int* excludedAttributes; int excludedCount; - ShBindingTable* uniformBindings; // created by the linker + ShBindingTable* uniformBindings; // created by the linker }; // @@ -155,7 +154,7 @@ protected: // and the machine dependent code. // // The machine dependent code should derive from the classes -// above. Then Construct*() and Delete*() will create and +// above. Then Construct*() and Delete*() will create and // destroy the machine dependent objects, which contain the // above machine independent information. // @@ -165,7 +164,7 @@ TShHandleBase* ConstructLinker(EShExecutable, int); TShHandleBase* ConstructBindings(); void DeleteLinker(TShHandleBase*); void DeleteBindingList(TShHandleBase* bindingList); - + TUniformMap* ConstructUniformMap(); void DeleteCompiler(TCompiler*); diff --git a/3rdparty/glslang/glslang/Include/Types.h b/3rdparty/glslang/glslang/Include/Types.h index 6bd201d4f..684408a86 100644 --- a/3rdparty/glslang/glslang/Include/Types.h +++ b/3rdparty/glslang/glslang/Include/Types.h @@ -1,13 +1,13 @@ // -//Copyright (C) 2002-2005 3Dlabs Inc. Ltd. -//Copyright (C) 2012-2016 LunarG, Inc. -//Copyright (C) 2015-2016 Google, Inc. +// Copyright (C) 2002-2005 3Dlabs Inc. Ltd. +// Copyright (C) 2012-2016 LunarG, Inc. +// Copyright (C) 2015-2016 Google, Inc. // -//All rights reserved. +// All rights reserved. // -//Redistribution and use in source and binary forms, with or without -//modification, are permitted provided that the following conditions -//are met: +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: // // Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. @@ -21,18 +21,18 @@ // contributors may be used to endorse or promote products derived // from this software without specific prior written permission. // -//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -//"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS -//FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE -//COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, -//INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -//BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -//LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -//CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -//LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN -//ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -//POSSIBILITY OF SUCH DAMAGE. +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +// COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. // #ifndef _TYPES_INCLUDED @@ -421,7 +421,7 @@ public: clearLayout(); } - // Drop just the storage qualification, which perhaps should + // Drop just the storage qualification, which perhaps should // never be done, as it is fundamentally inconsistent, but need to // explore what downstream consumers need. // E.g., in a deference, it is an inconsistency between: @@ -927,9 +927,9 @@ struct TShaderQualifiers { TLayoutDepth layoutDepth; bool blendEquation; // true if any blend equation was specified -#ifdef NV_EXTENSIONS +#ifdef NV_EXTENSIONS bool layoutOverrideCoverage; // true if layout override_coverage set -#endif +#endif void init() { @@ -950,7 +950,7 @@ struct TShaderQualifiers { earlyFragmentTests = false; layoutDepth = EldNone; blendEquation = false; -#ifdef NV_EXTENSIONS +#ifdef NV_EXTENSIONS layoutOverrideCoverage = false; #endif } @@ -989,10 +989,10 @@ struct TShaderQualifiers { layoutDepth = src.layoutDepth; if (src.blendEquation) blendEquation = src.blendEquation; -#ifdef NV_EXTENSIONS +#ifdef NV_EXTENSIONS if (src.layoutOverrideCoverage) layoutOverrideCoverage = src.layoutOverrideCoverage; -#endif +#endif } }; @@ -1085,7 +1085,7 @@ public: qualifier.storage = q; } // for explicit precision qualifier - TType(TBasicType t, TStorageQualifier q, TPrecisionQualifier p, int vs = 1, int mc = 0, int mr = 0, + TType(TBasicType t, TStorageQualifier q, TPrecisionQualifier p, int vs = 1, int mc = 0, int mr = 0, bool isVector = false) : basicType(t), vectorSize(vs), matrixCols(mc), matrixRows(mr), vector1(isVector && vs == 1), arraySizes(nullptr), structure(nullptr), fieldName(nullptr), typeName(nullptr) @@ -1332,7 +1332,7 @@ public: return false; } } - + // Recursively checks if the type contains the given basic type virtual bool containsBasicType(TBasicType checkType) const { @@ -1601,7 +1601,6 @@ public: p += snprintf(p, end - p, "passthrough "); #endif - p += snprintf(p, end - p, ") "); } } diff --git a/3rdparty/glslang/glslang/Include/arrays.h b/3rdparty/glslang/glslang/Include/arrays.h index a50088d2d..b6b5e479d 100644 --- a/3rdparty/glslang/glslang/Include/arrays.h +++ b/3rdparty/glslang/glslang/Include/arrays.h @@ -1,12 +1,12 @@ // -//Copyright (C) 2002-2005 3Dlabs Inc. Ltd. -//Copyright (C) 2012-2013 LunarG, Inc. +// Copyright (C) 2002-2005 3Dlabs Inc. Ltd. +// Copyright (C) 2012-2013 LunarG, Inc. // -//All rights reserved. +// All rights reserved. // -//Redistribution and use in source and binary forms, with or without -//modification, are permitted provided that the following conditions -//are met: +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: // // Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. @@ -20,18 +20,18 @@ // contributors may be used to endorse or promote products derived // from this software without specific prior written permission. // -//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -//"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS -//FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE -//COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, -//INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -//BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -//LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -//CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -//LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN -//ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -//POSSIBILITY OF SUCH DAMAGE. +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +// COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. // // diff --git a/3rdparty/glslang/glslang/Include/intermediate.h b/3rdparty/glslang/glslang/Include/intermediate.h index 7fb98cff7..78c187eb6 100644 --- a/3rdparty/glslang/glslang/Include/intermediate.h +++ b/3rdparty/glslang/glslang/Include/intermediate.h @@ -1,12 +1,12 @@ // -//Copyright (C) 2002-2005 3Dlabs Inc. Ltd. -//Copyright (C) 2012-2016 LunarG, Inc. +// Copyright (C) 2002-2005 3Dlabs Inc. Ltd. +// Copyright (C) 2012-2016 LunarG, Inc. // -//All rights reserved. +// All rights reserved. // -//Redistribution and use in source and binary forms, with or without -//modification, are permitted provided that the following conditions -//are met: +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: // // Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. @@ -20,25 +20,25 @@ // contributors may be used to endorse or promote products derived // from this software without specific prior written permission. // -//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -//"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS -//FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE -//COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, -//INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -//BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -//LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -//CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -//LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN -//ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -//POSSIBILITY OF SUCH DAMAGE. +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +// COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. // // // Definition of the in-memory high-level intermediate representation // of shaders. This is a tree that parser creates. // -// Nodes in the tree are defined as a hierarchy of classes derived from +// Nodes in the tree are defined as a hierarchy of classes derived from // TIntermNode. Each is a node in a tree. There is no preset branching factor; // each node can have it's own type of list of children. // @@ -66,14 +66,14 @@ enum TOperator { EOpNull, // if in a node, should only mean a node is still being built EOpSequence, // denotes a list of statements, or parameters, etc. EOpLinkerObjects, // for aggregate node of objects the linker may need, if not reference by the rest of the AST - EOpFunctionCall, + EOpFunctionCall, EOpFunction, // For function definition EOpParameters, // an aggregate listing the parameters to a function // // Unary operators // - + EOpNegative, EOpLogicalNot, EOpVectorLogicalNot, @@ -445,7 +445,7 @@ enum TOperator { // // moves // - + EOpAssign, EOpAddAssign, EOpSubAssign, @@ -709,7 +709,7 @@ public: virtual void setType(const TType& t) { type.shallowCopy(t); } virtual const TType& getType() const { return type; } virtual TType& getWritableType() { return type; } - + virtual TBasicType getBasicType() const { return type.getBasicType(); } virtual TQualifier& getQualifier() { return type.getQualifier(); } virtual const TQualifier& getQualifier() const { return type.getQualifier(); } @@ -734,7 +734,7 @@ protected: // class TIntermLoop : public TIntermNode { public: - TIntermLoop(TIntermNode* aBody, TIntermTyped* aTest, TIntermTyped* aTerminal, bool testFirst) : + TIntermLoop(TIntermNode* aBody, TIntermTyped* aTest, TIntermTyped* aTerminal, bool testFirst) : body(aBody), test(aTest), terminal(aTerminal), @@ -1148,7 +1148,7 @@ enum TVisit }; // -// For traversing the tree. User should derive from this, +// For traversing the tree. User should derive from this, // put their traversal specific data in it, and then pass // it to a Traverse method. // @@ -1160,10 +1160,10 @@ enum TVisit // the subtree). Similarly for inVisit for in-order visiting of nodes with // multiple children. // -// If you only want post-visits, explicitly turn off preVisit (and inVisit) +// If you only want post-visits, explicitly turn off preVisit (and inVisit) // and turn on postVisit. // -// In general, for the visit*() methods, return true from interior nodes +// In general, for the visit*() methods, return true from interior nodes // to have the traversal continue on to children. // // If you process children yourself, or don't want them processed, return false. diff --git a/3rdparty/glslang/glslang/Include/revision.h b/3rdparty/glslang/glslang/Include/revision.h index cee8a8b79..047e4ed64 100644 --- a/3rdparty/glslang/glslang/Include/revision.h +++ b/3rdparty/glslang/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.1730" -#define GLSLANG_DATE "03-Jan-2017" +#define GLSLANG_REVISION "Overload400-PrecQual.1760" +#define GLSLANG_DATE "11-Jan-2017" diff --git a/3rdparty/glslang/glslang/Include/revision.template b/3rdparty/glslang/glslang/Include/revision.template index 1dc3392b3..6c13630b2 100644 --- a/3rdparty/glslang/glslang/Include/revision.template +++ b/3rdparty/glslang/glslang/Include/revision.template @@ -1,4 +1,4 @@ -// The file revision.h should be updated to the latest version, somehow, on +// The file revision.h should be updated to the latest version, somehow, on // check-in, if glslang has changed. // // revision.template is the source for revision.h when using SubWCRev as the diff --git a/3rdparty/glslang/glslang/MachineIndependent/Constant.cpp b/3rdparty/glslang/glslang/MachineIndependent/Constant.cpp index 537eb5d6a..c709a7859 100644 --- a/3rdparty/glslang/glslang/MachineIndependent/Constant.cpp +++ b/3rdparty/glslang/glslang/MachineIndependent/Constant.cpp @@ -1,12 +1,12 @@ // -//Copyright (C) 2002-2005 3Dlabs Inc. Ltd. -//Copyright (C) 2012-2013 LunarG, Inc. +// Copyright (C) 2002-2005 3Dlabs Inc. Ltd. +// Copyright (C) 2012-2013 LunarG, Inc. // -//All rights reserved. +// All rights reserved. // -//Redistribution and use in source and binary forms, with or without -//modification, are permitted provided that the following conditions -//are met: +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: // // Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. @@ -20,18 +20,18 @@ // contributors may be used to endorse or promote products derived // from this software without specific prior written permission. // -//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -//"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS -//FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE -//COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, -//INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -//BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -//LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -//CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -//LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN -//ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -//POSSIBILITY OF SUCH DAMAGE. +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +// COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. // #include "localintermediate.h" diff --git a/3rdparty/glslang/glslang/MachineIndependent/InfoSink.cpp b/3rdparty/glslang/glslang/MachineIndependent/InfoSink.cpp index 79acba878..d00c42256 100644 --- a/3rdparty/glslang/glslang/MachineIndependent/InfoSink.cpp +++ b/3rdparty/glslang/glslang/MachineIndependent/InfoSink.cpp @@ -1,10 +1,10 @@ // -//Copyright (C) 2002-2005 3Dlabs Inc. Ltd. -//All rights reserved. +// Copyright (C) 2002-2005 3Dlabs Inc. Ltd. +// All rights reserved. // -//Redistribution and use in source and binary forms, with or without -//modification, are permitted provided that the following conditions -//are met: +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: // // Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. @@ -18,18 +18,18 @@ // contributors may be used to endorse or promote products derived // from this software without specific prior written permission. // -//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -//"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS -//FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE -//COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, -//INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -//BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -//LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -//CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -//LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN -//ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -//POSSIBILITY OF SUCH DAMAGE. +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +// COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. // #include "../Include/InfoSink.h" @@ -59,10 +59,10 @@ void TInfoSinkBase::append(const char* s) } void TInfoSinkBase::append(int count, char c) -{ +{ if (outputStream & EString) { checkMem(count); - sink.append(count, c); + sink.append(count, c); } //#ifdef _WIN32 @@ -79,10 +79,10 @@ void TInfoSinkBase::append(int count, char c) } void TInfoSinkBase::append(const TPersistString& t) -{ +{ if (outputStream & EString) { checkMem(t.size()); - sink.append(t); + sink.append(t); } //#ifdef _WIN32 @@ -95,10 +95,10 @@ void TInfoSinkBase::append(const TPersistString& t) } void TInfoSinkBase::append(const TString& t) -{ +{ if (outputStream & EString) { checkMem(t.size()); - sink.append(t.c_str()); + sink.append(t.c_str()); } //#ifdef _WIN32 diff --git a/3rdparty/glslang/glslang/MachineIndependent/Initialize.cpp b/3rdparty/glslang/glslang/MachineIndependent/Initialize.cpp index 443cd7a32..2ed238120 100644 --- a/3rdparty/glslang/glslang/MachineIndependent/Initialize.cpp +++ b/3rdparty/glslang/glslang/MachineIndependent/Initialize.cpp @@ -1,13 +1,13 @@ // -//Copyright (C) 2002-2005 3Dlabs Inc. Ltd. -//Copyright (C) 2012-2016 LunarG, Inc. -//Copyright (C) 2015-2016 Google, Inc. +// Copyright (C) 2002-2005 3Dlabs Inc. Ltd. +// Copyright (C) 2012-2016 LunarG, Inc. +// Copyright (C) 2015-2016 Google, Inc. // -//All rights reserved. +// All rights reserved. // -//Redistribution and use in source and binary forms, with or without -//modification, are permitted provided that the following conditions -//are met: +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: // // Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. @@ -21,22 +21,22 @@ // contributors may be used to endorse or promote products derived // from this software without specific prior written permission. // -//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -//"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS -//FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE -//COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, -//INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -//BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -//LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -//CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -//LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN -//ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -//POSSIBILITY OF SUCH DAMAGE. +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +// COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. // // -// Create strings that declare built-in definitions, add built-ins programmatically +// Create strings that declare built-in definitions, add built-ins programmatically // that cannot be expressed in the strings, and establish mappings between // built-in functions and operators. // @@ -103,7 +103,6 @@ TBuiltIns::~TBuiltIns() { } - // // Add all context-independent built-in functions and variables that are present // for the given version and profile. Share common ones across stages, otherwise @@ -128,47 +127,47 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV "vec2 radians(vec2 degrees);" "vec3 radians(vec3 degrees);" "vec4 radians(vec4 degrees);" - + "float degrees(float radians);" "vec2 degrees(vec2 radians);" "vec3 degrees(vec3 radians);" "vec4 degrees(vec4 radians);" - + "float sin(float angle);" "vec2 sin(vec2 angle);" "vec3 sin(vec3 angle);" "vec4 sin(vec4 angle);" - + "float cos(float angle);" "vec2 cos(vec2 angle);" "vec3 cos(vec3 angle);" "vec4 cos(vec4 angle);" - + "float tan(float angle);" "vec2 tan(vec2 angle);" "vec3 tan(vec3 angle);" "vec4 tan(vec4 angle);" - + "float asin(float x);" "vec2 asin(vec2 x);" "vec3 asin(vec3 x);" "vec4 asin(vec4 x);" - + "float acos(float x);" "vec2 acos(vec2 x);" "vec3 acos(vec3 x);" "vec4 acos(vec4 x);" - + "float atan(float y, float x);" "vec2 atan(vec2 y, vec2 x);" "vec3 atan(vec3 y, vec3 x);" "vec4 atan(vec4 y, vec4 x);" - + "float atan(float y_over_x);" "vec2 atan(vec2 y_over_x);" "vec3 atan(vec3 y_over_x);" "vec4 atan(vec4 y_over_x);" - + "\n"); if (version >= 130) { @@ -177,32 +176,32 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV "vec2 sinh(vec2 angle);" "vec3 sinh(vec3 angle);" "vec4 sinh(vec4 angle);" - + "float cosh(float angle);" "vec2 cosh(vec2 angle);" "vec3 cosh(vec3 angle);" "vec4 cosh(vec4 angle);" - + "float tanh(float angle);" "vec2 tanh(vec2 angle);" "vec3 tanh(vec3 angle);" "vec4 tanh(vec4 angle);" - + "float asinh(float x);" "vec2 asinh(vec2 x);" "vec3 asinh(vec3 x);" "vec4 asinh(vec4 x);" - + "float acosh(float x);" "vec2 acosh(vec2 x);" "vec3 acosh(vec3 x);" "vec4 acosh(vec4 x);" - + "float atanh(float y_over_x);" "vec2 atanh(vec2 y_over_x);" "vec3 atanh(vec3 y_over_x);" "vec4 atanh(vec4 y_over_x);" - + "\n"); } @@ -214,37 +213,37 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV "vec2 pow(vec2 x, vec2 y);" "vec3 pow(vec3 x, vec3 y);" "vec4 pow(vec4 x, vec4 y);" - + "float exp(float x);" "vec2 exp(vec2 x);" "vec3 exp(vec3 x);" "vec4 exp(vec4 x);" - + "float log(float x);" "vec2 log(vec2 x);" "vec3 log(vec3 x);" "vec4 log(vec4 x);" - + "float exp2(float x);" "vec2 exp2(vec2 x);" "vec3 exp2(vec3 x);" "vec4 exp2(vec4 x);" - + "float log2(float x);" "vec2 log2(vec2 x);" "vec3 log2(vec3 x);" "vec4 log2(vec4 x);" - + "float sqrt(float x);" "vec2 sqrt(vec2 x);" "vec3 sqrt(vec3 x);" "vec4 sqrt(vec4 x);" - + "float inversesqrt(float x);" "vec2 inversesqrt(vec2 x);" "vec3 inversesqrt(vec3 x);" "vec4 inversesqrt(vec4 x);" - + "\n"); // @@ -255,27 +254,27 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV "vec2 abs(vec2 x);" "vec3 abs(vec3 x);" "vec4 abs(vec4 x);" - + "float sign(float x);" "vec2 sign(vec2 x);" "vec3 sign(vec3 x);" "vec4 sign(vec4 x);" - + "float floor(float x);" "vec2 floor(vec2 x);" "vec3 floor(vec3 x);" "vec4 floor(vec4 x);" - + "float ceil(float x);" "vec2 ceil(vec2 x);" "vec3 ceil(vec3 x);" "vec4 ceil(vec4 x);" - + "float fract(float x);" "vec2 fract(vec2 x);" "vec3 fract(vec3 x);" "vec4 fract(vec4 x);" - + "float mod(float x, float y);" "vec2 mod(vec2 x, float y);" "vec3 mod(vec3 x, float y);" @@ -283,7 +282,7 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV "vec2 mod(vec2 x, vec2 y);" "vec3 mod(vec3 x, vec3 y);" "vec4 mod(vec4 x, vec4 y);" - + "float min(float x, float y);" "vec2 min(vec2 x, float y);" "vec3 min(vec3 x, float y);" @@ -291,7 +290,7 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV "vec2 min(vec2 x, vec2 y);" "vec3 min(vec3 x, vec3 y);" "vec4 min(vec4 x, vec4 y);" - + "float max(float x, float y);" "vec2 max(vec2 x, float y);" "vec3 max(vec3 x, float y);" @@ -299,7 +298,7 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV "vec2 max(vec2 x, vec2 y);" "vec3 max(vec3 x, vec3 y);" "vec4 max(vec4 x, vec4 y);" - + "float clamp(float x, float minVal, float maxVal);" "vec2 clamp(vec2 x, float minVal, float maxVal);" "vec3 clamp(vec3 x, float minVal, float maxVal);" @@ -307,7 +306,7 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV "vec2 clamp(vec2 x, vec2 minVal, vec2 maxVal);" "vec3 clamp(vec3 x, vec3 minVal, vec3 maxVal);" "vec4 clamp(vec4 x, vec4 minVal, vec4 maxVal);" - + "float mix(float x, float y, float a);" "vec2 mix(vec2 x, vec2 y, float a);" "vec3 mix(vec3 x, vec3 y, float a);" @@ -323,7 +322,7 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV "vec2 step(float edge, vec2 x);" "vec3 step(float edge, vec3 x);" "vec4 step(float edge, vec4 x);" - + "float smoothstep(float edge0, float edge1, float x);" "vec2 smoothstep(vec2 edge0, vec2 edge1, vec2 x);" "vec3 smoothstep(vec3 edge0, vec3 edge1, vec3 x);" @@ -331,7 +330,7 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV "vec2 smoothstep(float edge0, float edge1, vec2 x);" "vec3 smoothstep(float edge0, float edge1, vec3 x);" "vec4 smoothstep(float edge0, float edge1, vec4 x);" - + "\n"); if (version >= 130) { @@ -350,22 +349,22 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV "vec2 trunc(vec2 x);" "vec3 trunc(vec3 x);" "vec4 trunc(vec4 x);" - + "float round(float x);" "vec2 round(vec2 x);" "vec3 round(vec3 x);" "vec4 round(vec4 x);" - + "float roundEven(float x);" "vec2 roundEven(vec2 x);" "vec3 roundEven(vec3 x);" "vec4 roundEven(vec4 x);" - + "float modf(float, out float);" "vec2 modf(vec2, out vec2 );" "vec3 modf(vec3, out vec3 );" "vec4 modf(vec4, out vec4 );" - + " int min(int x, int y);" "ivec2 min(ivec2 x, int y);" "ivec3 min(ivec3 x, int y);" @@ -373,7 +372,7 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV "ivec2 min(ivec2 x, ivec2 y);" "ivec3 min(ivec3 x, ivec3 y);" "ivec4 min(ivec4 x, ivec4 y);" - + " uint min(uint x, uint y);" "uvec2 min(uvec2 x, uint y);" "uvec3 min(uvec3 x, uint y);" @@ -381,7 +380,7 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV "uvec2 min(uvec2 x, uvec2 y);" "uvec3 min(uvec3 x, uvec3 y);" "uvec4 min(uvec4 x, uvec4 y);" - + " int max(int x, int y);" "ivec2 max(ivec2 x, int y);" "ivec3 max(ivec3 x, int y);" @@ -589,12 +588,12 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV "dvec2 faceforward(dvec2, dvec2, dvec2);" "dvec3 faceforward(dvec3, dvec3, dvec3);" "dvec4 faceforward(dvec4, dvec4, dvec4);" - + "double reflect(double, double);" "dvec2 reflect(dvec2 , dvec2 );" "dvec3 reflect(dvec3 , dvec3 );" "dvec4 reflect(dvec4 , dvec4 );" - + "double refract(double, double, double);" "dvec2 refract(dvec2 , dvec2 , double);" "dvec3 refract(dvec3 , dvec3 , double);" @@ -1079,38 +1078,38 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV "float length(vec2 x);" "float length(vec3 x);" "float length(vec4 x);" - + "float distance(float p0, float p1);" "float distance(vec2 p0, vec2 p1);" "float distance(vec3 p0, vec3 p1);" "float distance(vec4 p0, vec4 p1);" - + "float dot(float x, float y);" "float dot(vec2 x, vec2 y);" "float dot(vec3 x, vec3 y);" "float dot(vec4 x, vec4 y);" - + "vec3 cross(vec3 x, vec3 y);" "float normalize(float x);" "vec2 normalize(vec2 x);" "vec3 normalize(vec3 x);" "vec4 normalize(vec4 x);" - + "float faceforward(float N, float I, float Nref);" "vec2 faceforward(vec2 N, vec2 I, vec2 Nref);" "vec3 faceforward(vec3 N, vec3 I, vec3 Nref);" "vec4 faceforward(vec4 N, vec4 I, vec4 Nref);" - + "float reflect(float I, float N);" "vec2 reflect(vec2 I, vec2 N);" "vec3 reflect(vec3 I, vec3 N);" "vec4 reflect(vec4 I, vec4 N);" - + "float refract(float I, float N, float eta);" "vec2 refract(vec2 I, vec2 N, float eta);" "vec3 refract(vec3 I, vec3 N, float eta);" "vec4 refract(vec4 I, vec4 N, float eta);" - + "\n"); // @@ -1120,7 +1119,7 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV "mat2 matrixCompMult(mat2 x, mat2 y);" "mat3 matrixCompMult(mat3 x, mat3 y);" "mat4 matrixCompMult(mat4 x, mat4 y);" - + "\n"); // 120 is correct for both ES and desktop @@ -1135,7 +1134,7 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV "mat4x2 outerProduct(vec2 c, vec4 r);" "mat3x4 outerProduct(vec4 c, vec3 r);" "mat4x3 outerProduct(vec3 c, vec4 r);" - + "mat2 transpose(mat2 m);" "mat3 transpose(mat3 m);" "mat4 transpose(mat4 m);" @@ -1151,8 +1150,8 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV "mat3x2 matrixCompMult(mat3x2, mat3x2);" "mat3x4 matrixCompMult(mat3x4, mat3x4);" "mat4x2 matrixCompMult(mat4x2, mat4x2);" - "mat4x3 matrixCompMult(mat4x3, mat4x3);" - + "mat4x3 matrixCompMult(mat4x3, mat4x3);" + "\n"); // 150 is correct for both ES and desktop @@ -1161,11 +1160,11 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV "float determinant(mat2 m);" "float determinant(mat3 m);" "float determinant(mat4 m);" - + "mat2 inverse(mat2 m);" "mat3 inverse(mat3 m);" "mat4 inverse(mat4 m);" - + "\n"); } } @@ -1177,71 +1176,71 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV "bvec2 lessThan(vec2 x, vec2 y);" "bvec3 lessThan(vec3 x, vec3 y);" "bvec4 lessThan(vec4 x, vec4 y);" - + "bvec2 lessThan(ivec2 x, ivec2 y);" "bvec3 lessThan(ivec3 x, ivec3 y);" "bvec4 lessThan(ivec4 x, ivec4 y);" - + "bvec2 lessThanEqual(vec2 x, vec2 y);" "bvec3 lessThanEqual(vec3 x, vec3 y);" "bvec4 lessThanEqual(vec4 x, vec4 y);" - + "bvec2 lessThanEqual(ivec2 x, ivec2 y);" "bvec3 lessThanEqual(ivec3 x, ivec3 y);" "bvec4 lessThanEqual(ivec4 x, ivec4 y);" - + "bvec2 greaterThan(vec2 x, vec2 y);" "bvec3 greaterThan(vec3 x, vec3 y);" "bvec4 greaterThan(vec4 x, vec4 y);" - + "bvec2 greaterThan(ivec2 x, ivec2 y);" "bvec3 greaterThan(ivec3 x, ivec3 y);" "bvec4 greaterThan(ivec4 x, ivec4 y);" - + "bvec2 greaterThanEqual(vec2 x, vec2 y);" "bvec3 greaterThanEqual(vec3 x, vec3 y);" "bvec4 greaterThanEqual(vec4 x, vec4 y);" - + "bvec2 greaterThanEqual(ivec2 x, ivec2 y);" "bvec3 greaterThanEqual(ivec3 x, ivec3 y);" "bvec4 greaterThanEqual(ivec4 x, ivec4 y);" - + "bvec2 equal(vec2 x, vec2 y);" "bvec3 equal(vec3 x, vec3 y);" "bvec4 equal(vec4 x, vec4 y);" - + "bvec2 equal(ivec2 x, ivec2 y);" "bvec3 equal(ivec3 x, ivec3 y);" "bvec4 equal(ivec4 x, ivec4 y);" - + "bvec2 equal(bvec2 x, bvec2 y);" "bvec3 equal(bvec3 x, bvec3 y);" "bvec4 equal(bvec4 x, bvec4 y);" - + "bvec2 notEqual(vec2 x, vec2 y);" "bvec3 notEqual(vec3 x, vec3 y);" "bvec4 notEqual(vec4 x, vec4 y);" - + "bvec2 notEqual(ivec2 x, ivec2 y);" "bvec3 notEqual(ivec3 x, ivec3 y);" "bvec4 notEqual(ivec4 x, ivec4 y);" - + "bvec2 notEqual(bvec2 x, bvec2 y);" "bvec3 notEqual(bvec3 x, bvec3 y);" "bvec4 notEqual(bvec4 x, bvec4 y);" - + "bool any(bvec2 x);" "bool any(bvec3 x);" "bool any(bvec4 x);" - + "bool all(bvec2 x);" "bool all(bvec3 x);" "bool all(bvec4 x);" - + "bvec2 not(bvec2 x);" "bvec3 not(bvec3 x);" "bvec4 not(bvec4 x);" - + "\n"); if (version >= 130) { @@ -1249,27 +1248,27 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV "bvec2 lessThan(uvec2 x, uvec2 y);" "bvec3 lessThan(uvec3 x, uvec3 y);" "bvec4 lessThan(uvec4 x, uvec4 y);" - + "bvec2 lessThanEqual(uvec2 x, uvec2 y);" "bvec3 lessThanEqual(uvec3 x, uvec3 y);" "bvec4 lessThanEqual(uvec4 x, uvec4 y);" - + "bvec2 greaterThan(uvec2 x, uvec2 y);" "bvec3 greaterThan(uvec3 x, uvec3 y);" "bvec4 greaterThan(uvec4 x, uvec4 y);" - + "bvec2 greaterThanEqual(uvec2 x, uvec2 y);" "bvec3 greaterThanEqual(uvec3 x, uvec3 y);" "bvec4 greaterThanEqual(uvec4 x, uvec4 y);" - + "bvec2 equal(uvec2 x, uvec2 y);" "bvec3 equal(uvec3 x, uvec3 y);" "bvec4 equal(uvec4 x, uvec4 y);" "bvec2 notEqual(uvec2 x, uvec2 y);" "bvec3 notEqual(uvec3 x, uvec3 y);" - "bvec4 notEqual(uvec4 x, uvec4 y);" - + "bvec4 notEqual(uvec4 x, uvec4 y);" + "\n"); } @@ -1292,7 +1291,7 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV "vec4 texture3DProj(sampler3D, vec4);" // OES_texture_3D, but caught by keyword check "vec4 textureCube(samplerCube, vec3);" - + "\n"); } } @@ -1306,7 +1305,7 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV "vec4 texture1DProj(sampler1D, vec2);" "vec4 texture1DProj(sampler1D, vec4);" - + "vec4 shadow1D(sampler1DShadow, vec3);" "vec4 shadow2D(sampler2DShadow, vec3);" "vec4 shadow1DProj(sampler1DShadow, vec4);" @@ -1346,22 +1345,22 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV "float noise1(vec2 x);" "float noise1(vec3 x);" "float noise1(vec4 x);" - + "vec2 noise2(float x);" "vec2 noise2(vec2 x);" "vec2 noise2(vec3 x);" "vec2 noise2(vec4 x);" - + "vec3 noise3(float x);" "vec3 noise3(vec2 x);" "vec3 noise3(vec3 x);" "vec3 noise3(vec4 x);" - + "vec4 noise4(float x);" "vec4 noise4(vec2 x);" "vec4 noise4(vec3 x);" "vec4 noise4(vec4 x);" - + "\n"); } @@ -1517,7 +1516,7 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV "lowp ivec2 findMSB(highp uvec2);" "lowp ivec3 findMSB(highp uvec3);" "lowp ivec4 findMSB(highp uvec4);" - + "\n"); } @@ -2243,7 +2242,7 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV "vec2 dFdx(vec2 p);" "vec3 dFdx(vec3 p);" "vec4 dFdx(vec4 p);" - + "float dFdy(float p);" "vec2 dFdy(vec2 p);" "vec3 dFdy(vec3 p);" @@ -2286,12 +2285,12 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV "vec2 dFdyCoarse(vec2 p);" "vec3 dFdyCoarse(vec3 p);" "vec4 dFdyCoarse(vec4 p);" - + "float fwidthCoarse(float p);" "vec2 fwidthCoarse(vec2 p);" "vec3 fwidthCoarse(vec3 p);" "vec4 fwidthCoarse(vec4 p);" - + "\n"); } @@ -2462,11 +2461,11 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV "uniform mat4 gl_ModelViewMatrixInverse;" "uniform mat4 gl_ProjectionMatrixInverse;" "uniform mat4 gl_ModelViewProjectionMatrixInverse;" - + "uniform mat4 gl_ModelViewMatrixTranspose;" "uniform mat4 gl_ProjectionMatrixTranspose;" "uniform mat4 gl_ModelViewProjectionMatrixTranspose;" - + "uniform mat4 gl_ModelViewMatrixInverseTranspose;" "uniform mat4 gl_ProjectionMatrixInverseTranspose;" "uniform mat4 gl_ModelViewProjectionMatrixInverseTranspose;" @@ -2524,7 +2523,6 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV "float quadraticAttenuation;"// K2 "};" - "struct gl_LightModelParameters {" "vec4 ambient;" // Acs "};" @@ -2559,7 +2557,7 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV "};" "uniform gl_FogParameters gl_Fog;" - + "\n"); } @@ -2589,7 +2587,7 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV // Define the interface to the vertex shader. // //============================================================================ - + if (profile != EEsProfile) { if (version < 130) { stageBuiltins[EShLangVertex].append( @@ -2621,7 +2619,7 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV "in vec4 gl_MultiTexCoord5;" "in vec4 gl_MultiTexCoord6;" "in vec4 gl_MultiTexCoord7;" - "in float gl_FogCoord;" + "in float gl_FogCoord;" "\n"); } @@ -2663,7 +2661,7 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV "vec4 gl_Position;" // needs qualifier fixed later "float gl_PointSize;" // needs qualifier fixed later "float gl_ClipDistance[];" - ); + ); if (IncludeLegacy(version, profile, spvVersion)) stageBuiltins[EShLangVertex].append( "vec4 gl_ClipVertex;" // needs qualifier fixed later @@ -2827,7 +2825,6 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV ); } - //============================================================================ // // Define the interface to the tessellation control shader. @@ -2907,7 +2904,7 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV "patch in float gl_TessLevelOuter[4];" "patch in float gl_TessLevelInner[2];" - + "out gl_PerVertex {" "vec4 gl_Position;" "float gl_PointSize;" @@ -2941,7 +2938,7 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV "patch in highp float gl_TessLevelOuter[4];" "patch in highp float gl_TessLevelInner[2];" - + "out gl_PerVertex {" "highp vec4 gl_Position;" "highp float gl_PointSize;" @@ -3108,12 +3105,12 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV "\n"); } - //printf("%s\n", commonBuiltins.c_str()); - //printf("%s\n", stageBuiltins[EShLangFragment].c_str()); + // printf("%s\n", commonBuiltins.c_str()); + // printf("%s\n", stageBuiltins[EShLangFragment].c_str()); } // -// Helper function for initialize(), to add the second set of names for texturing, +// Helper function for initialize(), to add the second set of names for texturing, // when adding context-independent built-in functions. // void TBuiltIns::add2ndGenerationSamplingImaging(int version, EProfile profile, const SpvVersion& spvVersion) @@ -3221,7 +3218,7 @@ void TBuiltIns::add2ndGenerationSamplingImaging(int version, EProfile profile, c } // -// Helper function for add2ndGenerationSamplingImaging(), +// Helper function for add2ndGenerationSamplingImaging(), // when adding context-independent built-in functions. // // Add all the query functions for the given type. @@ -3298,7 +3295,7 @@ void TBuiltIns::addQueryFunctions(TSampler sampler, TString& typeName, int versi } // -// Helper function for add2ndGenerationSamplingImaging(), +// Helper function for add2ndGenerationSamplingImaging(), // when adding context-independent built-in functions. // // Add all the image access functions for the given type. @@ -3357,7 +3354,7 @@ void TBuiltIns::addImageFunctions(TSampler sampler, TString& typeName, int versi " imageAtomicOr(volatile coherent ", " imageAtomicXor(volatile coherent ", " imageAtomicExchange(volatile coherent " - }; + }; for (size_t i = 0; i < numBuiltins; ++i) { commonBuiltins.append(dataType); @@ -3408,7 +3405,7 @@ void TBuiltIns::addSubpassSampling(TSampler sampler, TString& typeName, int /*ve } // -// Helper function for add2ndGenerationSamplingImaging(), +// Helper function for add2ndGenerationSamplingImaging(), // when adding context-independent built-in functions. // // Add all the texture lookup functions for the given type. @@ -3637,9 +3634,8 @@ void TBuiltIns::addSamplingFunctions(TSampler sampler, TString& typeName, int ve } } - // -// Helper function for add2ndGenerationSamplingImaging(), +// Helper function for add2ndGenerationSamplingImaging(), // when adding context-independent built-in functions. // // Add all the texture gather functions for the given type. @@ -3840,7 +3836,7 @@ void TBuiltIns::initialize(const TBuiltInResource &resources, int version, EProf s.append(builtInConstant); snprintf(builtInConstant, maxSize, "const int gl_MaxTessControlTotalOutputComponents = %d;", resources.maxTessControlTotalOutputComponents); s.append(builtInConstant); - + snprintf(builtInConstant, maxSize, "const int gl_MaxTessEvaluationInputComponents = %d;", resources.maxTessEvaluationInputComponents); s.append(builtInConstant); snprintf(builtInConstant, maxSize, "const int gl_MaxTessEvaluationOutputComponents = %d;", resources.maxTessEvaluationOutputComponents); @@ -3849,7 +3845,7 @@ void TBuiltIns::initialize(const TBuiltInResource &resources, int version, EProf s.append(builtInConstant); snprintf(builtInConstant, maxSize, "const int gl_MaxTessEvaluationUniformComponents = %d;", resources.maxTessEvaluationUniformComponents); s.append(builtInConstant); - + snprintf(builtInConstant, maxSize, "const int gl_MaxTessPatchComponents = %d;", resources.maxTessPatchComponents); s.append(builtInConstant); @@ -4012,7 +4008,7 @@ void TBuiltIns::initialize(const TBuiltInResource &resources, int version, EProf s.append(builtInConstant); snprintf(builtInConstant, maxSize, "const int gl_MaxTessControlTotalOutputComponents = %d;", resources.maxTessControlTotalOutputComponents); s.append(builtInConstant); - + snprintf(builtInConstant, maxSize, "const int gl_MaxTessEvaluationInputComponents = %d;", resources.maxTessEvaluationInputComponents); s.append(builtInConstant); snprintf(builtInConstant, maxSize, "const int gl_MaxTessEvaluationOutputComponents = %d;", resources.maxTessEvaluationOutputComponents); @@ -4021,7 +4017,7 @@ void TBuiltIns::initialize(const TBuiltInResource &resources, int version, EProf s.append(builtInConstant); snprintf(builtInConstant, maxSize, "const int gl_MaxTessEvaluationUniformComponents = %d;", resources.maxTessEvaluationUniformComponents); s.append(builtInConstant); - + snprintf(builtInConstant, maxSize, "const int gl_MaxTessPatchComponents = %d;", resources.maxTessPatchComponents); s.append(builtInConstant); snprintf(builtInConstant, maxSize, "const int gl_MaxTessGenLevel = %d;", resources.maxTessGenLevel); @@ -4086,7 +4082,7 @@ void TBuiltIns::initialize(const TBuiltInResource &resources, int version, EProf } // images (some in compute below) - if ((profile == EEsProfile && version >= 310) || + if ((profile == EEsProfile && version >= 310) || (profile != EEsProfile && version >= 130)) { snprintf(builtInConstant, maxSize, "const int gl_MaxImageUnits = %d;", resources.maxImageUnits); s.append(builtInConstant); @@ -4101,7 +4097,7 @@ void TBuiltIns::initialize(const TBuiltInResource &resources, int version, EProf } // atomic counters (some in compute below) - if ((profile == EEsProfile && version >= 310) || + if ((profile == EEsProfile && version >= 310) || (profile != EEsProfile && version >= 420)) { snprintf(builtInConstant, maxSize, "const int gl_MaxVertexAtomicCounters = %d;", resources. maxVertexAtomicCounters); s.append(builtInConstant); @@ -4137,12 +4133,11 @@ void TBuiltIns::initialize(const TBuiltInResource &resources, int version, EProf s.append("\n"); } - // compute if ((profile == EEsProfile && version >= 310) || (profile != EEsProfile && version >= 420)) { snprintf(builtInConstant, maxSize, "const ivec3 gl_MaxComputeWorkGroupCount = ivec3(%d,%d,%d);", resources.maxComputeWorkGroupCountX, resources.maxComputeWorkGroupCountY, - resources.maxComputeWorkGroupCountZ); + resources.maxComputeWorkGroupCountZ); s.append(builtInConstant); snprintf(builtInConstant, maxSize, "const ivec3 gl_MaxComputeWorkGroupSize = ivec3(%d,%d,%d);", resources.maxComputeWorkGroupSizeX, resources.maxComputeWorkGroupSizeY, @@ -4272,7 +4267,7 @@ void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion // N.B.: a symbol should only be tagged once, and this function is called multiple times, once // per stage that's used for this profile. So // - generally, stick common ones in the fragment stage to ensure they are tagged exactly once - // - for ES, which has different precisions for different stages, the coarsest-grained tagging + // - for ES, which has different precisions for different stages, the coarsest-grained tagging // for a built-in used in many stages needs to be once for the fragment stage and once for // the vertex stage @@ -4465,7 +4460,7 @@ void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion // However, the current automatic extension scheme does not work per block member, // so for now check when parsing. // - //if (profile == EEsProfile) { + // if (profile == EEsProfile) { // if (language == EShLangGeometry) // symbolTable.setVariableExtensions("gl_PointSize", Num_AEP_geometry_point_size, AEP_geometry_point_size); // else if (language == EShLangTessEvaluation || language == EShLangTessControl) @@ -4501,7 +4496,7 @@ void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion symbolTable.setVariableExtensions("gl_NumSamples", 1, &E_GL_OES_sample_variables); } } - + BuiltInVariable("gl_Layer", EbvLayer, symbolTable); BuiltInVariable("gl_ViewportIndex", EbvViewportIndex, symbolTable); @@ -5062,7 +5057,7 @@ void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion // // Add context-dependent (resource-specific) built-ins not handled by the above. These -// would be ones that need to be programmatically added because they cannot +// would be ones that need to be programmatically added because they cannot // be added by simple text strings. For these, also // 1) Map built-in functions to operators, for those that will turn into an operation node // instead of remaining a function call. diff --git a/3rdparty/glslang/glslang/MachineIndependent/Initialize.h b/3rdparty/glslang/glslang/MachineIndependent/Initialize.h index 23f57acc1..45b439562 100644 --- a/3rdparty/glslang/glslang/MachineIndependent/Initialize.h +++ b/3rdparty/glslang/glslang/MachineIndependent/Initialize.h @@ -1,12 +1,12 @@ // -//Copyright (C) 2002-2005 3Dlabs Inc. Ltd. -//Copyright (C) 2013-2016 LunarG, Inc. +// Copyright (C) 2002-2005 3Dlabs Inc. Ltd. +// Copyright (C) 2013-2016 LunarG, Inc. // -//All rights reserved. +// All rights reserved. // -//Redistribution and use in source and binary forms, with or without -//modification, are permitted provided that the following conditions -//are met: +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: // // Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. @@ -20,18 +20,18 @@ // contributors may be used to endorse or promote products derived // from this software without specific prior written permission. // -//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -//"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS -//FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE -//COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, -//INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -//BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -//LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -//CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -//LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN -//ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -//POSSIBILITY OF SUCH DAMAGE. +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +// COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. // #ifndef _INITIALIZE_INCLUDED_ @@ -67,7 +67,7 @@ public: virtual const TString& getStageString(EShLanguage language) const { return stageBuiltins[language]; } virtual void identifyBuiltIns(int version, EProfile profile, const SpvVersion& spvVersion, EShLanguage language, TSymbolTable& symbolTable) = 0; - + virtual void identifyBuiltIns(int version, EProfile profile, const SpvVersion& spvVersion, EShLanguage language, TSymbolTable& symbolTable, const TBuiltInResource &resources) = 0; protected: @@ -89,7 +89,7 @@ public: void initialize(const TBuiltInResource& resources, int version, EProfile, const SpvVersion& spvVersion, EShLanguage); void identifyBuiltIns(int version, EProfile profile, const SpvVersion& spvVersion, EShLanguage language, TSymbolTable& symbolTable); - + void identifyBuiltIns(int version, EProfile profile, const SpvVersion& spvVersion, EShLanguage language, TSymbolTable& symbolTable, const TBuiltInResource &resources); protected: @@ -107,7 +107,6 @@ protected: int dimMap[EsdNumDims]; }; - } // end namespace glslang #endif // _INITIALIZE_INCLUDED_ diff --git a/3rdparty/glslang/glslang/MachineIndependent/IntermTraverse.cpp b/3rdparty/glslang/glslang/MachineIndependent/IntermTraverse.cpp index b910f4738..f46010b71 100644 --- a/3rdparty/glslang/glslang/MachineIndependent/IntermTraverse.cpp +++ b/3rdparty/glslang/glslang/MachineIndependent/IntermTraverse.cpp @@ -1,13 +1,13 @@ // -//Copyright (C) 2002-2005 3Dlabs Inc. Ltd. -//Copyright (C) 2013 LunarG, Inc. -//Copyright (c) 2002-2010 The ANGLE Project Authors. +// Copyright (C) 2002-2005 3Dlabs Inc. Ltd. +// Copyright (C) 2013 LunarG, Inc. +// Copyright (c) 2002-2010 The ANGLE Project Authors. // -//All rights reserved. +// All rights reserved. // -//Redistribution and use in source and binary forms, with or without -//modification, are permitted provided that the following conditions -//are met: +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: // // Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. @@ -21,18 +21,18 @@ // contributors may be used to endorse or promote products derived // from this software without specific prior written permission. // -//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -//"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS -//FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE -//COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, -//INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -//BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -//LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -//CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -//LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN -//ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -//POSSIBILITY OF SUCH DAMAGE. +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +// COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. // #include "../Include/intermediate.h" diff --git a/3rdparty/glslang/glslang/MachineIndependent/Intermediate.cpp b/3rdparty/glslang/glslang/MachineIndependent/Intermediate.cpp index 999fd5d8a..e89bc31bd 100644 --- a/3rdparty/glslang/glslang/MachineIndependent/Intermediate.cpp +++ b/3rdparty/glslang/glslang/MachineIndependent/Intermediate.cpp @@ -1,13 +1,13 @@ // -//Copyright (C) 2002-2005 3Dlabs Inc. Ltd. -//Copyright (C) 2012-2015 LunarG, Inc. -//Copyright (C) 2015-2016 Google, Inc. +// Copyright (C) 2002-2005 3Dlabs Inc. Ltd. +// Copyright (C) 2012-2015 LunarG, Inc. +// Copyright (C) 2015-2016 Google, Inc. // -//All rights reserved. +// All rights reserved. // -//Redistribution and use in source and binary forms, with or without -//modification, are permitted provided that the following conditions -//are met: +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: // // Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. @@ -21,18 +21,18 @@ // contributors may be used to endorse or promote products derived // from this software without specific prior written permission. // -//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -//"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS -//FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE -//COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, -//INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -//BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -//LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -//CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -//LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN -//ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -//POSSIBILITY OF SUCH DAMAGE. +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +// COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. // // @@ -155,7 +155,7 @@ TIntermTyped* TIntermediate::addBinaryMath(TOperator op, TIntermTyped* left, TIn return folded; } - // If either is a specialization constant, while the other is + // If either is a specialization constant, while the other is // a constant (or specialization constant), the result is still // a specialization constant, if the operation is an allowed // specialization-constant operation. @@ -192,7 +192,7 @@ TIntermBinary* TIntermediate::addBinaryNode(TOperator op, TIntermTyped* left, TI node->setType(type); return node; } - + // // Low level: add unary node (no promotions or other argument modifications) // @@ -286,7 +286,7 @@ TIntermTyped* TIntermediate::addUnaryMath(TOperator op, TIntermTyped* child, TSo if (source == EShSourceHlsl) { break; // HLSL can promote logical not } - + if (child->getType().getBasicType() != EbtBool || child->getType().isMatrix() || child->getType().isArray() || child->getType().isVector()) { return nullptr; } @@ -474,7 +474,7 @@ TIntermTyped* TIntermediate::addConversion(TOperator op, const TType& type, TInt // samplers can get assigned via a sampler constructor // (well, not yet, but code in the rest of this function is ready for it) - if (node->getBasicType() == EbtSampler && op == EOpAssign && + if (node->getBasicType() == EbtSampler && op == EOpAssign && node->getAsOperator() != nullptr && node->getAsOperator()->getOp() == EOpConstructTextureSampler) break; @@ -867,16 +867,16 @@ bool TIntermediate::canImplicitlyPromote(TBasicType from, TBasicType to, TOperat if (fromConvertable && toConvertable) { switch (op) { case EOpAndAssign: // assignments can perform arbitrary conversions - case EOpInclusiveOrAssign: // ... - case EOpExclusiveOrAssign: // ... - case EOpAssign: // ... - case EOpAddAssign: // ... - case EOpSubAssign: // ... - case EOpMulAssign: // ... - case EOpVectorTimesScalarAssign: // ... - case EOpMatrixTimesScalarAssign: // ... - case EOpDivAssign: // ... - case EOpModAssign: // ... + case EOpInclusiveOrAssign: // ... + case EOpExclusiveOrAssign: // ... + case EOpAssign: // ... + case EOpAddAssign: // ... + case EOpSubAssign: // ... + case EOpMulAssign: // ... + case EOpVectorTimesScalarAssign: // ... + case EOpMatrixTimesScalarAssign: // ... + case EOpDivAssign: // ... + case EOpModAssign: // ... case EOpReturn: // function returns can also perform arbitrary conversions case EOpFunctionCall: // conversion of a calling parameter case EOpLogicalNot: @@ -1245,13 +1245,12 @@ TIntermNode* TIntermediate::addSelection(TIntermTyped* cond, TIntermNodePair nod return node; } - TIntermTyped* TIntermediate::addComma(TIntermTyped* left, TIntermTyped* right, const TSourceLoc& loc) { // However, the lowest precedence operators of the sequence operator ( , ) and the assignment operators // ... are not included in the operators that can create a constant expression. // - //if (left->getType().getQualifier().storage == EvqConst && + // if (left->getType().getQualifier().storage == EvqConst && // right->getType().getQualifier().storage == EvqConst) { // return right; @@ -1520,7 +1519,7 @@ void TIntermediate::addSymbolLinkageNodes(TIntermAggregate*& linkage, EShLanguag // - ftransform() can make gl_Vertex and gl_ModelViewProjectionMatrix active. // - //if (ftransformUsed) { + // if (ftransformUsed) { // TODO: 1.1 lowering functionality: track ftransform() usage // addSymbolLinkageNode(root, symbolTable, "gl_Vertex"); // addSymbolLinkageNode(root, symbolTable, "gl_ModelViewProjectionMatrix"); @@ -2256,8 +2255,8 @@ bool TIntermediate::promoteAggregate(TIntermAggregate& node) case EOpDot: case EOpDst: case EOpFaceForward: - // case EOpFindMSB: TODO: ?? - // case EOpFindLSB: TODO: ?? + // case EOpFindMSB: TODO: + // case EOpFindLSB: TODO: case EOpFma: case EOpMod: case EOpFrexp: @@ -2267,11 +2266,11 @@ bool TIntermediate::promoteAggregate(TIntermAggregate& node) case EOpMax: case EOpMin: case EOpModf: - // case EOpGenMul: TODO: ?? + // case EOpGenMul: TODO: case EOpPow: case EOpReflect: case EOpRefract: - // case EOpSinCos: TODO: ?? + // case EOpSinCos: TODO: case EOpSmoothStep: case EOpStep: break; @@ -2304,7 +2303,6 @@ bool TIntermediate::promoteAggregate(TIntermAggregate& node) return false; } - void TIntermBinary::updatePrecision() { #ifdef AMD_EXTENSIONS diff --git a/3rdparty/glslang/glslang/MachineIndependent/LiveTraverser.h b/3rdparty/glslang/glslang/MachineIndependent/LiveTraverser.h index 286efe6ce..029c24a82 100644 --- a/3rdparty/glslang/glslang/MachineIndependent/LiveTraverser.h +++ b/3rdparty/glslang/glslang/MachineIndependent/LiveTraverser.h @@ -1,11 +1,11 @@ // -//Copyright (C) 2016 LunarG, Inc. +// Copyright (C) 2016 LunarG, Inc. // -//All rights reserved. +// All rights reserved. // -//Redistribution and use in source and binary forms, with or without -//modification, are permitted provided that the following conditions -//are met: +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: // // Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. @@ -19,18 +19,18 @@ // contributors may be used to endorse or promote products derived // from this software without specific prior written permission. // -//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -//"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS -//FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE -//COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, -//INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -//BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -//LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -//CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -//LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN -//ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -//POSSIBILITY OF SUCH DAMAGE. +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +// COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. // #include "../Include/Common.h" diff --git a/3rdparty/glslang/glslang/MachineIndependent/ParseContextBase.cpp b/3rdparty/glslang/glslang/MachineIndependent/ParseContextBase.cpp index 872c27630..2b1a7a3ab 100644 --- a/3rdparty/glslang/glslang/MachineIndependent/ParseContextBase.cpp +++ b/3rdparty/glslang/glslang/MachineIndependent/ParseContextBase.cpp @@ -1,12 +1,12 @@ // -//Copyright (C) 2002-2005 3Dlabs Inc. Ltd. -//Copyright (C) 2016 Google, Inc. +// Copyright (C) 2002-2005 3Dlabs Inc. Ltd. +// Copyright (C) 2016 Google, Inc. // -//All rights reserved. +// All rights reserved. // -//Redistribution and use in source and binary forms, with or without -//modification, are permitted provided that the following conditions -//are met: +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: // // Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. @@ -20,18 +20,18 @@ // contributors may be used to endorse or promote products derived // from this software without specific prior written permission. // -//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -//"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS -//FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE -//COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, -//INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -//BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -//LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -//CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -//LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN -//ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -//POSSIBILITY OF SUCH DAMAGE. +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +// COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. // // Implement the TParseContextBase class. @@ -240,7 +240,7 @@ void TParseContextBase::trackLinkageDeferred(TSymbol& symbol) linkageSymbols.push_back(&symbol); } -// Make a shared symbol have a non-shared version that can be edited by the current +// Make a shared symbol have a non-shared version that can be edited by the current // compile, such that editing its type will not change the shared version and will // effect all nodes already sharing it (non-shallow type), // or adopting its full type after being edited (shallow type). @@ -308,20 +308,20 @@ const TFunction* TParseContextBase::selectFunction( std::function better, /* output */ bool& tie) { -// +// // Operation -// +// // 1. Prune the input list of candidates down to a list of viable candidates, // where each viable candidate has -// +// // * at least as many parameters as there are calling arguments, with any // remaining parameters being optional or having default values // * each parameter is true under convertible(A, B), where A is the calling // type for in and B is the formal type, and in addition, for out B is the // calling type and A is the formal type -// +// // 2. If there are no viable candidates, return with no match. -// +// // 3. If there is only one viable candidate, it is the best match. // // 4. If there are multiple viable candidates, select the first viable candidate @@ -329,7 +329,7 @@ const TFunction* TParseContextBase::selectFunction( // that candidate is better (bullets below), make it the incumbent. Repeat, with // a linear walk through the viable candidate list. The final incumbent will be // returned as the best match. A viable candidate is better than the incumbent if -// +// // * it has a function argument with a better(...) conversion than the incumbent, // for all directions needed by in and out // * the incumbent has no argument with a better(...) conversion then the @@ -408,7 +408,7 @@ const TFunction* TParseContextBase::selectFunction( } return true; }; - + const TFunction* incumbent = viableCandidates.front(); for (auto it = viableCandidates.begin() + 1; it != viableCandidates.end(); ++it) { const TFunction& candidate = *(*it); @@ -421,7 +421,7 @@ const TFunction* TParseContextBase::selectFunction( if (incumbent == *it) continue; const TFunction& candidate = *(*it); - + // In the case of default parameters, it may have an identical initial set, which is // also ambiguous if (betterParam(*incumbent, candidate) || equivalentParams(*incumbent, candidate)) diff --git a/3rdparty/glslang/glslang/MachineIndependent/ParseHelper.cpp b/3rdparty/glslang/glslang/MachineIndependent/ParseHelper.cpp index a5f4d8dc5..cfb56b04d 100644 --- a/3rdparty/glslang/glslang/MachineIndependent/ParseHelper.cpp +++ b/3rdparty/glslang/glslang/MachineIndependent/ParseHelper.cpp @@ -1,13 +1,13 @@ // -//Copyright (C) 2002-2005 3Dlabs Inc. Ltd. -//Copyright (C) 2012-2015 LunarG, Inc. -//Copyright (C) 2015-2016 Google, Inc. +// Copyright (C) 2002-2005 3Dlabs Inc. Ltd. +// Copyright (C) 2012-2015 LunarG, Inc. +// Copyright (C) 2015-2016 Google, Inc. // -//All rights reserved. +// All rights reserved. // -//Redistribution and use in source and binary forms, with or without -//modification, are permitted provided that the following conditions -//are met: +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: // // Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. @@ -21,18 +21,18 @@ // contributors may be used to endorse or promote products derived // from this software without specific prior written permission. // -//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -//"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS -//FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE -//COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, -//INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -//BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -//LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -//CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -//LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN -//ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -//POSSIBILITY OF SUCH DAMAGE. +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +// COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. // #include "ParseHelper.h" @@ -50,7 +50,7 @@ namespace glslang { TParseContext::TParseContext(TSymbolTable& symbolTable, TIntermediate& interm, bool parsingBuiltins, int version, EProfile profile, const SpvVersion& spvVersion, EShLanguage language, TInfoSink& infoSink, bool forwardCompatible, EShMessages messages) : - TParseContextBase(symbolTable, interm, parsingBuiltins, version, profile, spvVersion, language, infoSink, forwardCompatible, messages), + TParseContextBase(symbolTable, interm, parsingBuiltins, version, profile, spvVersion, language, infoSink, forwardCompatible, messages), contextPragma(true, false), loopNestingLevel(0), structNestingLevel(0), controlFlowNestingLevel(0), statementNestingLevel(0), inMain(false), postMainReturn(false), currentFunctionType(nullptr), blockName(nullptr), limits(resources.limits), @@ -76,7 +76,7 @@ TParseContext::TParseContext(TSymbolTable& symbolTable, TIntermediate& interm, b globalInputDefaults.clear(); globalOutputDefaults.clear(); - // "Shaders in the transform + // "Shaders in the transform // feedback capturing mode have an initial global default of // layout(xfb_buffer = 0) out;" if (language == EShLangVertex || @@ -370,12 +370,12 @@ TIntermTyped* TParseContext::handleVariable(const TSourceLoc& loc, TSymbol* symb requireExtensions(loc, symbol->getNumExtensions(), symbol->getExtensions(), symbol->getName().c_str()); if (symbol && symbol->isReadOnly()) { - // All shared things containing an implicitly sized array must be copied up + // All shared things containing an implicitly sized array must be copied up // on first use, so that all future references will share its array structure, // so that editing the implicit size will effect all nodes consuming it, // and so that editing the implicit size won't change the shared one. // - // If this is a variable or a block, check it and all it contains, but if this + // If this is a variable or a block, check it and all it contains, but if this // is a member of an anonymous block, check the whole block, as the whole block // will need to be copied up if it contains an implicitly-sized array. if (symbol->getType().containsImplicitlySizedArray() || @@ -537,7 +537,7 @@ void TParseContext::checkIndex(const TSourceLoc& loc, const TType& type, int& in error(loc, "", "[", "matrix index out of range '%d'", index); index = type.getMatrixCols() - 1; } - } + } } // for ES 2.0 (version 100) limitations for almost all index operations except vertex-shader uniforms @@ -558,7 +558,7 @@ void TParseContext::handleIndexLimits(const TSourceLoc& /*loc*/, TIntermTyped* b } } -// Make a shared symbol have a non-shared version that can be edited by the current +// Make a shared symbol have a non-shared version that can be edited by the current // compile, such that editing its type will not change the shared version and will // effect all nodes sharing it. void TParseContext::makeEditable(TSymbol*& symbol) @@ -600,7 +600,7 @@ void TParseContext::fixIoArraySize(const TSourceLoc& loc, TType& type) // Issue any errors if the non-array object is missing arrayness WRT // shader I/O that has array requirements. -// All arrayness checking is handled in array paths, this is for +// All arrayness checking is handled in array paths, this is for void TParseContext::ioArrayCheck(const TSourceLoc& loc, const TType& type, const TString& identifier) { if (! type.isArray() && ! symbolTable.atBuiltInLevel()) { @@ -633,7 +633,7 @@ void TParseContext::handleIoResizeArrayAccess(const TSourceLoc& /*loc*/, TInterm // If there has been an input primitive declaration (geometry shader) or an output // number of vertices declaration(tessellation shader), make sure all input array types -// match it in size. Types come either from nodes in the AST or symbols in the +// match it in size. Types come either from nodes in the AST or symbols in the // symbol table. // // Types without an array size will be given one. @@ -729,7 +729,7 @@ TIntermTyped* TParseContext::handleUnaryMath(const TSourceLoc& loc, const char* return result; else unaryOpError(loc, str, childNode->getCompleteString()); - + return childNode; } @@ -742,7 +742,7 @@ TIntermTyped* TParseContext::handleDotDereference(const TSourceLoc& loc, TInterm // // .length() can't be resolved until we later see the function-calling syntax. - // Save away the name in the AST for now. Processing is completed in + // Save away the name in the AST for now. Processing is completed in // handleLengthMethod(). // if (field == "length") { @@ -906,7 +906,7 @@ TFunction* TParseContext::handleFunctionDeclarator(const TSourceLoc& loc, TFunct if (symbolTable.atBuiltInLevel()) function.setDefined(); else { - if (prevDec && ! builtIn) + if (prevDec && ! builtIn) symbol->getAsFunction()->setPrototyped(); // need a writable one, but like having prevDec as a const function.setPrototyped(); } @@ -926,7 +926,7 @@ TFunction* TParseContext::handleFunctionDeclarator(const TSourceLoc& loc, TFunct } // -// Handle seeing the function prototype in front of a function definition in the grammar. +// Handle seeing the function prototype in front of a function definition in the grammar. // The body is handled after this function returns. // TIntermAggregate* TParseContext::handleFunctionDefinition(const TSourceLoc& loc, TFunction& function) @@ -1087,10 +1087,10 @@ TIntermTyped* TParseContext::handleFunctionCall(const TSourceLoc& loc, TFunction if (argQualifier.writeonly && ! formalQualifier.writeonly) error(arguments->getLoc(), message, "writeonly", ""); } - // TODO 4.5 functionality: A shader will fail to compile + // TODO 4.5 functionality: A shader will fail to compile // if the value passed to the memargument of an atomic memory function does not correspond to a buffer or - // shared variable. It is acceptable to pass an element of an array or a single component of a vector to the - // memargument of an atomic memory function, as long as the underlying array or vector is a buffer or + // shared variable. It is acceptable to pass an element of an array or a single component of a vector to the + // memargument of an atomic memory function, as long as the underlying array or vector is a buffer or // shared variable. } @@ -1213,7 +1213,7 @@ void TParseContext::computeBuiltinPrecisions(TIntermTyped& node, const TFunction operationPrecision = std::max(function[0].type->getQualifier().precision, unaryNode->getOperand()->getType().getQualifier().precision); if (function.getType().getBasicType() != EbtBool) - resultPrecision = function.getType().getQualifier().precision == EpqNone ? + resultPrecision = function.getType().getQualifier().precision == EpqNone ? operationPrecision : function.getType().getQualifier().precision; } else if (TIntermAggregate* agg = node.getAsAggregate()) { @@ -1243,7 +1243,7 @@ void TParseContext::computeBuiltinPrecisions(TIntermTyped& node, const TFunction if (agg->isSampling() || agg->getOp() == EOpImageLoad || agg->getOp() == EOpImageStore) resultPrecision = sequence[0]->getAsTyped()->getQualifier().precision; else if (function.getType().getBasicType() != EbtBool) - resultPrecision = function.getType().getQualifier().precision == EpqNone ? + resultPrecision = function.getType().getQualifier().precision == EpqNone ? operationPrecision : function.getType().getQualifier().precision; } @@ -1301,7 +1301,7 @@ void TParseContext::checkLocation(const TSourceLoc& loc, TOperator op) } // Finish processing object.length(). This started earlier in handleDotDereference(), where -// the ".length" part was recognized and semantically checked, and finished here where the +// the ".length" part was recognized and semantically checked, and finished here where the // function syntax "()" is recognized. // // Return resulting tree node. @@ -1319,8 +1319,8 @@ TIntermTyped* TParseContext::handleLengthMethod(const TSourceLoc& loc, TFunction return intermediate.addBuiltInFunctionCall(loc, EOpArrayLength, true, intermNode, TType(EbtInt)); } else if (type.isImplicitlySizedArray()) { if (intermNode->getAsSymbolNode() && isIoResizeArray(type)) { - // We could be between a layout declaration that gives a built-in io array implicit size and - // a user redeclaration of that array, meaning we have to substitute its implicit size here + // We could be between a layout declaration that gives a built-in io array implicit size and + // a user redeclaration of that array, meaning we have to substitute its implicit size here // without actually redeclaring the array. (It is an error to use a member before the // redeclaration, but not an error to use the array name itself.) const TString& name = intermNode->getAsSymbolNode()->getName(); @@ -1604,7 +1604,7 @@ void TParseContext::builtInOpCheck(const TSourceLoc& loc, const TFunction& fnCan if (imageType.getQualifier().layoutFormat != ElfR32i && imageType.getQualifier().layoutFormat != ElfR32ui) error(loc, "only supported on image with format r32i or r32ui", fnCandidate.getName().c_str(), ""); } else { - if (fnCandidate.getName().compare(0, 19, "imageAtomicExchange") != 0) + if (fnCandidate.getName().compare(0, 19, "imageAtomicExchange") != 0) error(loc, "only supported on integer images", fnCandidate.getName().c_str(), ""); else if (imageType.getQualifier().layoutFormat != ElfR32f && profile == EEsProfile) error(loc, "only supported on image with format r32f", fnCandidate.getName().c_str(), ""); @@ -1654,7 +1654,7 @@ extern bool PureOperatorBuiltins; // void TParseContext::nonOpBuiltInCheck(const TSourceLoc& loc, const TFunction& fnCandidate, TIntermAggregate& callNode) { - // Further maintenance of this function is deprecated, because the "correct" + // Further maintenance of this function is deprecated, because the "correct" // future-oriented design is to not have to do string compares on function names. // If PureOperatorBuiltins == true, then all built-ins should be mapped @@ -1759,7 +1759,7 @@ void TParseContext::nonOpBuiltInCheck(const TSourceLoc& loc, const TFunction& fn if (imageType.getQualifier().layoutFormat != ElfR32i && imageType.getQualifier().layoutFormat != ElfR32ui) error(loc, "only supported on image with format r32i or r32ui", fnCandidate.getName().c_str(), ""); } else { - if (fnCandidate.getName().compare(0, 19, "imageAtomicExchange") != 0) + if (fnCandidate.getName().compare(0, 19, "imageAtomicExchange") != 0) error(loc, "only supported on integer images", fnCandidate.getName().c_str(), ""); else if (imageType.getQualifier().layoutFormat != ElfR32f && profile == EEsProfile) error(loc, "only supported on image with format r32f", fnCandidate.getName().c_str(), ""); @@ -2412,8 +2412,8 @@ bool TParseContext::constructorTextureSamplerError(const TSourceLoc& loc, const // of the texture type must match that of the constructed sampler type // (that is, the suffixes of the type of the first argument and the // type of the constructor will be spelled the same way) - if (function[0].type->getBasicType() != EbtSampler || - ! function[0].type->getSampler().isTexture() || + if (function[0].type->getBasicType() != EbtSampler || + ! function[0].type->getSampler().isTexture() || function[0].type->isArray()) { error(loc, "sampler-constructor first argument must be a scalar textureXXX type", token, ""); return true; @@ -2720,7 +2720,7 @@ void TParseContext::mergeQualifiers(const TSourceLoc& loc, TQualifier& dst, cons #endif // Ordering - if (! force && ((profile != EEsProfile && version < 420) || + if (! force && ((profile != EEsProfile && version < 420) || (profile == EEsProfile && version < 310)) && ! extensionTurnedOn(E_GL_ARB_shading_language_420pack)) { // non-function parameters @@ -3330,7 +3330,7 @@ TSymbol* TParseContext::redeclareBuiltinVariable(const TSourceLoc& loc, const TS // Now, modify the type of the copy, as per the type of the current redeclaration. TQualifier& symbolQualifier = symbol->getWritableType().getQualifier(); - if (ssoPre150) { + if (ssoPre150) { if (intermediate.inIoAccessed(identifier)) error(loc, "cannot redeclare after use", identifier.c_str(), ""); if (qualifier.hasLayout()) @@ -3368,7 +3368,7 @@ TSymbol* TParseContext::redeclareBuiltinVariable(const TSourceLoc& loc, const TS error(loc, "can only change layout qualification of", "redeclaration", symbol->getName().c_str()); if (qualifier.storage != EvqVaryingIn) error(loc, "cannot change input storage qualification of", "redeclaration", symbol->getName().c_str()); - if (! builtIn && (publicType.pixelCenterInteger != intermediate.getPixelCenterInteger() || + if (! builtIn && (publicType.pixelCenterInteger != intermediate.getPixelCenterInteger() || publicType.originUpperLeft != intermediate.getOriginUpperLeft())) error(loc, "cannot redeclare with different qualification:", "redeclaration", symbol->getName().c_str()); if (publicType.pixelCenterInteger) @@ -3388,7 +3388,7 @@ TSymbol* TParseContext::redeclareBuiltinVariable(const TSourceLoc& loc, const TS error(loc, "all redeclarations must use the same depth layout on", "redeclaration", symbol->getName().c_str()); } } -#ifdef NV_EXTENSIONS +#ifdef NV_EXTENSIONS else if (identifier == "gl_SampleMask") { if (!publicType.layoutOverrideCoverage) { error(loc, "redeclaration only allowed for override_coverage layout", "redeclaration", symbol->getName().c_str()); @@ -3526,7 +3526,7 @@ void TParseContext::redeclareBuiltinBlock(const TSourceLoc& loc, TTypeList& newT // go to next member ++member; - } else { + } else { // For missing members of anonymous blocks that have been redeclared, // hide the original (shared) declaration. // Instance-named blocks can just have the member removed. @@ -3659,7 +3659,7 @@ void TParseContext::structTypeCheck(const TSourceLoc& /*loc*/, TPublicType& publ // fix and check for member storage qualifiers and types that don't belong within a structure for (unsigned int member = 0; member < typeList.size(); ++member) { - TQualifier& memberQualifier = typeList[member].type->getQualifier(); + TQualifier& memberQualifier = typeList[member].type->getQualifier(); const TSourceLoc& memberLoc = typeList[member].loc; if (memberQualifier.isAuxiliary() || memberQualifier.isInterpolation() || @@ -3833,7 +3833,7 @@ void TParseContext::finish() // Check for stages that are enabled by extension. // Can't do this at the beginning, it is chicken and egg to add a stage by // extension. - // Stage-specific features were correctly tested for already, this is just + // Stage-specific features were correctly tested for already, this is just // about the stage itself. switch (language) { case EShLangGeometry: @@ -4041,7 +4041,7 @@ void TParseContext::setLayoutQualifier(const TSourceLoc& loc, TPublicType& publi error(loc, "unknown blend equation", "blend_support", ""); return; } -#ifdef NV_EXTENSIONS +#ifdef NV_EXTENSIONS if (id == "override_coverage") { requireExtensions(loc, 1, &E_GL_NV_sample_mask_override_coverage, "sample mask override coverage"); publicType.shaderQualifiers.layoutOverrideCoverage = true; @@ -4079,7 +4079,7 @@ void TParseContext::setLayoutQualifier(const TSourceLoc& loc, TPublicType& publi } std::transform(id.begin(), id.end(), id.begin(), ::tolower); - + if (id == "offset") { // "offset" can be for either // - uniform offsets @@ -4135,9 +4135,9 @@ void TParseContext::setLayoutQualifier(const TSourceLoc& loc, TPublicType& publi publicType.qualifier.layoutComponent = value; return; } else if (id.compare(0, 4, "xfb_") == 0) { - // "Any shader making any static use (after preprocessing) of any of these - // *xfb_* qualifiers will cause the shader to be in a transform feedback - // capturing mode and hence responsible for describing the transform feedback + // "Any shader making any static use (after preprocessing) of any of these + // *xfb_* qualifiers will cause the shader to be in a transform feedback + // capturing mode and hence responsible for describing the transform feedback // setup." intermediate.setXfbMode(); const char* feature = "transform feedback qualifier"; @@ -4148,7 +4148,7 @@ void TParseContext::setLayoutQualifier(const TSourceLoc& loc, TPublicType& publi // "It is a compile-time error to specify an *xfb_buffer* that is greater than // the implementation-dependent constant gl_MaxTransformFeedbackBuffers." if (value >= resources.maxTransformFeedbackBuffers) - error(loc, "buffer is too large:", id.c_str(), "gl_MaxTransformFeedbackBuffers is %d", resources.maxTransformFeedbackBuffers); + error(loc, "buffer is too large:", id.c_str(), "gl_MaxTransformFeedbackBuffers is %d", resources.maxTransformFeedbackBuffers); if (value >= (int)TQualifier::layoutXfbBufferEnd) error(loc, "buffer is too large:", id.c_str(), "internal max is %d", TQualifier::layoutXfbBufferEnd-1); else @@ -4161,7 +4161,7 @@ void TParseContext::setLayoutQualifier(const TSourceLoc& loc, TPublicType& publi publicType.qualifier.layoutXfbOffset = value; return; } else if (id == "xfb_stride") { - // "The resulting stride (implicit or explicit), when divided by 4, must be less than or equal to the + // "The resulting stride (implicit or explicit), when divided by 4, must be less than or equal to the // implementation-dependent constant gl_MaxTransformFeedbackInterleavedComponents." if (value > 4 * resources.maxTransformFeedbackInterleavedComponents) error(loc, "1/4 stride is too large:", id.c_str(), "gl_MaxTransformFeedbackInterleavedComponents is %d", resources.maxTransformFeedbackInterleavedComponents); @@ -4295,17 +4295,17 @@ void TParseContext::setLayoutQualifier(const TSourceLoc& loc, TPublicType& publi // Merge any layout qualifier information from src into dst, leaving everything else in dst alone // // "More than one layout qualifier may appear in a single declaration. -// Additionally, the same layout-qualifier-name can occur multiple times -// within a layout qualifier or across multiple layout qualifiers in the -// same declaration. When the same layout-qualifier-name occurs -// multiple times, in a single declaration, the last occurrence overrides -// the former occurrence(s). Further, if such a layout-qualifier-name -// will effect subsequent declarations or other observable behavior, it -// is only the last occurrence that will have any effect, behaving as if -// the earlier occurrence(s) within the declaration are not present. -// This is also true for overriding layout-qualifier-names, where one -// overrides the other (e.g., row_major vs. column_major); only the last -// occurrence has any effect." +// Additionally, the same layout-qualifier-name can occur multiple times +// within a layout qualifier or across multiple layout qualifiers in the +// same declaration. When the same layout-qualifier-name occurs +// multiple times, in a single declaration, the last occurrence overrides +// the former occurrence(s). Further, if such a layout-qualifier-name +// will effect subsequent declarations or other observable behavior, it +// is only the last occurrence that will have any effect, behaving as if +// the earlier occurrence(s) within the declaration are not present. +// This is also true for overriding layout-qualifier-names, where one +// overrides the other (e.g., row_major vs. column_major); only the last +// occurrence has any effect." // void TParseContext::mergeObjectLayoutQualifiers(TQualifier& dst, const TQualifier& src, bool inheritOnly) { @@ -4384,7 +4384,7 @@ void TParseContext::layoutObjectCheck(const TSourceLoc& loc, const TSymbol& symb } } - // Check packing and matrix + // Check packing and matrix if (qualifier.hasUniformLayout()) { switch (qualifier.storage) { case EvqUniform: @@ -4472,8 +4472,8 @@ void TParseContext::layoutTypeCheck(const TSourceLoc& loc, const TType& type) if (repeated >= 0) error(loc, "overlapping offsets at", "xfb_offset", "offset %d in buffer %d", repeated, qualifier.layoutXfbBuffer); - // "The offset must be a multiple of the size of the first component of the first - // qualified variable or block member, or a compile-time error results. Further, if applied to an aggregate + // "The offset must be a multiple of the size of the first component of the first + // qualified variable or block member, or a compile-time error results. Further, if applied to an aggregate // containing a double, the offset must also be a multiple of 8..." if (type.containsBasicType(EbtDouble) && ! IsMultipleOfPow2(qualifier.layoutXfbOffset, 8)) error(loc, "type contains double; xfb_offset must be a multiple of 8", "xfb_offset", ""); @@ -4547,7 +4547,7 @@ void TParseContext::layoutTypeCheck(const TSourceLoc& loc, const TType& type) error(loc, "does not apply to unsigned integer images", TQualifier::getLayoutFormatString(qualifier.layoutFormat), ""); if (profile == EEsProfile) { - // "Except for image variables qualified with the format qualifiers r32f, r32i, and r32ui, image variables must + // "Except for image variables qualified with the format qualifiers r32f, r32i, and r32ui, image variables must // specify either memory qualifier readonly or the memory qualifier writeonly." if (! (qualifier.layoutFormat == ElfR32f || qualifier.layoutFormat == ElfR32i || qualifier.layoutFormat == ElfR32ui)) { if (! qualifier.readonly && ! qualifier.writeonly) @@ -4609,8 +4609,8 @@ void TParseContext::layoutQualifierCheck(const TSourceLoc& loc, const TQualifier if (qualifier.hasAnyLocation()) { - // "As with input layout qualifiers, all shaders except compute shaders - // allow *location* layout qualifiers on output variable declarations, + // "As with input layout qualifiers, all shaders except compute shaders + // allow *location* layout qualifiers on output variable declarations, // output block declarations, and output block member declarations." switch (qualifier.storage) { @@ -4921,7 +4921,7 @@ const TFunction* TParseContext::findFunction400(const TSourceLoc& loc, const TFu // create list of candidates to send TVector candidateList; symbolTable.findFunctionNameList(call.getMangledName(), candidateList, builtIn); - + // can 'from' convert to 'to'? const auto convertible = [this](const TType& from, const TType& to, TOperator, int) -> bool { if (from == to) @@ -4953,7 +4953,7 @@ const TFunction* TParseContext::findFunction400(const TSourceLoc& loc, const TFu // for ambiguity reporting bool tie = false; - + // send to the generic selector const TFunction* bestMatch = selectFunction(candidateList, call, convertible, better, tie); @@ -4965,7 +4965,7 @@ const TFunction* TParseContext::findFunction400(const TSourceLoc& loc, const TFu return bestMatch; } -// When a declaration includes a type, but not a variable name, it can be +// When a declaration includes a type, but not a variable name, it can be // to establish defaults. void TParseContext::declareTypeDefaults(const TSourceLoc& loc, const TPublicType& publicType) { @@ -5029,7 +5029,7 @@ TIntermNode* TParseContext::declareVariable(const TSourceLoc& loc, TString& iden // Declare the variable if (arraySizes || type.isArray()) { - // Arrayness is potentially coming both from the type and from the + // Arrayness is potentially coming both from the type and from the // variable: "int[] a[];" or just one or the other. // Merge it all to the type, so all arrayness is part of the type. arrayDimCheck(loc, &type, arraySizes); @@ -5667,9 +5667,9 @@ void TParseContext::declareBlock(const TSourceLoc& loc, TTypeList& typeList, con error(memberLoc, "member cannot contradict block", "stream", ""); } - // "This includes a block's inheritance of the - // current global default buffer, a block member's inheritance of the block's - // buffer, and the requirement that any *xfb_buffer* declared on a block + // "This includes a block's inheritance of the + // current global default buffer, a block member's inheritance of the block's + // buffer, and the requirement that any *xfb_buffer* declared on a block // member must match the buffer inherited from the block." if (memberQualifier.hasXfbBuffer()) { if (defaultQualification.layoutXfbBuffer != memberQualifier.layoutXfbBuffer) @@ -5854,15 +5854,15 @@ void TParseContext::blockQualifierCheck(const TSourceLoc& loc, const TQualifier& } // -// "For a block, this process applies to the entire block, or until the first member -// is reached that has a location layout qualifier. When a block member is declared with a location +// "For a block, this process applies to the entire block, or until the first member +// is reached that has a location layout qualifier. When a block member is declared with a location // qualifier, its location comes from that qualifier: The member's location qualifier overrides the block-level -// declaration. Subsequent members are again assigned consecutive locations, based on the newest location, -// until the next member declared with a location qualifier. The values used for locations do not have to be +// declaration. Subsequent members are again assigned consecutive locations, based on the newest location, +// until the next member declared with a location qualifier. The values used for locations do not have to be // declared in increasing order." void TParseContext::fixBlockLocations(const TSourceLoc& loc, TQualifier& qualifier, TTypeList& typeList, bool memberWithLocation, bool memberWithoutLocation) { - // "If a block has no block-level location layout qualifier, it is required that either all or none of its members + // "If a block has no block-level location layout qualifier, it is required that either all or none of its members // have a location layout qualifier, or a compile-time error results." if (! qualifier.hasLocation() && memberWithLocation && memberWithoutLocation) error(loc, "either the block needs a location, or all members need a location, or no members have a location", "location", ""); @@ -5898,9 +5898,9 @@ void TParseContext::fixBlockLocations(const TSourceLoc& loc, TQualifier& qualifi void TParseContext::fixBlockXfbOffsets(TQualifier& qualifier, TTypeList& typeList) { - // "If a block is qualified with xfb_offset, all its - // members are assigned transform feedback buffer offsets. If a block is not qualified with xfb_offset, any - // members of that block not qualified with an xfb_offset will not be assigned transform feedback buffer + // "If a block is qualified with xfb_offset, all its + // members are assigned transform feedback buffer offsets. If a block is not qualified with xfb_offset, any + // members of that block not qualified with an xfb_offset will not be assigned transform feedback buffer // offsets." if (! qualifier.hasXfbBuffer() || ! qualifier.hasXfbOffset()) @@ -5927,10 +5927,10 @@ void TParseContext::fixBlockXfbOffsets(TQualifier& qualifier, TTypeList& typeLis qualifier.layoutXfbOffset = TQualifier::layoutXfbOffsetEnd; } -// Calculate and save the offset of each block member, using the recursively +// Calculate and save the offset of each block member, using the recursively // defined block offset rules and the user-provided offset and align. // -// Also, compute and save the total size of the block. For the block's size, arrayness +// Also, compute and save the total size of the block. For the block's size, arrayness // is not taken into account, as each element is backed by a separate buffer. // void TParseContext::fixBlockUniformOffsets(TQualifier& qualifier, TTypeList& typeList) @@ -5954,20 +5954,20 @@ void TParseContext::fixBlockUniformOffsets(TQualifier& qualifier, TTypeList& typ int memberAlignment = intermediate.getBaseAlignment(*typeList[member].type, memberSize, dummyStride, qualifier.layoutPacking == ElpStd140, subMatrixLayout != ElmNone ? subMatrixLayout == ElmRowMajor : qualifier.layoutMatrix == ElmRowMajor); if (memberQualifier.hasOffset()) { - // "The specified offset must be a multiple + // "The specified offset must be a multiple // of the base alignment of the type of the block member it qualifies, or a compile-time error results." if (! IsMultipleOfPow2(memberQualifier.layoutOffset, memberAlignment)) error(memberLoc, "must be a multiple of the member's alignment", "offset", ""); - // GLSL: "It is a compile-time error to specify an offset that is smaller than the offset of the previous + // GLSL: "It is a compile-time error to specify an offset that is smaller than the offset of the previous // member in the block or that lies within the previous member of the block" if (spvVersion.spv == 0) { if (memberQualifier.layoutOffset < offset) error(memberLoc, "cannot lie in previous members", "offset", ""); - // "The offset qualifier forces the qualified member to start at or after the specified - // integral-constant expression, which will be its byte offset from the beginning of the buffer. - // "The actual offset of a member is computed as + // "The offset qualifier forces the qualified member to start at or after the specified + // integral-constant expression, which will be its byte offset from the beginning of the buffer. + // "The actual offset of a member is computed as // follows: If offset was declared, start with that offset, otherwise start with the next available offset." offset = std::max(offset, memberQualifier.layoutOffset); } else { @@ -5978,13 +5978,13 @@ void TParseContext::fixBlockUniformOffsets(TQualifier& qualifier, TTypeList& typ } } - // "The actual alignment of a member will be the greater of the specified align alignment and the standard + // "The actual alignment of a member will be the greater of the specified align alignment and the standard // (e.g., std140) base alignment for the member's type." if (memberQualifier.hasAlign()) memberAlignment = std::max(memberAlignment, memberQualifier.layoutAlign); // "If the resulting offset is not a multiple of the actual alignment, - // increase it to the first offset that is a multiple of + // increase it to the first offset that is a multiple of // the actual alignment." RoundToPow2(offset, memberAlignment); typeList[member].type->getQualifier().layoutOffset = offset; @@ -6074,7 +6074,7 @@ void TParseContext::updateStandaloneQualifierDefaults(const TSourceLoc& loc, con error(loc, "can only apply to 'out'", id, ""); if (! intermediate.setVertices(publicType.shaderQualifiers.vertices)) error(loc, "cannot change previously set layout value", id, ""); - + if (language == EShLangTessControl) checkIoArraysConsistency(loc); } diff --git a/3rdparty/glslang/glslang/MachineIndependent/ParseHelper.h b/3rdparty/glslang/glslang/MachineIndependent/ParseHelper.h index f850f0897..8d169e4ee 100644 --- a/3rdparty/glslang/glslang/MachineIndependent/ParseHelper.h +++ b/3rdparty/glslang/glslang/MachineIndependent/ParseHelper.h @@ -1,12 +1,12 @@ // -//Copyright (C) 2002-2005 3Dlabs Inc. Ltd. -//Copyright (C) 2012-2013 LunarG, Inc. +// Copyright (C) 2002-2005 3Dlabs Inc. Ltd. +// Copyright (C) 2012-2013 LunarG, Inc. // -//All rights reserved. +// All rights reserved. // -//Redistribution and use in source and binary forms, with or without -//modification, are permitted provided that the following conditions -//are met: +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: // // Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. @@ -20,18 +20,18 @@ // contributors may be used to endorse or promote products derived // from this software without specific prior written permission. // -//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -//"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS -//FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE -//COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, -//INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -//BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -//LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -//CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -//LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN -//ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -//POSSIBILITY OF SUCH DAMAGE. +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +// COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. // // @@ -448,7 +448,7 @@ protected: // * note, that appropriately gives an error if redeclaring a block that // was already used and hence already copied-up // - // - on seeing a layout declaration that sizes the array, fix everything in the + // - on seeing a layout declaration that sizes the array, fix everything in the // resize-list, giving errors for mismatch // // - on seeing an array size declaration, give errors on mismatch between it and previous diff --git a/3rdparty/glslang/glslang/MachineIndependent/PoolAlloc.cpp b/3rdparty/glslang/glslang/MachineIndependent/PoolAlloc.cpp index 9dfcd3055..3502e9399 100644 --- a/3rdparty/glslang/glslang/MachineIndependent/PoolAlloc.cpp +++ b/3rdparty/glslang/glslang/MachineIndependent/PoolAlloc.cpp @@ -1,10 +1,10 @@ // -//Copyright (C) 2002-2005 3Dlabs Inc. Ltd. -//All rights reserved. +// Copyright (C) 2002-2005 3Dlabs Inc. Ltd. +// All rights reserved. // -//Redistribution and use in source and binary forms, with or without -//modification, are permitted provided that the following conditions -//are met: +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: // // Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. @@ -18,18 +18,18 @@ // contributors may be used to endorse or promote products derived // from this software without specific prior written permission. // -//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -//"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS -//FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE -//COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, -//INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -//BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -//LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -//CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -//LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN -//ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -//POSSIBILITY OF SUCH DAMAGE. +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +// COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. // #include "../Include/Common.h" @@ -44,14 +44,14 @@ OS_TLSIndex PoolIndex; void InitializeMemoryPools() { - TThreadMemoryPools* pools = static_cast(OS_GetTLSValue(PoolIndex)); + TThreadMemoryPools* pools = static_cast(OS_GetTLSValue(PoolIndex)); if (pools) return; TPoolAllocator *threadPoolAllocator = new TPoolAllocator(); TThreadMemoryPools* threadData = new TThreadMemoryPools(); - + threadData->threadPoolAllocator = threadPoolAllocator; OS_SetTLSValue(PoolIndex, threadData); @@ -60,12 +60,12 @@ void InitializeMemoryPools() void FreeGlobalPools() { // Release the allocated memory for this thread. - TThreadMemoryPools* globalPools = static_cast(OS_GetTLSValue(PoolIndex)); + TThreadMemoryPools* globalPools = static_cast(OS_GetTLSValue(PoolIndex)); if (! globalPools) return; GetThreadPoolAllocator().popAll(); - delete &GetThreadPoolAllocator(); + delete &GetThreadPoolAllocator(); delete globalPools; } @@ -102,7 +102,7 @@ void SetThreadPoolAllocator(TPoolAllocator& poolAllocator) // Implement the functionality of the TPoolAllocator class, which // is documented in PoolAlloc.h. // -TPoolAllocator::TPoolAllocator(int growthIncrement, int allocationAlignment) : +TPoolAllocator::TPoolAllocator(int growthIncrement, int allocationAlignment) : pageSize(growthIncrement), alignment(allocationAlignment), freeList(0), @@ -206,13 +206,12 @@ void TAllocation::checkGuardBlock(unsigned char*, unsigned char, const char*) co #endif } - void TPoolAllocator::push() { tAllocState state = { currentPageOffset, inUseList }; stack.push_back(state); - + // // Indicate there is no current page to allocate from. // @@ -237,7 +236,7 @@ void TPoolAllocator::pop() while (inUseList != page) { // invoke destructor to free allocation list inUseList->~tHeader(); - + tHeader* nextInUse = inUseList->nextPage; if (inUseList->pageCount > 1) delete [] reinterpret_cast(inUseList); @@ -269,7 +268,7 @@ void* TPoolAllocator::allocate(size_t numBytes) // size including guard blocks. In release build, // guardBlockSize=0 and this all gets optimized away. size_t allocationSize = TAllocation::allocationSize(numBytes); - + // // Just keep some interesting statistics. // @@ -327,14 +326,13 @@ void* TPoolAllocator::allocate(size_t numBytes) // Use placement-new to initialize header new(memory) tHeader(inUseList, 1); inUseList = memory; - + unsigned char* ret = reinterpret_cast(inUseList) + headerSkip; currentPageOffset = (headerSkip + allocationSize + alignmentMask) & ~alignmentMask; return initializeAllocation(inUseList, ret, numBytes); } - // // Check all allocations in a list for damage by calling check on each. // diff --git a/3rdparty/glslang/glslang/MachineIndependent/RemoveTree.cpp b/3rdparty/glslang/glslang/MachineIndependent/RemoveTree.cpp index a4fa551ca..1d33bfd20 100644 --- a/3rdparty/glslang/glslang/MachineIndependent/RemoveTree.cpp +++ b/3rdparty/glslang/glslang/MachineIndependent/RemoveTree.cpp @@ -1,12 +1,12 @@ // -//Copyright (C) 2002-2005 3Dlabs Inc. Ltd. -//Copyright (C) 2013 LunarG, Inc. +// Copyright (C) 2002-2005 3Dlabs Inc. Ltd. +// Copyright (C) 2013 LunarG, Inc. // -//All rights reserved. +// All rights reserved. // -//Redistribution and use in source and binary forms, with or without -//modification, are permitted provided that the following conditions -//are met: +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: // // Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. @@ -20,18 +20,18 @@ // contributors may be used to endorse or promote products derived // from this software without specific prior written permission. // -//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -//"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS -//FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE -//COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, -//INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -//BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -//LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -//CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -//LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN -//ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -//POSSIBILITY OF SUCH DAMAGE. +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +// COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. // #include "../Include/intermediate.h" diff --git a/3rdparty/glslang/glslang/MachineIndependent/RemoveTree.h b/3rdparty/glslang/glslang/MachineIndependent/RemoveTree.h index 483b25dcb..507307e44 100644 --- a/3rdparty/glslang/glslang/MachineIndependent/RemoveTree.h +++ b/3rdparty/glslang/glslang/MachineIndependent/RemoveTree.h @@ -1,10 +1,10 @@ // -//Copyright (C) 2002-2005 3Dlabs Inc. Ltd. -//All rights reserved. +// Copyright (C) 2002-2005 3Dlabs Inc. Ltd. +// All rights reserved. // -//Redistribution and use in source and binary forms, with or without -//modification, are permitted provided that the following conditions -//are met: +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: // // Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. @@ -18,18 +18,18 @@ // contributors may be used to endorse or promote products derived // from this software without specific prior written permission. // -//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -//"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS -//FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE -//COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, -//INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -//BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -//LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -//CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -//LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN -//ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -//POSSIBILITY OF SUCH DAMAGE. +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +// COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. // namespace glslang { diff --git a/3rdparty/glslang/glslang/MachineIndependent/Scan.cpp b/3rdparty/glslang/glslang/MachineIndependent/Scan.cpp index 3ea316d8f..d2f728441 100644 --- a/3rdparty/glslang/glslang/MachineIndependent/Scan.cpp +++ b/3rdparty/glslang/glslang/MachineIndependent/Scan.cpp @@ -1,12 +1,12 @@ // -//Copyright (C) 2002-2005 3Dlabs Inc. Ltd. -//Copyright (C) 2013 LunarG, Inc. +// Copyright (C) 2002-2005 3Dlabs Inc. Ltd. +// Copyright (C) 2013 LunarG, Inc. // -//All rights reserved. +// All rights reserved. // -//Redistribution and use in source and binary forms, with or without -//modification, are permitted provided that the following conditions -//are met: +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: // // Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. @@ -20,18 +20,18 @@ // contributors may be used to endorse or promote products derived // from this software without specific prior written permission. // -//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -//"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS -//FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE -//COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, -//INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -//BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -//LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -//CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -//LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN -//ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -//POSSIBILITY OF SUCH DAMAGE. +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +// COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. // // @@ -142,13 +142,13 @@ void TInputScanner::consumeWhitespaceComment(bool& foundNonSpaceTab) { do { consumeWhiteSpace(foundNonSpaceTab); - + // if not starting a comment now, then done int c = peek(); if (c != '/' || c == EndOfInput) return; - // skip potential comment + // skip potential comment foundNonSpaceTab = true; if (! consumeComment()) return; @@ -199,10 +199,10 @@ bool TInputScanner::scanVersion(int& version, EProfile& profile, bool& notFirstT } lookingInMiddle = true; - // Nominal start, skipping the desktop allowed comments and white space, but tracking if + // Nominal start, skipping the desktop allowed comments and white space, but tracking if // something else was found for ES: consumeWhitespaceComment(foundNonSpaceTab); - if (foundNonSpaceTab) + if (foundNonSpaceTab) versionNotFirst = true; // "#" @@ -802,7 +802,7 @@ int TScanContext::tokenizeIdentifier() return keyword; case BUFFER: - if ((parseContext.profile == EEsProfile && parseContext.version < 310) || + if ((parseContext.profile == EEsProfile && parseContext.version < 310) || (parseContext.profile != EEsProfile && parseContext.version < 430)) return identifierOrType(); return keyword; @@ -962,7 +962,7 @@ int TScanContext::tokenizeIdentifier() case U64VEC3: case U64VEC4: afterType = true; - if (parseContext.symbolTable.atBuiltInLevel() || + if (parseContext.symbolTable.atBuiltInLevel() || (parseContext.extensionTurnedOn(E_GL_ARB_gpu_shader_int64) && parseContext.profile != EEsProfile && parseContext.version >= 450)) return keyword; @@ -1194,7 +1194,7 @@ int TScanContext::tokenizeIdentifier() return keyword; case PRECISE: - if ((parseContext.profile == EEsProfile && parseContext.extensionsTurnedOn(Num_AEP_gpu_shader5, AEP_gpu_shader5)) || + if ((parseContext.profile == EEsProfile && parseContext.extensionsTurnedOn(Num_AEP_gpu_shader5, AEP_gpu_shader5)) || (parseContext.profile != EEsProfile && parseContext.version >= 400)) return keyword; if (parseContext.profile == EEsProfile && parseContext.version == 310) { @@ -1356,7 +1356,7 @@ int TScanContext::dMat() int TScanContext::firstGenerationImage(bool inEs310) { - if (parseContext.symbolTable.atBuiltInLevel() || + if (parseContext.symbolTable.atBuiltInLevel() || (parseContext.profile != EEsProfile && (parseContext.version >= 420 || parseContext.extensionTurnedOn(E_GL_ARB_shader_image_load_store))) || (inEs310 && parseContext.profile == EEsProfile && parseContext.version >= 310)) return keyword; @@ -1381,8 +1381,8 @@ int TScanContext::secondGenerationImage() return keyword; } - if (parseContext.symbolTable.atBuiltInLevel() || - (parseContext.profile != EEsProfile && + if (parseContext.symbolTable.atBuiltInLevel() || + (parseContext.profile != EEsProfile && (parseContext.version >= 420 || parseContext.extensionTurnedOn(E_GL_ARB_shader_image_load_store)))) return keyword; diff --git a/3rdparty/glslang/glslang/MachineIndependent/Scan.h b/3rdparty/glslang/glslang/MachineIndependent/Scan.h index 67c86d2ef..9b8f2d451 100644 --- a/3rdparty/glslang/glslang/MachineIndependent/Scan.h +++ b/3rdparty/glslang/glslang/MachineIndependent/Scan.h @@ -1,12 +1,12 @@ // -//Copyright (C) 2002-2005 3Dlabs Inc. Ltd. -//Copyright (C) 2013 LunarG, Inc. +// Copyright (C) 2002-2005 3Dlabs Inc. Ltd. +// Copyright (C) 2013 LunarG, Inc. // -//All rights reserved. +// All rights reserved. // -//Redistribution and use in source and binary forms, with or without -//modification, are permitted provided that the following conditions -//are met: +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: // // Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. @@ -20,18 +20,18 @@ // contributors may be used to endorse or promote products derived // from this software without specific prior written permission. // -//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -//"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS -//FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE -//COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, -//INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -//BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -//LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -//CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -//LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN -//ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -//POSSIBILITY OF SUCH DAMAGE. +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +// COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. // #ifndef _GLSLANG_SCAN_INCLUDED_ #define _GLSLANG_SCAN_INCLUDED_ @@ -254,7 +254,7 @@ protected: size_t currentChar; // This is for reporting what string/line an error occurred on, and can be overridden by #line. - // It remembers the last state of each source string as it is left for the next one, so unget() + // It remembers the last state of each source string as it is left for the next one, so unget() // can restore that state. TSourceLoc* loc; // an array diff --git a/3rdparty/glslang/glslang/MachineIndependent/ScanContext.h b/3rdparty/glslang/glslang/MachineIndependent/ScanContext.h index f237bee9f..1d86348eb 100644 --- a/3rdparty/glslang/glslang/MachineIndependent/ScanContext.h +++ b/3rdparty/glslang/glslang/MachineIndependent/ScanContext.h @@ -1,11 +1,11 @@ // -//Copyright (C) 2013 LunarG, Inc. +// Copyright (C) 2013 LunarG, Inc. // -//All rights reserved. +// All rights reserved. // -//Redistribution and use in source and binary forms, with or without -//modification, are permitted provided that the following conditions -//are met: +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: // // Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. @@ -19,18 +19,18 @@ // contributors may be used to endorse or promote products derived // from this software without specific prior written permission. // -//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -//"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS -//FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE -//COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, -//INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -//BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -//LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -//CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -//LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN -//ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -//POSSIBILITY OF SUCH DAMAGE. +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +// COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. // // diff --git a/3rdparty/glslang/glslang/MachineIndependent/ShaderLang.cpp b/3rdparty/glslang/glslang/MachineIndependent/ShaderLang.cpp index 9038a7f0e..dadac56a7 100644 --- a/3rdparty/glslang/glslang/MachineIndependent/ShaderLang.cpp +++ b/3rdparty/glslang/glslang/MachineIndependent/ShaderLang.cpp @@ -1,13 +1,13 @@ // -//Copyright (C) 2002-2005 3Dlabs Inc. Ltd. -//Copyright (C) 2013-2016 LunarG, Inc. -//Copyright (C) 2015-2016 Google, Inc. +// Copyright (C) 2002-2005 3Dlabs Inc. Ltd. +// Copyright (C) 2013-2016 LunarG, Inc. +// Copyright (C) 2015-2016 Google, Inc. // -//All rights reserved. +// All rights reserved. // -//Redistribution and use in source and binary forms, with or without -//modification, are permitted provided that the following conditions -//are met: +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: // // Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. @@ -21,18 +21,18 @@ // contributors may be used to endorse or promote products derived // from this software without specific prior written permission. // -//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -//"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS -//FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE -//COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, -//INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -//BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -//LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -//CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -//LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN -//ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -//POSSIBILITY OF SUCH DAMAGE. +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +// COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. // // @@ -47,11 +47,14 @@ #include #include "SymbolTable.h" #include "ParseHelper.h" -#include "../../hlsl/hlslParseHelper.h" -#include "../../hlsl/hlslParseables.h" #include "Scan.h" #include "ScanContext.h" + +#ifdef ENABLE_HLSL +#include "../../hlsl/hlslParseHelper.h" +#include "../../hlsl/hlslParseables.h" #include "../../hlsl/hlslScanContext.h" +#endif #include "../Include/ShHandle.h" #include "../../OGLCompilersDLL/InitializeDll.h" @@ -73,7 +76,9 @@ TBuiltInParseables* CreateBuiltInParseables(TInfoSink& infoSink, EShSource sourc { switch (source) { case EShSourceGlsl: return new TBuiltIns(); // GLSL builtIns +#ifdef ENABLE_HLSL case EShSourceHlsl: return new TBuiltInParseablesHlsl(); // HLSL intrinsics +#endif default: infoSink.info.message(EPrefixInternalError, "Unable to determine source language"); @@ -88,15 +93,21 @@ TParseContextBase* CreateParseContext(TSymbolTable& symbolTable, TIntermediate& SpvVersion spvVersion, bool forwardCompatible, EShMessages messages, bool parsingBuiltIns, const std::string sourceEntryPointName = "") { +#ifndef ENABLE_HLSL + (void)sourceEntryPointName; // Unused argument. +#endif + switch (source) { case EShSourceGlsl: intermediate.setEntryPointName("main"); return new TParseContext(symbolTable, intermediate, parsingBuiltIns, version, profile, spvVersion, language, infoSink, forwardCompatible, messages); +#ifdef ENABLE_HLSL case EShSourceHlsl: return new HlslParseContext(symbolTable, intermediate, parsingBuiltIns, version, profile, spvVersion, language, infoSink, sourceEntryPointName.c_str(), forwardCompatible, messages); +#endif default: infoSink.info.message(EPrefixInternalError, "Unable to determine source language"); return nullptr; @@ -194,11 +205,11 @@ enum EPrecisionClass { EPcCount }; -// A process-global symbol table per version per profile for built-ins common -// to multiple stages (languages), and a process-global symbol table per version +// A process-global symbol table per version per profile for built-ins common +// to multiple stages (languages), and a process-global symbol table per version // per profile per stage for built-ins unique to each stage. They will be sparsely // populated, so they will only be generated as needed. -// +// // Each has a different set of built-ins, and we want to preserve that from // compile to compile. // @@ -214,19 +225,19 @@ bool InitializeSymbolTable(const TString& builtIns, int version, EProfile profil EShSource source, TInfoSink& infoSink, TSymbolTable& symbolTable) { TIntermediate intermediate(language, version, profile); - + intermediate.setSource(source); - std::unique_ptr parseContext(CreateParseContext(symbolTable, intermediate, version, profile, source, + std::unique_ptr parseContext(CreateParseContext(symbolTable, intermediate, version, profile, source, language, infoSink, spvVersion, true, EShMsgDefault, true)); - TShader::ForbidInclude includer; + TShader::ForbidIncluder includer; TPpContext ppContext(*parseContext, "", includer); TScanContext scanContext(*parseContext); parseContext->setScanContext(&scanContext); parseContext->setPpContext(&ppContext); - + // // Push the symbol table to give it an initial scope. This // push should not have a corresponding pop, so that built-ins @@ -242,7 +253,7 @@ bool InitializeSymbolTable(const TString& builtIns, int version, EProfile profil if (builtInLengths[0] == 0) return true; - + TInputScanner input(1, builtInShaders, builtInLengths); if (! parseContext->parseShaderStrings(ppContext, input) != 0) { infoSink.info.message(EPrefixInternalError, "Unable to parse built-ins"); @@ -285,6 +296,9 @@ bool InitializeSymbolTables(TInfoSink& infoSink, TSymbolTable** commonTable, TS { std::unique_ptr builtInParseables(CreateBuiltInParseables(infoSink, source)); + if (builtInParseables == nullptr) + return false; + builtInParseables->initialize(version, profile, spvVersion); // do the common tables @@ -330,7 +344,10 @@ bool AddContextSpecificSymbols(const TBuiltInResource* resources, TInfoSink& inf EProfile profile, const SpvVersion& spvVersion, EShLanguage language, EShSource source) { std::unique_ptr builtInParseables(CreateBuiltInParseables(infoSink, source)); - + + if (builtInParseables == nullptr) + return false; + builtInParseables->initialize(*resources, version, profile, spvVersion, language); InitializeSymbolTable(builtInParseables->getCommonString(), version, profile, spvVersion, language, source, infoSink, symbolTable); builtInParseables->identifyBuiltIns(version, profile, spvVersion, language, symbolTable, *resources); @@ -339,7 +356,7 @@ bool AddContextSpecificSymbols(const TBuiltInResource* resources, TInfoSink& inf } // -// To do this on the fly, we want to leave the current state of our thread's +// To do this on the fly, we want to leave the current state of our thread's // pool allocator intact, so: // - Switch to a new pool for parsing the built-ins // - Do the parsing, which builds the symbol table, using the new pool @@ -402,7 +419,7 @@ void SetupBuiltinSymbolTable(int version, EProfile profile, const SpvVersion& sp [versionIndex][spvVersionIndex][profileIndex][sourceIndex][CommonIndex(profile, (EShLanguage)stage)]); SharedSymbolTables[versionIndex][spvVersionIndex][profileIndex][sourceIndex][stage]->copyTable(*stageTables[stage]); SharedSymbolTables[versionIndex][spvVersionIndex][profileIndex][sourceIndex][stage]->readOnly(); - } + } } // Clean up the local tables before deleting the pool they used. @@ -471,7 +488,7 @@ bool DeduceVersionProfile(TInfoSink& infoSink, EShLanguage stage, bool versionNo profile = ECoreProfile; else profile = ENoProfile; - } + } // else: typical desktop case... e.g., "#version 410 core" } } @@ -628,7 +645,7 @@ bool ProcessDeferred( if (numStrings == 0) return true; - + // Move to length-based strings, rather than null-terminated strings. // Also, add strings to include the preamble and to ensure the shader is not null, // which lets the grammar accept what was a null (post preprocessing) shader. @@ -710,24 +727,25 @@ bool ProcessDeferred( if (spvVersion.vulkan >= 100) intermediate.setOriginUpperLeft(); SetupBuiltinSymbolTable(version, profile, spvVersion, source); - + TSymbolTable* cachedTable = SharedSymbolTables[MapVersionToIndex(version)] [MapSpvVersionToIndex(spvVersion)] [MapProfileToIndex(profile)] [MapSourceToIndex(source)] [compiler->getLanguage()]; - + // Dynamically allocate the symbol table so we can control when it is deallocated WRT the pool. TSymbolTable* symbolTableMemory = new TSymbolTable; TSymbolTable& symbolTable = *symbolTableMemory; if (cachedTable) symbolTable.adoptLevels(*cachedTable); - + // Add built-in symbols that are potentially context dependent; // they get popped again further down. - AddContextSpecificSymbols(resources, compiler->infoSink, symbolTable, version, profile, spvVersion, - compiler->getLanguage(), source); - + if (! AddContextSpecificSymbols(resources, compiler->infoSink, symbolTable, version, profile, spvVersion, + compiler->getLanguage(), source)) + return false; + // // Now we can process the full shader under proper symbols and rules. // @@ -754,7 +772,7 @@ bool ProcessDeferred( } parseContext->initializeExtensionBehavior(); - + // Fill in the strings as outlined above. std::string preamble; parseContext->getPreamble(preamble); @@ -978,7 +996,7 @@ struct DoFullParse{ bool operator()(TParseContextBase& parseContext, TPpContext& ppContext, TInputScanner& fullInput, bool versionWillBeError, TSymbolTable&, TIntermediate& intermediate, - EShOptimizationLevel optLevel, EShMessages messages) + EShOptimizationLevel optLevel, EShMessages messages) { bool success = true; // Parse the full shader. @@ -1032,7 +1050,6 @@ bool PreprocessDeferred( false, includer); } - // // do a partial compile on the given strings for a single compilation unit // for a potential deferred link into a single stage (and deferred full compile of that @@ -1041,7 +1058,7 @@ bool PreprocessDeferred( // all preprocessing, parsing, semantic checks, etc. for a single compilation unit // are done here. // -// return: the tree and other information is filled into the intermediate argument, +// return: the tree and other information is filled into the intermediate argument, // and true is returned by the function for success. // bool CompileDeferred( @@ -1072,7 +1089,6 @@ bool CompileDeferred( } // end anonymous namespace for local functions - // // ShInitialize() should be called exactly once per process, not per thread. // @@ -1087,7 +1103,9 @@ int ShInitialize() PerProcessGPA = new TPoolAllocator(); glslang::TScanContext::fillInKeywordMap(); +#ifdef ENABLE_HLSL glslang::HlslScanContext::fillInKeywordMap(); +#endif return 1; } @@ -1103,7 +1121,7 @@ ShHandle ShConstructCompiler(const EShLanguage language, int debugOptions) return 0; TShHandleBase* base = static_cast(ConstructCompiler(language, debugOptions)); - + return reinterpret_cast(base); } @@ -1180,7 +1198,9 @@ int __fastcall ShFinalize() } glslang::TScanContext::deleteKeywordMap(); +#ifdef ENABLE_HLSL glslang::HlslScanContext::deleteKeywordMap(); +#endif return 1; } @@ -1219,7 +1239,7 @@ int ShCompile( compiler->infoSink.debug.erase(); TIntermediate intermediate(compiler->getLanguage()); - TShader::ForbidInclude includer; + TShader::ForbidIncluder includer; bool success = CompileDeferred(compiler, shaderStrings, numStrings, inputLengths, nullptr, "", optLevel, resources, defaultVersion, ENoProfile, false, forwardCompatible, messages, intermediate, includer); @@ -1264,8 +1284,7 @@ int ShLinkExt( } if (base->getAsCompiler()) cObjects.push_back(base->getAsCompiler()); - - + if (cObjects[i] == 0) return 0; } @@ -1281,7 +1300,7 @@ int ShLinkExt( for (int i = 0; i < numHandles; ++i) { if (cObjects[i]->getAsCompiler()) { if (! cObjects[i]->getAsCompiler()->linkable()) { - linker->infoSink.info.message(EPrefixError, "Not all shaders have valid object code."); + linker->infoSink.info.message(EPrefixError, "Not all shaders have valid object code."); return 0; } } @@ -1340,7 +1359,7 @@ const void* ShGetExecutable(const ShHandle handle) return 0; TShHandleBase* base = reinterpret_cast(handle); - + TLinker* linker = static_cast(base->getAsLinker()); if (linker == 0) return 0; @@ -1357,7 +1376,7 @@ const void* ShGetExecutable(const ShHandle handle) // success or failure. // int ShSetVirtualAttributeBindings(const ShHandle handle, const ShBindingTable* table) -{ +{ if (!InitThread()) return 0; @@ -1369,7 +1388,7 @@ int ShSetVirtualAttributeBindings(const ShHandle handle, const ShBindingTable* t if (linker == 0) return 0; - + linker->setAppAttributeBindings(table); return 1; @@ -1446,7 +1465,7 @@ int ShGetUniformLocation(const ShHandle handle, const char* name) // // Below is a new alternate C++ interface that might potentially replace the above // opaque handle-based interface. -// +// // See more detailed comment in ShaderLang.h // @@ -1552,7 +1571,7 @@ bool TShader::parse(const TBuiltInResource* builtInResources, int defaultVersion { if (! InitThread()) return false; - + pool = new TPoolAllocator(); SetThreadPoolAllocator(*pool); if (! preamble) @@ -1636,7 +1655,7 @@ bool TProgram::link(EShMessages messages) linked = true; bool error = false; - + pool = new TPoolAllocator(); SetThreadPoolAllocator(*pool); @@ -1723,7 +1742,7 @@ const char* TProgram::getInfoDebugLog() // bool TProgram::buildReflection() -{ +{ if (! linked || reflection) return false; diff --git a/3rdparty/glslang/glslang/MachineIndependent/SymbolTable.cpp b/3rdparty/glslang/glslang/MachineIndependent/SymbolTable.cpp index d34f4d2ca..080a5e0f4 100644 --- a/3rdparty/glslang/glslang/MachineIndependent/SymbolTable.cpp +++ b/3rdparty/glslang/glslang/MachineIndependent/SymbolTable.cpp @@ -1,12 +1,12 @@ // -//Copyright (C) 2002-2005 3Dlabs Inc. Ltd. -//Copyright (C) 2012-2013 LunarG, Inc. +// Copyright (C) 2002-2005 3Dlabs Inc. Ltd. +// Copyright (C) 2012-2013 LunarG, Inc. // -//All rights reserved. +// All rights reserved. // -//Redistribution and use in source and binary forms, with or without -//modification, are permitted provided that the following conditions -//are met: +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: // // Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. @@ -20,18 +20,18 @@ // contributors may be used to endorse or promote products derived // from this software without specific prior written permission. // -//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -//"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS -//FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE -//COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, -//INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -//BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -//LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -//CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -//LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN -//ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -//POSSIBILITY OF SUCH DAMAGE. +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +// COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. // // diff --git a/3rdparty/glslang/glslang/MachineIndependent/SymbolTable.h b/3rdparty/glslang/glslang/MachineIndependent/SymbolTable.h index 1cb08d6de..9028dd762 100644 --- a/3rdparty/glslang/glslang/MachineIndependent/SymbolTable.h +++ b/3rdparty/glslang/glslang/MachineIndependent/SymbolTable.h @@ -1,12 +1,12 @@ // -//Copyright (C) 2002-2005 3Dlabs Inc. Ltd. -//Copyright (C) 2013 LunarG, Inc. +// Copyright (C) 2002-2005 3Dlabs Inc. Ltd. +// Copyright (C) 2013 LunarG, Inc. // -//All rights reserved. +// All rights reserved. // -//Redistribution and use in source and binary forms, with or without -//modification, are permitted provided that the following conditions -//are met: +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: // // Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. @@ -20,18 +20,18 @@ // contributors may be used to endorse or promote products derived // from this software without specific prior written permission. // -//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -//"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS -//FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE -//COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, -//INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -//BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -//LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -//CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -//LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN -//ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -//POSSIBILITY OF SUCH DAMAGE. +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +// COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. // #ifndef _SYMBOL_TABLE_INCLUDED_ @@ -120,7 +120,7 @@ protected: const TString *name; unsigned int uniqueId; // For cross-scope comparing during code generation - // For tracking what extensions must be present + // For tracking what extensions must be present // (don't use if correct version/profile is present). int numExtensions; const char** extensions; // an array of pointers to existing constant char strings @@ -145,7 +145,7 @@ protected: class TVariable : public TSymbol { public: TVariable(const TString *name, const TType& t, bool uT = false ) - : TSymbol(name), + : TSymbol(name), userType(uT), constSubtree(nullptr), anonId(-1) { type.shallowCopy(t); } @@ -192,7 +192,7 @@ struct TParameter { TString *name; TType* type; TIntermTyped* defaultValue; - void copyParam(const TParameter& param) + void copyParam(const TParameter& param) { if (param.name) name = NewPoolTString(param.name->c_str()); @@ -284,7 +284,7 @@ public: virtual const TAnonMember* getAsAnonMember() const { return this; } virtual const TVariable& getAnonContainer() const { return anonContainer; } virtual unsigned int getMemberNumber() const { return memberNumber; } - + virtual const TType& getType() const { const TTypeList& types = *anonContainer.getType().getStruct(); @@ -297,7 +297,7 @@ public: const TTypeList& types = *anonContainer.getType().getStruct(); return *types[memberNumber].type; } - + virtual int getAnonId() const { return anonId; } virtual void dump(TInfoSink &infoSink) const; @@ -377,7 +377,7 @@ public: TSymbol* find(const TString& name) const { tLevel::const_iterator it = level.find(name); - if (it == level.end()) + if (it == level.end()) return 0; else return (*it).second; @@ -500,7 +500,7 @@ public: while (table.size() > adoptedLevels) pop(0); } - + void adoptLevels(TSymbolTable& symTable) { for (unsigned int level = 0; level < symTable.table.size(); ++level) { @@ -532,7 +532,7 @@ public: void setNoBuiltInRedeclarations() { noBuiltInRedeclarations = true; } void setSeparateNameSpaces() { separateNameSpaces = true; } - + void push() { table.push_back(new TSymbolTableLevel); @@ -558,7 +558,7 @@ public: // make sure there isn't a function of this variable name if (! separateNameSpaces && ! symbol.getAsFunction() && table[currentLevel()]->hasFunctionName(symbol.getName())) return false; - + // check for not overloading or redefining a built-in function if (noBuiltInRedeclarations) { if (atGlobalLevel() && currentLevel() > 0) { @@ -582,7 +582,7 @@ public: // // To allocate an internal temporary, which will need to be uniquely - // identified by the consumer of the AST, but never need to + // identified by the consumer of the AST, but never need to // found by doing a symbol table search by name, hence allowed an // arbitrary name in the symbol with no worry of collision. // @@ -684,7 +684,7 @@ public: for (unsigned int level = 0; level < table.size(); ++level) table[level]->relateToOperator(name, op); } - + void setFunctionExtensions(const char* name, int num, const char* const extensions[]) { for (unsigned int level = 0; level < table.size(); ++level) diff --git a/3rdparty/glslang/glslang/MachineIndependent/Versions.cpp b/3rdparty/glslang/glslang/MachineIndependent/Versions.cpp index afedb4f71..6a8c34509 100644 --- a/3rdparty/glslang/glslang/MachineIndependent/Versions.cpp +++ b/3rdparty/glslang/glslang/MachineIndependent/Versions.cpp @@ -1,12 +1,12 @@ // -//Copyright (C) 2002-2005 3Dlabs Inc. Ltd. -//Copyright (C) 2012-2013 LunarG, Inc. +// Copyright (C) 2002-2005 3Dlabs Inc. Ltd. +// Copyright (C) 2012-2013 LunarG, Inc. // -//All rights reserved. +// All rights reserved. // -//Redistribution and use in source and binary forms, with or without -//modification, are permitted provided that the following conditions -//are met: +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: // // Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. @@ -20,24 +20,24 @@ // contributors may be used to endorse or promote products derived // from this software without specific prior written permission. // -//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -//"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS -//FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE -//COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, -//INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -//BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -//LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -//CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -//LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN -//ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -//POSSIBILITY OF SUCH DAMAGE. +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +// COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. // // // Help manage multiple profiles, versions, extensions etc. // -// These don't return error codes, as the presumption is parsing will +// These don't return error codes, as the presumption is parsing will // always continue as if the tested feature were enabled, and thus there // is no error recovery needed. // @@ -47,25 +47,25 @@ // // To add a new hypothetical "Feature F" to the front end, where an extension // "XXX_extension_X" can be used to enable the feature, do the following. -// +// // OVERVIEW: Specific features are what are error-checked for, not -// extensions: A specific Feature F might be enabled by an extension, or a +// extensions: A specific Feature F might be enabled by an extension, or a // particular version in a particular profile, or a stage, or combinations, etc. -// -// The basic mechanism is to use the following to "declare" all the things that +// +// The basic mechanism is to use the following to "declare" all the things that // enable/disable Feature F, in a code path that implements Feature F: -// +// // requireProfile() // profileRequires() // requireStage() // checkDeprecated() // requireNotRemoved() // requireExtensions() -// -// Typically, only the first two calls are needed. They go into a code path that -// implements Feature F, and will log the proper error/warning messages. Parsing +// +// Typically, only the first two calls are needed. They go into a code path that +// implements Feature F, and will log the proper error/warning messages. Parsing // will then always continue as if the tested feature was enabled. -// +// // There is typically no if-testing or conditional parsing, just insertion of the calls above. // However, if symbols specific to the extension are added (step 5), they will // only be added under tests that the minimum version and profile are present. @@ -73,10 +73,10 @@ // 1) Add a symbol name for the extension string at the bottom of Versions.h: // // const char* const XXX_extension_X = "XXX_extension_X"; -// +// // 2) Add extension initialization to TParseVersions::initializeExtensionBehavior(), // the first function below: -// +// // extensionBehavior[XXX_extension_X] = EBhDisable; // // 3) Add any preprocessor directives etc. in the next function, TParseVersions::getPreamble(): @@ -84,50 +84,50 @@ // "#define XXX_extension_X 1\n" // // The new-line is important, as that ends preprocess tokens. -// +// // 4) Insert a profile check in the feature's path (unless all profiles support the feature, // for some version level). That is, call requireProfile() to constrain the profiles, e.g.: -// +// // // ... in a path specific to Feature F... // requireProfile(loc, // ECoreProfile | ECompatibilityProfile, // "Feature F"); -// +// // 5) For each profile that supports the feature, insert version/extension checks: -// +// // The mostly likely scenario is that Feature F can only be used with a // particular profile if XXX_extension_X is present or the version is // high enough that the core specification already incorporated it. -// +// // // following the requireProfile() call... -// profileRequires(loc, +// profileRequires(loc, // ECoreProfile | ECompatibilityProfile, // 420, // 0 if no version incorporated the feature into the core spec. // XXX_extension_X, // can be a list of extensions that all add the feature // "Feature F Description"); -// +// // This allows the feature if either A) one of the extensions is enabled or // B) the version is high enough. If no version yet incorporates the feature // into core, pass in 0. -// +// // This can be called multiple times, if different profiles support the -// feature starting at different version numbers or with different +// feature starting at different version numbers or with different // extensions. -// +// // This must be called for each profile allowed by the initial call to requireProfile(). -// +// // Profiles are all masks, which can be "or"-ed together. -// +// // ENoProfile // ECoreProfile // ECompatibilityProfile // EEsProfile -// +// // The ENoProfile profile is only for desktop, before profiles showed up in version 150; // All other #version with no profile default to either es or core, and so have profiles. -// +// // You can select all but a particular profile using ~. The following basically means "desktop": -// +// // ~EEsProfile // // 6) If built-in symbols are added by the extension, add them in Initialize.cpp: Their use @@ -155,7 +155,7 @@ void TParseVersions::initializeExtensionBehavior() extensionBehavior[E_GL_EXT_frag_depth] = EBhDisable; extensionBehavior[E_GL_OES_EGL_image_external] = EBhDisable; extensionBehavior[E_GL_EXT_shader_texture_lod] = EBhDisable; - + extensionBehavior[E_GL_ARB_texture_rectangle] = EBhDisable; extensionBehavior[E_GL_3DL_array_objects] = EBhDisable; extensionBehavior[E_GL_ARB_shading_language_420pack] = EBhDisable; @@ -195,7 +195,7 @@ void TParseVersions::initializeExtensionBehavior() extensionBehavior[E_GL_AMD_gpu_shader_half_float] = EBhDisable; #endif -#ifdef NV_EXTENSIONS +#ifdef NV_EXTENSIONS extensionBehavior[E_GL_NV_sample_mask_override_coverage] = EBhDisable; extensionBehavior[E_SPV_NV_geometry_shader_passthrough] = EBhDisable; #endif @@ -234,7 +234,7 @@ void TParseVersions::initializeExtensionBehavior() void TParseVersions::getPreamble(std::string& preamble) { if (profile == EEsProfile) { - preamble = + preamble = "#define GL_ES 1\n" "#define GL_FRAGMENT_PRECISION_HIGH 1\n" "#define GL_OES_texture_3D 1\n" @@ -273,7 +273,7 @@ void TParseVersions::getPreamble(std::string& preamble) "#define GL_EXT_shader_non_constant_global_initializers 1\n" ; } else { - preamble = + preamble = "#define GL_FRAGMENT_PRECISION_HIGH 1\n" "#define GL_ARB_texture_rectangle 1\n" "#define GL_ARB_shading_language_420pack 1\n" @@ -308,7 +308,7 @@ void TParseVersions::getPreamble(std::string& preamble) "#define GL_AMD_gpu_shader_half_float 1\n" #endif -#ifdef NV_EXTENSIONS +#ifdef NV_EXTENSIONS "#define GL_NV_sample_mask_override_coverage 1\n" "#define GL_NV_geometry_shader_passthrough 1\n" #endif @@ -316,7 +316,7 @@ void TParseVersions::getPreamble(std::string& preamble) } // #line and #include - preamble += + preamble += "#define GL_GOOGLE_cpp_style_line_directive 1\n" "#define GL_GOOGLE_include_directive 1\n" ; @@ -343,7 +343,7 @@ void TParseVersions::getPreamble(std::string& preamble) // // When to use requireProfile(): // -// Use if only some profiles support a feature. However, if within a profile the feature +// Use if only some profiles support a feature. However, if within a profile the feature // is version or extension specific, follow this call with calls to profileRequires(). // // Operation: If the current profile is not one of the profileMask, @@ -358,7 +358,7 @@ void TParseVersions::requireProfile(const TSourceLoc& loc, int profileMask, cons // // Map from stage enum to externally readable text name. // -const char* StageName(EShLanguage stage) +const char* StageName(EShLanguage stage) { switch(stage) { case EShLangVertex: return "vertex"; @@ -383,7 +383,7 @@ const char* StageName(EShLanguage stage) // Operation: Will issue warnings/errors based on the current profile, version, and extension // behaviors. It only checks extensions when the current profile is one of the profileMask. // -// A minVersion of 0 means no version of the profileMask support this in core, +// A minVersion of 0 means no version of the profileMask support this in core, // the extension must be present. // @@ -421,7 +421,7 @@ void TParseVersions::profileRequires(const TSourceLoc& loc, int profileMask, int // // When to use requireStage() // -// If only some stages support a feature. +// If only some stages support a feature. // // Operation: If the current stage is not present, give an error message. // @@ -663,7 +663,7 @@ void TParseVersions::updateExtensionBehavior(const char* extension, TExtensionBe // Call for any operation needing full GLSL integer data-type support. void TParseVersions::fullIntegerCheck(const TSourceLoc& loc, const char* op) { - profileRequires(loc, ENoProfile, 130, nullptr, op); + profileRequires(loc, ENoProfile, 130, nullptr, op); profileRequires(loc, EEsProfile, 300, nullptr, op); } diff --git a/3rdparty/glslang/glslang/MachineIndependent/Versions.h b/3rdparty/glslang/glslang/MachineIndependent/Versions.h index fe9764ffe..2db06018d 100644 --- a/3rdparty/glslang/glslang/MachineIndependent/Versions.h +++ b/3rdparty/glslang/glslang/MachineIndependent/Versions.h @@ -1,12 +1,12 @@ // -//Copyright (C) 2002-2005 3Dlabs Inc. Ltd. -//Copyright (C) 2012-2013 LunarG, Inc. +// Copyright (C) 2002-2005 3Dlabs Inc. Ltd. +// Copyright (C) 2012-2013 LunarG, Inc. // -//All rights reserved. +// All rights reserved. // -//Redistribution and use in source and binary forms, with or without -//modification, are permitted provided that the following conditions -//are met: +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: // // Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. @@ -20,18 +20,18 @@ // contributors may be used to endorse or promote products derived // from this software without specific prior written permission. // -//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -//"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS -//FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE -//COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, -//INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -//BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -//LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -//CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -//LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN -//ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -//POSSIBILITY OF SUCH DAMAGE. +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +// COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. // #ifndef _VERSIONS_INCLUDED_ #define _VERSIONS_INCLUDED_ @@ -127,7 +127,7 @@ const char* const E_GL_ARB_gpu_shader_int64 = "GL_ARB_gpu_shader_int const char* const E_GL_ARB_shader_ballot = "GL_ARB_shader_ballot"; const char* const E_GL_ARB_sparse_texture2 = "GL_ARB_sparse_texture2"; const char* const E_GL_ARB_sparse_texture_clamp = "GL_ARB_sparse_texture_clamp"; -//const char* const E_GL_ARB_cull_distance = "GL_ARB_cull_distance"; // present for 4.5, but need extension control over block members +// const char* const E_GL_ARB_cull_distance = "GL_ARB_cull_distance"; // present for 4.5, but need extension control over block members const char* const E_GL_EXT_shader_non_constant_global_initializers = "GL_EXT_shader_non_constant_global_initializers"; diff --git a/3rdparty/glslang/glslang/MachineIndependent/glslang.y b/3rdparty/glslang/glslang/MachineIndependent/glslang.y index 060ffdd6f..f2512b828 100644 --- a/3rdparty/glslang/glslang/MachineIndependent/glslang.y +++ b/3rdparty/glslang/glslang/MachineIndependent/glslang.y @@ -1,12 +1,12 @@ // -//Copyright (C) 2002-2005 3Dlabs Inc. Ltd. -//Copyright (C) 2012-2013 LunarG, Inc. +// Copyright (C) 2002-2005 3Dlabs Inc. Ltd. +// Copyright (C) 2012-2013 LunarG, Inc. // -//All rights reserved. +// All rights reserved. // -//Redistribution and use in source and binary forms, with or without -//modification, are permitted provided that the following conditions -//are met: +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: // // Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. @@ -20,18 +20,18 @@ // contributors may be used to endorse or promote products derived // from this software without specific prior written permission. // -//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -//"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS -//FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE -//COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, -//INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -//BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -//LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -//CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -//LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN -//ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -//POSSIBILITY OF SUCH DAMAGE. +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +// COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. // /** diff --git a/3rdparty/glslang/glslang/MachineIndependent/intermOut.cpp b/3rdparty/glslang/glslang/MachineIndependent/intermOut.cpp index f8c963b72..12f967d47 100644 --- a/3rdparty/glslang/glslang/MachineIndependent/intermOut.cpp +++ b/3rdparty/glslang/glslang/MachineIndependent/intermOut.cpp @@ -1,12 +1,12 @@ // -//Copyright (C) 2002-2005 3Dlabs Inc. Ltd. -//Copyright (C) 2012-2016 LunarG, Inc. +// Copyright (C) 2002-2005 3Dlabs Inc. Ltd. +// Copyright (C) 2012-2016 LunarG, Inc. // -//All rights reserved. +// All rights reserved. // -//Redistribution and use in source and binary forms, with or without -//modification, are permitted provided that the following conditions -//are met: +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: // // Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. @@ -20,18 +20,18 @@ // contributors may be used to endorse or promote products derived // from this software without specific prior written permission. // -//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -//"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS -//FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE -//COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, -//INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -//BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -//LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -//CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -//LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN -//ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -//POSSIBILITY OF SUCH DAMAGE. +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +// COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. // #include "localintermediate.h" diff --git a/3rdparty/glslang/glslang/MachineIndependent/iomapper.cpp b/3rdparty/glslang/glslang/MachineIndependent/iomapper.cpp index 269d65495..a2b353183 100644 --- a/3rdparty/glslang/glslang/MachineIndependent/iomapper.cpp +++ b/3rdparty/glslang/glslang/MachineIndependent/iomapper.cpp @@ -1,11 +1,11 @@ // -//Copyright (C) 2016 LunarG, Inc. +// Copyright (C) 2016 LunarG, Inc. // -//All rights reserved. +// All rights reserved. // -//Redistribution and use in source and binary forms, with or without -//modification, are permitted provided that the following conditions -//are met: +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: // // Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. @@ -19,18 +19,18 @@ // contributors may be used to endorse or promote products derived // from this software without specific prior written permission. // -//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -//"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS -//FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE -//COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, -//INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -//BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -//LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -//CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -//LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN -//ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -//POSSIBILITY OF SUCH DAMAGE. +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +// COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. // #include "../Include/Common.h" @@ -168,8 +168,8 @@ public: struct TResolverAdaptor { TResolverAdaptor(EShLanguage s, TIoMapResolver& r, TInfoSink& i, bool& e) - : resolver(r) - , stage(s) + : stage(s) + , resolver(r) , infoSink(i) , error(e) { diff --git a/3rdparty/glslang/glslang/MachineIndependent/iomapper.h b/3rdparty/glslang/glslang/MachineIndependent/iomapper.h index ff47543d2..5e0d4391c 100644 --- a/3rdparty/glslang/glslang/MachineIndependent/iomapper.h +++ b/3rdparty/glslang/glslang/MachineIndependent/iomapper.h @@ -1,11 +1,11 @@ // -//Copyright (C) 2016 LunarG, Inc. +// Copyright (C) 2016 LunarG, Inc. // -//All rights reserved. +// All rights reserved. // -//Redistribution and use in source and binary forms, with or without -//modification, are permitted provided that the following conditions -//are met: +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: // // Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. @@ -19,18 +19,18 @@ // contributors may be used to endorse or promote products derived // from this software without specific prior written permission. // -//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -//"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS -//FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE -//COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, -//INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -//BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -//LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -//CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -//LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN -//ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -//POSSIBILITY OF SUCH DAMAGE. +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +// COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. // #ifndef _IOMAPPER_INCLUDED diff --git a/3rdparty/glslang/glslang/MachineIndependent/limits.cpp b/3rdparty/glslang/glslang/MachineIndependent/limits.cpp index 49da93011..64d191b47 100644 --- a/3rdparty/glslang/glslang/MachineIndependent/limits.cpp +++ b/3rdparty/glslang/glslang/MachineIndependent/limits.cpp @@ -1,11 +1,11 @@ // -//Copyright (C) 2013 LunarG, Inc. +// Copyright (C) 2013 LunarG, Inc. // -//All rights reserved. +// All rights reserved. // -//Redistribution and use in source and binary forms, with or without -//modification, are permitted provided that the following conditions -//are met: +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: // // Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. @@ -19,18 +19,18 @@ // contributors may be used to endorse or promote products derived // from this software without specific prior written permission. // -//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -//"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS -//FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE -//COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, -//INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -//BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -//LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -//CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -//LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN -//ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -//POSSIBILITY OF SUCH DAMAGE. +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +// COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. // // @@ -83,7 +83,7 @@ protected: // check binary operations for those modifying the loop index bool TInductiveTraverser::visitBinary(TVisit /* visit */, TIntermBinary* node) { - if (node->modifiesState() && node->getLeft()->getAsSymbolNode() && + if (node->modifiesState() && node->getLeft()->getAsSymbolNode() && node->getLeft()->getAsSymbolNode()->getId() == loopId) { bad = true; badLoc = node->getLoc(); @@ -95,7 +95,7 @@ bool TInductiveTraverser::visitBinary(TVisit /* visit */, TIntermBinary* node) // check unary operations for those modifying the loop index bool TInductiveTraverser::visitUnary(TVisit /* visit */, TIntermUnary* node) { - if (node->modifiesState() && node->getOperand()->getAsSymbolNode() && + if (node->modifiesState() && node->getOperand()->getAsSymbolNode() && node->getOperand()->getAsSymbolNode()->getId() == loopId) { bad = true; badLoc = node->getLoc(); @@ -145,7 +145,7 @@ void TParseContext::inductiveLoopBodyCheck(TIntermNode* body, int loopId, TSymbo // // The "constant-index-expression" tranverser. // -// Just look at things that can form an index. +// Just look at things that can form an index. // class TIndexTraverser : public TIntermTraverser { diff --git a/3rdparty/glslang/glslang/MachineIndependent/linkValidate.cpp b/3rdparty/glslang/glslang/MachineIndependent/linkValidate.cpp index b8ce6d7e8..761cb4164 100644 --- a/3rdparty/glslang/glslang/MachineIndependent/linkValidate.cpp +++ b/3rdparty/glslang/glslang/MachineIndependent/linkValidate.cpp @@ -1,11 +1,11 @@ // -//Copyright (C) 2013 LunarG, Inc. +// Copyright (C) 2013 LunarG, Inc. // -//All rights reserved. +// All rights reserved. // -//Redistribution and use in source and binary forms, with or without -//modification, are permitted provided that the following conditions -//are met: +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: // // Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. @@ -19,18 +19,18 @@ // contributors may be used to endorse or promote products derived // from this software without specific prior written permission. // -//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -//"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS -//FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE -//COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, -//INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -//BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -//LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -//CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -//LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN -//ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -//POSSIBILITY OF SUCH DAMAGE. +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +// COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. // // @@ -48,7 +48,7 @@ #include "../Include/InfoSink.h" namespace glslang { - + // // Link-time error emitter. // @@ -67,8 +67,8 @@ void TIntermediate::warn(TInfoSink& infoSink, const char* message) 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 +// 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." // @@ -112,12 +112,12 @@ void TIntermediate::merge(TInfoSink& infoSink, TIntermediate& unit) inputPrimitive = unit.inputPrimitive; else if (inputPrimitive != unit.inputPrimitive) error(infoSink, "Contradictory input layout primitives"); - + if (outputPrimitive == ElgNone) outputPrimitive = unit.outputPrimitive; else if (outputPrimitive != unit.outputPrimitive) error(infoSink, "Contradictory output layout primitives"); - + if (vertices == TQualifier::layoutNotSet) vertices = unit.vertices; else if (vertices != unit.vertices) { @@ -178,7 +178,7 @@ void TIntermediate::merge(TInfoSink& infoSink, TIntermediate& unit) } // Getting this far means we have two existing trees to merge... - + version = std::max(version, unit.version); requestedExtensions.insert(unit.requestedExtensions.begin(), unit.requestedExtensions.end()); @@ -341,9 +341,9 @@ void TIntermediate::mergeErrorCheck(TInfoSink& infoSink, const TIntermSymbol& sy writeTypeComparison = true; } - // Layouts... - // TODO: 4.4 enhanced layouts: Generalize to include offset/align: current spec - // requires separate user-supplied offset from actual computed offset, but + // Layouts... + // TODO: 4.4 enhanced layouts: Generalize to include offset/align: current spec + // requires separate user-supplied offset from actual computed offset, but // current implementation only has one offset. if (symbol.getQualifier().layoutMatrix != unitSymbol.getQualifier().layoutMatrix || symbol.getQualifier().layoutPacking != unitSymbol.getQualifier().layoutPacking || @@ -417,7 +417,7 @@ void TIntermediate::finalCheck(TInfoSink& infoSink, bool keepUncalled) if (xfbBuffers[b].containsDouble) RoundToPow2(xfbBuffers[b].implicitStride, 8); - // "It is a compile-time or link-time error to have + // "It is a compile-time or link-time error to have // any xfb_offset that overflows xfb_stride, whether stated on declarations before or after the xfb_stride, or // in different compilation units. While xfb_stride can be declared multiple times for the same buffer, it is a // compile-time or link-time error to have different values specified for the stride for the same buffer." @@ -429,8 +429,8 @@ void TIntermediate::finalCheck(TInfoSink& infoSink, bool keepUncalled) if (xfbBuffers[b].stride == TQualifier::layoutXfbStrideEnd) xfbBuffers[b].stride = xfbBuffers[b].implicitStride; - // "If the buffer is capturing any - // outputs with double-precision components, the stride must be a multiple of 8, otherwise it must be a + // "If the buffer is capturing any + // outputs with double-precision components, the stride must be a multiple of 8, otherwise it must be a // multiple of 4, or a compile-time or link-time error results." if (xfbBuffers[b].containsDouble && ! IsMultipleOfPow2(xfbBuffers[b].stride, 8)) { error(infoSink, "xfb_stride must be multiple of 8 for buffer holding a double:"); @@ -442,7 +442,7 @@ void TIntermediate::finalCheck(TInfoSink& infoSink, bool keepUncalled) infoSink.info << " xfb_buffer " << (unsigned int)b << ", xfb_stride " << xfbBuffers[b].stride << "\n"; } - // "The resulting stride (implicit or explicit), when divided by 4, must be less than or equal to the + // "The resulting stride (implicit or explicit), when divided by 4, must be less than or equal to the // implementation-dependent constant gl_MaxTransformFeedbackInterleavedComponents." if (xfbBuffers[b].stride > (unsigned int)(4 * resources.maxTransformFeedbackInterleavedComponents)) { error(infoSink, "xfb_stride is too large:"); @@ -540,7 +540,7 @@ void TIntermediate::checkCallGraphCycles(TInfoSink& infoSink) break; // Otherwise, we found a new subgraph, process it: - // See what all can be reached by this new root, and if any of + // See what all can be reached by this new root, and if any of // that is recursive. This is done by depth-first traversals, seeing // if a new call is found that was already in the currentPath (a back edge), // thereby detecting recursion. @@ -709,7 +709,7 @@ TIntermSequence& TIntermediate::findLinkerObjects() const } // See if a variable was both a user-declared output and used. -// Note: the spec discusses writing to one, but this looks at read or write, which +// Note: the spec discusses writing to one, but this looks at read or write, which // is more useful, and perhaps the spec should be changed to reflect that. bool TIntermediate::userOutputUsed() const { @@ -720,7 +720,7 @@ bool TIntermediate::userOutputUsed() const const TIntermSymbol& symbolNode = *linkerObjects[i]->getAsSymbolNode(); if (symbolNode.getQualifier().storage == EvqVaryingOut && symbolNode.getName().compare(0, 3, "gl_") != 0 && - inIoAccessed(symbolNode.getName())) { + inIoAccessed(symbolNode.getName())) { found = true; break; } @@ -899,7 +899,7 @@ bool TIntermediate::addUsedConstantId(int id) // Return the size of type, as measured by "locations". int TIntermediate::computeTypeLocationSize(const TType& type) const { - // "If the declared input is an array of size n and each element takes m locations, it will be assigned m * n + // "If the declared input is an array of size n and each element takes m locations, it will be assigned m * n // consecutive locations..." if (type.isArray()) { // TODO: perf: this can be flattened by using getCumulativeArraySize(), and a deref that discards all arrayness @@ -911,8 +911,8 @@ int TIntermediate::computeTypeLocationSize(const TType& type) const return type.getOuterArraySize() * computeTypeLocationSize(elementType); } - // "The locations consumed by block and structure members are determined by applying the rules above - // recursively..." + // "The locations consumed by block and structure members are determined by applying the rules above + // recursively..." if (type.isStruct()) { int size = 0; for (int member = 0; member < (int)type.getStruct()->size(); ++member) { @@ -924,9 +924,9 @@ int TIntermediate::computeTypeLocationSize(const TType& type) const // ES: "If a shader input is any scalar or vector type, it will consume a single location." - // Desktop: "If a vertex shader input is any scalar or vector type, it will consume a single location. If a non-vertex - // shader input is a scalar or vector type other than dvec3 or dvec4, it will consume a single location, while - // types dvec3 or dvec4 will consume two consecutive locations. Inputs of type double and dvec2 will + // Desktop: "If a vertex shader input is any scalar or vector type, it will consume a single location. If a non-vertex + // shader input is a scalar or vector type other than dvec3 or dvec4, it will consume a single location, while + // types dvec3 or dvec4 will consume two consecutive locations. Inputs of type double and dvec2 will // consume only a single location, in all stages." if (type.isScalar()) return 1; @@ -940,7 +940,7 @@ int TIntermediate::computeTypeLocationSize(const TType& type) const } // "If the declared input is an n x m single- or double-precision matrix, ... - // The number of locations assigned for each matrix will be the same as + // The number of locations assigned for each matrix will be the same as // for an n-element array of m-component vectors..." if (type.isMatrix()) { TType columnType(type, 0); @@ -986,14 +986,14 @@ int TIntermediate::addXfbBufferOffset(const TType& type) // N.B. Caller must set containsDouble to false before calling. unsigned int TIntermediate::computeTypeXfbSize(const TType& type, bool& containsDouble) const { - // "...if applied to an aggregate containing a double, the offset must also be a multiple of 8, + // "...if applied to an aggregate containing a double, the offset must also be a multiple of 8, // and the space taken in the buffer will be a multiple of 8. - // ...within the qualified entity, subsequent components are each + // ...within the qualified entity, subsequent components are each // assigned, in order, to the next available offset aligned to a multiple of // that component's size. Aggregate types are flattened down to the component // level to get this sequence of components." - if (type.isArray()) { + if (type.isArray()) { // TODO: perf: this can be flattened by using getCumulativeArraySize(), and a deref that discards all arrayness assert(type.isExplicitlySizedArray()); TType elementType(type, 0); @@ -1005,8 +1005,8 @@ unsigned int TIntermediate::computeTypeXfbSize(const TType& type, bool& contains bool structContainsDouble = false; for (int member = 0; member < (int)type.getStruct()->size(); ++member) { TType memberType(type, member); - // "... if applied to - // an aggregate containing a double, the offset must also be a multiple of 8, + // "... if applied to + // an aggregate containing a double, the offset must also be a multiple of 8, // and the space taken in the buffer will be a multiple of 8." bool memberContainsDouble = false; int memberSize = computeTypeXfbSize(memberType, memberContainsDouble); @@ -1064,7 +1064,7 @@ int TIntermediate::getBaseAlignmentScalar(const TType& type, int& size) // Implement base-alignment and size rules from section 7.6.2.2 Standard Uniform Block Layout // Operates recursively. // -// If std140 is true, it does the rounding up to vec4 size required by std140, +// If std140 is true, it does the rounding up to vec4 size required by std140, // otherwise it does not, yielding std430 rules. // // The size is returned in the 'size' parameter @@ -1093,7 +1093,7 @@ int TIntermediate::getBaseAlignment(const TType& type, int& size, int& stride, b // // 1. If the member is a scalar consuming N basic machine units, the base alignment is N. // - // 2. If the member is a two- or four-component vector with components consuming N basic + // 2. If the member is a two- or four-component vector with components consuming N basic // machine units, the base alignment is 2N or 4N, respectively. // // 3. If the member is a three-component vector with components consuming N @@ -1106,7 +1106,7 @@ int TIntermediate::getBaseAlignment(const TType& type, int& size, int& stride, b // the array is rounded up to the next multiple of the base alignment. // // 5. If the member is a column-major matrix with C columns and R rows, the - // matrix is stored identically to an array of C column vectors with R + // matrix is stored identically to an array of C column vectors with R // components each, according to rule (4). // // 6. If the member is an array of S column-major matrices with C columns and @@ -1123,7 +1123,7 @@ int TIntermediate::getBaseAlignment(const TType& type, int& size, int& stride, b // // 9. If the member is a structure, the base alignment of the structure is N , where // N is the largest base alignment value of any of its members, and rounded - // up to the base alignment of a vec4. The individual members of this substructure + // up to the base alignment of a vec4. The individual members of this substructure // are then assigned offsets by applying this set of rules recursively, // where the base offset of the first member of the sub-structure is equal to the // aligned offset of the structure. The structure may have padding at the end; @@ -1165,7 +1165,7 @@ int TIntermediate::getBaseAlignment(const TType& type, int& size, int& stride, b int memberAlignment = getBaseAlignment(*memberList[m].type, memberSize, dummyStride, std140, (subMatrixLayout != ElmNone) ? (subMatrixLayout == ElmRowMajor) : rowMajor); maxAlignment = std::max(maxAlignment, memberAlignment); - RoundToPow2(size, memberAlignment); + RoundToPow2(size, memberAlignment); size += memberSize; } @@ -1188,7 +1188,7 @@ int TIntermediate::getBaseAlignment(const TType& type, int& size, int& stride, b case 2: size *= 2; return 2 * scalarAlign; - default: + default: size *= type.getVectorSize(); return 4 * scalarAlign; } @@ -1198,7 +1198,7 @@ int TIntermediate::getBaseAlignment(const TType& type, int& size, int& stride, b if (type.isMatrix()) { // rule 5: deref to row, not to column, meaning the size of vector is num columns instead of num rows TType derefType(type, 0, rowMajor); - + alignment = getBaseAlignment(derefType, size, dummyStride, std140, rowMajor); if (std140) alignment = std::max(baseAlignmentVec4Std140, alignment); diff --git a/3rdparty/glslang/glslang/MachineIndependent/localintermediate.h b/3rdparty/glslang/glslang/MachineIndependent/localintermediate.h index 34875c2be..24370029f 100644 --- a/3rdparty/glslang/glslang/MachineIndependent/localintermediate.h +++ b/3rdparty/glslang/glslang/MachineIndependent/localintermediate.h @@ -1,11 +1,11 @@ // -//Copyright (C) 2002-2005 3Dlabs Inc. Ltd. -//Copyright (C) 2016 LunarG, Inc. -//All rights reserved. +// Copyright (C) 2002-2005 3Dlabs Inc. Ltd. +// Copyright (C) 2016 LunarG, Inc. +// All rights reserved. // -//Redistribution and use in source and binary forms, with or without -//modification, are permitted provided that the following conditions -//are met: +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: // // Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. @@ -19,18 +19,18 @@ // contributors may be used to endorse or promote products derived // from this software without specific prior written permission. // -//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -//"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS -//FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE -//COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, -//INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -//BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -//LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -//CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -//LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN -//ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -//POSSIBILITY OF SUCH DAMAGE. +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +// COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. // #ifndef _LOCAL_INTERMEDIATE_INCLUDED_ @@ -83,7 +83,7 @@ struct TCall { // A generic 1-D range. struct TRange { TRange(int start, int last) : start(start), last(last) { } - bool overlap(const TRange& rhs) const + bool overlap(const TRange& rhs) const { return last >= rhs.start && start <= rhs.last; } @@ -139,22 +139,22 @@ class TVariable; class TIntermediate { public: explicit TIntermediate(EShLanguage l, int v = 0, EProfile p = ENoProfile) : - source(EShSourceNone), language(l), profile(p), version(v), treeRoot(0), + language(l), source(EShSourceNone), profile(p), version(v), treeRoot(0), numEntryPoints(0), numErrors(0), numPushConstants(0), recursive(false), invocations(TQualifier::layoutNotSet), vertices(TQualifier::layoutNotSet), inputPrimitive(ElgNone), outputPrimitive(ElgNone), pixelCenterInteger(false), originUpperLeft(false), vertexSpacing(EvsNone), vertexOrder(EvoNone), pointMode(false), earlyFragmentTests(false), depthLayout(EldNone), depthReplacing(false), blendEquations(0), - multiStream(false), xfbMode(false), + xfbMode(false), multiStream(false), +#ifdef NV_EXTENSIONS + layoutOverrideCoverage(false), + geoPassthroughEXT(false), +#endif shiftSamplerBinding(0), shiftTextureBinding(0), shiftImageBinding(0), shiftUboBinding(0), autoMapBindings(false), flattenUniformArrays(false), -#ifdef NV_EXTENSIONS - layoutOverrideCoverage(false), - geoPassthroughEXT(false), -#endif useUnknownFormat(false) { localSize[0] = 1; @@ -192,7 +192,7 @@ public: bool getFlattenUniformArrays() const { return flattenUniformArrays; } void setNoStorageFormat(bool b) { useUnknownFormat = b; } bool getNoStorageFormat() const { return useUnknownFormat; } - + void setVersion(int v) { version = v; } int getVersion() const { return version; } void setProfile(EProfile p) { profile = p; } @@ -273,7 +273,7 @@ public: void addSymbolLinkageNodes(TIntermAggregate*& linkage, EShLanguage, TSymbolTable&); void addSymbolLinkageNode(TIntermAggregate*& linkage, const TSymbol&); - bool setInvocations(int i) + bool setInvocations(int i) { if (invocations != TQualifier::layoutNotSet) return invocations == i; @@ -315,7 +315,7 @@ public: TVertexOrder getVertexOrder() const { return vertexOrder; } void setPointMode() { pointMode = true; } bool getPointMode() const { return pointMode; } - + bool setLocalSize(int dim, int size) { if (localSize[dim] > 1) @@ -391,7 +391,7 @@ public: static int getBaseAlignment(const TType&, int& size, int& stride, bool std140, bool rowMajor); bool promote(TIntermOperator*); -#ifdef NV_EXTENSIONS +#ifdef NV_EXTENSIONS void setLayoutOverrideCoverage() { layoutOverrideCoverage = true; } bool getLayoutOverrideCoverage() const { return layoutOverrideCoverage; } void setGeoPassthroughEXT() { geoPassthroughEXT = true; } @@ -417,18 +417,11 @@ protected: bool promoteBinary(TIntermBinary&); void addSymbolLinkageNode(TIntermAggregate*& linkage, TSymbolTable&, const TString&); bool promoteAggregate(TIntermAggregate&); - + const EShLanguage language; // stage, known at construction time EShSource source; // source language, known a bit later std::string entryPointName; std::string entryPointMangledName; - unsigned int shiftSamplerBinding; - unsigned int shiftTextureBinding; - unsigned int shiftImageBinding; - unsigned int shiftUboBinding; - bool autoMapBindings; - bool flattenUniformArrays; - bool useUnknownFormat; EProfile profile; int version; @@ -458,11 +451,19 @@ protected: bool xfbMode; bool multiStream; -#ifdef NV_EXTENSIONS +#ifdef NV_EXTENSIONS bool layoutOverrideCoverage; bool geoPassthroughEXT; #endif + unsigned int shiftSamplerBinding; + unsigned int shiftTextureBinding; + unsigned int shiftImageBinding; + unsigned int shiftUboBinding; + bool autoMapBindings; + bool flattenUniformArrays; + bool useUnknownFormat; + typedef std::list TGraph; TGraph callGraph; diff --git a/3rdparty/glslang/glslang/MachineIndependent/parseConst.cpp b/3rdparty/glslang/glslang/MachineIndependent/parseConst.cpp index 90621d39f..22b55516a 100644 --- a/3rdparty/glslang/glslang/MachineIndependent/parseConst.cpp +++ b/3rdparty/glslang/glslang/MachineIndependent/parseConst.cpp @@ -1,10 +1,10 @@ // -//Copyright (C) 2002-2005 3Dlabs Inc. Ltd. -//All rights reserved. +// Copyright (C) 2002-2005 3Dlabs Inc. Ltd. +// All rights reserved. // -//Redistribution and use in source and binary forms, with or without -//modification, are permitted provided that the following conditions -//are met: +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: // // Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. @@ -18,22 +18,22 @@ // contributors may be used to endorse or promote products derived // from this software without specific prior written permission. // -//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -//"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS -//FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE -//COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, -//INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -//BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -//LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -//CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -//LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN -//ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -//POSSIBILITY OF SUCH DAMAGE. +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +// COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. // // -// Travarse a tree of constants to create a single folded constant. +// Traverse a tree of constants to create a single folded constant. // It should only be used when the whole tree is known to be constant. // @@ -45,7 +45,7 @@ class TConstTraverser : public TIntermTraverser { public: TConstTraverser(const TConstUnionArray& cUnion, bool singleConstParam, TOperator constructType, const TType& t) : unionArray(cUnion), type(t), - constructorType(constructType), singleConstantParam(singleConstParam), error(false), isMatrix(false), + constructorType(constructType), singleConstantParam(singleConstParam), error(false), isMatrix(false), matrixCols(0), matrixRows(0) { index = 0; tOp = EOpNull; } virtual void visitConstantUnion(TIntermConstantUnion* node); @@ -73,7 +73,7 @@ bool TConstTraverser::visitAggregate(TVisit /* visit */, TIntermAggregate* node) if (! node->isConstructor() && node->getOp() != EOpComma) { error = true; - return false; + return false; } if (node->getSequence().size() == 0) { @@ -84,7 +84,7 @@ bool TConstTraverser::visitAggregate(TVisit /* visit */, TIntermAggregate* node) bool flag = node->getSequence().size() == 1 && node->getSequence()[0]->getAsTyped()->getAsConstantUnion(); if (flag) { - singleConstantParam = true; + singleConstantParam = true; constructorType = node->getOp(); size = node->getType().computeNumComponents(); @@ -93,19 +93,19 @@ bool TConstTraverser::visitAggregate(TVisit /* visit */, TIntermAggregate* node) matrixCols = node->getType().getMatrixCols(); matrixRows = node->getType().getMatrixRows(); } - } + } - for (TIntermSequence::iterator p = node->getSequence().begin(); + for (TIntermSequence::iterator p = node->getSequence().begin(); p != node->getSequence().end(); p++) { if (node->getOp() == EOpComma) - index = 0; + index = 0; (*p)->traverse(this); - } - if (flag) + } + if (flag) { - singleConstantParam = false; + singleConstantParam = false; constructorType = EOpNull; size = 0; isMatrix = false; @@ -126,7 +126,7 @@ void TConstTraverser::visitConstantUnion(TIntermConstantUnion* node) if (! singleConstantParam) { int rightUnionSize = node->getType().computeNumComponents(); - + const TConstUnionArray& rightUnionArray = node->getConstArray(); for (int i = 0; i < rightUnionSize; i++) { if (index >= instanceSize) @@ -148,7 +148,7 @@ void TConstTraverser::visitConstantUnion(TIntermConstantUnion* node) leftUnionArray[i] = rightUnionArray[count]; (index)++; - + if (nodeComps > 1) count++; } @@ -180,13 +180,13 @@ void TConstTraverser::visitConstantUnion(TIntermConstantUnion* node) return; if (i == startIndex || (i - startIndex) % (matrixRows + 1) == 0 ) leftUnionArray[i] = rightUnionArray[count]; - else + else leftUnionArray[i].setDConst(0.0); index++; if (nodeComps > 1) - count++; + count++; } } } @@ -199,7 +199,7 @@ bool TIntermediate::parseConstTree(TIntermNode* root, TConstUnionArray unionArra return false; TConstTraverser it(unionArray, singleConstantParam, constructorType, t); - + root->traverse(&it); if (it.error) return true; diff --git a/3rdparty/glslang/glslang/MachineIndependent/parseVersions.h b/3rdparty/glslang/glslang/MachineIndependent/parseVersions.h index acb57507a..0c85f8a19 100755 --- a/3rdparty/glslang/glslang/MachineIndependent/parseVersions.h +++ b/3rdparty/glslang/glslang/MachineIndependent/parseVersions.h @@ -1,11 +1,11 @@ // -//Copyright (C) 2016 Google, Inc. +// Copyright (C) 2016 Google, Inc. // -//All rights reserved. +// All rights reserved. // -//Redistribution and use in source and binary forms, with or without -//modification, are permitted provided that the following conditions -//are met: +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: // // Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. @@ -19,18 +19,18 @@ // contributors may be used to endorse or promote products derived // from this software without specific prior written permission. // -//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -//"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS -//FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE -//COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, -//INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -//BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -//LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -//CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -//LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN -//ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -//POSSIBILITY OF SUCH DAMAGE. +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +// COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. // // This is implemented in Versions.cpp diff --git a/3rdparty/glslang/glslang/MachineIndependent/preprocessor/Pp.cpp b/3rdparty/glslang/glslang/MachineIndependent/preprocessor/Pp.cpp index 02e452112..49c78ef88 100644 --- a/3rdparty/glslang/glslang/MachineIndependent/preprocessor/Pp.cpp +++ b/3rdparty/glslang/glslang/MachineIndependent/preprocessor/Pp.cpp @@ -1,11 +1,11 @@ // -//Copyright (C) 2002-2005 3Dlabs Inc. Ltd. -//Copyright (C) 2013 LunarG, Inc. -//All rights reserved. +// Copyright (C) 2002-2005 3Dlabs Inc. Ltd. +// Copyright (C) 2013 LunarG, Inc. +// All rights reserved. // -//Redistribution and use in source and binary forms, with or without -//modification, are permitted provided that the following conditions -//are met: +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: // // Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. @@ -19,18 +19,18 @@ // contributors may be used to endorse or promote products derived // from this software without specific prior written permission. // -//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -//"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS -//FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE -//COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, -//INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -//BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -//LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -//CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -//LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN -//ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -//POSSIBILITY OF SUCH DAMAGE. +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +// COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. // /****************************************************************************\ Copyright (c) 2002, NVIDIA Corporation. @@ -57,7 +57,7 @@ Except as expressly stated in this notice, no other rights or licenses express or implied, are granted by NVIDIA herein, including but not limited to any patent rights that may be infringed by your derivative works or by other works in which the NVIDIA Software may be -incorporated. No hardware is licensed hereunder. +incorporated. No hardware is licensed hereunder. THE NVIDIA SOFTWARE IS BEING PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED, @@ -113,7 +113,7 @@ int TPpContext::CPPdefine(TPpToken* ppToken) mac.emptyArgs = 1; do { token = scanToken(ppToken); - if (mac.args.size() == 0 && token == ')') + if (mac.args.size() == 0 && token == ')') break; if (token != PpAtomIdentifier) { parseContext.ppError(ppToken->loc, "bad argument", "#define", ""); @@ -177,7 +177,7 @@ int TPpContext::CPPdefine(TPpToken* ppToken) newToken = ReadToken(mac.body, &newPpToken); if (oldToken != newToken || oldPpToken != newPpToken) { parseContext.ppError(defineLoc, "Macro redefined; different substitutions:", "#define", atomStrings.getString(defAtom)); - break; + break; } } while (newToken > 0); } @@ -238,8 +238,8 @@ int TPpContext::CPPelse(int matchelse, TPpToken* ppToken) int nextAtom = atomStrings.getAtom(ppToken->name); if (nextAtom == PpAtomIf || nextAtom == PpAtomIfdef || nextAtom == PpAtomIfndef) { - depth++; - ifdepth++; + depth++; + ifdepth++; elsetracker++; } else if (nextAtom == PpAtomEndif) { token = extraTokenCheck(nextAtom, ppToken, scanToken(ppToken)); @@ -247,7 +247,7 @@ int TPpContext::CPPelse(int matchelse, TPpToken* ppToken) --elsetracker; if (depth == 0) { // found the #endif we are looking for - if (ifdepth) + if (ifdepth) --ifdepth; break; } @@ -461,7 +461,7 @@ int TPpContext::eval(int token, int precedence, bool shortCircuit, int& res, boo // Perform evaluation of binary operation, if there is one, otherwise we are done. while (! err) { - if (token == ')' || token == '\n') + if (token == ')' || token == '\n') break; int op; for (op = NUM_ELEMENTS(binop) - 1; op >= 0; op--) { @@ -523,7 +523,7 @@ int TPpContext::evalToToken(int token, bool shortCircuit, int& res, bool& err, T } // Handle #if -int TPpContext::CPPif(TPpToken* ppToken) +int TPpContext::CPPif(TPpToken* ppToken) { int token = scanToken(ppToken); elsetracker++; @@ -554,7 +554,7 @@ int TPpContext::CPPifdef(int defined, TPpToken* ppToken) if (token != PpAtomIdentifier) { if (defined) parseContext.ppError(ppToken->loc, "must be followed by macro name", "#ifdef", ""); - else + else parseContext.ppError(ppToken->loc, "must be followed by macro name", "#ifndef", ""); } else { MacroSymbol* macro = lookupMacroDef(atomStrings.getAtom(ppToken->name)); @@ -576,12 +576,12 @@ int TPpContext::CPPifdef(int defined, TPpToken* ppToken) int TPpContext::CPPinclude(TPpToken* ppToken) { const TSourceLoc directiveLoc = ppToken->loc; - TShader::Includer::IncludeType includeType = TShader::Includer::EIncludeRelative; + bool startWithLocalSearch = true; // to additionally include the extra "" paths int token = scanToken(ppToken); // handle -style #include if (token == '<') { - includeType = TShader::Includer::EIncludeStandard; + startWithLocalSearch = false; token = scanHeaderName(ppToken, '>'); } // otherwise ppToken already has the header name and it was "header-name" style @@ -593,44 +593,60 @@ int TPpContext::CPPinclude(TPpToken* ppToken) // Make a copy of the name because it will be overwritten by the next token scan. const std::string filename = ppToken->name; + + // See if the directive was well formed token = scanToken(ppToken); if (token != '\n') { if (token == EndOfInput) - parseContext.ppError(ppToken->loc, "expected newline", "#include", ""); + parseContext.ppError(ppToken->loc, "expected newline after header name:", "#include", "%s", filename.c_str()); else - parseContext.ppError(ppToken->loc, "extra content after header name", "#include", ""); - } else { - TShader::Includer::IncludeResult* res = includer.include(filename.c_str(), includeType, currentSourceFile.c_str(), includeStack.size() + 1); - if (res && !res->file_name.empty()) { - if (res->file_data && res->file_length) { - const bool forNextLine = parseContext.lineDirectiveShouldSetNextLine(); - std::ostringstream prologue; - std::ostringstream epilogue; - prologue << "#line " << forNextLine << " " << "\"" << res->file_name << "\"\n"; - epilogue << (res->file_data[res->file_length - 1] == '\n'? "" : "\n") << "#line " << directiveLoc.line + forNextLine << " " << directiveLoc.getStringNameOrNum() << "\n"; - pushInput(new TokenizableIncludeFile(directiveLoc, prologue.str(), res, epilogue.str(), this)); - } - // At EOF, there's no "current" location anymore. - if (token != EndOfInput) - parseContext.setCurrentColumn(0); - // Don't accidentally return EndOfInput, which will end all preprocessing. - return '\n'; + parseContext.ppError(ppToken->loc, "extra content after header name:", "#include", "%s", filename.c_str()); + return token; + } + + // Process well-formed directive + + // Find the inclusion, first look in "Local" ("") paths, if requested, + // otherwise, only search the "System" (<>) paths. + TShader::Includer::IncludeResult* res = nullptr; + if (startWithLocalSearch) + res = includer.includeLocal(filename.c_str(), currentSourceFile.c_str(), includeStack.size() + 1); + if (! res || res->headerName.empty()) { + includer.releaseInclude(res); + res = includer.includeSystem(filename.c_str(), currentSourceFile.c_str(), includeStack.size() + 1); + } + + // Process the results + if (res && !res->headerName.empty()) { + if (res->headerData && res->headerLength) { + // path for processing one or more tokens from an included header, hand off 'res' + const bool forNextLine = parseContext.lineDirectiveShouldSetNextLine(); + std::ostringstream prologue; + std::ostringstream epilogue; + prologue << "#line " << forNextLine << " " << "\"" << res->headerName << "\"\n"; + epilogue << (res->headerData[res->headerLength - 1] == '\n'? "" : "\n") << + "#line " << directiveLoc.line + forNextLine << " " << directiveLoc.getStringNameOrNum() << "\n"; + pushInput(new TokenizableIncludeFile(directiveLoc, prologue.str(), res, epilogue.str(), this)); + // There's no "current" location anymore. + parseContext.setCurrentColumn(0); } else { - std::string message = - res ? std::string(res->file_data, res->file_length) - : std::string("Could not process include directive"); - parseContext.ppError(directiveLoc, message.c_str(), "#include", ""); - if (res) { - includer.releaseInclude(res); - } + // things are okay, but there is nothing to process + includer.releaseInclude(res); } + } else { + // error path, clean up + std::string message = + res ? std::string(res->headerData, res->headerLength) + : std::string("Could not process include directive"); + parseContext.ppError(directiveLoc, message.c_str(), "#include", "for header name: %s", filename.c_str()); + includer.releaseInclude(res); } return token; } // Handle #line -int TPpContext::CPPline(TPpToken* ppToken) +int TPpContext::CPPline(TPpToken* ppToken) { // "#line must have, after macro substitution, one of the following forms: // "#line line @@ -688,7 +704,7 @@ int TPpContext::CPPline(TPpToken* ppToken) } // Handle #error -int TPpContext::CPPerror(TPpToken* ppToken) +int TPpContext::CPPerror(TPpToken* ppToken) { int token = scanToken(ppToken); std::string message; @@ -711,7 +727,7 @@ int TPpContext::CPPerror(TPpToken* ppToken) token = scanToken(ppToken); } parseContext.notifyErrorDirective(loc.line, message.c_str()); - //store this msg into the shader's information log..set the Compile Error flag!!!! + // store this msg into the shader's information log..set the Compile Error flag!!!! parseContext.ppError(loc, message.c_str(), "#error", ""); return '\n'; @@ -865,7 +881,7 @@ int TPpContext::readCPPline(TPpToken* ppToken) if (elseSeen[elsetracker]) parseContext.ppError(ppToken->loc, "#elif after #else", "#elif", ""); // this token is really a dont care, but we still need to eat the tokens - token = scanToken(ppToken); + token = scanToken(ppToken); while (token != '\n' && token != EndOfInput) token = scanToken(ppToken); token = CPPelse(0, ppToken); @@ -999,7 +1015,7 @@ TPpContext::TokenStream* TPpContext::PrescanMacroArg(TokenStream& arg, TPpToken* return expandedArg; } -// +// // Return the next token for a macro expansion, handling macro arguments, // whose semantics are dependent on being adjacent to ##. // @@ -1108,7 +1124,7 @@ int TPpContext::tZeroInput::scan(TPpToken* ppToken) // Check a token to see if it is a macro that should be expanded. // If it is, and defined, push a tInput that will produce the appropriate expansion // and return 1. -// If it is, but undefined, and expandUndef is requested, push a tInput that will +// If it is, but undefined, and expandUndef is requested, push a tInput that will // expand to 0 and return -1. // Otherwise, return 0 to indicate no expansion, which is not necessarily an error. // diff --git a/3rdparty/glslang/glslang/MachineIndependent/preprocessor/PpAtom.cpp b/3rdparty/glslang/glslang/MachineIndependent/preprocessor/PpAtom.cpp index 6948aada4..c4904033a 100644 --- a/3rdparty/glslang/glslang/MachineIndependent/preprocessor/PpAtom.cpp +++ b/3rdparty/glslang/glslang/MachineIndependent/preprocessor/PpAtom.cpp @@ -1,11 +1,11 @@ // -//Copyright (C) 2002-2005 3Dlabs Inc. Ltd. -//Copyright (C) 2013 LunarG, Inc. -//All rights reserved. +// Copyright (C) 2002-2005 3Dlabs Inc. Ltd. +// Copyright (C) 2013 LunarG, Inc. +// All rights reserved. // -//Redistribution and use in source and binary forms, with or without -//modification, are permitted provided that the following conditions -//are met: +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: // // Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. @@ -19,18 +19,18 @@ // contributors may be used to endorse or promote products derived // from this software without specific prior written permission. // -//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -//"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS -//FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE -//COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, -//INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -//BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -//LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -//CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -//LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN -//ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -//POSSIBILITY OF SUCH DAMAGE. +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +// COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. // /****************************************************************************\ Copyright (c) 2002, NVIDIA Corporation. @@ -57,7 +57,7 @@ Except as expressly stated in this notice, no other rights or licenses express or implied, are granted by NVIDIA herein, including but not limited to any patent rights that may be infringed by your derivative works or by other works in which the NVIDIA Software may be -incorporated. No hardware is licensed hereunder. +incorporated. No hardware is licensed hereunder. THE NVIDIA SOFTWARE IS BEING PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED, diff --git a/3rdparty/glslang/glslang/MachineIndependent/preprocessor/PpContext.cpp b/3rdparty/glslang/glslang/MachineIndependent/preprocessor/PpContext.cpp index e31127faa..6a2e05fef 100644 --- a/3rdparty/glslang/glslang/MachineIndependent/preprocessor/PpContext.cpp +++ b/3rdparty/glslang/glslang/MachineIndependent/preprocessor/PpContext.cpp @@ -1,11 +1,11 @@ // -//Copyright (C) 2002-2005 3Dlabs Inc. Ltd. -//Copyright (C) 2013 LunarG, Inc. -//All rights reserved. +// Copyright (C) 2002-2005 3Dlabs Inc. Ltd. +// Copyright (C) 2013 LunarG, Inc. +// All rights reserved. // -//Redistribution and use in source and binary forms, with or without -//modification, are permitted provided that the following conditions -//are met: +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: // // Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. @@ -19,18 +19,18 @@ // contributors may be used to endorse or promote products derived // from this software without specific prior written permission. // -//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -//"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS -//FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE -//COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, -//INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -//BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -//LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -//CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -//LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN -//ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -//POSSIBILITY OF SUCH DAMAGE. +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +// COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. // /****************************************************************************\ Copyright (c) 2002, NVIDIA Corporation. @@ -57,7 +57,7 @@ Except as expressly stated in this notice, no other rights or licenses express or implied, are granted by NVIDIA herein, including but not limited to any patent rights that may be infringed by your derivative works or by other works in which the NVIDIA Software may be -incorporated. No hardware is licensed hereunder. +incorporated. No hardware is licensed hereunder. THE NVIDIA SOFTWARE IS BEING PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED, @@ -82,7 +82,7 @@ NVIDIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. namespace glslang { -TPpContext::TPpContext(TParseContextBase& pc, const std::string& rootFileName, TShader::Includer& inclr) : +TPpContext::TPpContext(TParseContextBase& pc, const std::string& rootFileName, TShader::Includer& inclr) : preamble(0), strings(0), previous_token('\n'), parseContext(pc), includer(inclr), inComment(false), rootFileName(rootFileName), currentSourceFile(rootFileName) diff --git a/3rdparty/glslang/glslang/MachineIndependent/preprocessor/PpContext.h b/3rdparty/glslang/glslang/MachineIndependent/preprocessor/PpContext.h index 84c1bef1f..15e54b79f 100644 --- a/3rdparty/glslang/glslang/MachineIndependent/preprocessor/PpContext.h +++ b/3rdparty/glslang/glslang/MachineIndependent/preprocessor/PpContext.h @@ -1,10 +1,10 @@ // -//Copyright (C) 2013 LunarG, Inc. -//All rights reserved. +// Copyright (C) 2013 LunarG, Inc. +// All rights reserved. // -//Redistribution and use in source and binary forms, with or without -//modification, are permitted provided that the following conditions -//are met: +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: // // Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. @@ -18,18 +18,18 @@ // contributors may be used to endorse or promote products derived // from this software without specific prior written permission. // -//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -//"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS -//FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE -//COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, -//INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -//BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -//LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -//CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -//LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN -//ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -//POSSIBILITY OF SUCH DAMAGE. +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +// COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. // /****************************************************************************\ Copyright (c) 2002, NVIDIA Corporation. @@ -56,7 +56,7 @@ Except as expressly stated in this notice, no other rights or licenses express or implied, are granted by NVIDIA herein, including but not limited to any patent rights that may be infringed by your derivative works or by other works in which the NVIDIA Software may be -incorporated. No hardware is licensed hereunder. +incorporated. No hardware is licensed hereunder. THE NVIDIA SOFTWARE IS BEING PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED, @@ -94,7 +94,7 @@ class TPpToken { public: TPpToken() : space(false), ival(0), dval(0.0), i64val(0) { - loc.init(); + loc.init(); name[0] = 0; } @@ -287,7 +287,7 @@ protected: static const int maxIfNesting = 64; - int ifdepth; // current #if-#else-#endif nesting in the cpp.c file (pre-processor) + int ifdepth; // current #if-#else-#endif nesting in the cpp.c file (pre-processor) bool elseSeen[maxIfNesting]; // Keep a track of whether an else has been seen at a particular depth int elsetracker; // #if-#else and #endif constructs...Counter. @@ -359,11 +359,11 @@ protected: int extraTokenCheck(int atom, TPpToken* ppToken, int token); int eval(int token, int precedence, bool shortCircuit, int& res, bool& err, TPpToken * ppToken); int evalToToken(int token, bool shortCircuit, int& res, bool& err, TPpToken * ppToken); - int CPPif (TPpToken * ppToken); + int CPPif (TPpToken * ppToken); int CPPifdef(int defined, TPpToken * ppToken); int CPPinclude(TPpToken * ppToken); - int CPPline(TPpToken * ppToken); - int CPPerror(TPpToken * ppToken); + int CPPline(TPpToken * ppToken); + int CPPerror(TPpToken * ppToken); int CPPpragma(TPpToken * ppToken); int CPPversion(TPpToken * ppToken); int CPPextension(TPpToken * ppToken); @@ -383,7 +383,7 @@ protected: int ReadToken(TokenStream&, TPpToken*); void pushTokenStreamInput(TokenStream&, bool pasting = false); void UngetToken(int token, TPpToken*); - + class tTokenInput : public tInput { public: tTokenInput(TPpContext* pp, TokenStream* t, bool prepasting) : tInput(pp), tokens(t), lastTokenPastes(prepasting) { } @@ -441,7 +441,7 @@ protected: return '\\'; } while (ch == '\\'); } - + // handle any non-escaped newline if (ch == '\r' || ch == '\n') { if (ch == '\r' && input->peek() == '\n') @@ -486,7 +486,7 @@ protected: TInputScanner* input; }; - // Holds a reference to included file data, as well as a + // Holds a reference to included file data, as well as a // prologue and an epilogue string. This can be scanned using the tInput // interface and acts as a single source string. class TokenizableIncludeFile : public tInput { @@ -500,18 +500,18 @@ protected: TPpContext* pp) : tInput(pp), prologue_(prologue), - includedFile_(includedFile), epilogue_(epilogue), + includedFile_(includedFile), scanner(3, strings, lengths, names, 0, 0, true), prevScanner(nullptr), stringInput(pp, scanner) { strings[0] = prologue_.data(); - strings[1] = includedFile_->file_data; + strings[1] = includedFile_->headerData; strings[2] = epilogue_.data(); lengths[0] = prologue_.size(); - lengths[1] = includedFile_->file_length; + lengths[1] = includedFile_->headerLength; lengths[2] = epilogue_.size(); scanner.setLine(startLoc.line); @@ -552,7 +552,7 @@ protected: // Points to the IncludeResult that this TokenizableIncludeFile represents. TShader::Includer::IncludeResult* includedFile_; - // Will point to prologue_, includedFile_->file_data and epilogue_ + // Will point to prologue_, includedFile_->headerData and epilogue_ // This is passed to scanner constructor. // These do not own the storage and it must remain valid until this // object has been destroyed. @@ -576,7 +576,7 @@ protected: void push_include(TShader::Includer::IncludeResult* result) { - currentSourceFile = result->file_name; + currentSourceFile = result->headerName; includeStack.push(result); } @@ -588,7 +588,7 @@ protected: if (includeStack.empty()) { currentSourceFile = rootFileName; } else { - currentSourceFile = includeStack.top()->file_name; + currentSourceFile = includeStack.top()->headerName; } } diff --git a/3rdparty/glslang/glslang/MachineIndependent/preprocessor/PpMemory.cpp b/3rdparty/glslang/glslang/MachineIndependent/preprocessor/PpMemory.cpp index 4d0f32a49..e30db7f6d 100644 --- a/3rdparty/glslang/glslang/MachineIndependent/preprocessor/PpMemory.cpp +++ b/3rdparty/glslang/glslang/MachineIndependent/preprocessor/PpMemory.cpp @@ -1,11 +1,11 @@ // -//Copyright (C) 2002-2005 3Dlabs Inc. Ltd. -//Copyright (C) 2013 LunarG, Inc. -//All rights reserved. +// Copyright (C) 2002-2005 3Dlabs Inc. Ltd. +// Copyright (C) 2013 LunarG, Inc. +// All rights reserved. // -//Redistribution and use in source and binary forms, with or without -//modification, are permitted provided that the following conditions -//are met: +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: // // Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. @@ -19,18 +19,18 @@ // contributors may be used to endorse or promote products derived // from this software without specific prior written permission. // -//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -//"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS -//FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE -//COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, -//INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -//BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -//LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -//CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -//LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN -//ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -//POSSIBILITY OF SUCH DAMAGE. +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +// COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. // /****************************************************************************\ Copyright (c) 2002, NVIDIA Corporation. @@ -57,7 +57,7 @@ Except as expressly stated in this notice, no other rights or licenses express or implied, are granted by NVIDIA herein, including but not limited to any patent rights that may be infringed by your derivative works or by other works in which the NVIDIA Software may be -incorporated. No hardware is licensed hereunder. +incorporated. No hardware is licensed hereunder. THE NVIDIA SOFTWARE IS BEING PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED, diff --git a/3rdparty/glslang/glslang/MachineIndependent/preprocessor/PpScanner.cpp b/3rdparty/glslang/glslang/MachineIndependent/preprocessor/PpScanner.cpp index 426e44ed8..ffd4cdd98 100644 --- a/3rdparty/glslang/glslang/MachineIndependent/preprocessor/PpScanner.cpp +++ b/3rdparty/glslang/glslang/MachineIndependent/preprocessor/PpScanner.cpp @@ -1,11 +1,11 @@ // -//Copyright (C) 2002-2005 3Dlabs Inc. Ltd. -//Copyright (C) 2013 LunarG, Inc. -//All rights reserved. +// Copyright (C) 2002-2005 3Dlabs Inc. Ltd. +// Copyright (C) 2013 LunarG, Inc. +// All rights reserved. // -//Redistribution and use in source and binary forms, with or without -//modification, are permitted provided that the following conditions -//are met: +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: // // Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. @@ -19,18 +19,18 @@ // contributors may be used to endorse or promote products derived // from this software without specific prior written permission. // -//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -//"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS -//FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE -//COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, -//INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -//BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -//LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -//CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -//LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN -//ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -//POSSIBILITY OF SUCH DAMAGE. +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +// COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. // /****************************************************************************\ Copyright (c) 2002, NVIDIA Corporation. @@ -57,7 +57,7 @@ Except as expressly stated in this notice, no other rights or licenses express or implied, are granted by NVIDIA herein, including but not limited to any patent rights that may be infringed by your derivative works or by other works in which the NVIDIA Software may be -incorporated. No hardware is licensed hereunder. +incorporated. No hardware is licensed hereunder. THE NVIDIA SOFTWARE IS BEING PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED, @@ -224,7 +224,7 @@ int TPpContext::lFloatConst(int len, int ch, TPpToken* ppToken) parseContext.ppError(ppToken->loc, "float literal too long", "", ""); len = 1,str_len=1; } - } else + } else ungetChar(); str[len]='\0'; diff --git a/3rdparty/glslang/glslang/MachineIndependent/preprocessor/PpSymbols.cpp b/3rdparty/glslang/glslang/MachineIndependent/preprocessor/PpSymbols.cpp index 585bf2c8d..700d82e2f 100644 --- a/3rdparty/glslang/glslang/MachineIndependent/preprocessor/PpSymbols.cpp +++ b/3rdparty/glslang/glslang/MachineIndependent/preprocessor/PpSymbols.cpp @@ -1,11 +1,11 @@ // -//Copyright (C) 2002-2005 3Dlabs Inc. Ltd. -//Copyright (C) 2013 LunarG, Inc. -//All rights reserved. +// Copyright (C) 2002-2005 3Dlabs Inc. Ltd. +// Copyright (C) 2013 LunarG, Inc. +// All rights reserved. // -//Redistribution and use in source and binary forms, with or without -//modification, are permitted provided that the following conditions -//are met: +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: // // Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. @@ -19,18 +19,18 @@ // contributors may be used to endorse or promote products derived // from this software without specific prior written permission. // -//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -//"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS -//FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE -//COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, -//INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -//BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -//LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -//CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -//LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN -//ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -//POSSIBILITY OF SUCH DAMAGE. +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +// COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. // /****************************************************************************\ Copyright (c) 2002, NVIDIA Corporation. @@ -57,7 +57,7 @@ Except as expressly stated in this notice, no other rights or licenses express or implied, are granted by NVIDIA herein, including but not limited to any patent rights that may be infringed by your derivative works or by other works in which the NVIDIA Software may be -incorporated. No hardware is licensed hereunder. +incorporated. No hardware is licensed hereunder. THE NVIDIA SOFTWARE IS BEING PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED, diff --git a/3rdparty/glslang/glslang/MachineIndependent/preprocessor/PpTokens.cpp b/3rdparty/glslang/glslang/MachineIndependent/preprocessor/PpTokens.cpp index 471f26c02..f0441b7f8 100644 --- a/3rdparty/glslang/glslang/MachineIndependent/preprocessor/PpTokens.cpp +++ b/3rdparty/glslang/glslang/MachineIndependent/preprocessor/PpTokens.cpp @@ -1,11 +1,11 @@ // -//Copyright (C) 2002-2005 3Dlabs Inc. Ltd. -//Copyright (C) 2013 LunarG, Inc. -//All rights reserved. +// Copyright (C) 2002-2005 3Dlabs Inc. Ltd. +// Copyright (C) 2013 LunarG, Inc. +// All rights reserved. // -//Redistribution and use in source and binary forms, with or without -//modification, are permitted provided that the following conditions -//are met: +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: // // Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. @@ -19,18 +19,18 @@ // contributors may be used to endorse or promote products derived // from this software without specific prior written permission. // -//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -//"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS -//FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE -//COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, -//INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -//BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -//LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -//CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -//LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN -//ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -//POSSIBILITY OF SUCH DAMAGE. +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +// COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. // /****************************************************************************\ Copyright (c) 2002, NVIDIA Corporation. @@ -57,7 +57,7 @@ Except as expressly stated in this notice, no other rights or licenses express or implied, are granted by NVIDIA herein, including but not limited to any patent rights that may be infringed by your derivative works or by other works in which the NVIDIA Software may be -incorporated. No hardware is licensed hereunder. +incorporated. No hardware is licensed hereunder. THE NVIDIA SOFTWARE IS BEING PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED, diff --git a/3rdparty/glslang/glslang/MachineIndependent/preprocessor/PpTokens.h b/3rdparty/glslang/glslang/MachineIndependent/preprocessor/PpTokens.h index 20aeb1010..3b1367f3b 100644 --- a/3rdparty/glslang/glslang/MachineIndependent/preprocessor/PpTokens.h +++ b/3rdparty/glslang/glslang/MachineIndependent/preprocessor/PpTokens.h @@ -1,10 +1,10 @@ // -//Copyright (C) 2002-2005 3Dlabs Inc. Ltd. -//All rights reserved. +// Copyright (C) 2002-2005 3Dlabs Inc. Ltd. +// All rights reserved. // -//Redistribution and use in source and binary forms, with or without -//modification, are permitted provided that the following conditions -//are met: +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: // // Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. @@ -18,18 +18,18 @@ // contributors may be used to endorse or promote products derived // from this software without specific prior written permission. // -//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -//"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS -//FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE -//COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, -//INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -//BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -//LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -//CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -//LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN -//ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -//POSSIBILITY OF SUCH DAMAGE. +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +// COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. // /****************************************************************************\ Copyright (c) 2002, NVIDIA Corporation. @@ -56,7 +56,7 @@ Except as expressly stated in this notice, no other rights or licenses express or implied, are granted by NVIDIA herein, including but not limited to any patent rights that may be infringed by your derivative works or by other works in which the NVIDIA Software may be -incorporated. No hardware is licensed hereunder. +incorporated. No hardware is licensed hereunder. THE NVIDIA SOFTWARE IS BEING PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED, @@ -128,7 +128,7 @@ enum EFixedAtoms { #endif PpAtomConstString, - // Identifiers + // Identifiers PpAtomIdentifier, // preprocessor "keywords" diff --git a/3rdparty/glslang/glslang/MachineIndependent/propagateNoContraction.cpp b/3rdparty/glslang/glslang/MachineIndependent/propagateNoContraction.cpp index caa6e200d..bcf40f928 100644 --- a/3rdparty/glslang/glslang/MachineIndependent/propagateNoContraction.cpp +++ b/3rdparty/glslang/glslang/MachineIndependent/propagateNoContraction.cpp @@ -272,9 +272,9 @@ TSymbolDefinitionCollectingTraverser::TSymbolDefinitionCollectingTraverser( ObjectAccesschainSet* precise_objects, std::unordered_set* precise_return_nodes) : TIntermTraverser(true, false, false), symbol_definition_mapping_(*symbol_definition_mapping), - precise_objects_(*precise_objects), current_object_(), - accesschain_mapping_(*accesschain_mapping), current_function_definition_node_(nullptr), - precise_return_nodes_(*precise_return_nodes) {} + precise_objects_(*precise_objects), precise_return_nodes_(*precise_return_nodes), + current_object_(), accesschain_mapping_(*accesschain_mapping), + current_function_definition_node_(nullptr) {} // Visits a symbol node, set the current_object_ to the // current node symbol ID, and record a mapping from this node to the current @@ -616,9 +616,9 @@ class TNoContractionPropagator : public glslang::TIntermTraverser { public: TNoContractionPropagator(ObjectAccesschainSet* precise_objects, const AccessChainMapping& accesschain_mapping) - : TIntermTraverser(true, false, false), remained_accesschain_(), - precise_objects_(*precise_objects), accesschain_mapping_(accesschain_mapping), - added_precise_object_ids_() {} + : TIntermTraverser(true, false, false), + precise_objects_(*precise_objects), added_precise_object_ids_(), + remained_accesschain_(), accesschain_mapping_(accesschain_mapping) {} // Propagates 'precise' in the right nodes of a given assignment node with // access chain record from the assignee node to a 'precise' object it diff --git a/3rdparty/glslang/glslang/MachineIndependent/reflection.cpp b/3rdparty/glslang/glslang/MachineIndependent/reflection.cpp index 31bd17255..688827da9 100644 --- a/3rdparty/glslang/glslang/MachineIndependent/reflection.cpp +++ b/3rdparty/glslang/glslang/MachineIndependent/reflection.cpp @@ -1,11 +1,11 @@ // -//Copyright (C) 2013-2016 LunarG, Inc. +// Copyright (C) 2013-2016 LunarG, Inc. // -//All rights reserved. +// All rights reserved. // -//Redistribution and use in source and binary forms, with or without -//modification, are permitted provided that the following conditions -//are met: +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: // // Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. @@ -19,18 +19,18 @@ // contributors may be used to endorse or promote products derived // from this software without specific prior written permission. // -//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -//"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS -//FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE -//COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, -//INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -//BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -//LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -//CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -//LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN -//ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -//POSSIBILITY OF SUCH DAMAGE. +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +// COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. // #include "../Include/Common.h" @@ -63,7 +63,6 @@ // there wasn't exactly one entry point. // - namespace glslang { // @@ -355,7 +354,6 @@ public: return blockIndex; } - // Are we at a level in a dereference chain at which individual active uniform queries are made? bool isReflectionGranularity(const TType& type) { @@ -694,7 +692,6 @@ void TReflectionTraverser::visitSymbol(TIntermSymbol* base) addAttribute(*base); } - // // Implement TReflection methods. // @@ -739,10 +736,10 @@ void TReflection::dump() indexToAttribute[i].dump(); printf("\n"); - //printf("Live names\n"); - //for (TNameToIndex::const_iterator it = nameToIndex.begin(); it != nameToIndex.end(); ++it) + // printf("Live names\n"); + // for (TNameToIndex::const_iterator it = nameToIndex.begin(); it != nameToIndex.end(); ++it) // printf("%s: %d\n", it->first.c_str(), it->second); - //printf("\n"); + // printf("\n"); } } // end namespace glslang diff --git a/3rdparty/glslang/glslang/MachineIndependent/reflection.h b/3rdparty/glslang/glslang/MachineIndependent/reflection.h index 13f5177c0..bae131cfd 100644 --- a/3rdparty/glslang/glslang/MachineIndependent/reflection.h +++ b/3rdparty/glslang/glslang/MachineIndependent/reflection.h @@ -1,11 +1,11 @@ // -//Copyright (C) 2013-2016 LunarG, Inc. +// Copyright (C) 2013-2016 LunarG, Inc. // -//All rights reserved. +// All rights reserved. // -//Redistribution and use in source and binary forms, with or without -//modification, are permitted provided that the following conditions -//are met: +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: // // Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. @@ -19,18 +19,18 @@ // contributors may be used to endorse or promote products derived // from this software without specific prior written permission. // -//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -//"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS -//FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE -//COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, -//INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -//BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -//LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -//CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -//LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN -//ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -//POSSIBILITY OF SUCH DAMAGE. +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +// COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. // #ifndef _REFLECTION_INCLUDED @@ -55,9 +55,9 @@ class TReflectionTraverser; // Data needed for just a single object at the granularity exchanged by the reflection API class TObjectReflection { public: - TObjectReflection(const TString& pName, const TType& pType, int pOffset, int pGLDefineType, int pSize, int pIndex) : - name(pName), type(pType.clone()), - offset(pOffset), glDefineType(pGLDefineType), size(pSize), index(pIndex) { } + TObjectReflection(const TString& pName, const TType& pType, int pOffset, int pGLDefineType, int pSize, int pIndex) : + name(pName), offset(pOffset), + glDefineType(pGLDefineType), size(pSize), index(pIndex), type(pType.clone()) { } void dump() const { printf("%s: offset %d, type %x, size %d, index %d, binding %d\n", @@ -81,7 +81,7 @@ protected: return type->getQualifier().layoutBinding; } - TObjectReflection() : type(nullptr), offset(-1), glDefineType(-1), size(-1), index(-1) { } + TObjectReflection() : offset(-1), glDefineType(-1), size(-1), index(-1), type(nullptr) { } const TType* type; }; @@ -107,7 +107,7 @@ public: // for mapping a block index to the block's description int getNumUniformBlocks() const { return (int)indexToUniformBlock.size(); } - const TObjectReflection& getUniformBlock(int i) const + const TObjectReflection& getUniformBlock(int i) const { if (i >= 0 && i < (int)indexToUniformBlock.size()) return indexToUniformBlock[i]; @@ -126,7 +126,7 @@ public: } // for mapping any name to its index (block names, uniform names and attribute names) - int getIndex(const char* name) const + int getIndex(const char* name) const { TNameToIndex::const_iterator it = nameToIndex.find(name); if (it == nameToIndex.end()) diff --git a/3rdparty/glslang/glslang/OSDependent/Unix/ossource.cpp b/3rdparty/glslang/glslang/OSDependent/Unix/ossource.cpp index 7e84d4eb2..4f8098b75 100644 --- a/3rdparty/glslang/glslang/OSDependent/Unix/ossource.cpp +++ b/3rdparty/glslang/glslang/OSDependent/Unix/ossource.cpp @@ -1,10 +1,10 @@ // -//Copyright (C) 2002-2005 3Dlabs Inc. Ltd. -//All rights reserved. +// Copyright (C) 2002-2005 3Dlabs Inc. Ltd. +// All rights reserved. // -//Redistribution and use in source and binary forms, with or without -//modification, are permitted provided that the following conditions -//are met: +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: // // Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. @@ -18,18 +18,18 @@ // contributors may be used to endorse or promote products derived // from this software without specific prior written permission. // -//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -//"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS -//FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE -//COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, -//INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -//BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -//LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -//CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -//LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN -//ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -//POSSIBILITY OF SUCH DAMAGE. +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +// COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. // // @@ -51,122 +51,119 @@ namespace glslang { // // -// Wrapper for Linux call to DetachThread. This is required as pthread_cleanup_push() expects +// Wrapper for Linux call to DetachThread. This is required as pthread_cleanup_push() expects // the cleanup routine to return void. -// +// static void DetachThreadLinux(void *) { - DetachThread(); + DetachThread(); } - // // Registers cleanup handler, sets cancel type and state, and executes the thread specific -// cleanup handler. This function will be called in the Standalone.cpp for regression -// testing. When OpenGL applications are run with the driver code, Linux OS does the +// cleanup handler. This function will be called in the Standalone.cpp for regression +// testing. When OpenGL applications are run with the driver code, Linux OS does the // thread cleanup. -// +// void OS_CleanupThreadData(void) { #ifdef __ANDROID__ - DetachThreadLinux(NULL); + DetachThreadLinux(NULL); #else - int old_cancel_state, old_cancel_type; - void *cleanupArg = NULL; + int old_cancel_state, old_cancel_type; + void *cleanupArg = NULL; - // - // Set thread cancel state and push cleanup handler. - // - pthread_setcancelstate(PTHREAD_CANCEL_ENABLE, &old_cancel_state); - pthread_cleanup_push(DetachThreadLinux, (void *) cleanupArg); + // + // Set thread cancel state and push cleanup handler. + // + pthread_setcancelstate(PTHREAD_CANCEL_ENABLE, &old_cancel_state); + pthread_cleanup_push(DetachThreadLinux, (void *) cleanupArg); - // - // Put the thread in deferred cancellation mode. - // - pthread_setcanceltype(PTHREAD_CANCEL_DEFERRED, &old_cancel_type); + // + // Put the thread in deferred cancellation mode. + // + pthread_setcanceltype(PTHREAD_CANCEL_DEFERRED, &old_cancel_type); - // - // Pop cleanup handler and execute it prior to unregistering the cleanup handler. - // - pthread_cleanup_pop(1); + // + // Pop cleanup handler and execute it prior to unregistering the cleanup handler. + // + pthread_cleanup_pop(1); - // - // Restore the thread's previous cancellation mode. - // - pthread_setcanceltype(old_cancel_state, NULL); + // + // Restore the thread's previous cancellation mode. + // + pthread_setcanceltype(old_cancel_state, NULL); #endif } - // // Thread Local Storage Operations // inline OS_TLSIndex PthreadKeyToTLSIndex(pthread_key_t key) { - return (OS_TLSIndex)((uintptr_t)key + 1); + return (OS_TLSIndex)((uintptr_t)key + 1); } inline pthread_key_t TLSIndexToPthreadKey(OS_TLSIndex nIndex) { - return (pthread_key_t)((uintptr_t)nIndex - 1); + return (pthread_key_t)((uintptr_t)nIndex - 1); } OS_TLSIndex OS_AllocTLSIndex() { - pthread_key_t pPoolIndex; + pthread_key_t pPoolIndex; - // - // Create global pool key. - // - if ((pthread_key_create(&pPoolIndex, NULL)) != 0) { - assert(0 && "OS_AllocTLSIndex(): Unable to allocate Thread Local Storage"); - return OS_INVALID_TLS_INDEX; - } - else - return PthreadKeyToTLSIndex(pPoolIndex); + // + // Create global pool key. + // + if ((pthread_key_create(&pPoolIndex, NULL)) != 0) { + assert(0 && "OS_AllocTLSIndex(): Unable to allocate Thread Local Storage"); + return OS_INVALID_TLS_INDEX; + } + else + return PthreadKeyToTLSIndex(pPoolIndex); } - bool OS_SetTLSValue(OS_TLSIndex nIndex, void *lpvValue) { - if (nIndex == OS_INVALID_TLS_INDEX) { - assert(0 && "OS_SetTLSValue(): Invalid TLS Index"); - return false; - } + if (nIndex == OS_INVALID_TLS_INDEX) { + assert(0 && "OS_SetTLSValue(): Invalid TLS Index"); + return false; + } - if (pthread_setspecific(TLSIndexToPthreadKey(nIndex), lpvValue) == 0) - return true; - else - return false; + if (pthread_setspecific(TLSIndexToPthreadKey(nIndex), lpvValue) == 0) + return true; + else + return false; } void* OS_GetTLSValue(OS_TLSIndex nIndex) { - // - // This function should return 0 if nIndex is invalid. - // - assert(nIndex != OS_INVALID_TLS_INDEX); - return pthread_getspecific(TLSIndexToPthreadKey(nIndex)); + // + // This function should return 0 if nIndex is invalid. + // + assert(nIndex != OS_INVALID_TLS_INDEX); + return pthread_getspecific(TLSIndexToPthreadKey(nIndex)); } bool OS_FreeTLSIndex(OS_TLSIndex nIndex) { - if (nIndex == OS_INVALID_TLS_INDEX) { - assert(0 && "OS_SetTLSValue(): Invalid TLS Index"); - return false; - } + if (nIndex == OS_INVALID_TLS_INDEX) { + assert(0 && "OS_SetTLSValue(): Invalid TLS Index"); + return false; + } - // - // Delete the global pool key. - // - if (pthread_key_delete(TLSIndexToPthreadKey(nIndex)) == 0) - return true; - else - return false; + // + // Delete the global pool key. + // + if (pthread_key_delete(TLSIndexToPthreadKey(nIndex)) == 0) + return true; + else + return false; } namespace { -pthread_mutex_t gMutex; + pthread_mutex_t gMutex; } void InitGlobalLock() diff --git a/3rdparty/glslang/glslang/OSDependent/Windows/main.cpp b/3rdparty/glslang/glslang/OSDependent/Windows/main.cpp index 6d6b0fddc..0bcde7b66 100644 --- a/3rdparty/glslang/glslang/OSDependent/Windows/main.cpp +++ b/3rdparty/glslang/glslang/OSDependent/Windows/main.cpp @@ -1,10 +1,10 @@ // -//Copyright (C) 2002-2005 3Dlabs Inc. Ltd. -//All rights reserved. +// Copyright (C) 2002-2005 3Dlabs Inc. Ltd. +// All rights reserved. // -//Redistribution and use in source and binary forms, with or without -//modification, are permitted provided that the following conditions -//are met: +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: // // Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. @@ -18,18 +18,18 @@ // contributors may be used to endorse or promote products derived // from this software without specific prior written permission. // -//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -//"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS -//FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE -//COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, -//INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -//BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -//LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -//CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -//LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN -//ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -//POSSIBILITY OF SUCH DAMAGE. +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +// COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. // #include "InitializeDll.h" diff --git a/3rdparty/glslang/glslang/OSDependent/Windows/ossource.cpp b/3rdparty/glslang/glslang/OSDependent/Windows/ossource.cpp index f71fac9cb..73ae0ca71 100644 --- a/3rdparty/glslang/glslang/OSDependent/Windows/ossource.cpp +++ b/3rdparty/glslang/glslang/OSDependent/Windows/ossource.cpp @@ -1,10 +1,10 @@ // -//Copyright (C) 2002-2005 3Dlabs Inc. Ltd. -//All rights reserved. +// Copyright (C) 2002-2005 3Dlabs Inc. Ltd. +// All rights reserved. // -//Redistribution and use in source and binary forms, with or without -//modification, are permitted provided that the following conditions -//are met: +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: // // Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. @@ -18,18 +18,18 @@ // contributors may be used to endorse or promote products derived // from this software without specific prior written permission. // -//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -//"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS -//FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE -//COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, -//INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -//BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -//LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -//CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -//LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN -//ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -//POSSIBILITY OF SUCH DAMAGE. +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +// COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. // #include "../osinclude.h" @@ -77,7 +77,6 @@ OS_TLSIndex OS_AllocTLSIndex() return ToGenericTLSIndex(dwIndex); } - bool OS_SetTLSValue(OS_TLSIndex nIndex, void *lpvValue) { if (nIndex == OS_INVALID_TLS_INDEX) { diff --git a/3rdparty/glslang/glslang/OSDependent/osinclude.h b/3rdparty/glslang/glslang/OSDependent/osinclude.h index 33f880380..e8325268e 100644 --- a/3rdparty/glslang/glslang/OSDependent/osinclude.h +++ b/3rdparty/glslang/glslang/OSDependent/osinclude.h @@ -1,10 +1,10 @@ // -//Copyright (C) 2002-2005 3Dlabs Inc. Ltd. -//All rights reserved. +// Copyright (C) 2002-2005 3Dlabs Inc. Ltd. +// All rights reserved. // -//Redistribution and use in source and binary forms, with or without -//modification, are permitted provided that the following conditions -//are met: +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: // // Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. @@ -18,18 +18,18 @@ // contributors may be used to endorse or promote products derived // from this software without specific prior written permission. // -//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -//"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS -//FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE -//COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, -//INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -//BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -//LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -//CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -//LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN -//ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -//POSSIBILITY OF SUCH DAMAGE. +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +// COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. // #ifndef __OSINCLUDE_H diff --git a/3rdparty/glslang/glslang/Public/ShaderLang.h b/3rdparty/glslang/glslang/Public/ShaderLang.h index afdc7d1eb..60e539b4a 100644 --- a/3rdparty/glslang/glslang/Public/ShaderLang.h +++ b/3rdparty/glslang/glslang/Public/ShaderLang.h @@ -1,12 +1,12 @@ // -//Copyright (C) 2002-2005 3Dlabs Inc. Ltd. -//Copyright (C) 2013-2016 LunarG, Inc. +// Copyright (C) 2002-2005 3Dlabs Inc. Ltd. +// Copyright (C) 2013-2016 LunarG, Inc. // -//All rights reserved. +// All rights reserved. // -//Redistribution and use in source and binary forms, with or without -//modification, are permitted provided that the following conditions -//are met: +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: // // Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. @@ -20,18 +20,18 @@ // contributors may be used to endorse or promote products derived // from this software without specific prior written permission. // -//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -//"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS -//FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE -//COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, -//INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -//BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -//LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -//CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -//LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN -//ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -//POSSIBILITY OF SUCH DAMAGE. +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +// COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. // #ifndef _COMPILER_INTERFACE_INCLUDED_ #define _COMPILER_INTERFACE_INCLUDED_ @@ -165,9 +165,9 @@ typedef struct { // // ShHandle held by but opaque to the driver. It is allocated, -// managed, and de-allocated by the compiler/linker. It's contents +// managed, and de-allocated by the compiler/linker. It's contents // are defined by and used by the compiler and linker. For example, -// symbol table information and object code passed from the compiler +// symbol table information and object code passed from the compiler // to the linker can be stored where ShHandle points. // // If handle creation fails, 0 will be returned. @@ -187,7 +187,7 @@ SH_IMPORT_EXPORT void ShDestruct(ShHandle); // The return value of ShCompile is boolean, non-zero indicating // success. // -// The info-log should be written by ShCompile into +// The info-log should be written by ShCompile into // ShHandle, so it can answer future queries. // SH_IMPORT_EXPORT int ShCompile( @@ -251,8 +251,8 @@ SH_IMPORT_EXPORT int ShGetUniformLocation(const ShHandle uniformMap, const char* // ----------------------------------- // // Below is a new alternate C++ interface that might potentially replace the above -// opaque handle-based interface. -// +// opaque handle-based interface. +// // The below is further designed to handle multiple compilation units per stage, where // the intermediate results, including the parse tree, are preserved until link time, // rather than the above interface which is designed to have each compilation unit @@ -331,72 +331,76 @@ public: // release the IncludeResult object. class Includer { public: - typedef enum { - EIncludeRelative, // For #include "something" - EIncludeStandard // Reserved. For #include - } IncludeType; - // An IncludeResult contains the resolved name and content of a source // inclusion. struct IncludeResult { - IncludeResult(const std::string& file_name, const char* const file_data, const size_t file_length, void* user_data) : - file_name(file_name), file_data(file_data), file_length(file_length), user_data(user_data) { } + IncludeResult(const std::string& headerName, const char* const headerData, const size_t headerLength, void* userData) : + headerName(headerName), headerData(headerData), headerLength(headerLength), userData(userData) { } // For a successful inclusion, the fully resolved name of the requested // include. For example, in a file system-based includer, full resolution // should convert a relative path name into an absolute path name. // For a failed inclusion, this is an empty string. - const std::string file_name; + const std::string headerName; // The content and byte length of the requested inclusion. The // Includer producing this IncludeResult retains ownership of the // storage. - // For a failed inclusion, the file_data + // For a failed inclusion, the header // field points to a string containing error details. - const char* const file_data; - const size_t file_length; + const char* const headerData; + const size_t headerLength; // Include resolver's context. - void* user_data; + void* userData; protected: IncludeResult& operator=(const IncludeResult&); IncludeResult(); }; - // Resolves an inclusion request by name, type, current source name, + // For both include methods below: + // + // Resolves an inclusion request by name, current source name, // and include depth. // On success, returns an IncludeResult containing the resolved name - // and content of the include. On failure, returns an IncludeResult - // with an empty string for the file_name and error details in the - // file_data field. The Includer retains ownership of the contents + // and content of the include. + // On failure, returns a nullptr, or an IncludeResult + // with an empty string for the headerName and error details in the + // header field. + // The Includer retains ownership of the contents // of the returned IncludeResult value, and those contents must // remain valid until the releaseInclude method is called on that // IncludeResult object. - virtual IncludeResult* include(const char* requested_source, - IncludeType type, - const char* requesting_source, - size_t inclusion_depth) = 0; + // + // Note "local" vs. "system" is not an "either/or": "local" is an + // extra thing to do over "system". Both might get called, as per + // the C++ specification. + + // For the "system" or <>-style includes; search the "system" paths. + virtual IncludeResult* includeSystem(const char* headerName, + const char* includerName, + size_t inclusionDepth) { return nullptr; } + + // For the "local"-only aspect of a "" include. Should not search in the + // "system" paths, because on returning a failure, the parser will + // call includeSystem() to look in the "system" locations. + virtual IncludeResult* includeLocal(const char* headerName, + const char* includerName, + size_t inclusionDepth) { return nullptr; } + // Signals that the parser will no longer use the contents of the // specified IncludeResult. - virtual void releaseInclude(IncludeResult* result) = 0; + virtual void releaseInclude(IncludeResult*) = 0; virtual ~Includer() {} }; - // Returns an error message for any #include directive. - class ForbidInclude : public Includer { + // Fail all Includer searches + class ForbidIncluder : public Includer { public: - IncludeResult* include(const char*, IncludeType, const char*, size_t) override - { - const char* unexpected_include = "unexpected include directive"; - return new IncludeResult(std::string(""), unexpected_include, strlen(unexpected_include), nullptr); - } - virtual void releaseInclude(IncludeResult* result) override - { - delete result; - } + virtual void releaseInclude(IncludeResult*) override { } }; bool parse(const TBuiltInResource* res, int defaultVersion, EProfile defaultProfile, bool forceDefaultVersionAndProfile, bool forwardCompatible, EShMessages messages) { - TShader::ForbidInclude includer; + TShader::ForbidIncluder includer; return parse(res, defaultVersion, defaultProfile, forceDefaultVersionAndProfile, forwardCompatible, messages, includer); } @@ -513,7 +517,7 @@ public: const char *getAttributeName(int index) const; // can be used for glGetActiveAttrib() int getAttributeType(int index) const; // can be used for glGetActiveAttrib() const TType* getUniformTType(int index) const; // returns a TType* - const TType* getUniformBlockTType(int index) const; // returns a TType* + const TType* getUniformBlockTType(int index) const; // returns a TType* const TType* getAttributeTType(int index) const; // returns a TType* void dumpReflection(); diff --git a/3rdparty/glslang/gtests/CMakeLists.txt b/3rdparty/glslang/gtests/CMakeLists.txt index 268caff7f..a06442dfb 100644 --- a/3rdparty/glslang/gtests/CMakeLists.txt +++ b/3rdparty/glslang/gtests/CMakeLists.txt @@ -40,9 +40,15 @@ if (TARGET gmock) ${PROJECT_SOURCE_DIR} ${gmock_SOURCE_DIR}/include ${gtest_SOURCE_DIR}/include) - target_link_libraries(glslangtests PRIVATE - SPVRemapper glslang OSDependent OGLCompiler HLSL glslang - SPIRV glslang-default-resource-limits gmock) + + set(LIBRARIES + SPVRemapper glslang OSDependent OGLCompiler glslang + SPIRV glslang-default-resource-limits) + if(ENABLE_HLSL) + set(LIBRARIES ${LIBRARIES} HLSL) + endif(ENABLE_HLSL) + target_link_libraries(glslangtests PRIVATE ${LIBRARIES} gmock) + add_test(NAME glslang-gtests - COMMAND glslangtests --test-root "${GLSLANG_TEST_DIRECTORY}") + COMMAND glslangtests --test-root "${GLSLANG_TEST_DIRECTORY}") endif() diff --git a/3rdparty/glslang/gtests/Hlsl.FromFile.cpp b/3rdparty/glslang/gtests/Hlsl.FromFile.cpp index 393931bff..e9e301c09 100644 --- a/3rdparty/glslang/gtests/Hlsl.FromFile.cpp +++ b/3rdparty/glslang/gtests/Hlsl.FromFile.cpp @@ -174,6 +174,7 @@ INSTANTIATE_TEST_CASE_P( {"hlsl.rw.bracket.frag", "main"}, {"hlsl.rw.register.frag", "main"}, {"hlsl.rw.scalar.bracket.frag", "main"}, + {"hlsl.rw.swizzle.frag", "main"}, {"hlsl.rw.vec2.bracket.frag", "main"}, {"hlsl.sample.array.dx10.frag", "main"}, {"hlsl.sample.basic.dx10.frag", "main"}, diff --git a/3rdparty/glslang/gtests/TestFixture.h b/3rdparty/glslang/gtests/TestFixture.h index e795e8dc9..6f4afc661 100644 --- a/3rdparty/glslang/gtests/TestFixture.h +++ b/3rdparty/glslang/gtests/TestFixture.h @@ -521,7 +521,7 @@ public: glslang::TShader shader(EShLangVertex); shader.setStringsWithLengths(&shaderStrings, &shaderLengths, 1); std::string ppShader; - glslang::TShader::ForbidInclude includer; + glslang::TShader::ForbidIncluder includer; const bool success = shader.preprocess( &glslang::DefaultTBuiltInResource, defaultVersion, defaultProfile, forceVersionProfile, isForwardCompatible, (EShMessages)(EShMsgOnlyPreprocessor | EShMsgCascadingErrors), diff --git a/3rdparty/glslang/hlsl/hlslAttributes.cpp b/3rdparty/glslang/hlsl/hlslAttributes.cpp index 966ff3521..df3704688 100644 --- a/3rdparty/glslang/hlsl/hlslAttributes.cpp +++ b/3rdparty/glslang/hlsl/hlslAttributes.cpp @@ -1,11 +1,11 @@ // -//Copyright (C) 2016 LunarG, Inc. +// Copyright (C) 2016 LunarG, Inc. // -//All rights reserved. +// All rights reserved. // -//Redistribution and use in source and binary forms, with or without -//modification, are permitted provided that the following conditions -//are met: +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: // // Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. @@ -19,18 +19,18 @@ // contributors may be used to endorse or promote products derived // from this software without specific prior written permission. // -//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -//"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS -//FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE -//COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, -//INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -//BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -//LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -//CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -//LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN -//ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -//POSSIBILITY OF SUCH DAMAGE. +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +// COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. // #include "hlslAttributes.h" @@ -95,7 +95,7 @@ namespace glslang { if (attr != EatNone) attributes[attr] = value; - + return attr; } @@ -106,5 +106,5 @@ namespace glslang { return (entry == attributes.end()) ? nullptr : entry->second; } - + } // end namespace glslang diff --git a/3rdparty/glslang/hlsl/hlslAttributes.h b/3rdparty/glslang/hlsl/hlslAttributes.h index 312a45642..820909b19 100644 --- a/3rdparty/glslang/hlsl/hlslAttributes.h +++ b/3rdparty/glslang/hlsl/hlslAttributes.h @@ -1,11 +1,11 @@ // -//Copyright (C) 2016 LunarG, Inc. +// Copyright (C) 2016 LunarG, Inc. // -//All rights reserved. +// All rights reserved. // -//Redistribution and use in source and binary forms, with or without -//modification, are permitted provided that the following conditions -//are met: +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: // // Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. @@ -19,18 +19,18 @@ // contributors may be used to endorse or promote products derived // from this software without specific prior written permission. // -//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -//"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS -//FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE -//COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, -//INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -//BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -//LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -//CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -//LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN -//ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -//POSSIBILITY OF SUCH DAMAGE. +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +// COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. // #ifndef HLSLATTRIBUTES_H_ diff --git a/3rdparty/glslang/hlsl/hlslGrammar.cpp b/3rdparty/glslang/hlsl/hlslGrammar.cpp index 6fef8ae5d..6ae7f8002 100755 --- a/3rdparty/glslang/hlsl/hlslGrammar.cpp +++ b/3rdparty/glslang/hlsl/hlslGrammar.cpp @@ -1,12 +1,12 @@ // -//Copyright (C) 2016 Google, Inc. -//Copyright (C) 2016 LunarG, Inc. +// Copyright (C) 2016 Google, Inc. +// Copyright (C) 2016 LunarG, Inc. // -//All rights reserved. +// All rights reserved. // -//Redistribution and use in source and binary forms, with or without -//modification, are permitted provided that the following conditions -//are met: +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: // // Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. @@ -20,18 +20,18 @@ // contributors may be used to endorse or promote products derived // from this software without specific prior written permission. // -//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -//"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS -//FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE -//COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, -//INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -//BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -//LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -//CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -//LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN -//ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -//POSSIBILITY OF SUCH DAMAGE. +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +// COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. // // @@ -89,7 +89,7 @@ bool HlslGrammar::acceptIdentifier(HlslToken& idToken) // they ARE still accepted as identifiers. This is not a dense space: e.g, "void" is not a // valid identifier, nor is "linear". This code special cases the known instances of this, so // e.g, "int sample;" or "float float;" is accepted. Other cases can be added here if needed. - + TString* idString = nullptr; switch (peek()) { case EHTokSample: idString = NewPoolTString("sample"); break; @@ -146,7 +146,7 @@ bool HlslGrammar::acceptCompilationUnit() } // sampler_state -// : LEFT_BRACE [sampler_state_assignment ... ] RIGHT_BRACE +// : LEFT_BRACE [sampler_state_assignment ... ] RIGHT_BRACE // // sampler_state_assignment // : sampler_state_identifier EQUAL value SEMICOLON @@ -171,7 +171,7 @@ bool HlslGrammar::acceptSamplerState() return true; parseContext.warn(token.loc, "unimplemented", "immediate sampler state", ""); - + do { // read state name HlslToken state; @@ -250,7 +250,7 @@ bool HlslGrammar::acceptSamplerDeclarationDX9(TType& /*type*/) { if (! acceptTokenClass(EHTokSampler)) return false; - + // TODO: remove this when DX9 style declarations are implemented. unimplemented("Direct3D 9 sampler declaration"); @@ -269,7 +269,6 @@ bool HlslGrammar::acceptSamplerDeclarationDX9(TType& /*type*/) return false; } - // declaration // : sampler_declaration_dx9 post_decls SEMICOLON // | fully_specified_type declarator_list SEMICOLON @@ -312,7 +311,7 @@ bool HlslGrammar::acceptDeclaration(TIntermNode*& node) // be possible to simultaneously compile D3D10+ style shaders and DX9 shaders. If we want to compile DX9 // HLSL shaders, this will have to be a master level switch // As such, the sampler keyword in D3D10+ turns into an automatic sampler type, and is commonly used - // For that reason, this line is commented out + // For that reason, this line is commented out // if (acceptSamplerDeclarationDX9(declaredType)) // return true; @@ -352,7 +351,7 @@ bool HlslGrammar::acceptDeclaration(TIntermNode*& node) if (declaredType.getQualifier().storage == EvqTemporary && parseContext.symbolTable.atGlobalLevel()) declaredType.getQualifier().storage = EvqUniform; - // We can handle multiple variables per type declaration, so + // We can handle multiple variables per type declaration, so // the number of types can expand when arrayness is different. TType variableType; variableType.shallowCopy(declaredType); @@ -444,7 +443,7 @@ bool HlslGrammar::acceptDeclaration(TIntermNode*& node) expected(";"); return false; } - + return true; } @@ -620,13 +619,13 @@ bool HlslGrammar::acceptQualifier(TQualifier& qualifier) qualifier.storage = EvqIn; if (!parseContext.handleInputGeometry(token.loc, ElgLinesAdjacency)) return false; - break; + break; case EHTokTriangleAdj: qualifier.storage = EvqIn; if (!parseContext.handleInputGeometry(token.loc, ElgTrianglesAdjacency)) return false; - break; - + break; + default: return true; } @@ -813,7 +812,7 @@ bool HlslGrammar::acceptMatrixTemplateType(TType& type) expected(","); return false; } - + // integer cols if (! peekTokenClass(EHTokIntConstant)) { expected("literal integer"); @@ -870,7 +869,7 @@ bool HlslGrammar::acceptStreamOutTemplateType(TType& type, TLayoutGeometry& geom if (! acceptTokenClass(EHTokLeftAngle)) return false; - + if (! acceptType(type)) { expected("stream output type"); return false; @@ -885,7 +884,7 @@ bool HlslGrammar::acceptStreamOutTemplateType(TType& type, TLayoutGeometry& geom return true; } - + // annotations // : LEFT_ANGLE declaration SEMI_COLON ... declaration SEMICOLON RIGHT_ANGLE // @@ -993,7 +992,7 @@ bool HlslGrammar::acceptTextureType(TType& type) case EHTokTexture1darray: dim = Esd1D; array = true; break; case EHTokTexture2d: dim = Esd2D; break; case EHTokTexture2darray: dim = Esd2D; array = true; break; - case EHTokTexture3d: dim = Esd3D; break; + case EHTokTexture3d: dim = Esd3D; break; case EHTokTextureCube: dim = EsdCube; break; case EHTokTextureCubearray: dim = EsdCube; array = true; break; case EHTokTexture2DMS: dim = Esd2D; ms = true; break; @@ -1011,7 +1010,7 @@ bool HlslGrammar::acceptTextureType(TType& type) advanceToken(); // consume the texture object keyword TType txType(EbtFloat, EvqUniform, 4); // default type is float4 - + TIntermTyped* msCount = nullptr; // texture type: required for multisample types and RWBuffer/RWTextures! @@ -1092,14 +1091,13 @@ bool HlslGrammar::acceptTextureType(TType& type) // Remember the declared vector size. sampler.vectorSize = txType.getVectorSize(); - + type.shallowCopy(TType(sampler, EvqUniform, arraySizes)); type.getQualifier().layoutFormat = format; return true; } - // If token is for a type, update 'type' with the type information, // and return true and advance. // Otherwise, return false, and don't advance @@ -1133,7 +1131,7 @@ bool HlslGrammar::acceptType(TType& type) if (! parseContext.handleOutputGeometry(token.loc, geometry)) return false; - + return true; } @@ -1261,7 +1259,6 @@ bool HlslGrammar::acceptType(TType& type) new(&type) TType(EbtUint, EvqTemporary, 4); break; - case EHTokBool: new(&type) TType(EbtBool); break; @@ -1295,7 +1292,7 @@ bool HlslGrammar::acceptType(TType& type) case EHTokHalf4: new(&type) TType(half_bt, EvqTemporary, EpqMedium, 4); break; - + case EHTokMin16float: new(&type) TType(min16float_bt, EvqTemporary, EpqMedium); break; @@ -1312,7 +1309,7 @@ bool HlslGrammar::acceptType(TType& type) case EHTokMin16float4: new(&type) TType(min16float_bt, EvqTemporary, EpqMedium, 4); break; - + case EHTokMin10float: new(&type) TType(min10float_bt, EvqTemporary, EpqMedium); break; @@ -1329,7 +1326,7 @@ bool HlslGrammar::acceptType(TType& type) case EHTokMin10float4: new(&type) TType(min10float_bt, EvqTemporary, EpqMedium, 4); break; - + case EHTokMin16int: new(&type) TType(min16int_bt, EvqTemporary, EpqMedium); break; @@ -1346,7 +1343,7 @@ bool HlslGrammar::acceptType(TType& type) case EHTokMin16int4: new(&type) TType(min16int_bt, EvqTemporary, EpqMedium, 4); break; - + case EHTokMin12int: new(&type) TType(min12int_bt, EvqTemporary, EpqMedium); break; @@ -1363,7 +1360,7 @@ bool HlslGrammar::acceptType(TType& type) case EHTokMin12int4: new(&type) TType(min12int_bt, EvqTemporary, EpqMedium, 4); break; - + case EHTokMin16uint: new(&type) TType(min16uint_bt, EvqTemporary, EpqMedium); break; @@ -1814,7 +1811,6 @@ bool HlslGrammar::acceptFunctionParameters(TFunction& function) return true; } - // default_parameter_declaration // : EQUAL conditional_expression // : EQUAL initializer @@ -1837,9 +1833,9 @@ bool HlslGrammar::acceptDefaultParameterDeclaration(const TType& type, TIntermTy return false; TIntermTyped* arguments = nullptr; - for (int i=0; igetAsAggregate()->getSequence().size()); i++) + for (int i = 0; i < int(node->getAsAggregate()->getSequence().size()); i++) parseContext.handleFunctionArgument(constructor, arguments, node->getAsAggregate()->getSequence()[i]->getAsTyped()); - + node = parseContext.handleFunctionCall(token.loc, constructor, node); } @@ -2243,7 +2239,7 @@ bool HlslGrammar::acceptUnaryExpression(TIntermTyped*& node) // peek for "op unary_expression" TOperator unaryOp = HlslOpMap::preUnary(peek()); - + // postfix_expression (if no unary operator) if (unaryOp == EOpNull) return acceptPostfixExpression(node); @@ -2299,7 +2295,7 @@ bool HlslGrammar::acceptPostfixExpression(TIntermTyped*& node) return false; } } else if (acceptLiteral(node)) { - // literal (nothing else to do yet), go on to the + // literal (nothing else to do yet), go on to the } else if (acceptConstructor(node)) { // constructor (nothing else to do yet) } else if (acceptIdentifier(idToken)) { @@ -2703,7 +2699,7 @@ void HlslGrammar::acceptAttributes(TAttributeMap& attributes) TIntermTyped* node; bool expectingExpression = false; - + while (acceptAssignmentExpression(node)) { expectingExpression = false; expressions->getSequence().push_back(node); @@ -2990,7 +2986,7 @@ bool HlslGrammar::acceptJumpStatement(TIntermNode*& statement) // SEMICOLON if (! acceptTokenClass(EHTokSemicolon)) expected(";"); - + return true; } @@ -3086,7 +3082,7 @@ void HlslGrammar::acceptArraySpecifier(TArraySizes*& arraySizes) void HlslGrammar::acceptPostDecls(TQualifier& qualifier) { do { - // COLON + // COLON if (acceptTokenClass(EHTokColon)) { HlslToken idToken; if (peekTokenClass(EHTokLayout)) diff --git a/3rdparty/glslang/hlsl/hlslGrammar.h b/3rdparty/glslang/hlsl/hlslGrammar.h index 8612c90de..29e4b1763 100755 --- a/3rdparty/glslang/hlsl/hlslGrammar.h +++ b/3rdparty/glslang/hlsl/hlslGrammar.h @@ -1,12 +1,12 @@ // -//Copyright (C) 2016 Google, Inc. -//Copyright (C) 2016 LunarG, Inc. +// Copyright (C) 2016 Google, Inc. +// Copyright (C) 2016 LunarG, Inc. // -//All rights reserved. +// All rights reserved. // -//Redistribution and use in source and binary forms, with or without -//modification, are permitted provided that the following conditions -//are met: +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: // // Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. @@ -20,18 +20,18 @@ // contributors may be used to endorse or promote products derived // from this software without specific prior written permission. // -//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -//"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS -//FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE -//COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, -//INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -//BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -//LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -//CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -//LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN -//ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -//POSSIBILITY OF SUCH DAMAGE. +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +// COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. // #ifndef HLSLGRAMMAR_H_ @@ -44,7 +44,7 @@ namespace glslang { class TAttributeMap; // forward declare - + // Should just be the grammar aspect of HLSL. // Described in more detail in hlslGrammar.cpp. diff --git a/3rdparty/glslang/hlsl/hlslOpMap.cpp b/3rdparty/glslang/hlsl/hlslOpMap.cpp index 524e66a2a..ba56eeb60 100755 --- a/3rdparty/glslang/hlsl/hlslOpMap.cpp +++ b/3rdparty/glslang/hlsl/hlslOpMap.cpp @@ -1,11 +1,11 @@ // -//Copyright (C) 2016 Google, Inc. +// Copyright (C) 2016 Google, Inc. // -//All rights reserved. +// All rights reserved. // -//Redistribution and use in source and binary forms, with or without -//modification, are permitted provided that the following conditions -//are met: +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: // // Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. @@ -19,18 +19,18 @@ // contributors may be used to endorse or promote products derived // from this software without specific prior written permission. // -//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -//"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS -//FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE -//COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, -//INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -//BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -//LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -//CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -//LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN -//ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -//POSSIBILITY OF SUCH DAMAGE. +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +// COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. // // Map from physical token form (e.g. '-') to logical operator @@ -99,7 +99,7 @@ TOperator HlslOpMap::preUnary(EHlslTokenClass op) case EHTokDash: return EOpNegative; case EHTokBang: return EOpLogicalNot; case EHTokTilde: return EOpBitwiseNot; - + case EHTokIncOp: return EOpPreIncrement; case EHTokDecOp: return EOpPreDecrement; @@ -114,7 +114,7 @@ TOperator HlslOpMap::postUnary(EHlslTokenClass op) switch (op) { case EHTokDot: return EOpIndexDirectStruct; case EHTokLeftBracket: return EOpIndexIndirect; - + case EHTokIncOp: return EOpPostIncrement; case EHTokDecOp: return EOpPostDecrement; diff --git a/3rdparty/glslang/hlsl/hlslOpMap.h b/3rdparty/glslang/hlsl/hlslOpMap.h index 924637878..4e783f3f0 100755 --- a/3rdparty/glslang/hlsl/hlslOpMap.h +++ b/3rdparty/glslang/hlsl/hlslOpMap.h @@ -1,11 +1,11 @@ // -//Copyright (C) 2016 Google, Inc. +// Copyright (C) 2016 Google, Inc. // -//All rights reserved. +// All rights reserved. // -//Redistribution and use in source and binary forms, with or without -//modification, are permitted provided that the following conditions -//are met: +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: // // Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. @@ -19,18 +19,18 @@ // contributors may be used to endorse or promote products derived // from this software without specific prior written permission. // -//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -//"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS -//FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE -//COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, -//INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -//BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -//LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -//CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -//LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN -//ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -//POSSIBILITY OF SUCH DAMAGE. +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +// COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. // #ifndef HLSLOPMAP_H_ diff --git a/3rdparty/glslang/hlsl/hlslParseHelper.cpp b/3rdparty/glslang/hlsl/hlslParseHelper.cpp index 613b18a56..fbb91cfc0 100755 --- a/3rdparty/glslang/hlsl/hlslParseHelper.cpp +++ b/3rdparty/glslang/hlsl/hlslParseHelper.cpp @@ -1,12 +1,12 @@ // -//Copyright (C) 2016 Google, Inc. -//Copyright (C) 2016 LunarG, Inc. +// Copyright (C) 2016 Google, Inc. +// Copyright (C) 2016 LunarG, Inc. // -//All rights reserved. +// All rights reserved. // -//Redistribution and use in source and binary forms, with or without -//modification, are permitted provided that the following conditions -//are met: +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: // // Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. @@ -20,18 +20,18 @@ // contributors may be used to endorse or promote products derived // from this software without specific prior written permission. // -//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -//"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS -//FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE -//COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, -//INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -//BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -//LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -//CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -//LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN -//ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -//POSSIBILITY OF SUCH DAMAGE. +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +// COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. // #include "hlslParseHelper.h" @@ -47,6 +47,7 @@ #include #include #include +#include namespace glslang { @@ -57,14 +58,14 @@ HlslParseContext::HlslParseContext(TSymbolTable& symbolTable, TIntermediate& int TParseContextBase(symbolTable, interm, parsingBuiltins, version, profile, spvVersion, language, infoSink, forwardCompatible, messages), contextPragma(true, false), loopNestingLevel(0), annotationNestingLevel(0), structNestingLevel(0), controlFlowNestingLevel(0), + inEntryPoint(false), postEntryPointReturn(false), limits(resources.limits), - inEntryPoint(false), entryPointOutput(nullptr), - nextInLocation(0), nextOutLocation(0), - sourceEntryPointName(sourceEntryPointName), builtInIoIndex(nullptr), - builtInIoBase(nullptr) + builtInIoBase(nullptr), + nextInLocation(0), nextOutLocation(0), + sourceEntryPointName(sourceEntryPointName) { globalUniformDefaults.clear(); globalUniformDefaults.layoutMatrix = ElmRowMajor; @@ -77,7 +78,7 @@ HlslParseContext::HlslParseContext(TSymbolTable& symbolTable, TIntermediate& int globalInputDefaults.clear(); globalOutputDefaults.clear(); - // "Shaders in the transform + // "Shaders in the transform // feedback capturing mode have an initial global default of // layout(xfb_buffer = 0) out;" if (language == EShLangVertex || @@ -147,6 +148,12 @@ bool HlslParseContext::shouldConvertLValue(const TIntermNode* node) const return false; const TIntermAggregate* lhsAsAggregate = node->getAsAggregate(); + const TIntermBinary* lhsAsBinary = node->getAsBinaryNode(); + + // If it's a swizzled/indexed aggregate, look at the left node instead. + if (lhsAsBinary != nullptr && + (lhsAsBinary->getOp() == EOpVectorSwizzle || lhsAsBinary->getOp() == EOpIndexDirect)) + lhsAsAggregate = lhsAsBinary->getLeft()->getAsAggregate(); if (lhsAsAggregate != nullptr && lhsAsAggregate->getOp() == EOpImageLoad) return true; @@ -192,7 +199,7 @@ bool HlslParseContext::lValueErrorCheck(const TSourceLoc& loc, const char* op, T TIntermAggregate* lhsAsAggregate = node->getAsAggregate(); TIntermTyped* object = lhsAsAggregate->getSequence()[0]->getAsTyped(); - + if (!object->getType().getSampler().isImage()) { error(loc, "operator[] on a non-RW texture must be an r-value", "", ""); return true; @@ -210,7 +217,7 @@ bool HlslParseContext::lValueErrorCheck(const TSourceLoc& loc, const char* op, T // series of other image operations. // // Most things are passed through unmodified, except for error checking. -// +// TIntermTyped* HlslParseContext::handleLvalue(const TSourceLoc& loc, const char* op, TIntermTyped* node) { if (node == nullptr) @@ -285,14 +292,59 @@ TIntermTyped* HlslParseContext::handleLvalue(const TSourceLoc& loc, const char* loc); }; + // Return true if swizzle or index writes all components of the given variable. + const auto writesAllComponents = [&](TIntermSymbol* var, TIntermBinary* swizzle) -> bool { + if (swizzle == nullptr) // not a swizzle or index + return true; + + // Track which components are being set. + std::array compIsSet; + compIsSet.fill(false); + + const TIntermConstantUnion* asConst = swizzle->getRight()->getAsConstantUnion(); + const TIntermAggregate* asAggregate = swizzle->getRight()->getAsAggregate(); + + // This could be either a direct index, or a swizzle. + if (asConst) { + compIsSet[asConst->getConstArray()[0].getIConst()] = true; + } else if (asAggregate) { + const TIntermSequence& seq = asAggregate->getSequence(); + for (int comp=0; compgetAsConstantUnion()->getConstArray()[0].getIConst()] = true; + } else { + assert(0); + } + + // Return true if all components are being set by the index or swizzle + return std::all_of(compIsSet.begin(), compIsSet.begin() + var->getType().getVectorSize(), + [](bool isSet) { return isSet; } ); + }; + // helper to create a temporary variable const auto addTmpVar = [&](const char* name, const TType& derefType) -> TIntermSymbol* { TVariable* tmpVar = makeInternalVariable(name, derefType); tmpVar->getWritableType().getQualifier().makeTemporary(); return intermediate.addSymbol(*tmpVar, loc); }; - + + // Create swizzle matching input swizzle + const auto addSwizzle = [&](TIntermSymbol* var, TIntermBinary* swizzle) -> TIntermTyped* { + if (swizzle) + return intermediate.addBinaryNode(swizzle->getOp(), var, swizzle->getRight(), loc, swizzle->getType()); + else + return var; + }; + + TIntermBinary* lhsAsBinary = lhs->getAsBinaryNode(); TIntermAggregate* lhsAsAggregate = lhs->getAsAggregate(); + bool lhsIsSwizzle = false; + + // If it's a swizzled L-value, remember the swizzle, and use the LHS. + if (lhsAsBinary != nullptr && (lhsAsBinary->getOp() == EOpVectorSwizzle || lhsAsBinary->getOp() == EOpIndexDirect)) { + lhsAsAggregate = lhsAsBinary->getLeft()->getAsAggregate(); + lhsIsSwizzle = true; + } + TIntermTyped* object = lhsAsAggregate->getSequence()[0]->getAsTyped(); TIntermTyped* coord = lhsAsAggregate->getSequence()[1]->getAsTyped(); @@ -342,13 +394,23 @@ TIntermTyped* HlslParseContext::handleLvalue(const TSourceLoc& loc, const char* // rhsTmp op= rhs // OpImageStore(object, coordTmp, rhsTmp) // rhsTmp + // + // If the lvalue is swizzled, we apply that when writing the temp variable, like so: + // ... + // rhsTmp.some_swizzle = ... + // For partial writes, an error is generated. TIntermSymbol* rhsTmp = rhs->getAsSymbolNode(); TIntermTyped* coordTmp = coord; - - if (rhsTmp == nullptr || isModifyOp) { + + if (rhsTmp == nullptr || isModifyOp || lhsIsSwizzle) { rhsTmp = addTmpVar("storeTemp", objDerefType); + // Partial updates not yet supported + if (!writesAllComponents(rhsTmp, lhsAsBinary)) { + error(loc, "unimplemented: partial image updates", "", ""); + } + // Assign storeTemp = rhs if (isModifyOp) { // We have to make a temp var for the coordinate, to avoid evaluating it twice. @@ -358,9 +420,9 @@ TIntermTyped* HlslParseContext::handleLvalue(const TSourceLoc& loc, const char* } // rhsTmp op= rhs. - makeBinary(assignOp, intermediate.addSymbol(*rhsTmp), rhs); + makeBinary(assignOp, addSwizzle(intermediate.addSymbol(*rhsTmp), lhsAsBinary), rhs); } - + makeStore(object, coordTmp, rhsTmp); // add a store return finishSequence(rhsTmp, objDerefType); // return rhsTmp from sequence } @@ -384,10 +446,10 @@ TIntermTyped* HlslParseContext::handleLvalue(const TSourceLoc& loc, const char* // rhsTmp op // OpImageStore(object, coordTmp, rhsTmp) // rhsTmp - + TIntermSymbol* rhsTmp = addTmpVar("storeTemp", objDerefType); TIntermTyped* coordTmp = addTmpVar("coordTemp", coord->getType()); - + makeBinary(EOpAssign, coordTmp, coord); // coordtmp = load[param1] makeLoad(rhsTmp, object, coordTmp, objDerefType); // rhsTmp = OpImageLoad(object, coordTmp) makeUnary(assignOp, rhsTmp); // op rhsTmp @@ -417,7 +479,7 @@ TIntermTyped* HlslParseContext::handleLvalue(const TSourceLoc& loc, const char* makeStore(object, coordTmp, rhsTmp2); // OpImageStore(object, coordTmp, rhsTmp2) return finishSequence(rhsTmp1, objDerefType); // return rhsTmp from sequence } - + default: break; } @@ -426,7 +488,7 @@ TIntermTyped* HlslParseContext::handleLvalue(const TSourceLoc& loc, const char* if (lhs) if (lValueErrorCheck(loc, op, lhs)) return nullptr; - + return node; } @@ -734,7 +796,7 @@ TIntermTyped* HlslParseContext::handleDotDereference(const TSourceLoc& loc, TInt // // methods can't be resolved until we later see the function-calling syntax. - // Save away the name in the AST for now. Processing is completed in + // Save away the name in the AST for now. Processing is completed in // handleLengthMethod(), etc. // if (field == "length") { @@ -925,7 +987,7 @@ TType& HlslParseContext::split(TType& type, TString name, const TType* outerStru // We can ignore arrayness: it's uninvolved. if (type.isStruct()) { TTypeList* userStructure = type.getWritableStruct(); - + // Get iterator to (now at end) set of builtin iterstage IO members const auto firstIo = std::stable_partition(userStructure->begin(), userStructure->end(), [](const TTypeLoc& t) {return !t.type->isBuiltInInterstageIO();}); @@ -961,7 +1023,7 @@ TType& HlslParseContext::split(TType& type, TString name, const TType* outerStru // Determine whether we should flatten an arbitrary type. bool HlslParseContext::shouldFlatten(const TType& type) const { - return shouldFlattenIO(type) || shouldFlattenUniform(type); + return shouldFlattenIO(type) || shouldFlattenUniform(type); } // Is this an IO variable that can't be passed down the stack? @@ -996,13 +1058,13 @@ void HlslParseContext::flatten(const TSourceLoc& loc, const TVariable& variable) const TType& type = variable.getType(); // emplace gives back a pair whose .first is an iterator to the item... - auto entry = flattenMap.emplace(variable.getUniqueId(), + auto entry = flattenMap.emplace(variable.getUniqueId(), TFlattenData(type.getQualifier().layoutBinding)); // ... and the item is a map pair, so first->second is the TFlattenData itself. flatten(loc, variable, type, entry.first->second, ""); } - + // Recursively flatten the given variable at the provided type, building the flattenData as we go. // // This is mutually recursive with flattenStruct and flattenArray. @@ -1011,7 +1073,7 @@ void HlslParseContext::flatten(const TSourceLoc& loc, const TVariable& variable) // location in this linear sequence. // // If the tree was N-ary, that can be directly calculated. However, we are dealing with -// arbitrary numbers - peraps a struct of 7 members containing an array of 3. Thus, we must +// arbitrary numbers - perhaps a struct of 7 members containing an array of 3. Thus, we must // build a data structure to allow the sequence of bracket and dot operators on arrays and // structs to arrive at the proper member. // @@ -1047,8 +1109,8 @@ int HlslParseContext::flatten(const TSourceLoc& loc, const TVariable& variable, // Add a single flattened member to the flattened data being tracked for the composite // Returns true for the final flattening level. -int HlslParseContext::addFlattenedMember(const TSourceLoc& loc, - const TVariable& variable, const TType& type, TFlattenData& flattenData, +int HlslParseContext::addFlattenedMember(const TSourceLoc& loc, + const TVariable& variable, const TType& type, TFlattenData& flattenData, const TString& memberName, bool track) { if (isFinalFlattening(type)) { @@ -1079,7 +1141,7 @@ int HlslParseContext::addFlattenedMember(const TSourceLoc& loc, // effecting a transfer of this information to the flattened variable form. // // Assumes shouldFlatten() or equivalent was called first. -int HlslParseContext::flattenStruct(const TSourceLoc& loc, const TVariable& variable, const TType& type, +int HlslParseContext::flattenStruct(const TSourceLoc& loc, const TVariable& variable, const TType& type, TFlattenData& flattenData, TString name) { assert(type.isStruct()); @@ -1109,7 +1171,7 @@ int HlslParseContext::flattenStruct(const TSourceLoc& loc, const TVariable& vari // equivalent set of individual variables. // // Assumes shouldFlatten() or equivalent was called first. -int HlslParseContext::flattenArray(const TSourceLoc& loc, const TVariable& variable, const TType& type, +int HlslParseContext::flattenArray(const TSourceLoc& loc, const TVariable& variable, const TType& type, TFlattenData& flattenData, TString name) { assert(type.isArray()); @@ -1128,7 +1190,7 @@ int HlslParseContext::flattenArray(const TSourceLoc& loc, const TVariable& varia int pos = start; flattenData.offsets.resize(int(pos + size), -1); - for (int element=0; element < size; ++element) { + for (int element=0; element < size; ++element) { char elementNumBuf[20]; // sufficient for MAXINT snprintf(elementNumBuf, sizeof(elementNumBuf)-1, "[%d]", element); const int mpos = addFlattenedMember(loc, variable, dereferencedType, flattenData, @@ -1154,7 +1216,6 @@ bool HlslParseContext::wasSplit(const TIntermTyped* node) const wasSplit(node->getAsSymbolNode()->getId()); } - // Turn an access into an aggregate that was flattened to instead be // an access to the individual variable the member was flattened to. // Assumes shouldFlatten() or equivalent was called first. @@ -1237,7 +1298,6 @@ void HlslParseContext::splitAccessArray(const TSourceLoc& loc, TIntermTyped* bas builtInIoIndex = index; } - // Turn an access into an struct that was split to instead be an // access to either the modified structure, or a direct reference to // one of the split member variables. @@ -1374,7 +1434,6 @@ TFunction& HlslParseContext::handleFunctionDeclarator(const TSourceLoc& loc, TFu return function; } - // Add interstage IO variables to the linkage in canonical order. void HlslParseContext::addInterstageIoToLinkage() { @@ -1392,10 +1451,10 @@ void HlslParseContext::addInterstageIoToLinkage() } // -// Handle seeing the function prototype in front of a function definition in the grammar. +// Handle seeing the function prototype in front of a function definition in the grammar. // The body is handled after this function returns. // -TIntermAggregate* HlslParseContext::handleFunctionDefinition(const TSourceLoc& loc, TFunction& function, +TIntermAggregate* HlslParseContext::handleFunctionDefinition(const TSourceLoc& loc, TFunction& function, const TAttributeMap& attributes) { currentCaller = function.getMangledName(); @@ -1503,7 +1562,7 @@ TIntermAggregate* HlslParseContext::handleFunctionDefinition(const TSourceLoc& l const TIntermAggregate* numThreads = attributes[EatNumThreads]; if (numThreads != nullptr) { const TIntermSequence& sequence = numThreads->getSequence(); - + for (int lid = 0; lid < int(sequence.size()); ++lid) intermediate.setLocalSize(lid, sequence[lid]->getAsConstantUnion()->getConstArray()[0].getIConst()); } @@ -1692,7 +1751,7 @@ TIntermTyped* HlslParseContext::handleAssign(const TSourceLoc& loc, TOperator op // 1. 1 item to copy: Use the RHS directly. // 2. >1 item, simple symbol RHS: we'll create a new TIntermSymbol node for each, but no assign to temp. // 3. >1 item, complex RHS: assign it to a new temp variable, and create a TIntermSymbol for each member. - + if (memberCount <= 1) { // case 1: we'll use the symbol directly below. Nothing to do. } else { @@ -1795,7 +1854,7 @@ TIntermTyped* HlslParseContext::handleAssign(const TSourceLoc& loc, TOperator op // subtree here IFF it does not itself contain any interstage built-in IO variables, so we only have to // recurse into it if there's something for splitting to do. That can save a lot of AST verbosity for // a bunch of memberwise copies. - if (isFinalFlattening(typeL) || (!isFlattenLeft && !isFlattenRight && + if (isFinalFlattening(typeL) || (!isFlattenLeft && !isFlattenRight && !typeL.containsBuiltInInterstageIO() && !typeR.containsBuiltInInterstageIO())) { assignList = intermediate.growAggregate(assignList, intermediate.addAssign(op, subSplitLeft, subSplitRight, loc), loc); } else { @@ -1848,7 +1907,7 @@ TOperator HlslParseContext::mapAtomicOp(const TSourceLoc& loc, TOperator op, boo case EOpInterlockedOr: return isImage ? EOpImageAtomicOr : EOpAtomicOr; case EOpInterlockedXor: return isImage ? EOpImageAtomicXor : EOpAtomicXor; case EOpInterlockedExchange: return isImage ? EOpImageAtomicExchange : EOpAtomicExchange; - case EOpInterlockedCompareStore: // TODO: ... + case EOpInterlockedCompareStore: // TODO: ... default: error(loc, "unknown atomic operation", "unknown op", ""); return EOpNull; @@ -1947,7 +2006,7 @@ void HlslParseContext::decomposeSampleMethods(const TSourceLoc& loc, TIntermType tex->getSequence().push_back(arg0); // sampler tex->getSequence().push_back(constructCoord); // coordinate tex->getSequence().push_back(bias); // bias - + node = clampReturn(tex, sampler); break; @@ -1992,7 +2051,7 @@ void HlslParseContext::decomposeSampleMethods(const TSourceLoc& loc, TIntermType break; } - + case EOpMethodSampleGrad: // ... { TIntermTyped* argTex = argAggregate->getSequence()[0]->getAsTyped(); @@ -2099,7 +2158,7 @@ void HlslParseContext::decomposeSampleMethods(const TSourceLoc& loc, TIntermType } else { indexedOut = sizeQueryReturn; } - + TIntermTyped* outParam = argAggregate->getSequence()[outParamBase + compNum]->getAsTyped(); TIntermTyped* compAssign = intermediate.addAssign(EOpAssign, outParam, indexedOut, loc); @@ -2127,7 +2186,7 @@ void HlslParseContext::decomposeSampleMethods(const TSourceLoc& loc, TIntermType samplesQuery->getSequence().push_back(argTex); samplesQuery->setType(TType(EbtUint, EvqTemporary, 1)); samplesQuery->setLoc(loc); - + TIntermTyped* compAssign = intermediate.addAssign(EOpAssign, outParam, samplesQuery, loc); compoundStatement = intermediate.growAggregate(compoundStatement, compAssign); } @@ -2153,7 +2212,7 @@ void HlslParseContext::decomposeSampleMethods(const TSourceLoc& loc, TIntermType // optional offset value if (argAggregate->getSequence().size() > 4) argOffset = argAggregate->getSequence()[4]->getAsTyped(); - + const int coordDimWithCmpVal = argCoord->getType().getVectorSize() + 1; // +1 for cmp // AST wants comparison value as one of the texture coordinates @@ -2280,12 +2339,12 @@ void HlslParseContext::decomposeSampleMethods(const TSourceLoc& loc, TIntermType TIntermTyped* argLod = argAggregate->getSequence()[3]->getAsTyped(); TIntermTyped* argOffset = nullptr; const TSampler& sampler = argTex->getType().getSampler(); - + const int numArgs = (int)argAggregate->getSequence().size(); if (numArgs == 5) // offset, if present argOffset = argAggregate->getSequence()[4]->getAsTyped(); - + const TOperator textureOp = (argOffset == nullptr ? EOpTextureLod : EOpTextureLodOffset); TIntermAggregate* txsample = new TIntermAggregate(textureOp); @@ -2332,7 +2391,7 @@ void HlslParseContext::decomposeSampleMethods(const TSourceLoc& loc, TIntermType break; } - + case EOpMethodGatherRed: // fall through... case EOpMethodGatherGreen: // ... case EOpMethodGatherBlue: // ... @@ -2516,7 +2575,7 @@ void HlslParseContext::decomposeGeometryMethods(const TSourceLoc& loc, TIntermTy emit->setType(TType(EbtVoid)); sequence = intermediate.growAggregate(sequence, - handleAssign(loc, EOpAssign, + handleAssign(loc, EOpAssign, argAggregate->getSequence()[0]->getAsTyped(), argAggregate->getSequence()[1]->getAsTyped()), loc); @@ -2576,7 +2635,7 @@ void HlslParseContext::decomposeIntrinsic(const TSourceLoc& loc, TIntermTyped*& if (!decomposeHlslIntrinsics || !node || !node->getAsOperator()) return; - + const TIntermAggregate* argAggregate = arguments ? arguments->getAsAggregate() : nullptr; TIntermUnary* fnUnary = node->getAsUnaryNode(); const TOperator op = node->getAsOperator()->getOp(); @@ -2673,7 +2732,7 @@ void HlslParseContext::decomposeIntrinsic(const TSourceLoc& loc, TIntermTyped*& arg0->getType().isVector())); // calculate # of components for comparison const - const int constComponentCount = + const int constComponentCount = std::max(arg0->getType().getVectorSize(), 1) * std::max(arg0->getType().getMatrixCols(), 1) * std::max(arg0->getType().getMatrixRows(), 1); @@ -2689,12 +2748,12 @@ void HlslParseContext::decomposeIntrinsic(const TSourceLoc& loc, TIntermTyped*& TIntermTyped* zero = intermediate.addConstantUnion(0, type0, loc, true); compareNode = handleBinaryMath(loc, "clip", EOpLessThan, arg0, zero); } - + TIntermBranch* killNode = intermediate.addBranch(EOpKill, loc); node = new TIntermSelection(compareNode, killNode, nullptr); node->setLoc(loc); - + break; } @@ -2763,7 +2822,7 @@ void HlslParseContext::decomposeIntrinsic(const TSourceLoc& loc, TIntermTyped*& atomic->setType(arg0->getType()); atomic->getWritableType().getQualifier().makeTemporary(); atomic->setLoc(loc); - + if (isImage) { // orig_value = imageAtomicOp(image, loc, data) imageAtomicParams(atomic, arg0); @@ -2814,7 +2873,7 @@ void HlslParseContext::decomposeIntrinsic(const TSourceLoc& loc, TIntermTyped*& atomic->getSequence().push_back(arg1); atomic->getSequence().push_back(arg2); node = intermediate.addAssign(EOpAssign, arg3, atomic, loc); - + break; } @@ -2840,7 +2899,7 @@ void HlslParseContext::decomposeIntrinsic(const TSourceLoc& loc, TIntermTyped*& intermediate.addConversion(EOpConstructFloat, TType(EbtFloat, EvqTemporary, 2), iU), recip16); - + TIntermAggregate* interp = new TIntermAggregate(EOpInterpolateAtOffset); interp->getSequence().push_back(arg0); interp->getSequence().push_back(floatOffset); @@ -2884,7 +2943,7 @@ void HlslParseContext::decomposeIntrinsic(const TSourceLoc& loc, TIntermTyped*& TIntermTyped* n_dot_h_m = handleBinaryMath(loc, "mul", EOpMul, n_dot_h, m); // n_dot_h * m dst->getSequence().push_back(intermediate.addSelection(compare, zero, n_dot_h_m, loc)); - + // One: dst->getSequence().push_back(intermediate.addConstantUnion(1.0, EbtFloat, loc, true)); @@ -2919,10 +2978,10 @@ void HlslParseContext::decomposeIntrinsic(const TSourceLoc& loc, TIntermTyped*& convert->setLoc(loc); convert->setType(TType(EbtDouble, EvqTemporary)); node = convert; - + break; } - + case EOpF16tof32: case EOpF32tof16: { @@ -3038,7 +3097,7 @@ TIntermTyped* HlslParseContext::handleFunctionCall(const TSourceLoc& loc, TFunct // for decompositions, since we want to operate on the function node, not the aggregate holding // output conversions. - const TIntermTyped* fnNode = result; + const TIntermTyped* fnNode = result; decomposeIntrinsic(loc, result, arguments); // HLSL->AST intrinsic decompositions decomposeSampleMethods(loc, result, arguments); // HLSL->AST sample method decompositions @@ -3069,7 +3128,7 @@ TIntermTyped* HlslParseContext::handleFunctionCall(const TSourceLoc& loc, TFunct } // Finish processing object.length(). This started earlier in handleDotDereference(), where -// the ".length" part was recognized and semantically checked, and finished here where the +// the ".length" part was recognized and semantically checked, and finished here where the // function syntax "()" is recognized. // // Return resulting tree node. @@ -3149,7 +3208,7 @@ void HlslParseContext::addInputArgumentConversions(const TFunction& function, TI // object itself. TVariable* internalAggregate = makeInternalVariable("aggShadow", *function[i].type); internalAggregate->getWritableType().getQualifier().makeTemporary(); - TIntermSymbol* internalSymbolNode = new TIntermSymbol(internalAggregate->getUniqueId(), + TIntermSymbol* internalSymbolNode = new TIntermSymbol(internalAggregate->getUniqueId(), internalAggregate->getName(), internalAggregate->getType()); internalSymbolNode->setLoc(arg->getLoc()); @@ -3441,8 +3500,7 @@ void HlslParseContext::handleSemantic(TSourceLoc loc, TQualifier& qualifier, con // Also, in DX10 if a SV value is present as the input of a stage, but isn't appropriate for that // stage, it would just be ignored as it is likely there as part of an output struct from one stage // to the next - - + bool bParseDX9 = false; if (bParseDX9) { if (semanticUpperCase == "PSIZE") @@ -3457,7 +3515,7 @@ void HlslParseContext::handleSemantic(TSourceLoc loc, TQualifier& qualifier, con qualifier.builtIn = EbvFragCoord; } - //SV Position has a different meaning in vertex vs fragment + // SV Position has a different meaning in vertex vs fragment if (semanticUpperCase == "SV_POSITION" && language != EShLangFragment) qualifier.builtIn = EbvPosition; else if (semanticUpperCase == "SV_POSITION" && language == EShLangFragment) @@ -3473,34 +3531,34 @@ void HlslParseContext::handleSemantic(TSourceLoc loc, TQualifier& qualifier, con else if (semanticUpperCase == "SV_TESSFACTOR") qualifier.builtIn = EbvTessLevelOuter; - //Targets are defined 0-7 + // Targets are defined 0-7 else if (semanticUpperCase == "SV_TARGET") { qualifier.builtIn = EbvNone; - //qualifier.layoutLocation = 0; + // qualifier.layoutLocation = 0; } else if (semanticUpperCase == "SV_TARGET0") { qualifier.builtIn = EbvNone; - //qualifier.layoutLocation = 0; + // qualifier.layoutLocation = 0; } else if (semanticUpperCase == "SV_TARGET1") { qualifier.builtIn = EbvNone; - //qualifier.layoutLocation = 1; + // qualifier.layoutLocation = 1; } else if (semanticUpperCase == "SV_TARGET2") { qualifier.builtIn = EbvNone; - //qualifier.layoutLocation = 2; + // qualifier.layoutLocation = 2; } else if (semanticUpperCase == "SV_TARGET3") { qualifier.builtIn = EbvNone; - //qualifier.layoutLocation = 3; + // qualifier.layoutLocation = 3; } else if (semanticUpperCase == "SV_TARGET4") { qualifier.builtIn = EbvNone; - //qualifier.layoutLocation = 4; + // qualifier.layoutLocation = 4; } else if (semanticUpperCase == "SV_TARGET5") { qualifier.builtIn = EbvNone; - //qualifier.layoutLocation = 5; + // qualifier.layoutLocation = 5; } else if (semanticUpperCase == "SV_TARGET6") { qualifier.builtIn = EbvNone; - //qualifier.layoutLocation = 6; + // qualifier.layoutLocation = 6; } else if (semanticUpperCase == "SV_TARGET7") { qualifier.builtIn = EbvNone; - //qualifier.layoutLocation = 7; + // qualifier.layoutLocation = 7; } else if (semanticUpperCase == "SV_SAMPLEINDEX") qualifier.builtIn = EbvSampleId; else if (semanticUpperCase == "SV_RENDERTARGETARRAYINDEX") @@ -3530,7 +3588,7 @@ void HlslParseContext::handleSemantic(TSourceLoc loc, TQualifier& qualifier, con else if( semanticUpperCase == "SV_COVERAGE") qualifier.builtIn = EbvSampleMask; - //TODO, these need to get refined to be more specific + // TODO, these need to get refined to be more specific else if( semanticUpperCase == "SV_DEPTHGREATEREQUAL") qualifier.builtIn = EbvFragDepthGreater; else if( semanticUpperCase == "SV_DEPTHLESSEQUAL") @@ -3732,7 +3790,6 @@ void HlslParseContext::globalCheck(const TSourceLoc& loc, const char* token) error(loc, "not allowed in nested scope", token, ""); } - bool HlslParseContext::builtInName(const TString& /*identifier*/) { return false; @@ -4418,38 +4475,38 @@ void HlslParseContext::setLayoutQualifier(const TSourceLoc& loc, TQualifier& qua } if (language == EShLangGeometry || language == EShLangTessEvaluation) { if (id == TQualifier::getGeometryString(ElgTriangles)) { - //publicType.shaderQualifiers.geometry = ElgTriangles; + // publicType.shaderQualifiers.geometry = ElgTriangles; warn(loc, "ignored", id.c_str(), ""); return; } if (language == EShLangGeometry) { if (id == TQualifier::getGeometryString(ElgPoints)) { - //publicType.shaderQualifiers.geometry = ElgPoints; + // publicType.shaderQualifiers.geometry = ElgPoints; warn(loc, "ignored", id.c_str(), ""); return; } if (id == TQualifier::getGeometryString(ElgLineStrip)) { - //publicType.shaderQualifiers.geometry = ElgLineStrip; + // publicType.shaderQualifiers.geometry = ElgLineStrip; warn(loc, "ignored", id.c_str(), ""); return; } if (id == TQualifier::getGeometryString(ElgLines)) { - //publicType.shaderQualifiers.geometry = ElgLines; + // publicType.shaderQualifiers.geometry = ElgLines; warn(loc, "ignored", id.c_str(), ""); return; } if (id == TQualifier::getGeometryString(ElgLinesAdjacency)) { - //publicType.shaderQualifiers.geometry = ElgLinesAdjacency; + // publicType.shaderQualifiers.geometry = ElgLinesAdjacency; warn(loc, "ignored", id.c_str(), ""); return; } if (id == TQualifier::getGeometryString(ElgTrianglesAdjacency)) { - //publicType.shaderQualifiers.geometry = ElgTrianglesAdjacency; + // publicType.shaderQualifiers.geometry = ElgTrianglesAdjacency; warn(loc, "ignored", id.c_str(), ""); return; } if (id == TQualifier::getGeometryString(ElgTriangleStrip)) { - //publicType.shaderQualifiers.geometry = ElgTriangleStrip; + // publicType.shaderQualifiers.geometry = ElgTriangleStrip; warn(loc, "ignored", id.c_str(), ""); return; } @@ -4458,53 +4515,53 @@ void HlslParseContext::setLayoutQualifier(const TSourceLoc& loc, TQualifier& qua // input primitive if (id == TQualifier::getGeometryString(ElgTriangles)) { - //publicType.shaderQualifiers.geometry = ElgTriangles; + // publicType.shaderQualifiers.geometry = ElgTriangles; warn(loc, "ignored", id.c_str(), ""); return; } if (id == TQualifier::getGeometryString(ElgQuads)) { - //publicType.shaderQualifiers.geometry = ElgQuads; + // publicType.shaderQualifiers.geometry = ElgQuads; warn(loc, "ignored", id.c_str(), ""); return; } if (id == TQualifier::getGeometryString(ElgIsolines)) { - //publicType.shaderQualifiers.geometry = ElgIsolines; + // publicType.shaderQualifiers.geometry = ElgIsolines; warn(loc, "ignored", id.c_str(), ""); return; } // vertex spacing if (id == TQualifier::getVertexSpacingString(EvsEqual)) { - //publicType.shaderQualifiers.spacing = EvsEqual; + // publicType.shaderQualifiers.spacing = EvsEqual; warn(loc, "ignored", id.c_str(), ""); return; } if (id == TQualifier::getVertexSpacingString(EvsFractionalEven)) { - //publicType.shaderQualifiers.spacing = EvsFractionalEven; + // publicType.shaderQualifiers.spacing = EvsFractionalEven; warn(loc, "ignored", id.c_str(), ""); return; } if (id == TQualifier::getVertexSpacingString(EvsFractionalOdd)) { - //publicType.shaderQualifiers.spacing = EvsFractionalOdd; + // publicType.shaderQualifiers.spacing = EvsFractionalOdd; warn(loc, "ignored", id.c_str(), ""); return; } // triangle order if (id == TQualifier::getVertexOrderString(EvoCw)) { - //publicType.shaderQualifiers.order = EvoCw; + // publicType.shaderQualifiers.order = EvoCw; warn(loc, "ignored", id.c_str(), ""); return; } if (id == TQualifier::getVertexOrderString(EvoCcw)) { - //publicType.shaderQualifiers.order = EvoCcw; + // publicType.shaderQualifiers.order = EvoCcw; warn(loc, "ignored", id.c_str(), ""); return; } // point mode if (id == "point_mode") { - //publicType.shaderQualifiers.pointMode = true; + // publicType.shaderQualifiers.pointMode = true; warn(loc, "ignored", id.c_str(), ""); return; } @@ -4512,23 +4569,23 @@ void HlslParseContext::setLayoutQualifier(const TSourceLoc& loc, TQualifier& qua } if (language == EShLangFragment) { if (id == "origin_upper_left") { - //publicType.shaderQualifiers.originUpperLeft = true; + // publicType.shaderQualifiers.originUpperLeft = true; warn(loc, "ignored", id.c_str(), ""); return; } if (id == "pixel_center_integer") { - //publicType.shaderQualifiers.pixelCenterInteger = true; + // publicType.shaderQualifiers.pixelCenterInteger = true; warn(loc, "ignored", id.c_str(), ""); return; } if (id == "early_fragment_tests") { - //publicType.shaderQualifiers.earlyFragmentTests = true; + // publicType.shaderQualifiers.earlyFragmentTests = true; warn(loc, "ignored", id.c_str(), ""); return; } for (TLayoutDepth depth = (TLayoutDepth)(EldNone + 1); depth < EldCount; depth = (TLayoutDepth)(depth + 1)) { if (id == TQualifier::getLayoutDepthString(depth)) { - //publicType.shaderQualifiers.layoutDepth = depth; + // publicType.shaderQualifiers.layoutDepth = depth; warn(loc, "ignored", id.c_str(), ""); return; } @@ -4539,7 +4596,7 @@ void HlslParseContext::setLayoutQualifier(const TSourceLoc& loc, TQualifier& qua if (id == TQualifier::getBlendEquationString(be)) { requireExtensions(loc, 1, &E_GL_KHR_blend_equation_advanced, "blend equation"); intermediate.addBlendEquation(be); - //publicType.shaderQualifiers.blendEquation = true; + // publicType.shaderQualifiers.blendEquation = true; warn(loc, "ignored", id.c_str(), ""); found = true; break; @@ -4558,7 +4615,7 @@ void HlslParseContext::setLayoutQualifier(const TSourceLoc& loc, TQualifier& qua void HlslParseContext::setLayoutQualifier(const TSourceLoc& loc, TQualifier& qualifier, TString& id, const TIntermTyped* node) { const char* feature = "layout-id value"; - //const char* nonLiteralFeature = "non-literal layout-id value"; + // const char* nonLiteralFeature = "non-literal layout-id value"; integerCheck(node, feature); const TIntermConstantUnion* constUnion = node->getAsConstantUnion(); @@ -4604,9 +4661,9 @@ void HlslParseContext::setLayoutQualifier(const TSourceLoc& loc, TQualifier& qua qualifier.layoutComponent = value; return; } else if (id.compare(0, 4, "xfb_") == 0) { - // "Any shader making any static use (after preprocessing) of any of these - // *xfb_* qualifiers will cause the shader to be in a transform feedback - // capturing mode and hence responsible for describing the transform feedback + // "Any shader making any static use (after preprocessing) of any of these + // *xfb_* qualifiers will cause the shader to be in a transform feedback + // capturing mode and hence responsible for describing the transform feedback // setup." intermediate.setXfbMode(); if (id == "xfb_buffer") { @@ -4626,7 +4683,7 @@ void HlslParseContext::setLayoutQualifier(const TSourceLoc& loc, TQualifier& qua qualifier.layoutXfbOffset = value; return; } else if (id == "xfb_stride") { - // "The resulting stride (implicit or explicit), when divided by 4, must be less than or equal to the + // "The resulting stride (implicit or explicit), when divided by 4, must be less than or equal to the // implementation-dependent constant gl_MaxTransformFeedbackInterleavedComponents." if (value > 4 * resources.maxTransformFeedbackInterleavedComponents) error(loc, "1/4 stride is too large:", id.c_str(), "gl_MaxTransformFeedbackInterleavedComponents is %d", resources.maxTransformFeedbackInterleavedComponents); @@ -4668,7 +4725,7 @@ void HlslParseContext::setLayoutQualifier(const TSourceLoc& loc, TQualifier& qua if (value == 0) error(loc, "must be greater than 0", "vertices", ""); else - //publicType.shaderQualifiers.vertices = value; + // publicType.shaderQualifiers.vertices = value; warn(loc, "ignored", id.c_str(), ""); return; } @@ -4682,12 +4739,12 @@ void HlslParseContext::setLayoutQualifier(const TSourceLoc& loc, TQualifier& qua if (value == 0) error(loc, "must be at least 1", "invocations", ""); else - //publicType.shaderQualifiers.invocations = value; + // publicType.shaderQualifiers.invocations = value; warn(loc, "ignored", id.c_str(), ""); return; } if (id == "max_vertices") { - //publicType.shaderQualifiers.vertices = value; + // publicType.shaderQualifiers.vertices = value; warn(loc, "ignored", id.c_str(), ""); if (value > resources.maxGeometryOutputVertices) error(loc, "too large, must be less than gl_MaxGeometryOutputVertices", "max_vertices", ""); @@ -4709,33 +4766,33 @@ void HlslParseContext::setLayoutQualifier(const TSourceLoc& loc, TQualifier& qua case EShLangCompute: if (id.compare(0, 11, "local_size_") == 0) { if (id == "local_size_x") { - //publicType.shaderQualifiers.localSize[0] = value; + // publicType.shaderQualifiers.localSize[0] = value; warn(loc, "ignored", id.c_str(), ""); return; } if (id == "local_size_y") { - //publicType.shaderQualifiers.localSize[1] = value; + // publicType.shaderQualifiers.localSize[1] = value; warn(loc, "ignored", id.c_str(), ""); return; } if (id == "local_size_z") { - //publicType.shaderQualifiers.localSize[2] = value; + // publicType.shaderQualifiers.localSize[2] = value; warn(loc, "ignored", id.c_str(), ""); return; } if (spvVersion.spv != 0) { if (id == "local_size_x_id") { - //publicType.shaderQualifiers.localSizeSpecId[0] = value; + // publicType.shaderQualifiers.localSizeSpecId[0] = value; warn(loc, "ignored", id.c_str(), ""); return; } if (id == "local_size_y_id") { - //publicType.shaderQualifiers.localSizeSpecId[1] = value; + // publicType.shaderQualifiers.localSizeSpecId[1] = value; warn(loc, "ignored", id.c_str(), ""); return; } if (id == "local_size_z_id") { - //publicType.shaderQualifiers.localSizeSpecId[2] = value; + // publicType.shaderQualifiers.localSizeSpecId[2] = value; warn(loc, "ignored", id.c_str(), ""); return; } @@ -4753,17 +4810,17 @@ void HlslParseContext::setLayoutQualifier(const TSourceLoc& loc, TQualifier& qua // Merge any layout qualifier information from src into dst, leaving everything else in dst alone // // "More than one layout qualifier may appear in a single declaration. -// Additionally, the same layout-qualifier-name can occur multiple times -// within a layout qualifier or across multiple layout qualifiers in the -// same declaration. When the same layout-qualifier-name occurs -// multiple times, in a single declaration, the last occurrence overrides -// the former occurrence(s). Further, if such a layout-qualifier-name -// will effect subsequent declarations or other observable behavior, it -// is only the last occurrence that will have any effect, behaving as if -// the earlier occurrence(s) within the declaration are not present. -// This is also true for overriding layout-qualifier-names, where one -// overrides the other (e.g., row_major vs. column_major); only the last -// occurrence has any effect." +// Additionally, the same layout-qualifier-name can occur multiple times +// within a layout qualifier or across multiple layout qualifiers in the +// same declaration. When the same layout-qualifier-name occurs +// multiple times, in a single declaration, the last occurrence overrides +// the former occurrence(s). Further, if such a layout-qualifier-name +// will effect subsequent declarations or other observable behavior, it +// is only the last occurrence that will have any effect, behaving as if +// the earlier occurrence(s) within the declaration are not present. +// This is also true for overriding layout-qualifier-names, where one +// overrides the other (e.g., row_major vs. column_major); only the last +// occurrence has any effect." // void HlslParseContext::mergeObjectLayoutQualifiers(TQualifier& dst, const TQualifier& src, bool inheritOnly) { @@ -4818,7 +4875,7 @@ void HlslParseContext::mergeObjectLayoutQualifiers(TQualifier& dst, const TQuali // Look up a function name in the symbol table, and make sure it is a function. // // First, look for an exact match. If there is none, use the generic selector -// TParseContextBase::selectFunction() to find one, parameterized by the +// TParseContextBase::selectFunction() to find one, parameterized by the // convertible() and better() predicates defined below. // // Return the function symbol if found, otherwise nullptr. @@ -4843,7 +4900,7 @@ const TFunction* HlslParseContext::findFunction(const TSourceLoc& loc, TFunction // create list of candidates to send TVector candidateList; symbolTable.findFunctionNameList(call.getMangledName(), candidateList, builtIn); - + // These builtin ops can accept any type, so we bypass the argument selection if (candidateList.size() == 1 && builtIn && (candidateList[0]->getBuiltInOp() == EOpMethodAppend || @@ -4860,7 +4917,7 @@ const TFunction* HlslParseContext::findFunction(const TSourceLoc& loc, TFunction return true; // no aggregate conversions - if (from.isArray() || to.isArray() || + if (from.isArray() || to.isArray() || from.isStruct() || to.isStruct()) return false; @@ -4877,7 +4934,7 @@ const TFunction* HlslParseContext::findFunction(const TSourceLoc& loc, TFunction // We do not promote the texture or image type for these ocodes. Normally that would not // be an issue because it's a buffer, but we haven't decomposed the opcode yet, and at this // stage it's merely e.g, a basic integer type. - // + // // Instead, we want to promote other arguments, but stay within the same family. In other // words, InterlockedAdd(RWBuffer, ...) will always use the int flavor, never the uint flavor, // but it is allowed to promote its other arguments. @@ -4968,7 +5025,7 @@ const TFunction* HlslParseContext::findFunction(const TSourceLoc& loc, TFunction // for ambiguity reporting bool tie = false; - + // send to the generic selector const TFunction* bestMatch = selectFunction(candidateList, call, convertible, better, tie); @@ -5069,7 +5126,7 @@ const TFunction* HlslParseContext::findFunction(const TSourceLoc& loc, TFunction // // Do everything necessary to handle a typedef declaration, for a single symbol. -// +// // 'parseType' is the type part of the declaration (to the left) // 'arraySizes' is the arrayness tagged on the identifier (to the right) // @@ -5256,8 +5313,16 @@ TIntermNode* HlslParseContext::executeInitializer(const TSourceLoc& loc, TInterm // constructor-style subtree, allowing the rest of the code to operate // identically for both kinds of initializers. // + // + // Type can't be deduced from the initializer list, so a skeletal type to + // follow has to be passed in. Constness and specialization-constness + // should be deduced bottom up, not dictated by the skeletal type. + // + TType skeletalType; + skeletalType.shallowCopy(variable->getType()); + skeletalType.getQualifier().makeTemporary(); if (initializer->getAsAggregate() && initializer->getAsAggregate()->getOp() == EOpNull) - initializer = convertInitializerList(loc, variable->getType(), initializer); + initializer = convertInitializerList(loc, skeletalType, initializer); if (! initializer) { // error recovery; don't leave const without constant values if (qualifier == EvqConst) @@ -5693,7 +5758,7 @@ void HlslParseContext::declareBlock(const TSourceLoc& loc, TType& type, const TS // This might be a redeclaration of a built-in block. If so, redeclareBuiltinBlock() will // do all the rest. - //if (! symbolTable.atBuiltInLevel() && builtInName(*blockName)) { + // if (! symbolTable.atBuiltInLevel() && builtInName(*blockName)) { // redeclareBuiltinBlock(loc, typeList, *blockName, instanceName, arraySizes); // return; //} @@ -5728,9 +5793,9 @@ void HlslParseContext::declareBlock(const TSourceLoc& loc, TType& type, const TS error(memberLoc, "member cannot contradict block", "stream", ""); } - // "This includes a block's inheritance of the - // current global default buffer, a block member's inheritance of the block's - // buffer, and the requirement that any *xfb_buffer* declared on a block + // "This includes a block's inheritance of the + // current global default buffer, a block member's inheritance of the block's + // buffer, and the requirement that any *xfb_buffer* declared on a block // member must match the buffer inherited from the block." if (memberQualifier.hasXfbBuffer()) { if (defaultQualification.layoutXfbBuffer != memberQualifier.layoutXfbBuffer) @@ -5807,15 +5872,15 @@ void HlslParseContext::finalizeGlobalUniformBlockLayout(TVariable& block) } // -// "For a block, this process applies to the entire block, or until the first member -// is reached that has a location layout qualifier. When a block member is declared with a location +// "For a block, this process applies to the entire block, or until the first member +// is reached that has a location layout qualifier. When a block member is declared with a location // qualifier, its location comes from that qualifier: The member's location qualifier overrides the block-level -// declaration. Subsequent members are again assigned consecutive locations, based on the newest location, -// until the next member declared with a location qualifier. The values used for locations do not have to be +// declaration. Subsequent members are again assigned consecutive locations, based on the newest location, +// until the next member declared with a location qualifier. The values used for locations do not have to be // declared in increasing order." void HlslParseContext::fixBlockLocations(const TSourceLoc& loc, TQualifier& qualifier, TTypeList& typeList, bool memberWithLocation, bool memberWithoutLocation) { - // "If a block has no block-level location layout qualifier, it is required that either all or none of its members + // "If a block has no block-level location layout qualifier, it is required that either all or none of its members // have a location layout qualifier, or a compile-time error results." if (! qualifier.hasLocation() && memberWithLocation && memberWithoutLocation) error(loc, "either the block needs a location, or all members need a location, or no members have a location", "location", ""); @@ -5851,9 +5916,9 @@ void HlslParseContext::fixBlockLocations(const TSourceLoc& loc, TQualifier& qual void HlslParseContext::fixBlockXfbOffsets(TQualifier& qualifier, TTypeList& typeList) { - // "If a block is qualified with xfb_offset, all its - // members are assigned transform feedback buffer offsets. If a block is not qualified with xfb_offset, any - // members of that block not qualified with an xfb_offset will not be assigned transform feedback buffer + // "If a block is qualified with xfb_offset, all its + // members are assigned transform feedback buffer offsets. If a block is not qualified with xfb_offset, any + // members of that block not qualified with an xfb_offset will not be assigned transform feedback buffer // offsets." if (! qualifier.hasXfbBuffer() || ! qualifier.hasXfbOffset()) @@ -5880,10 +5945,10 @@ void HlslParseContext::fixBlockXfbOffsets(TQualifier& qualifier, TTypeList& type qualifier.layoutXfbOffset = TQualifier::layoutXfbOffsetEnd; } -// Calculate and save the offset of each block member, using the recursively +// Calculate and save the offset of each block member, using the recursively // defined block offset rules and the user-provided offset and align. // -// Also, compute and save the total size of the block. For the block's size, arrayness +// Also, compute and save the total size of the block. For the block's size, arrayness // is not taken into account, as each element is backed by a separate buffer. // void HlslParseContext::fixBlockUniformOffsets(const TQualifier& qualifier, TTypeList& typeList) @@ -5909,25 +5974,25 @@ void HlslParseContext::fixBlockUniformOffsets(const TQualifier& qualifier, TType subMatrixLayout != ElmNone ? subMatrixLayout == ElmRowMajor : qualifier.layoutMatrix == ElmRowMajor); if (memberQualifier.hasOffset()) { - // "The specified offset must be a multiple + // "The specified offset must be a multiple // of the base alignment of the type of the block member it qualifies, or a compile-time error results." if (! IsMultipleOfPow2(memberQualifier.layoutOffset, memberAlignment)) error(memberLoc, "must be a multiple of the member's alignment", "offset", ""); - // "The offset qualifier forces the qualified member to start at or after the specified - // integral-constant expression, which will be its byte offset from the beginning of the buffer. - // "The actual offset of a member is computed as + // "The offset qualifier forces the qualified member to start at or after the specified + // integral-constant expression, which will be its byte offset from the beginning of the buffer. + // "The actual offset of a member is computed as // follows: If offset was declared, start with that offset, otherwise start with the next available offset." offset = std::max(offset, memberQualifier.layoutOffset); } - // "The actual alignment of a member will be the greater of the specified align alignment and the standard + // "The actual alignment of a member will be the greater of the specified align alignment and the standard // (e.g., std140) base alignment for the member's type." if (memberQualifier.hasAlign()) memberAlignment = std::max(memberAlignment, memberQualifier.layoutAlign); // "If the resulting offset is not a multiple of the actual alignment, - // increase it to the first offset that is a multiple of + // increase it to the first offset that is a multiple of // the actual alignment." RoundToPow2(offset, memberAlignment); typeList[member].type->getQualifier().layoutOffset = offset; @@ -6218,5 +6283,4 @@ void HlslParseContext::finish() TParseContextBase::finish(); } - } // end namespace glslang diff --git a/3rdparty/glslang/hlsl/hlslParseHelper.h b/3rdparty/glslang/hlsl/hlslParseHelper.h index 47ea5aa8f..d56bd4260 100755 --- a/3rdparty/glslang/hlsl/hlslParseHelper.h +++ b/3rdparty/glslang/hlsl/hlslParseHelper.h @@ -1,12 +1,12 @@ // -//Copyright (C) 2016 Google, Inc. -//Copyright (C) 2016 LunarG, Inc. +// Copyright (C) 2016 Google, Inc. +// Copyright (C) 2016 LunarG, Inc. // -//All rights reserved. +// All rights reserved. // -//Redistribution and use in source and binary forms, with or without -//modification, are permitted provided that the following conditions -//are met: +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: // // Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. @@ -20,18 +20,18 @@ // contributors may be used to endorse or promote products derived // from this software without specific prior written permission. // -//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -//"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS -//FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE -//COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, -//INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -//BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -//LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -//CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -//LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN -//ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -//POSSIBILITY OF SUCH DAMAGE. +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +// COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. // #ifndef HLSL_PARSE_INCLUDED_ #define HLSL_PARSE_INCLUDED_ @@ -231,7 +231,7 @@ protected: // Type sanitization: return existing sanitized (temporary) type if there is one, else make new one. TType* sanitizeType(TType*); - void finish(); // post-processing + void finish() override; // post-processing // Current state of parsing struct TPragma contextPragma; @@ -286,7 +286,7 @@ protected: // * note, that appropriately gives an error if redeclaring a block that // was already used and hence already copied-up // - // - on seeing a layout declaration that sizes the array, fix everything in the + // - on seeing a layout declaration that sizes the array, fix everything in the // resize-list, giving errors for mismatch // // - on seeing an array size declaration, give errors on mismatch between it and previous diff --git a/3rdparty/glslang/hlsl/hlslParseables.cpp b/3rdparty/glslang/hlsl/hlslParseables.cpp index 8c8b43df4..442f3b175 100755 --- a/3rdparty/glslang/hlsl/hlslParseables.cpp +++ b/3rdparty/glslang/hlsl/hlslParseables.cpp @@ -1,11 +1,11 @@ // -//Copyright (C) 2016 LunarG, Inc. +// Copyright (C) 2016 LunarG, Inc. // -//All rights reserved. +// All rights reserved. // -//Redistribution and use in source and binary forms, with or without -//modification, are permitted provided that the following conditions -//are met: +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: // // Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. @@ -19,22 +19,22 @@ // contributors may be used to endorse or promote products derived // from this software without specific prior written permission. // -//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -//"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS -//FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE -//COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, -//INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -//BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -//LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -//CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -//LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN -//ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -//POSSIBILITY OF SUCH DAMAGE. +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +// COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. // // -// Create strings that declare built-in definitions, add built-ins programmatically +// Create strings that declare built-in definitions, add built-ins programmatically // that cannot be expressed in the strings, and establish mappings between // built-in functions and operators. // @@ -102,14 +102,14 @@ bool IsIllegalSample(const glslang::TString& name, const char* argOrder, int dim return true; } - const bool isGather = - (name == "Gather" || + const bool isGather = + (name == "Gather" || name == "GatherRed" || - name == "GatherGreen" || + name == "GatherGreen" || name == "GatherBlue" || name == "GatherAlpha"); - const bool isGatherCmp = + const bool isGatherCmp = (name == "GatherCmpRed" || name == "GatherCmpGreen" || name == "GatherCmpBlue" || @@ -174,7 +174,7 @@ const char* IoParam(glslang::TString& s, const char* nthArgOrder) } else if (*nthArgOrder == '<') { // input params ++nthArgOrder; s.append("in "); - } + } return nthArgOrder; } @@ -195,9 +195,8 @@ inline bool IsEndOfArg(const char* arg) return arg == nullptr || *arg == '\0' || *arg == ','; } - // If this is a fixed vector size, such as V3, return the size. Else return 0. -int FixedVecSize(const char* arg) +int FixedVecSize(const char* arg) { while (!IsEndOfArg(arg)) { if (isdigit(*arg)) @@ -208,7 +207,6 @@ int FixedVecSize(const char* arg) return 0; // none found. } - // Create and return a type name. This is done in GLSL, not HLSL conventions, until such // time as builtins are parsed using the HLSL parser. // @@ -229,7 +227,7 @@ glslang::TString& AppendTypeName(glslang::TString& s, const char* argOrder, cons char type = *argType; if (isTranspose) { // Take transpose of matrix dimensions - std::swap(dim0, dim1); + std::swap(dim0, dim1); } else if (isTexture) { if (type == 'F') // map base type to texture of that type. type = 'T'; // e.g, int -> itexture, uint -> utexture, etc. @@ -255,10 +253,10 @@ glslang::TString& AppendTypeName(glslang::TString& s, const char* argOrder, cons case 'S': s += "sampler"; break; case 's': s += "SamplerComparisonState"; break; case 'T': s += ((isBuffer && isImage) ? "RWBuffer" : - isBuffer ? "Buffer" : + isBuffer ? "Buffer" : isImage ? "RWTexture" : "Texture"); break; case 'i': s += ((isBuffer && isImage) ? "RWBuffer" : - isBuffer ? "Buffer" : + isBuffer ? "Buffer" : isImage ? "RWTexture" : "Texture"); break; case 'u': s += ((isBuffer && isImage) ? "RWBuffer" : isBuffer ? "Buffer" : @@ -322,7 +320,7 @@ glslang::TString& AppendTypeName(glslang::TString& s, const char* argOrder, cons case 'V': s += ('0' + char(dim0)); break; - case 'M': + case 'M': s += ('0' + char(dim0)); s += 'x'; s += ('0' + char(dim1)); @@ -389,7 +387,6 @@ inline bool IsValid(const char* cname, char retOrder, char retType, char argOrde return true; } - // return position of end of argument specifier inline const char* FindEndOfArg(const char* arg) { @@ -424,7 +421,7 @@ inline void FindVectorMatrixBounds(const char* argOrder, int fixedVecSize, int& if (fixedVecSize > 0) // handle fixed sized vectors dim0Min = dim0Max = fixedVecSize; } - + } // end anonymous namespace namespace glslang { @@ -433,7 +430,6 @@ TBuiltInParseablesHlsl::TBuiltInParseablesHlsl() { } - // // Handle creation of mat*mat specially, since it doesn't fall conveniently out of // the generic prototype creation code below. @@ -476,7 +472,6 @@ void TBuiltInParseablesHlsl::createMatTimesMat() s.append(");\n"); // close paren - // Create V*M AppendTypeName(s, "V", "F", xCols, 1); // add return type s.append(" "); // space between type and name @@ -508,7 +503,7 @@ void TBuiltInParseablesHlsl::initialize(int /*version*/, EProfile /*profile*/, c // needed for furture validation. For now, they are commented out, and set below // to EShLangAll, to allow any intrinsic to be used in any shader, which is legal // if it is not called. - // + // // static const EShLanguageMask EShLangPSCS = EShLanguageMask(EShLangFragmentMask | EShLangComputeMask); // static const EShLanguageMask EShLangVSPSGS = EShLanguageMask(EShLangVertexMask | EShLangFragmentMask | EShLangGeometryMask); // static const EShLanguageMask EShLangCS = EShLangComputeMask; @@ -745,7 +740,7 @@ void TBuiltInParseablesHlsl::initialize(int /*version*/, EProfile /*profile*/, c { "GetSamplePosition", "V2", "F", "$&2,S", "FUI,I", EShLangVSPSGS }, - // + // // UINT Width // UINT MipLevel, UINT Width, UINT NumberOfLevels { "GetDimensions", /* 1D */ "-", "-", "%!~1,>S", "FUI,U", EShLangAll }, @@ -947,7 +942,7 @@ void TBuiltInParseablesHlsl::initialize(int /*version*/, EProfile /*profile*/, c AppendTypeName(s, nthArgOrder, nthArgType, argDim0, dim1); // Add arguments } - + s.append(");\n"); // close paren and trailing semicolon } // dim 1 loop } // dim 0 loop @@ -956,10 +951,10 @@ void TBuiltInParseablesHlsl::initialize(int /*version*/, EProfile /*profile*/, c // skip over special characters if (isTexture && isalpha(argOrder[1])) ++argOrder; - if (isdigit(argOrder[1])) + if (isdigit(argOrder[1])) ++argOrder; } // arg order loop - + if (intrinsic.stage == EShLangAll) // common builtins are only added once. break; } @@ -988,7 +983,6 @@ void TBuiltInParseablesHlsl::initialize(const TBuiltInResource& /*resources*/, i { } - // // Finish adding/processing context-independent built-in symbols. // 1) Programmatically add symbols that could not be added by simple text strings above. @@ -1167,7 +1161,7 @@ void TBuiltInParseablesHlsl::identifyBuiltIns(int /*version*/, EProfile /*profil // // Add context-dependent (resource-specific) built-ins not handled by the above. These -// would be ones that need to be programmatically added because they cannot +// would be ones that need to be programmatically added because they cannot // be added by simple text strings. For these, also // 1) Map built-in functions to operators, for those that will turn into an operation node // instead of remaining a function call. @@ -1179,5 +1173,4 @@ void TBuiltInParseablesHlsl::identifyBuiltIns(int /*version*/, EProfile /*profil { } - } // end namespace glslang diff --git a/3rdparty/glslang/hlsl/hlslParseables.h b/3rdparty/glslang/hlsl/hlslParseables.h index c83759003..28f424b31 100755 --- a/3rdparty/glslang/hlsl/hlslParseables.h +++ b/3rdparty/glslang/hlsl/hlslParseables.h @@ -1,11 +1,11 @@ // -//Copyright (C) 2016 LunarG, Inc. +// Copyright (C) 2016 LunarG, Inc. // -//All rights reserved. +// All rights reserved. // -//Redistribution and use in source and binary forms, with or without -//modification, are permitted provided that the following conditions -//are met: +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: // // Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. @@ -19,18 +19,18 @@ // contributors may be used to endorse or promote products derived // from this software without specific prior written permission. // -//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -//"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS -//FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE -//COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, -//INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -//BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -//LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -//CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -//LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN -//ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -//POSSIBILITY OF SUCH DAMAGE. +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +// COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. // #ifndef _HLSLPARSEABLES_INCLUDED_ @@ -52,7 +52,7 @@ public: void initialize(const TBuiltInResource& resources, int version, EProfile, const SpvVersion& spvVersion, EShLanguage); void identifyBuiltIns(int version, EProfile profile, const SpvVersion& spvVersion, EShLanguage language, TSymbolTable& symbolTable); - + void identifyBuiltIns(int version, EProfile profile, const SpvVersion& spvVersion, EShLanguage language, TSymbolTable& symbolTable, const TBuiltInResource &resources); private: diff --git a/3rdparty/glslang/hlsl/hlslScanContext.cpp b/3rdparty/glslang/hlsl/hlslScanContext.cpp index 5fa1a1bcf..69c1e37f8 100755 --- a/3rdparty/glslang/hlsl/hlslScanContext.cpp +++ b/3rdparty/glslang/hlsl/hlslScanContext.cpp @@ -1,12 +1,12 @@ // -//Copyright (C) 2016 Google, Inc. -//Copyright (C) 2016 LunarG, Inc. +// Copyright (C) 2016 Google, Inc. +// Copyright (C) 2016 LunarG, Inc. // -//All rights reserved. +// All rights reserved. // -//Redistribution and use in source and binary forms, with or without -//modification, are permitted provided that the following conditions -//are met: +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: // // Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. @@ -20,18 +20,18 @@ // contributors may be used to endorse or promote products derived // from this software without specific prior written permission. // -//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -//"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS -//FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE -//COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, -//INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -//BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -//LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -//CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -//LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN -//ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -//POSSIBILITY OF SUCH DAMAGE. +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +// COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. // // @@ -52,7 +52,7 @@ // preprocessor includes #include "../glslang/MachineIndependent/preprocessor/PpContext.h" #include "../glslang/MachineIndependent/preprocessor/PpTokens.h" - + namespace { struct str_eq @@ -142,7 +142,7 @@ void HlslScanContext::fillInKeywordMap() (*KeywordMap)["half"] = EHTokHalf; (*KeywordMap)["float"] = EHTokFloat; (*KeywordMap)["double"] = EHTokDouble; - (*KeywordMap)["min16float"] = EHTokMin16float; + (*KeywordMap)["min16float"] = EHTokMin16float; (*KeywordMap)["min10float"] = EHTokMin10float; (*KeywordMap)["min16int"] = EHTokMin16int; (*KeywordMap)["min12int"] = EHTokMin12int; @@ -316,7 +316,6 @@ void HlslScanContext::fillInKeywordMap() (*KeywordMap)["RWTexture3D"] = EHTokRWTexture3d; (*KeywordMap)["RWBuffer"] = EHTokRWBuffer; - (*KeywordMap)["struct"] = EHTokStruct; (*KeywordMap)["cbuffer"] = EHTokCBuffer; (*KeywordMap)["tbuffer"] = EHTokTBuffer; @@ -340,7 +339,7 @@ void HlslScanContext::fillInKeywordMap() // TODO: get correct set here ReservedSet = new std::unordered_set; - + ReservedSet->insert("auto"); ReservedSet->insert("catch"); ReservedSet->insert("char"); diff --git a/3rdparty/glslang/hlsl/hlslScanContext.h b/3rdparty/glslang/hlsl/hlslScanContext.h index 144a85343..b931d9be9 100755 --- a/3rdparty/glslang/hlsl/hlslScanContext.h +++ b/3rdparty/glslang/hlsl/hlslScanContext.h @@ -1,11 +1,11 @@ // -//Copyright (C) 2016 Google, Inc. +// Copyright (C) 2016 Google, Inc. // -//All rights reserved. +// All rights reserved. // -//Redistribution and use in source and binary forms, with or without -//modification, are permitted provided that the following conditions -//are met: +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: // // Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. @@ -19,18 +19,18 @@ // contributors may be used to endorse or promote products derived // from this software without specific prior written permission. // -//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -//"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS -//FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE -//COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, -//INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -//BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -//LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -//CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -//LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN -//ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -//POSSIBILITY OF SUCH DAMAGE. +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +// COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. // // diff --git a/3rdparty/glslang/hlsl/hlslTokenStream.cpp b/3rdparty/glslang/hlsl/hlslTokenStream.cpp index c915e0b59..b458ba47c 100755 --- a/3rdparty/glslang/hlsl/hlslTokenStream.cpp +++ b/3rdparty/glslang/hlsl/hlslTokenStream.cpp @@ -1,11 +1,11 @@ // -//Copyright (C) 2016 Google, Inc. +// Copyright (C) 2016 Google, Inc. // -//All rights reserved. +// All rights reserved. // -//Redistribution and use in source and binary forms, with or without -//modification, are permitted provided that the following conditions -//are met: +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: // // Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. @@ -19,18 +19,18 @@ // contributors may be used to endorse or promote products derived // from this software without specific prior written permission. // -//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -//"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS -//FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE -//COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, -//INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -//BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -//LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -//CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -//LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN -//ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -//POSSIBILITY OF SUCH DAMAGE. +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +// COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. // #include "hlslTokenStream.h" diff --git a/3rdparty/glslang/hlsl/hlslTokenStream.h b/3rdparty/glslang/hlsl/hlslTokenStream.h index ec4288943..955899888 100755 --- a/3rdparty/glslang/hlsl/hlslTokenStream.h +++ b/3rdparty/glslang/hlsl/hlslTokenStream.h @@ -1,11 +1,11 @@ // -//Copyright (C) 2016 Google, Inc. +// Copyright (C) 2016 Google, Inc. // -//All rights reserved. +// All rights reserved. // -//Redistribution and use in source and binary forms, with or without -//modification, are permitted provided that the following conditions -//are met: +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: // // Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. @@ -19,18 +19,18 @@ // contributors may be used to endorse or promote products derived // from this software without specific prior written permission. // -//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -//"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS -//FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE -//COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, -//INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -//BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -//LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -//CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -//LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN -//ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -//POSSIBILITY OF SUCH DAMAGE. +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +// COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. // #ifndef HLSLTOKENSTREAM_H_ diff --git a/3rdparty/glslang/hlsl/hlslTokens.h b/3rdparty/glslang/hlsl/hlslTokens.h index 43bf8b746..ae267705e 100755 --- a/3rdparty/glslang/hlsl/hlslTokens.h +++ b/3rdparty/glslang/hlsl/hlslTokens.h @@ -1,12 +1,12 @@ // -//Copyright (C) 2016 Google, Inc. -//Copyright (C) 2016 LunarG, Inc. +// Copyright (C) 2016 Google, Inc. +// Copyright (C) 2016 LunarG, Inc. // -//All rights reserved. +// All rights reserved. // -//Redistribution and use in source and binary forms, with or without -//modification, are permitted provided that the following conditions -//are met: +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: // // Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. @@ -20,18 +20,18 @@ // contributors may be used to endorse or promote products derived // from this software without specific prior written permission. // -//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -//"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS -//FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE -//COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, -//INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -//BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -//LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -//CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -//LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN -//ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -//POSSIBILITY OF SUCH DAMAGE. +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +// COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. // #ifndef EHLSLTOKENS_H_ @@ -251,7 +251,6 @@ enum EHlslTokenClass { EHTokRWTexture2darray, EHTokRWTexture3d, EHTokRWBuffer, - // variable, user type, ... EHTokIdentifier,