From 37d4782628a21b347a32b3e5e5d360b55b0c9ea1 Mon Sep 17 00:00:00 2001 From: moudgils Date: Thu, 13 May 2021 10:37:32 -0700 Subject: [PATCH 1/8] Adding a driver bug fix Fixed conflicts from original changes from @moudgils Signed-off-by: galibzon <66021303+galibzon@users.noreply.github.com> Signed-off-by: EnterTheArcane <96613937+EnterTheArcane@users.noreply.github.com> --- include/dxc/Support/HLSLOptions.td | 2 ++ include/dxc/Support/SPIRVOptions.h | 1 + lib/DxcSupport/HLSLOptions.cpp | 2 ++ tools/clang/lib/SPIRV/LowerTypeVisitor.cpp | 6 +++++- 4 files changed, 10 insertions(+), 1 deletion(-) diff --git a/include/dxc/Support/HLSLOptions.td b/include/dxc/Support/HLSLOptions.td index 019aa12e39..18260efdd3 100644 --- a/include/dxc/Support/HLSLOptions.td +++ b/include/dxc/Support/HLSLOptions.td @@ -454,6 +454,8 @@ def fvk_bind_sampler_heap : MultiArg<["-"], "fvk-bind-sampler-heap", 2>, MetaVar HelpText<"Specify Vulkan binding number and set number for the sampler heap.">; def fvk_bind_counter_heap : MultiArg<["-"], "fvk-bind-counter-heap", 2>, MetaVarName<" ">, Group, Flags<[CoreOption, DriverOption]>, HelpText<"Specify Vulkan binding number and set number for the counter heap.">; +def fvk_disable_depth_hint: Flag<["-"], "fvk-disable-depth-hint">, Group, Flags<[CoreOption, DriverOption]>, + HelpText<"Disable the depth hint when generating OpTypeImage (driver issues)">; // SPIRV Change Ends ////////////////////////////////////////////////////////////////////////////// diff --git a/include/dxc/Support/SPIRVOptions.h b/include/dxc/Support/SPIRVOptions.h index 0253caba63..a774251387 100644 --- a/include/dxc/Support/SPIRVOptions.h +++ b/include/dxc/Support/SPIRVOptions.h @@ -65,6 +65,7 @@ struct SpirvCodeGenOptions { bool useScalarLayout = false; bool flattenResourceArrays = false; bool reduceLoadSize = false; + bool disableImageTypeDepthHint = false; // Disable depth hint for OpTypeImage because some mobile drivers crash. bool autoShiftBindings = false; bool supportNonzeroBaseInstance = false; bool supportNonzeroBaseVertex = false; diff --git a/lib/DxcSupport/HLSLOptions.cpp b/lib/DxcSupport/HLSLOptions.cpp index 1630243aab..0a449adceb 100644 --- a/lib/DxcSupport/HLSLOptions.cpp +++ b/lib/DxcSupport/HLSLOptions.cpp @@ -1124,6 +1124,8 @@ int ReadDxcOpts(const OptTable *optionTable, unsigned flagsToInclude, Args.hasFlag(OPT_fspv_reduce_load_size, OPT_INVALID, false); opts.SpirvOptions.fixFuncCallArguments = Args.hasFlag(OPT_fspv_fix_func_call_arguments, OPT_INVALID, false); + opts.SpirvOptions.disableImageTypeDepthHint = + Args.hasFlag(OPT_fvk_disable_depth_hint, OPT_INVALID, false); opts.SpirvOptions.autoShiftBindings = Args.hasFlag(OPT_fvk_auto_shift_bindings, OPT_INVALID, false); opts.SpirvOptions.finiteMathOnly = diff --git a/tools/clang/lib/SPIRV/LowerTypeVisitor.cpp b/tools/clang/lib/SPIRV/LowerTypeVisitor.cpp index 4c06cd4113..d52a436619 100644 --- a/tools/clang/lib/SPIRV/LowerTypeVisitor.cpp +++ b/tools/clang/lib/SPIRV/LowerTypeVisitor.cpp @@ -906,6 +906,10 @@ LowerTypeVisitor::lowerResourceType(QualType type, SpirvLayoutRule rule, { // Texture types spv::Dim dim = {}; bool isArray = {}; + // Disable depth hint because of driver issues + ImageType::WithDepth depth = spvOptions.disableImageTypeDepthHint + ? ImageType::WithDepth::No + : ImageType::WithDepth::Unknown; if ((dim = spv::Dim::Dim1D, isArray = false, name == "Texture1D") || (dim = spv::Dim::Dim2D, isArray = false, name == "Texture2D") || (dim = spv::Dim::Dim3D, isArray = false, name == "Texture3D") || @@ -950,7 +954,7 @@ LowerTypeVisitor::lowerResourceType(QualType type, SpirvLayoutRule rule, return spvContext.getImageType( lowerType(getElementType(astContext, sampledType), rule, /*isRowMajor*/ llvm::None, srcLoc), - dim, ImageType::WithDepth::Unknown, isArray, + dim, depth, isArray, /*isMultiSampled=*/false, /*sampled=*/ImageType::WithSampler::No, format); } From 6170af83b1dc69b2d5297dccba0c69a83e89a57f Mon Sep 17 00:00:00 2001 From: "rgba16f [Amazon]" <82187279+rgba16f@users.noreply.github.com> Date: Wed, 4 Aug 2021 11:51:38 -0500 Subject: [PATCH 2/8] Make the Spirv output add the invariant flag if the position was marked as precise (#2) Signed-off-by: rgba16f <82187279+rgba16f@users.noreply.github.com> Signed-off-by: EnterTheArcane <96613937+EnterTheArcane@users.noreply.github.com> --- tools/clang/lib/SPIRV/SpirvBuilder.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tools/clang/lib/SPIRV/SpirvBuilder.cpp b/tools/clang/lib/SPIRV/SpirvBuilder.cpp index f61d61ed71..a759e8337f 100644 --- a/tools/clang/lib/SPIRV/SpirvBuilder.cpp +++ b/tools/clang/lib/SPIRV/SpirvBuilder.cpp @@ -1678,6 +1678,14 @@ SpirvVariable *SpirvBuilder::addStageBuiltinVar(QualType type, loc, var, spv::Decoration::BuiltIn, {static_cast(builtin)}); mod->addDecoration(decor); + // If precise is enabled, Position is additionally decorated with Invariant. + if (isPrecise && builtin == spv::BuiltIn::Position) + { + auto *invariantDecor = new (context) SpirvDecoration( + loc, var, spv::Decoration::Invariant); + mod->addDecoration(invariantDecor); + } + // Add variable to cache. builtinVars.emplace_back(storageClass, builtin, var); From 55ab2d9170a6bcc4b35c7865cbf4f4759e739b26 Mon Sep 17 00:00:00 2001 From: Akio Gaule <10719597+akioCL@users.noreply.github.com> Date: Thu, 30 May 2024 18:40:45 -0400 Subject: [PATCH 3/8] Add Dxsc tool to patch shader bytecode with specialization constants Signed-off-by: Akio Gaule <10719597+akioCL@users.noreply.github.com> Signed-off-by: EnterTheArcane <96613937+EnterTheArcane@users.noreply.github.com> --- include/llvm/Bitcode/BitstreamWriter.h | 26 ++ include/llvm/Bitcode/ReaderWriter.h | 7 +- lib/Bitcode/Writer/BitcodeWriter.cpp | 6 +- tools/clang/tools/CMakeLists.txt | 4 + tools/clang/tools/dxsc/CMakeLists.txt | 39 +++ tools/clang/tools/dxsc/dxsc.cpp | 406 +++++++++++++++++++++++++ tools/clang/tools/dxsc/dxsc.rc | 13 + 7 files changed, 498 insertions(+), 3 deletions(-) create mode 100644 tools/clang/tools/dxsc/CMakeLists.txt create mode 100644 tools/clang/tools/dxsc/dxsc.cpp create mode 100644 tools/clang/tools/dxsc/dxsc.rc diff --git a/include/llvm/Bitcode/BitstreamWriter.h b/include/llvm/Bitcode/BitstreamWriter.h index 62d2049e7b..de5ce4ecf9 100644 --- a/include/llvm/Bitcode/BitstreamWriter.h +++ b/include/llvm/Bitcode/BitstreamWriter.h @@ -21,6 +21,11 @@ #include "llvm/Support/Endian.h" #include +// O3DE change start +#include "llvm/Bitcode/LLVMBitCodes.h" +#include +// O3DE change end + namespace llvm { class BitstreamWriter { @@ -88,6 +93,11 @@ class BitstreamWriter { } public: + // O3DE change start + typedef std::function ConstantHandlerFn; + ConstantHandlerFn WriteConstantCallback = nullptr; + // O3DE change end + explicit BitstreamWriter(SmallVectorImpl &O) : Out(O), CurBit(0), CurValue(0), CurCodeSize(2) {} @@ -370,6 +380,22 @@ class BitstreamWriter { WriteByte(0); } else { // Single scalar field. assert(RecordIdx < Vals.size() && "Invalid abbrev/record"); + + // O3DE Change Start + if (WriteConstantCallback && + Vals[0] == bitc::CST_CODE_INTEGER && + Op.getEncoding() == BitCodeAbbrevOp::VBR) { + uint64_t SCBitOffset = (uint64_t)Out.size_in_bytes() * 8 + CurBit; + uint64_t SCVal = Vals[RecordIdx]; + if (Vals[RecordIdx] & 1) { + SCVal = -(SCVal >> 1); + } else { + SCVal = SCVal >> 1; + } + + WriteConstantCallback(SCVal, SCBitOffset); + } + // O3DE Change End EmitAbbreviatedField(Op, Vals[RecordIdx]); ++RecordIdx; } diff --git a/include/llvm/Bitcode/ReaderWriter.h b/include/llvm/Bitcode/ReaderWriter.h index 876decb6cb..02f331f51e 100644 --- a/include/llvm/Bitcode/ReaderWriter.h +++ b/include/llvm/Bitcode/ReaderWriter.h @@ -18,11 +18,13 @@ #include "llvm/Support/Endian.h" #include "llvm/Support/ErrorOr.h" #include "llvm/Support/MemoryBuffer.h" +// O3DE change start +#include "llvm/Bitcode/BitstreamWriter.h" +// O3DE change end #include #include namespace llvm { - class BitstreamWriter; class DataStreamer; class LLVMContext; class Module; @@ -69,7 +71,8 @@ namespace llvm { /// Value in \c M. These will be reconstructed exactly when \a M is /// deserialized. void WriteBitcodeToFile(const Module *M, raw_ostream &Out, - bool ShouldPreserveUseListOrder = false); + bool ShouldPreserveUseListOrder = false, + BitstreamWriter::ConstantHandlerFn WriteCallback = nullptr); // O3DE change /// isBitcodeWrapper - Return true if the given bytes are the magic bytes /// for an LLVM IR bitcode wrapper. diff --git a/lib/Bitcode/Writer/BitcodeWriter.cpp b/lib/Bitcode/Writer/BitcodeWriter.cpp index f02344ae64..7800c2c2b0 100644 --- a/lib/Bitcode/Writer/BitcodeWriter.cpp +++ b/lib/Bitcode/Writer/BitcodeWriter.cpp @@ -2494,7 +2494,8 @@ static void EmitDarwinBCHeaderAndTrailer(SmallVectorImpl &Buffer, /// WriteBitcodeToFile - Write the specified module to the specified output /// stream. void llvm::WriteBitcodeToFile(const Module *M, raw_ostream &Out, - bool ShouldPreserveUseListOrder) { + bool ShouldPreserveUseListOrder, + BitstreamWriter::ConstantHandlerFn WriteCallback) { // O3DE change SmallVector Buffer; Buffer.reserve(256*1024); @@ -2507,6 +2508,9 @@ void llvm::WriteBitcodeToFile(const Module *M, raw_ostream &Out, // Emit the module into the buffer. { BitstreamWriter Stream(Buffer); + // O3DE change start + Stream.WriteConstantCallback = WriteCallback; + // O3DE change end // Emit the file header. Stream.Emit((unsigned)'B', 8); diff --git a/tools/clang/tools/CMakeLists.txt b/tools/clang/tools/CMakeLists.txt index 9991de0308..77ffaa501f 100644 --- a/tools/clang/tools/CMakeLists.txt +++ b/tools/clang/tools/CMakeLists.txt @@ -43,3 +43,7 @@ add_subdirectory(dxlib-sample) add_subdirectory(dotnetc) endif (MSVC) # HLSL Change Ends + +# O3DE Change Starts +add_subdirectory(dxsc) +# O3DE Change Ends diff --git a/tools/clang/tools/dxsc/CMakeLists.txt b/tools/clang/tools/dxsc/CMakeLists.txt new file mode 100644 index 0000000000..11dfd9624e --- /dev/null +++ b/tools/clang/tools/dxsc/CMakeLists.txt @@ -0,0 +1,39 @@ +# Copyright (C) Microsoft Corporation. All rights reserved. +# This file is distributed under the University of Illinois Open Source License. See LICENSE.TXT for details. +# Builds dxsc.exe + +set( LLVM_LINK_COMPONENTS + ${LLVM_TARGETS_TO_BUILD} + DXIL + DxilContainer + DxilRootSignature + HLSL + dxcsupport + Option # option library + MSSupport # for CreateMSFileSystemForDisk + ) + +add_clang_executable(dxsc + dxsc.cpp + ) + +target_link_libraries(dxsc + dxcompiler + ) + +set_target_properties(dxsc PROPERTIES VERSION ${CLANG_EXECUTABLE_VERSION}) + +add_dependencies(dxsc dxcompiler) + +if(UNIX) + set(CLANGXX_LINK_OR_COPY create_symlink) +# Create a relative symlink + set(dxsc_binary "dxsc${CMAKE_EXECUTABLE_SUFFIX}") +else() + set(CLANGXX_LINK_OR_COPY copy) + set(dxsc_binary "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${CMAKE_CFG_INTDIR}/dxsc${CMAKE_EXECUTABLE_SUFFIX}") +endif() + +install(TARGETS dxsc + RUNTIME DESTINATION bin) + diff --git a/tools/clang/tools/dxsc/dxsc.cpp b/tools/clang/tools/dxsc/dxsc.cpp new file mode 100644 index 0000000000..cc8b283587 --- /dev/null +++ b/tools/clang/tools/dxsc/dxsc.cpp @@ -0,0 +1,406 @@ +/* + * Copyright (c) Contributors to the Open 3D Engine Project. + * For complete copyright and license terms please see the LICENSE at the root + * of this distribution. + * + * SPDX-License-Identifier: Apache-2.0 OR MIT + * + */ + +#include "dxc/Support/Global.h" +#include "dxc/Support/Unicode.h" +#include "dxc/Support/WinIncludes.h" + +#include "dxc/dxcapi.h" +#include "dxc/Support/dxcapi.use.h" +#include "dxc/Support/FileIOHelper.h" +#include "dxc/Support/HLSLOptions.h" +#include "dxc/Support/dxcapi.impl.h" +#include "dxc/DxilContainer/DxilContainer.h" +#include "dxc/DxilRootSignature/DxilRootSignature.h" +#include "dxc/Test/RDATDumper.h" +#include "dxc/Test/D3DReflectionDumper.h" +#include "dxc/DxilContainer/DxilContainerAssembler.h" +#include "dxc/DxilContainer/DxilContainerReader.h" + +#include "llvm/Support/CommandLine.h" +#include "llvm/Support//MSFileSystem.h" +#include "llvm/Support/FileSystem.h" +#include "llvm/Support/raw_ostream.h" +#include "llvm/IR/Constants.h" +#include "llvm/IR/LLVMContext.h" +#include "llvm/IR/Instructions.h" +#include "llvm/Bitcode/ReaderWriter.h" + +#include +#include +#include +#include + +using namespace llvm; +using namespace llvm::opt; +using namespace dxc; +using namespace hlsl::options; + +static cl::opt Help("help", cl::desc("Print help")); +static cl::alias Help_h("h", cl::aliasopt(Help)); +static cl::alias Help_q("?", cl::aliasopt(Help)); + +static cl::opt InputFilename(cl::Positional, + cl::desc("<>")); + +static cl::opt OutputFilename("o", + cl::desc("Output filename"), + cl::value_desc("filename")); + +static cl::opt OffsetsFilename("f", + cl::desc("Json offsets filename"), + cl::value_desc("filename")); + +static cl::opt SentinelValue("sv", + cl::desc("Sentinel value to use")); + +constexpr uint64_t SentinelMask = 0xffffffffffffff00; +constexpr uint64_t SentinelIdMask = 0x00000000000000ff; + +using namespace hlsl::options; + +// Writes the offsets into a json file +void WriteOffsetJsonFile( + uint64_t dxilPartOffset, const std::map& offsets) { + std::stringstream stream; + stream << "{"; + for (const auto &entry : offsets) { + stream << "\n\t\"" << entry.first << "\": " << (dxilPartOffset + entry.second) << ","; + } + if (!offsets.empty()) + { + // Remove last "," + stream.seekp(-1, stream.cur); + } + stream << "\n}"; + auto jsonString = stream.str(); + + StringRefWide pFileName = StringRefWide(OffsetsFilename); + CHandle file(CreateFileW(pFileName, GENERIC_WRITE, FILE_SHARE_READ, nullptr, + CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, nullptr)); + if (file == INVALID_HANDLE_VALUE) { + IFT_Data(HRESULT_FROM_WIN32(GetLastError()), pFileName); + } + + DWORD written; + if (FALSE == WriteFile(file, jsonString.data(), (DWORD)jsonString.size(), &written, nullptr)) { + IFT_Data(HRESULT_FROM_WIN32(GetLastError()), pFileName); + } +} + +// The DXSC application is used for patching a DXIL blob for use with specialization constants in O3DE. +// It uses a sentinel value to detect the exact offset to each shader constant in the shader bytecode so +// it can be patched at runtime. Based on Godot's approach https://godotengine.org/article/d3d12-adventures-in-shaderland/ +#ifdef _WIN32 +int __cdecl wmain(int argc, const wchar_t **argv) { +#else +int main(int argc, const char **argv) { +#endif + if (llvm::sys::fs::SetupPerThreadFileSystem()) + return 1; + llvm::sys::fs::AutoCleanupPerThreadFileSystem auto_cleanup_fs; + if (FAILED(DxcInitThreadMalloc())) return 1; + DxcSetThreadMallocToDefault(); + + const char *pStage = "Operation"; + try { + llvm::sys::fs::MSFileSystem *msfPtr; + IFT(CreateMSFileSystemForDisk(&msfPtr)); + std::unique_ptr<::llvm::sys::fs::MSFileSystem> msf(msfPtr); + + ::llvm::sys::fs::AutoPerThreadSystem pts(msf.get()); + IFTLLVM(pts.error_code()); + + pStage = "Argument processing"; + + // Parse command line options. + MainArgs argStrings(argc, argv, 0); + cl::ParseCommandLineOptions(argc, argStrings.getArrayRef().data(), + "dxsc patching\n"); + + if (InputFilename == "" || !SentinelValue || Help) { + cl::PrintHelpMessage(); + return 2; + } + + DxcDllSupport dxcSupport; + dxc::EnsureEnabled(dxcSupport); + + CComPtr pSource; + ReadFileIntoBlob(dxcSupport, StringRefWide(InputFilename), &pSource); + + CComPtr pReflection; + IFT(dxcSupport.CreateInstance(CLSID_DxcContainerReflection, + &pReflection)); + IFT(pReflection->Load(pSource)); + + std::unique_ptr pContainerWriter( + hlsl::NewDxilContainerWriter(true)); + CComPtr patchedDxilPartStream; + + std::map bitOffsets; + uint64_t dxilPartOffset = 0; + UINT32 partCount = 0; + IFT(pReflection->GetPartCount(&partCount)); + + // Patch the LLVM IR. + for (UINT32 i = 0; i < partCount; ++i) { + CComPtr pBitcode; + IFT(pReflection->GetPartContent(i, &pBitcode)); + + LPVOID partStart = pBitcode->GetBufferPointer(); + SIZE_T partSize = pBitcode->GetBufferSize(); + + UINT32 kind = 0; + IFT(pReflection->GetPartKind(i, &kind)); + + // Find the DXIL container + if (kind == hlsl::DFCC_DXIL) { + const hlsl::DxilProgramHeader *dxilHeader = + (const hlsl::DxilProgramHeader *)partStart; + + const char *bitcode_ptr = hlsl::GetDxilBitcodeData(dxilHeader); + unsigned bitcode_size = hlsl::GetDxilBitcodeSize(dxilHeader); + + llvm::StringRef bitcode_buffer(bitcode_ptr, bitcode_size); + llvm::LLVMContext llvm_context; + llvm::ErrorOr> bitcode_parsed = + llvm::parseBitcodeFile(llvm::MemoryBufferRef(bitcode_buffer, ""), + llvm_context); + if (std::error_code ec = bitcode_parsed.getError()) { + throw hlsl::Exception(DXC_E_MALFORMED_CONTAINER); + } + + llvm::Module &llvm_module = *bitcode_parsed->get(); + std::unordered_map allocSCIndices; + + // Step 1: + // Make a database of the 'alloca's, based on the volatile stores. + // %63 = bitcast i32* %59 to i8* + // call void @llvm.lifetime.start(i64 4, i8* %63) + // store volatile i32 9, i32* %59, align 4 <---- Locate this + for (llvm::Function &function : llvm_module.getFunctionList()) { + if (function.isDeclaration()) { + continue; + } + for (llvm::BasicBlock &block : function) { + for (llvm::Instruction &instruction : block) { + if (llvm::isa(instruction) && + llvm::cast(instruction).isVolatile()) { + llvm::StoreInst &store = + llvm::cast(instruction); + uint32_t scIndex = + llvm::dyn_cast(store.getValueOperand()) + ->getZExtValue(); + llvm::AllocaInst *allocaInst = + llvm::dyn_cast(store.getPointerOperand()); + allocSCIndices[allocaInst] = scIndex; + } + } + } + } + + std::vector instructionsToRemove; + std::unordered_set instructionsToRemoveUnique; + std::unordered_map loadsToReplaceToSCindex; + + // Step 2: + // Replace uses of the result of volatile loads by constants, like + // this: + // Original: + // %590 = load volatile i32, i32* %61, align 4 + // %591 = icmp eq i32 %590, 0 + // Changed: + // %586 = icmp eq i32 ???, 0 + for (auto &E : allocSCIndices) { + llvm::AllocaInst *alloca_inst = E.first; + uint32_t scIndex = E.second; + + if (instructionsToRemoveUnique.find(alloca_inst) == + instructionsToRemoveUnique.end()) { + instructionsToRemove.push_back(alloca_inst); + instructionsToRemoveUnique.insert(alloca_inst); + + for (llvm::User *U : alloca_inst->users()) { + if (llvm::isa(U) && + llvm::cast(U)->isVolatile()) { + llvm::LoadInst *LI = llvm::cast(U); + loadsToReplaceToSCindex[LI] = scIndex; + } + } + } + } + + // Replace all loads with the sentinel value + the specialization constant index + for (auto &E : loadsToReplaceToSCindex) { + llvm::LoadInst *I = E.first; + uint32_t scIndex = E.second; + llvm::Constant *scConstant = llvm::ConstantInt::get( + llvm::Type::getInt32Ty(llvm_context), SentinelValue + scIndex); + I->replaceAllUsesWith(scConstant); + } + + // Step 3: + // Remove any other instructions using the slot the load happened + // from, + // which includes not only volatile stores but also any other + // instruction the compiler may have added on its own, such as + // 'bitcast' and lifetime control calls, as well as any other + // instruction that is invalid now due to the previously removed ones. + uint32_t k = 0; + while (k < instructionsToRemove.size()) { + for (llvm::User *U : instructionsToRemove[k]->users()) { + llvm::Instruction *I = llvm::cast(U); + if (instructionsToRemoveUnique.find(I) == + instructionsToRemoveUnique.end()) + { + instructionsToRemove.push_back(I); + instructionsToRemoveUnique.insert(I); + } + } + k++; + } + + // Remove all unnecesary operations + for (llvm::Instruction* instruction : instructionsToRemove) { + + instruction->removeFromParent(); + instruction->dropAllReferences(); + } + for (llvm::Instruction *instruction : instructionsToRemove) { + delete instruction; + } + + // Now rebuild the DXIL part. + { + IFR(hlsl::CreateMemoryStream(DxcGetThreadMallocNoRef(), + &patchedDxilPartStream)); + + ULONG headerSize = 0; + IFR(patchedDxilPartStream->Write( + dxilHeader, sizeof(hlsl::DxilProgramHeader), + &headerSize)); + + ULONG bitcode_start = patchedDxilPartStream->GetPtrSize(); + { + raw_stream_ostream ostream(patchedDxilPartStream); + llvm::WriteBitcodeToFile( + &llvm_module, ostream, false, + [&](uint64_t value, uint64_t offset) + { + // Check if it's the sentinel value we replaced + if ((value & SentinelMask) == (uint64_t)SentinelValue) + { + // Extract the specialization index id and save the offset for patching + uint32_t scIndex = (uint32_t)(value & SentinelIdMask); + bitOffsets[scIndex] = offset; + } + }); + } + ULONG bitcodeEnd = patchedDxilPartStream->GetPtrSize(); + + partStart = patchedDxilPartStream->GetPtr(); + partSize = patchedDxilPartStream->GetPtrSize(); + + ((hlsl::DxilProgramHeader *)partStart)->SizeInUint32 = + bitcodeEnd / sizeof(uint32_t); + ((hlsl::DxilProgramHeader *)partStart)->BitcodeHeader.BitcodeSize = + bitcodeEnd - bitcode_start; + } + } + + // Write the container back + pContainerWriter->AddPart( + kind, partSize, + [=, &dxilPartOffset](hlsl::AbstractMemoryStream *s) { + if (kind == hlsl::DFCC_DXIL) { + dxilPartOffset = s->GetPosition(); + } + ULONG written = 0; + s->Write(partStart, partSize, &written); + }); + } + + // Serialize the container + CComPtr pUtils; + IFT(DxcCreateInstance(CLSID_DxcUtils, IID_PPV_ARGS(&pUtils))); + + CComPtr pContainerBlob; + UINT32 OutputSize = pContainerWriter->size(); + CComHeapPtr pOutput; + IFTBOOL(pOutput.AllocateBytes(OutputSize), E_OUTOFMEMORY); + CComPtr pOutputStream; + IFT(CreateFixedSizeMemoryStream((LPBYTE)pOutput.m_pData, OutputSize, + &pOutputStream)); + pContainerWriter->write(pOutputStream); + IFR(pUtils->CreateBlob((LPBYTE)pOutput.m_pData, OutputSize, DXC_CP_ACP, + &pContainerBlob)); + + // Sign container + CComPtr pValidator; + CComPtr pResult; + DxcDllSupport DxilSupport; + IFT(DxilSupport.InitializeForDll(kDxilLib, "DxcCreateInstance")); + IFT(DxilSupport.CreateInstance(CLSID_DxcValidator, &pValidator)); + IFT(pValidator->Validate(pContainerBlob, DxcValidatorFlags_InPlaceEdit, + &pResult)); + + HRESULT status; + IFT(pResult->GetStatus(&status)); + + if (FAILED(status)) { + // Signing failed. + CComPtr text; + IFT(pResult->GetErrorBuffer(&text)); + const char *pStart = (const char *)text->GetBufferPointer(); + std::string msg(pStart); + IFTMSG(status, msg); + } + + // Write the blob + if (!OutputFilename.empty()) { + // Write the signed blob to a file + WriteBlobToFile(pContainerBlob, StringRefWide(OutputFilename), CP_ACP); + } + + // Write the offsets + if (!OffsetsFilename.empty()) + { + WriteOffsetJsonFile((dxilPartOffset + sizeof(hlsl::DxilProgramHeader)) * 8, bitOffsets); + } + + } catch (const ::hlsl::Exception &hlslException) { + try { + const char *msg = hlslException.what(); + Unicode::acp_char printBuffer[128]; // printBuffer is safe to treat as + // UTF-8 because we use ASCII only errors + // only + if (msg == nullptr || *msg == '\0') { + sprintf_s(printBuffer, _countof(printBuffer), + "Assembly failed - error code 0x%08x.", hlslException.hr); + msg = printBuffer; + } + llvm::errs() << msg; + printf("%s\n", msg); + } catch (...) { + printf("%s failed - unable to retrieve error message.\n", pStage); + } + return 1; + } catch (std::bad_alloc &) { + llvm::errs() << "failed - out of memory"; + printf("%s failed - out of memory.\n", pStage); + return 1; + } catch (...) { + printf("%s failed - unknown error.\n", pStage); + return 1; + } + + printf("Specialized Constants Patching succeeded."); + return 0; +} diff --git a/tools/clang/tools/dxsc/dxsc.rc b/tools/clang/tools/dxsc/dxsc.rc new file mode 100644 index 0000000000..384a8d9647 --- /dev/null +++ b/tools/clang/tools/dxsc/dxsc.rc @@ -0,0 +1,13 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// + +#include +#include + +#define VER_FILETYPE VFT_DLL +#define VER_FILESUBTYPE VFT_UNKNOWN +#define VER_FILEDESCRIPTION_STR "DX Specialization Constant" +#define VER_INTERNALNAME_STR "DX Specialization Constant" +#define VER_ORIGINALFILENAME_STR "dxsc.exe" + +#include \ No newline at end of file From 411f8ccea0b015a572a085725e12159bd482f6e1 Mon Sep 17 00:00:00 2001 From: Akio Gaule <10719597+akioCL@users.noreply.github.com> Date: Sun, 30 Jun 2024 21:36:26 -0400 Subject: [PATCH 4/8] Fix linux build Signed-off-by: Akio Gaule <10719597+akioCL@users.noreply.github.com> Signed-off-by: EnterTheArcane <96613937+EnterTheArcane@users.noreply.github.com> --- tools/clang/tools/dxsc/dxsc.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/clang/tools/dxsc/dxsc.cpp b/tools/clang/tools/dxsc/dxsc.cpp index cc8b283587..eb29f8013d 100644 --- a/tools/clang/tools/dxsc/dxsc.cpp +++ b/tools/clang/tools/dxsc/dxsc.cpp @@ -10,6 +10,7 @@ #include "dxc/Support/Global.h" #include "dxc/Support/Unicode.h" #include "dxc/Support/WinIncludes.h" +#include "dxc/Support/WinFunctions.h" #include "dxc/dxcapi.h" #include "dxc/Support/dxcapi.use.h" From d8f637b53cbecc9ae6d687535268923b0c0a19e3 Mon Sep 17 00:00:00 2001 From: EnterTheArcane <96613937+EnterTheArcane@users.noreply.github.com> Date: Sat, 22 Aug 2026 15:21:18 -0600 Subject: [PATCH 5/8] Port dxsc to v1.9 loader APIs Signed-off-by: EnterTheArcane <96613937+EnterTheArcane@users.noreply.github.com> --- tools/clang/tools/dxsc/dxsc.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/clang/tools/dxsc/dxsc.cpp b/tools/clang/tools/dxsc/dxsc.cpp index eb29f8013d..19347c5f54 100644 --- a/tools/clang/tools/dxsc/dxsc.cpp +++ b/tools/clang/tools/dxsc/dxsc.cpp @@ -130,7 +130,7 @@ int main(int argc, const char **argv) { return 2; } - DxcDllSupport dxcSupport; + DXCLibraryDllLoader dxcSupport; dxc::EnsureEnabled(dxcSupport); CComPtr pSource; @@ -346,7 +346,7 @@ int main(int argc, const char **argv) { // Sign container CComPtr pValidator; CComPtr pResult; - DxcDllSupport DxilSupport; + SpecificDllLoader DxilSupport; IFT(DxilSupport.InitializeForDll(kDxilLib, "DxcCreateInstance")); IFT(DxilSupport.CreateInstance(CLSID_DxcValidator, &pValidator)); IFT(pValidator->Validate(pContainerBlob, DxcValidatorFlags_InPlaceEdit, From fa92464c6efa8dac62664065007295c243637710 Mon Sep 17 00:00:00 2001 From: EnterTheArcane <96613937+EnterTheArcane@users.noreply.github.com> Date: Sat, 22 Aug 2026 15:22:37 -0600 Subject: [PATCH 6/8] Revert "Disallow `volatile` keyword (#8397)" This reverts commit d73829d4e677ef00931e8e57de6d544396ab46cb. Signed-off-by: EnterTheArcane <96613937+EnterTheArcane@users.noreply.github.com> --- tools/clang/include/clang/Lex/Token.h | 2 +- tools/clang/lib/Parse/ParseDecl.cpp | 4 - tools/clang/test/HLSL/cpp-errors-hv2015.hlsl | 2 +- tools/clang/test/HLSL/cpp-errors.hlsl | 3 +- .../correct_rewrites/varmods-syntax_gold.hlsl | 14 + .../HLSL/rewriter/varmods-syntax_noerr.hlsl | 34 +- .../types/conversions/varmods-syntax_Mod.hlsl | 18 +- tools/clang/test/SemaHLSL/varmods-syntax.hlsl | 544 +++++++++--------- 8 files changed, 322 insertions(+), 299 deletions(-) diff --git a/tools/clang/include/clang/Lex/Token.h b/tools/clang/include/clang/Lex/Token.h index 42e45bc035..edbe7a26c0 100644 --- a/tools/clang/include/clang/Lex/Token.h +++ b/tools/clang/include/clang/Lex/Token.h @@ -305,7 +305,7 @@ class Token { is(tok::kw_sizeof) || is(tok::kw_static_cast) || is(tok::kw_template) || is(tok::kw_throw) || is(tok::kw_try) || is(tok::kw_typename) || is(tok::kw_union) || is(tok::kw_using) || - is(tok::kw_virtual) || is(tok::kw_volatile); + is(tok::kw_virtual); } // HLSL Change Starts diff --git a/tools/clang/lib/Parse/ParseDecl.cpp b/tools/clang/lib/Parse/ParseDecl.cpp index 85404a1673..8b2928e444 100644 --- a/tools/clang/lib/Parse/ParseDecl.cpp +++ b/tools/clang/lib/Parse/ParseDecl.cpp @@ -4197,10 +4197,6 @@ void Parser::ParseDeclarationSpecifiers(DeclSpec &DS, getLangOpts()); break; case tok::kw_volatile: - // HLSL Change - volatile is reserved for HLSL - if (getLangOpts().HLSL) - goto HLSLReservedKeyword; - // HLSL Change Ends isInvalid = DS.SetTypeQual(DeclSpec::TQ_volatile, Loc, PrevSpec, DiagID, getLangOpts()); break; diff --git a/tools/clang/test/HLSL/cpp-errors-hv2015.hlsl b/tools/clang/test/HLSL/cpp-errors-hv2015.hlsl index 57c512741c..416261cad0 100644 --- a/tools/clang/test/HLSL/cpp-errors-hv2015.hlsl +++ b/tools/clang/test/HLSL/cpp-errors-hv2015.hlsl @@ -60,7 +60,7 @@ struct s_with_friend { }; typedef int (*fn_int_const)(int) const; // expected-error {{expected ';' after top level declarator}} expected-error {{pointers are unsupported in HLSL}} expected-warning {{declaration does not declare anything}} -typedef int (*fn_int_volatile)(int) volatile; // expected-error {{'volatile' is a reserved keyword in HLSL}} expected-error {{expected ';' after top level declarator}} expected-error {{pointers are unsupported in HLSL}} expected-warning {{declaration does not declare anything}} +typedef int (*fn_int_volatile)(int) volatile; // expected-error {{expected ';' after top level declarator}} expected-error {{pointers are unsupported in HLSL}} expected-warning {{declaration does not declare anything}} void fn_throw() throw() { } // expected-error {{exception specification is unsupported in HLSL}} diff --git a/tools/clang/test/HLSL/cpp-errors.hlsl b/tools/clang/test/HLSL/cpp-errors.hlsl index 1ecf4a57e1..d4d949b743 100644 --- a/tools/clang/test/HLSL/cpp-errors.hlsl +++ b/tools/clang/test/HLSL/cpp-errors.hlsl @@ -33,7 +33,6 @@ _Bool g_Bool; // expected-error {{unknown type name '_Bool'}} _vector int altivec_vector; // expected-error {{expected unqualified-id}} expected-error {{unknown type name '_vector'}} restrict int g_restrict; // expected-error {{expected unqualified-id}} expected-error {{unknown type name 'restrict'}} -volatile int g_volatile; // expected-error {{'volatile' is a reserved keyword in HLSL}} __underlying_type(int) g_underlying_type; // expected-error {{__underlying_type is unsupported in HLSL}} _Atomic(something) g_Atomic; // expected-error {{'_Atomic' is a reserved keyword in HLSL}} expected-error {{HLSL requires a type specifier for all declarations}} @@ -57,7 +56,7 @@ struct s_with_friend { }; typedef int (*fn_int_const)(int) const; // expected-error {{expected ';' after top level declarator}} expected-error {{pointers are unsupported in HLSL}} expected-warning {{declaration does not declare anything}} -typedef int (*fn_int_volatile)(int) volatile; // expected-error {{'volatile' is a reserved keyword in HLSL}} expected-error {{expected ';' after top level declarator}} expected-error {{pointers are unsupported in HLSL}} expected-warning {{declaration does not declare anything}} +typedef int (*fn_int_volatile)(int) volatile; // expected-error {{expected ';' after top level declarator}} expected-error {{pointers are unsupported in HLSL}} expected-warning {{declaration does not declare anything}} void fn_throw() throw() { } // expected-error {{exception specification is unsupported in HLSL}} diff --git a/tools/clang/test/HLSL/rewriter/correct_rewrites/varmods-syntax_gold.hlsl b/tools/clang/test/HLSL/rewriter/correct_rewrites/varmods-syntax_gold.hlsl index 2432bbcaae..b62daecb5c 100644 --- a/tools/clang/test/HLSL/rewriter/correct_rewrites/varmods-syntax_gold.hlsl +++ b/tools/clang/test/HLSL/rewriter/correct_rewrites/varmods-syntax_gold.hlsl @@ -37,7 +37,11 @@ precise uniform const float g_pre_uni_init = 1.F; static float g_sta_init = 1.F; static const float g_sta_con_init = 1.F; uniform const float g_uni_init = 1.F; +typedef volatile float2 t_pre_vol; +typedef const volatile float2 t_pre_vol_con; typedef const float2 t_pre_con; +typedef volatile float2 t_vol; +typedef const volatile float2 t_vol_con; typedef const float2 t_con; struct s_storage_mods { precise float2 f_pre; @@ -218,12 +222,22 @@ float4 foo_interpolation_different_decl(sample float4 val) { void vain() { precise float l_pre; static precise float l_pre_sta; + static precise volatile float l_pre_sta_vol; + static precise const volatile float l_pre_sta_vol_con; static precise const float l_pre_sta_con; + precise volatile float l_pre_vol; static float l_sta; + static volatile float l_sta_vol; + static const volatile float l_sta_vol_con; static const float l_sta_con; + volatile float l_vol; + static precise const volatile float l_pre_sta_vol_con_init = 0.; static precise const float l_pre_sta_con_init = 0.; + precise const volatile float l_pre_vol_con_init = 0.; precise const float l_pre_con_init = 0.; + static const volatile float l_sta_vol_con_init = 0.; static const float l_sta_con_init = 0.; + const volatile float l_vol_con_init = 0.; const float l_con_init = 0.; } diff --git a/tools/clang/test/HLSL/rewriter/varmods-syntax_noerr.hlsl b/tools/clang/test/HLSL/rewriter/varmods-syntax_noerr.hlsl index b0e205a869..0f8f143d00 100644 --- a/tools/clang/test/HLSL/rewriter/varmods-syntax_noerr.hlsl +++ b/tools/clang/test/HLSL/rewriter/varmods-syntax_noerr.hlsl @@ -288,8 +288,8 @@ uniform float g_uni_init = 1.0f; //typedef precise uniform volatile float2 t_pre_uni_vol; /* expected-error {{'uniform' is not a valid modifier for a typedef}} fxc-error {{X3000: syntax error: unexpected token 'uniform'}} */ //typedef precise uniform volatile const float2 t_pre_uni_vol_con; /* expected-error {{'uniform' is not a valid modifier for a typedef}} fxc-error {{X3000: syntax error: unexpected token 'uniform'}} */ //typedef precise uniform const float2 t_pre_uni_con; /* expected-error {{'uniform' is not a valid modifier for a typedef}} fxc-error {{X3000: syntax error: unexpected token 'uniform'}} */ -//typedef precise volatile float2 t_pre_vol; /* expected-error {{'volatile' is a reserved keyword in HLSL}} */ -//typedef precise volatile const float2 t_pre_vol_con; /* expected-error {{'volatile' is a reserved keyword in HLSL}} */ +typedef precise volatile float2 t_pre_vol; +typedef precise volatile const float2 t_pre_vol_con; typedef precise const float2 t_pre_con; //typedef static float2 t_sta; /* expected-error {{cannot combine with previous 'typedef' declaration specifier}} fxc-error {{X3000: syntax error: unexpected token 'static'}} */ //typedef static volatile float2 t_sta_vol; /* expected-error {{cannot combine with previous 'typedef' declaration specifier}} fxc-error {{X3000: syntax error: unexpected token 'static'}} */ @@ -299,8 +299,8 @@ typedef precise const float2 t_pre_con; //typedef uniform volatile float2 t_uni_vol; /* expected-error {{'uniform' is not a valid modifier for a typedef}} fxc-error {{X3000: syntax error: unexpected token 'uniform'}} */ //typedef uniform volatile const float2 t_uni_vol_con; /* expected-error {{'uniform' is not a valid modifier for a typedef}} fxc-error {{X3000: syntax error: unexpected token 'uniform'}} */ //typedef uniform const float2 t_uni_con; /* expected-error {{'uniform' is not a valid modifier for a typedef}} fxc-error {{X3000: syntax error: unexpected token 'uniform'}} */ -//typedef volatile float2 t_vol; /* expected-error {{'volatile' is a reserved keyword in HLSL}} */ -//typedef volatile const float2 t_vol_con; /* expected-error {{'volatile' is a reserved keyword in HLSL}} */ +typedef volatile float2 t_vol; +typedef volatile const float2 t_vol_con; typedef const float2 t_con; // GENERATED_CODE:END @@ -668,26 +668,26 @@ void vain() { //extern const float l_ext_con; /* expected-error {{'extern' is not a valid modifier for a local variable}} fxc-error {{X3006: 'l_ext_con': local variables cannot be declared 'extern'}} fxc-error {{X3012: 'l_ext_con': missing initial value}} */ precise float l_pre; precise static float l_pre_sta; - //precise static volatile float l_pre_sta_vol; /* expected-error {{'volatile' is a reserved keyword in HLSL}} */ - //precise static volatile const float l_pre_sta_vol_con; /* expected-error {{'volatile' is a reserved keyword in HLSL}} */ + precise static volatile float l_pre_sta_vol; + precise static volatile const float l_pre_sta_vol_con; precise static const float l_pre_sta_con; //precise uniform float l_pre_uni; /* expected-error {{'uniform' is not a valid modifier for a local variable}} fxc-error {{X3047: 'l_pre_uni': local variables cannot be declared 'uniform'}} */ //precise uniform volatile float l_pre_uni_vol; /* expected-error {{'uniform' is not a valid modifier for a local variable}} fxc-error {{X3047: 'l_pre_uni_vol': local variables cannot be declared 'uniform'}} */ //precise uniform volatile const float l_pre_uni_vol_con; /* expected-error {{'uniform' is not a valid modifier for a local variable}} fxc-error {{X3012: 'l_pre_uni_vol_con': missing initial value}} fxc-error {{X3047: 'l_pre_uni_vol_con': local variables cannot be declared 'uniform'}} */ //precise uniform const float l_pre_uni_con; /* expected-error {{'uniform' is not a valid modifier for a local variable}} fxc-error {{X3012: 'l_pre_uni_con': missing initial value}} fxc-error {{X3047: 'l_pre_uni_con': local variables cannot be declared 'uniform'}} */ - //precise volatile float l_pre_vol; /* expected-error {{'volatile' is a reserved keyword in HLSL}} */ - //precise volatile const float l_pre_vol_con; /* fxc-error {{X3012: 'l_pre_vol_con': missing initial value}} expected-error {{'volatile' is a reserved keyword in HLSL}} */ + precise volatile float l_pre_vol; + //precise volatile const float l_pre_vol_con; /* fxc-error {{X3012: 'l_pre_vol_con': missing initial value}} */ //precise const float l_pre_con; /* fxc-error {{X3012: 'l_pre_con': missing initial value}} */ static float l_sta; - //static volatile float l_sta_vol; /* expected-error {{'volatile' is a reserved keyword in HLSL}} */ - //static volatile const float l_sta_vol_con; /* expected-error {{'volatile' is a reserved keyword in HLSL}} */ + static volatile float l_sta_vol; + static volatile const float l_sta_vol_con; static const float l_sta_con; //uniform float l_uni; /* expected-error {{'uniform' is not a valid modifier for a local variable}} fxc-error {{X3047: 'l_uni': local variables cannot be declared 'uniform'}} */ //uniform volatile float l_uni_vol; /* expected-error {{'uniform' is not a valid modifier for a local variable}} fxc-error {{X3047: 'l_uni_vol': local variables cannot be declared 'uniform'}} */ //uniform volatile const float l_uni_vol_con; /* expected-error {{'uniform' is not a valid modifier for a local variable}} fxc-error {{X3012: 'l_uni_vol_con': missing initial value}} fxc-error {{X3047: 'l_uni_vol_con': local variables cannot be declared 'uniform'}} */ //uniform const float l_uni_con; /* expected-error {{'uniform' is not a valid modifier for a local variable}} fxc-error {{X3012: 'l_uni_con': missing initial value}} fxc-error {{X3047: 'l_uni_con': local variables cannot be declared 'uniform'}} */ - //volatile float l_vol; /* expected-error {{'volatile' is a reserved keyword in HLSL}} */ - //volatile const float l_vol_con; /* fxc-error {{X3012: 'l_vol_con': missing initial value}} expected-error {{'volatile' is a reserved keyword in HLSL}} */ + volatile float l_vol; + //volatile const float l_vol_con; /* fxc-error {{X3012: 'l_vol_con': missing initial value}} */ //const float l_con; /* fxc-error {{X3012: 'l_con': missing initial value}} */ // GENERATED_CODE:END // Now with const vars initialized: @@ -713,17 +713,17 @@ void vain() { //extern uniform const float l_ext_uni_con_init = 0.0; /* expected-error {{'extern' is not a valid modifier for a local variable}} expected-error {{'uniform' is not a valid modifier for a local variable}} fxc-error {{X3006: 'l_ext_uni_con_init': local variables cannot be declared 'extern'}} fxc-error {{X3012: 'l_ext_uni_con_init': missing initial value}} fxc-error {{X3047: 'l_ext_uni_con_init': local variables cannot be declared 'uniform'}} */ //extern volatile const float l_ext_vol_con_init = 0.0; /* expected-error {{'extern' is not a valid modifier for a local variable}} fxc-error {{X3006: 'l_ext_vol_con_init': local variables cannot be declared 'extern'}} fxc-error {{X3012: 'l_ext_vol_con_init': missing initial value}} */ //extern const float l_ext_con_init = 0.0; /* expected-error {{'extern' is not a valid modifier for a local variable}} fxc-error {{X3006: 'l_ext_con_init': local variables cannot be declared 'extern'}} fxc-error {{X3012: 'l_ext_con_init': missing initial value}} */ - //precise static volatile const float l_pre_sta_vol_con_init = 0.0; /* expected-error {{'volatile' is a reserved keyword in HLSL}} */ + precise static volatile const float l_pre_sta_vol_con_init = 0.0; precise static const float l_pre_sta_con_init = 0.0; //precise uniform volatile const float l_pre_uni_vol_con_init = 0.0; /* expected-error {{'uniform' is not a valid modifier for a local variable}} fxc-error {{X3012: 'l_pre_uni_vol_con_init': missing initial value}} fxc-error {{X3047: 'l_pre_uni_vol_con_init': local variables cannot be declared 'uniform'}} */ //precise uniform const float l_pre_uni_con_init = 0.0; /* expected-error {{'uniform' is not a valid modifier for a local variable}} fxc-error {{X3012: 'l_pre_uni_con_init': missing initial value}} fxc-error {{X3047: 'l_pre_uni_con_init': local variables cannot be declared 'uniform'}} */ - //precise volatile const float l_pre_vol_con_init = 0.0; /* expected-error {{'volatile' is a reserved keyword in HLSL}} */ + precise volatile const float l_pre_vol_con_init = 0.0; precise const float l_pre_con_init = 0.0; - //static volatile const float l_sta_vol_con_init = 0.0; /* expected-error {{'volatile' is a reserved keyword in HLSL}} */ + static volatile const float l_sta_vol_con_init = 0.0; static const float l_sta_con_init = 0.0; //uniform volatile const float l_uni_vol_con_init = 0.0; /* expected-error {{'uniform' is not a valid modifier for a local variable}} fxc-error {{X3012: 'l_uni_vol_con_init': missing initial value}} fxc-error {{X3047: 'l_uni_vol_con_init': local variables cannot be declared 'uniform'}} */ //uniform const float l_uni_con_init = 0.0; /* expected-error {{'uniform' is not a valid modifier for a local variable}} fxc-error {{X3012: 'l_uni_con_init': missing initial value}} fxc-error {{X3047: 'l_uni_con_init': local variables cannot be declared 'uniform'}} */ - //volatile const float l_vol_con_init = 0.0; /* expected-error {{'volatile' is a reserved keyword in HLSL}} */ + volatile const float l_vol_con_init = 0.0; const float l_con_init = 0.0; // GENERATED_CODE:END @@ -969,4 +969,4 @@ class C //out float fn_out() { return 1.0f; } /* expected-error {{HLSL usage 'out' is only valid on a parameter}} fxc-error {{X3000: syntax error: unexpected token 'out'}} */ //inout float fn_inout() { return 1.0f; } /* expected-error {{HLSL usage 'inout' is only valid on a parameter}} fxc-error {{X3000: syntax error: unexpected token 'inout'}} */ -}; +}; \ No newline at end of file diff --git a/tools/clang/test/HLSLFileCheck/hlsl/types/conversions/varmods-syntax_Mod.hlsl b/tools/clang/test/HLSLFileCheck/hlsl/types/conversions/varmods-syntax_Mod.hlsl index 1ec583e9f7..fa2c367051 100644 --- a/tools/clang/test/HLSLFileCheck/hlsl/types/conversions/varmods-syntax_Mod.hlsl +++ b/tools/clang/test/HLSLFileCheck/hlsl/types/conversions/varmods-syntax_Mod.hlsl @@ -40,7 +40,7 @@ def make_trunc(num): return trunc linear_mods = ['linear', 'sample', 'noperspective', 'centroid'] interp_combos = [('nointerpolation',)] + [('nointerpolation', mod) for mod in linear_mods] + list(gen_combos(linear_mods)) -storage_mods = 'groupshared extern precise static uniform const'.split() +storage_mods = 'groupshared extern precise static uniform volatile const'.split() bad_storage_combos = [('groupshared', 'extern'), ('extern', 'static'), ('static', 'uniform')] @@ -127,7 +127,11 @@ const float g_con_init = 1.0f; /* fxc-warning {{X32 // modify(lines, gen_code('typedef %(mods)s float2 t_%(id)s;', storage_combos)) // GENERATED_CODE:BEGIN typedef precise float2 t_pre; +typedef precise volatile float2 t_pre_vol; +typedef precise volatile const float2 t_pre_vol_con; typedef precise const float2 t_pre_con; +typedef volatile float2 t_vol; +typedef volatile const float2 t_vol_con; typedef const float2 t_con; // GENERATED_CODE:END @@ -290,16 +294,26 @@ void main() { // GENERATED_CODE:BEGIN precise float l_pre; precise static float l_pre_sta; + precise static volatile float l_pre_sta_vol; + precise static volatile const float l_pre_sta_vol_con; precise static const float l_pre_sta_con; + precise volatile float l_pre_vol; static float l_sta; + static volatile float l_sta_vol; + static volatile const float l_sta_vol_con; static const float l_sta_con; + volatile float l_vol; // GENERATED_CODE:END // Now with const vars initialized: // modify(lines, gen_code('%(mods)s float l_%(id)s_init = 0.0;', filter(lambda combo: 'const' in combo, storage_combos))) // GENERATED_CODE:BEGIN + precise static volatile const float l_pre_sta_vol_con_init = 0.0; precise static const float l_pre_sta_con_init = 0.0; + precise volatile const float l_pre_vol_con_init = 0.0; precise const float l_pre_con_init = 0.0; + static volatile const float l_sta_vol_con_init = 0.0; static const float l_sta_con_init = 0.0; + volatile const float l_vol_con_init = 0.0; const float l_con_init = 0.0; // GENERATED_CODE:END @@ -364,4 +378,4 @@ class C // GENERATED_CODE:END -}; +}; \ No newline at end of file diff --git a/tools/clang/test/SemaHLSL/varmods-syntax.hlsl b/tools/clang/test/SemaHLSL/varmods-syntax.hlsl index b6788f4234..17fa7cd810 100644 --- a/tools/clang/test/SemaHLSL/varmods-syntax.hlsl +++ b/tools/clang/test/SemaHLSL/varmods-syntax.hlsl @@ -69,65 +69,65 @@ static uniform float2 g_sta_uni; /* expected-error {{ groupshared float2 g_gro; groupshared precise float2 g_gro_pre; groupshared precise static float2 g_gro_pre_sta; -groupshared precise static volatile float2 g_gro_pre_sta_vol; /* expected-error {{'volatile' is a reserved keyword in HLSL}} fxc-error {{X3008: 'g_gro_pre_sta_vol': global variables cannot be declared 'volatile'}} */ -groupshared precise static volatile const float2 g_gro_pre_sta_vol_con; /* expected-error {{'volatile' is a reserved keyword in HLSL}} fxc-error {{X3008: 'g_gro_pre_sta_vol_con': global variables cannot be declared 'volatile'}} */ +groupshared precise static volatile float2 g_gro_pre_sta_vol; /* expected-error {{'volatile' is not a valid modifier for a global variable}} fxc-error {{X3008: 'g_gro_pre_sta_vol': global variables cannot be declared 'volatile'}} */ +groupshared precise static volatile const float2 g_gro_pre_sta_vol_con; /* expected-error {{'volatile' is not a valid modifier for a global variable}} fxc-error {{X3008: 'g_gro_pre_sta_vol_con': global variables cannot be declared 'volatile'}} */ groupshared precise static const float2 g_gro_pre_sta_con; /* fxc-error {{X3012: 'g_gro_pre_sta_con': missing initial value}} */ groupshared precise uniform float2 g_gro_pre_uni; /* fxc-error {{X3010: 'g_gro_pre_uni': uniform global variables cannot be declared 'groupshared'}} */ -groupshared precise uniform volatile float2 g_gro_pre_uni_vol; /* expected-error {{'volatile' is a reserved keyword in HLSL}} fxc-error {{X3008: 'g_gro_pre_uni_vol': global variables cannot be declared 'volatile'}} fxc-error {{X3010: 'g_gro_pre_uni_vol': uniform global variables cannot be declared 'groupshared'}} */ -groupshared precise uniform volatile const float2 g_gro_pre_uni_vol_con; /* expected-error {{'volatile' is a reserved keyword in HLSL}} fxc-error {{X3008: 'g_gro_pre_uni_vol_con': global variables cannot be declared 'volatile'}} fxc-error {{X3010: 'g_gro_pre_uni_vol_con': uniform global variables cannot be declared 'groupshared'}} */ +groupshared precise uniform volatile float2 g_gro_pre_uni_vol; /* expected-error {{'volatile' is not a valid modifier for a global variable}} fxc-error {{X3008: 'g_gro_pre_uni_vol': global variables cannot be declared 'volatile'}} fxc-error {{X3010: 'g_gro_pre_uni_vol': uniform global variables cannot be declared 'groupshared'}} */ +groupshared precise uniform volatile const float2 g_gro_pre_uni_vol_con; /* expected-error {{'volatile' is not a valid modifier for a global variable}} fxc-error {{X3008: 'g_gro_pre_uni_vol_con': global variables cannot be declared 'volatile'}} fxc-error {{X3010: 'g_gro_pre_uni_vol_con': uniform global variables cannot be declared 'groupshared'}} */ groupshared precise uniform const float2 g_gro_pre_uni_con; /* fxc-error {{X3010: 'g_gro_pre_uni_con': uniform global variables cannot be declared 'groupshared'}} */ -groupshared precise volatile float2 g_gro_pre_vol; /* expected-error {{'volatile' is a reserved keyword in HLSL}} fxc-error {{X3008: 'g_gro_pre_vol': global variables cannot be declared 'volatile'}} */ -groupshared precise volatile const float2 g_gro_pre_vol_con; /* expected-error {{'volatile' is a reserved keyword in HLSL}} fxc-error {{X3008: 'g_gro_pre_vol_con': global variables cannot be declared 'volatile'}} */ +groupshared precise volatile float2 g_gro_pre_vol; /* expected-error {{'volatile' is not a valid modifier for a global variable}} fxc-error {{X3008: 'g_gro_pre_vol': global variables cannot be declared 'volatile'}} */ +groupshared precise volatile const float2 g_gro_pre_vol_con; /* expected-error {{'volatile' is not a valid modifier for a global variable}} fxc-error {{X3008: 'g_gro_pre_vol_con': global variables cannot be declared 'volatile'}} */ groupshared precise const float2 g_gro_pre_con; /* fxc-error {{X3012: 'g_gro_pre_con': missing initial value}} */ groupshared static float2 g_gro_sta; -groupshared static volatile float2 g_gro_sta_vol; /* expected-error {{'volatile' is a reserved keyword in HLSL}} fxc-error {{X3008: 'g_gro_sta_vol': global variables cannot be declared 'volatile'}} */ -groupshared static volatile const float2 g_gro_sta_vol_con; /* expected-error {{'volatile' is a reserved keyword in HLSL}} fxc-error {{X3008: 'g_gro_sta_vol_con': global variables cannot be declared 'volatile'}} */ +groupshared static volatile float2 g_gro_sta_vol; /* expected-error {{'volatile' is not a valid modifier for a global variable}} fxc-error {{X3008: 'g_gro_sta_vol': global variables cannot be declared 'volatile'}} */ +groupshared static volatile const float2 g_gro_sta_vol_con; /* expected-error {{'volatile' is not a valid modifier for a global variable}} fxc-error {{X3008: 'g_gro_sta_vol_con': global variables cannot be declared 'volatile'}} */ groupshared static const float2 g_gro_sta_con; /* fxc-error {{X3012: 'g_gro_sta_con': missing initial value}} */ groupshared uniform float2 g_gro_uni; /* fxc-error {{X3010: 'g_gro_uni': uniform global variables cannot be declared 'groupshared'}} */ -groupshared uniform volatile float2 g_gro_uni_vol; /* expected-error {{'volatile' is a reserved keyword in HLSL}} fxc-error {{X3008: 'g_gro_uni_vol': global variables cannot be declared 'volatile'}} fxc-error {{X3010: 'g_gro_uni_vol': uniform global variables cannot be declared 'groupshared'}} */ -groupshared uniform volatile const float2 g_gro_uni_vol_con; /* expected-error {{'volatile' is a reserved keyword in HLSL}} fxc-error {{X3008: 'g_gro_uni_vol_con': global variables cannot be declared 'volatile'}} fxc-error {{X3010: 'g_gro_uni_vol_con': uniform global variables cannot be declared 'groupshared'}} */ +groupshared uniform volatile float2 g_gro_uni_vol; /* expected-error {{'volatile' is not a valid modifier for a global variable}} fxc-error {{X3008: 'g_gro_uni_vol': global variables cannot be declared 'volatile'}} fxc-error {{X3010: 'g_gro_uni_vol': uniform global variables cannot be declared 'groupshared'}} */ +groupshared uniform volatile const float2 g_gro_uni_vol_con; /* expected-error {{'volatile' is not a valid modifier for a global variable}} fxc-error {{X3008: 'g_gro_uni_vol_con': global variables cannot be declared 'volatile'}} fxc-error {{X3010: 'g_gro_uni_vol_con': uniform global variables cannot be declared 'groupshared'}} */ groupshared uniform const float2 g_gro_uni_con; /* fxc-error {{X3010: 'g_gro_uni_con': uniform global variables cannot be declared 'groupshared'}} */ -groupshared volatile float2 g_gro_vol; /* expected-error {{'volatile' is a reserved keyword in HLSL}} fxc-error {{X3008: 'g_gro_vol': global variables cannot be declared 'volatile'}} */ -groupshared volatile const float2 g_gro_vol_con; /* expected-error {{'volatile' is a reserved keyword in HLSL}} fxc-error {{X3008: 'g_gro_vol_con': global variables cannot be declared 'volatile'}} */ +groupshared volatile float2 g_gro_vol; /* expected-error {{'volatile' is not a valid modifier for a global variable}} fxc-error {{X3008: 'g_gro_vol': global variables cannot be declared 'volatile'}} */ +groupshared volatile const float2 g_gro_vol_con; /* expected-error {{'volatile' is not a valid modifier for a global variable}} fxc-error {{X3008: 'g_gro_vol_con': global variables cannot be declared 'volatile'}} */ groupshared const float2 g_gro_con; /* fxc-error {{X3012: 'g_gro_con': missing initial value}} */ extern float2 g_ext; extern precise float2 g_ext_pre; extern precise uniform float2 g_ext_pre_uni; -extern precise uniform volatile float2 g_ext_pre_uni_vol; /* expected-error {{'volatile' is a reserved keyword in HLSL}} fxc-error {{X3008: 'g_ext_pre_uni_vol': global variables cannot be declared 'volatile'}} */ -extern precise uniform volatile const float2 g_ext_pre_uni_vol_con; /* expected-error {{'volatile' is a reserved keyword in HLSL}} fxc-error {{X3008: 'g_ext_pre_uni_vol_con': global variables cannot be declared 'volatile'}} */ +extern precise uniform volatile float2 g_ext_pre_uni_vol; /* expected-error {{'volatile' is not a valid modifier for a global variable}} fxc-error {{X3008: 'g_ext_pre_uni_vol': global variables cannot be declared 'volatile'}} */ +extern precise uniform volatile const float2 g_ext_pre_uni_vol_con; /* expected-error {{'volatile' is not a valid modifier for a global variable}} fxc-error {{X3008: 'g_ext_pre_uni_vol_con': global variables cannot be declared 'volatile'}} */ extern precise uniform const float2 g_ext_pre_uni_con; -extern precise volatile float2 g_ext_pre_vol; /* expected-error {{'volatile' is a reserved keyword in HLSL}} fxc-error {{X3008: 'g_ext_pre_vol': global variables cannot be declared 'volatile'}} */ -extern precise volatile const float2 g_ext_pre_vol_con; /* expected-error {{'volatile' is a reserved keyword in HLSL}} fxc-error {{X3008: 'g_ext_pre_vol_con': global variables cannot be declared 'volatile'}} */ +extern precise volatile float2 g_ext_pre_vol; /* expected-error {{'volatile' is not a valid modifier for a global variable}} fxc-error {{X3008: 'g_ext_pre_vol': global variables cannot be declared 'volatile'}} */ +extern precise volatile const float2 g_ext_pre_vol_con; /* expected-error {{'volatile' is not a valid modifier for a global variable}} fxc-error {{X3008: 'g_ext_pre_vol_con': global variables cannot be declared 'volatile'}} */ extern precise const float2 g_ext_pre_con; extern uniform float2 g_ext_uni; -extern uniform volatile float2 g_ext_uni_vol; /* expected-error {{'volatile' is a reserved keyword in HLSL}} fxc-error {{X3008: 'g_ext_uni_vol': global variables cannot be declared 'volatile'}} */ -extern uniform volatile const float2 g_ext_uni_vol_con; /* expected-error {{'volatile' is a reserved keyword in HLSL}} fxc-error {{X3008: 'g_ext_uni_vol_con': global variables cannot be declared 'volatile'}} */ +extern uniform volatile float2 g_ext_uni_vol; /* expected-error {{'volatile' is not a valid modifier for a global variable}} fxc-error {{X3008: 'g_ext_uni_vol': global variables cannot be declared 'volatile'}} */ +extern uniform volatile const float2 g_ext_uni_vol_con; /* expected-error {{'volatile' is not a valid modifier for a global variable}} fxc-error {{X3008: 'g_ext_uni_vol_con': global variables cannot be declared 'volatile'}} */ extern uniform const float2 g_ext_uni_con; -extern volatile float2 g_ext_vol; /* expected-error {{'volatile' is a reserved keyword in HLSL}} fxc-error {{X3008: 'g_ext_vol': global variables cannot be declared 'volatile'}} */ -extern volatile const float2 g_ext_vol_con; /* expected-error {{'volatile' is a reserved keyword in HLSL}} fxc-error {{X3008: 'g_ext_vol_con': global variables cannot be declared 'volatile'}} */ +extern volatile float2 g_ext_vol; /* expected-error {{'volatile' is not a valid modifier for a global variable}} fxc-error {{X3008: 'g_ext_vol': global variables cannot be declared 'volatile'}} */ +extern volatile const float2 g_ext_vol_con; /* expected-error {{'volatile' is not a valid modifier for a global variable}} fxc-error {{X3008: 'g_ext_vol_con': global variables cannot be declared 'volatile'}} */ extern const float2 g_ext_con; precise float2 g_pre; precise static float2 g_pre_sta; -precise static volatile float2 g_pre_sta_vol; /* expected-error {{'volatile' is a reserved keyword in HLSL}} fxc-error {{X3008: 'g_pre_sta_vol': global variables cannot be declared 'volatile'}} */ -precise static volatile const float2 g_pre_sta_vol_con; /* expected-error {{'volatile' is a reserved keyword in HLSL}} fxc-error {{X3008: 'g_pre_sta_vol_con': global variables cannot be declared 'volatile'}} */ +precise static volatile float2 g_pre_sta_vol; /* expected-error {{'volatile' is not a valid modifier for a global variable}} fxc-error {{X3008: 'g_pre_sta_vol': global variables cannot be declared 'volatile'}} */ +precise static volatile const float2 g_pre_sta_vol_con; /* expected-error {{'volatile' is not a valid modifier for a global variable}} fxc-error {{X3008: 'g_pre_sta_vol_con': global variables cannot be declared 'volatile'}} */ precise static const float2 g_pre_sta_con; precise uniform float2 g_pre_uni; -precise uniform volatile float2 g_pre_uni_vol; /* expected-error {{'volatile' is a reserved keyword in HLSL}} fxc-error {{X3008: 'g_pre_uni_vol': global variables cannot be declared 'volatile'}} */ -precise uniform volatile const float2 g_pre_uni_vol_con; /* expected-error {{'volatile' is a reserved keyword in HLSL}} fxc-error {{X3008: 'g_pre_uni_vol_con': global variables cannot be declared 'volatile'}} */ +precise uniform volatile float2 g_pre_uni_vol; /* expected-error {{'volatile' is not a valid modifier for a global variable}} fxc-error {{X3008: 'g_pre_uni_vol': global variables cannot be declared 'volatile'}} */ +precise uniform volatile const float2 g_pre_uni_vol_con; /* expected-error {{'volatile' is not a valid modifier for a global variable}} fxc-error {{X3008: 'g_pre_uni_vol_con': global variables cannot be declared 'volatile'}} */ precise uniform const float2 g_pre_uni_con; -precise volatile float2 g_pre_vol; /* expected-error {{'volatile' is a reserved keyword in HLSL}} fxc-error {{X3008: 'g_pre_vol': global variables cannot be declared 'volatile'}} */ -precise volatile const float2 g_pre_vol_con; /* expected-error {{'volatile' is a reserved keyword in HLSL}} fxc-error {{X3008: 'g_pre_vol_con': global variables cannot be declared 'volatile'}} */ +precise volatile float2 g_pre_vol; /* expected-error {{'volatile' is not a valid modifier for a global variable}} fxc-error {{X3008: 'g_pre_vol': global variables cannot be declared 'volatile'}} */ +precise volatile const float2 g_pre_vol_con; /* expected-error {{'volatile' is not a valid modifier for a global variable}} fxc-error {{X3008: 'g_pre_vol_con': global variables cannot be declared 'volatile'}} */ precise const float2 g_pre_con; static float2 g_sta; -static volatile float2 g_sta_vol; /* expected-error {{'volatile' is a reserved keyword in HLSL}} fxc-error {{X3008: 'g_sta_vol': global variables cannot be declared 'volatile'}} */ -static volatile const float2 g_sta_vol_con; /* expected-error {{'volatile' is a reserved keyword in HLSL}} fxc-error {{X3008: 'g_sta_vol_con': global variables cannot be declared 'volatile'}} */ +static volatile float2 g_sta_vol; /* expected-error {{'volatile' is not a valid modifier for a global variable}} fxc-error {{X3008: 'g_sta_vol': global variables cannot be declared 'volatile'}} */ +static volatile const float2 g_sta_vol_con; /* expected-error {{'volatile' is not a valid modifier for a global variable}} fxc-error {{X3008: 'g_sta_vol_con': global variables cannot be declared 'volatile'}} */ static const float2 g_sta_con; uniform float2 g_uni; -uniform volatile float2 g_uni_vol; /* expected-error {{'volatile' is a reserved keyword in HLSL}} fxc-error {{X3008: 'g_uni_vol': global variables cannot be declared 'volatile'}} */ -uniform volatile const float2 g_uni_vol_con; /* expected-error {{'volatile' is a reserved keyword in HLSL}} fxc-error {{X3008: 'g_uni_vol_con': global variables cannot be declared 'volatile'}} */ +uniform volatile float2 g_uni_vol; /* expected-error {{'volatile' is not a valid modifier for a global variable}} fxc-error {{X3008: 'g_uni_vol': global variables cannot be declared 'volatile'}} */ +uniform volatile const float2 g_uni_vol_con; /* expected-error {{'volatile' is not a valid modifier for a global variable}} fxc-error {{X3008: 'g_uni_vol_con': global variables cannot be declared 'volatile'}} */ uniform const float2 g_uni_con; -volatile float2 g_vol; /* expected-error {{'volatile' is a reserved keyword in HLSL}} fxc-error {{X3008: 'g_vol': global variables cannot be declared 'volatile'}} */ -volatile const float2 g_vol_con; /* expected-error {{'volatile' is a reserved keyword in HLSL}} fxc-error {{X3008: 'g_vol_con': global variables cannot be declared 'volatile'}} */ +volatile float2 g_vol; /* expected-error {{'volatile' is not a valid modifier for a global variable}} fxc-error {{X3008: 'g_vol': global variables cannot be declared 'volatile'}} */ +volatile const float2 g_vol_con; /* expected-error {{'volatile' is not a valid modifier for a global variable}} fxc-error {{X3008: 'g_vol_con': global variables cannot be declared 'volatile'}} */ const float2 g_con; // GENERATED_CODE:END @@ -140,65 +140,65 @@ static uniform float g_sta_uni_init = 1.0f; /* expected-error {{ groupshared float g_gro_init = 1.0f; groupshared precise float g_gro_pre_init = 1.0f; groupshared precise static float g_gro_pre_sta_init = 1.0f; -groupshared precise static volatile float g_gro_pre_sta_vol_init = 1.0f; /* expected-error {{'volatile' is a reserved keyword in HLSL}} fxc-error {{X3008: 'g_gro_pre_sta_vol_init': global variables cannot be declared 'volatile'}} */ -groupshared precise static volatile const float g_gro_pre_sta_vol_con_init = 1.0f; /* expected-error {{'volatile' is a reserved keyword in HLSL}} fxc-error {{X3008: 'g_gro_pre_sta_vol_con_init': global variables cannot be declared 'volatile'}} */ +groupshared precise static volatile float g_gro_pre_sta_vol_init = 1.0f; /* expected-error {{'volatile' is not a valid modifier for a global variable}} fxc-error {{X3008: 'g_gro_pre_sta_vol_init': global variables cannot be declared 'volatile'}} */ +groupshared precise static volatile const float g_gro_pre_sta_vol_con_init = 1.0f; /* expected-error {{'volatile' is not a valid modifier for a global variable}} fxc-error {{X3008: 'g_gro_pre_sta_vol_con_init': global variables cannot be declared 'volatile'}} */ groupshared precise static const float g_gro_pre_sta_con_init = 1.0f; groupshared precise uniform float g_gro_pre_uni_init = 1.0f; /* fxc-error {{X3010: 'g_gro_pre_uni_init': uniform global variables cannot be declared 'groupshared'}} */ -groupshared precise uniform volatile float g_gro_pre_uni_vol_init = 1.0f; /* expected-error {{'volatile' is a reserved keyword in HLSL}} fxc-error {{X3008: 'g_gro_pre_uni_vol_init': global variables cannot be declared 'volatile'}} fxc-error {{X3010: 'g_gro_pre_uni_vol_init': uniform global variables cannot be declared 'groupshared'}} */ -groupshared precise uniform volatile const float g_gro_pre_uni_vol_con_init = 1.0f; /* expected-error {{'volatile' is a reserved keyword in HLSL}} fxc-error {{X3008: 'g_gro_pre_uni_vol_con_init': global variables cannot be declared 'volatile'}} fxc-error {{X3010: 'g_gro_pre_uni_vol_con_init': uniform global variables cannot be declared 'groupshared'}} */ +groupshared precise uniform volatile float g_gro_pre_uni_vol_init = 1.0f; /* expected-error {{'volatile' is not a valid modifier for a global variable}} fxc-error {{X3008: 'g_gro_pre_uni_vol_init': global variables cannot be declared 'volatile'}} fxc-error {{X3010: 'g_gro_pre_uni_vol_init': uniform global variables cannot be declared 'groupshared'}} */ +groupshared precise uniform volatile const float g_gro_pre_uni_vol_con_init = 1.0f; /* expected-error {{'volatile' is not a valid modifier for a global variable}} fxc-error {{X3008: 'g_gro_pre_uni_vol_con_init': global variables cannot be declared 'volatile'}} fxc-error {{X3010: 'g_gro_pre_uni_vol_con_init': uniform global variables cannot be declared 'groupshared'}} */ groupshared precise uniform const float g_gro_pre_uni_con_init = 1.0f; /* fxc-error {{X3010: 'g_gro_pre_uni_con_init': uniform global variables cannot be declared 'groupshared'}} */ -groupshared precise volatile float g_gro_pre_vol_init = 1.0f; /* expected-error {{'volatile' is a reserved keyword in HLSL}} fxc-error {{X3008: 'g_gro_pre_vol_init': global variables cannot be declared 'volatile'}} */ -groupshared precise volatile const float g_gro_pre_vol_con_init = 1.0f; /* expected-error {{'volatile' is a reserved keyword in HLSL}} fxc-error {{X3008: 'g_gro_pre_vol_con_init': global variables cannot be declared 'volatile'}} */ +groupshared precise volatile float g_gro_pre_vol_init = 1.0f; /* expected-error {{'volatile' is not a valid modifier for a global variable}} fxc-error {{X3008: 'g_gro_pre_vol_init': global variables cannot be declared 'volatile'}} */ +groupshared precise volatile const float g_gro_pre_vol_con_init = 1.0f; /* expected-error {{'volatile' is not a valid modifier for a global variable}} fxc-error {{X3008: 'g_gro_pre_vol_con_init': global variables cannot be declared 'volatile'}} */ groupshared precise const float g_gro_pre_con_init = 1.0f; groupshared static float g_gro_sta_init = 1.0f; -groupshared static volatile float g_gro_sta_vol_init = 1.0f; /* expected-error {{'volatile' is a reserved keyword in HLSL}} fxc-error {{X3008: 'g_gro_sta_vol_init': global variables cannot be declared 'volatile'}} */ -groupshared static volatile const float g_gro_sta_vol_con_init = 1.0f; /* expected-error {{'volatile' is a reserved keyword in HLSL}} fxc-error {{X3008: 'g_gro_sta_vol_con_init': global variables cannot be declared 'volatile'}} */ +groupshared static volatile float g_gro_sta_vol_init = 1.0f; /* expected-error {{'volatile' is not a valid modifier for a global variable}} fxc-error {{X3008: 'g_gro_sta_vol_init': global variables cannot be declared 'volatile'}} */ +groupshared static volatile const float g_gro_sta_vol_con_init = 1.0f; /* expected-error {{'volatile' is not a valid modifier for a global variable}} fxc-error {{X3008: 'g_gro_sta_vol_con_init': global variables cannot be declared 'volatile'}} */ groupshared static const float g_gro_sta_con_init = 1.0f; groupshared uniform float g_gro_uni_init = 1.0f; /* fxc-error {{X3010: 'g_gro_uni_init': uniform global variables cannot be declared 'groupshared'}} */ -groupshared uniform volatile float g_gro_uni_vol_init = 1.0f; /* expected-error {{'volatile' is a reserved keyword in HLSL}} fxc-error {{X3008: 'g_gro_uni_vol_init': global variables cannot be declared 'volatile'}} fxc-error {{X3010: 'g_gro_uni_vol_init': uniform global variables cannot be declared 'groupshared'}} */ -groupshared uniform volatile const float g_gro_uni_vol_con_init = 1.0f; /* expected-error {{'volatile' is a reserved keyword in HLSL}} fxc-error {{X3008: 'g_gro_uni_vol_con_init': global variables cannot be declared 'volatile'}} fxc-error {{X3010: 'g_gro_uni_vol_con_init': uniform global variables cannot be declared 'groupshared'}} */ +groupshared uniform volatile float g_gro_uni_vol_init = 1.0f; /* expected-error {{'volatile' is not a valid modifier for a global variable}} fxc-error {{X3008: 'g_gro_uni_vol_init': global variables cannot be declared 'volatile'}} fxc-error {{X3010: 'g_gro_uni_vol_init': uniform global variables cannot be declared 'groupshared'}} */ +groupshared uniform volatile const float g_gro_uni_vol_con_init = 1.0f; /* expected-error {{'volatile' is not a valid modifier for a global variable}} fxc-error {{X3008: 'g_gro_uni_vol_con_init': global variables cannot be declared 'volatile'}} fxc-error {{X3010: 'g_gro_uni_vol_con_init': uniform global variables cannot be declared 'groupshared'}} */ groupshared uniform const float g_gro_uni_con_init = 1.0f; /* fxc-error {{X3010: 'g_gro_uni_con_init': uniform global variables cannot be declared 'groupshared'}} */ -groupshared volatile float g_gro_vol_init = 1.0f; /* expected-error {{'volatile' is a reserved keyword in HLSL}} fxc-error {{X3008: 'g_gro_vol_init': global variables cannot be declared 'volatile'}} */ -groupshared volatile const float g_gro_vol_con_init = 1.0f; /* expected-error {{'volatile' is a reserved keyword in HLSL}} fxc-error {{X3008: 'g_gro_vol_con_init': global variables cannot be declared 'volatile'}} */ +groupshared volatile float g_gro_vol_init = 1.0f; /* expected-error {{'volatile' is not a valid modifier for a global variable}} fxc-error {{X3008: 'g_gro_vol_init': global variables cannot be declared 'volatile'}} */ +groupshared volatile const float g_gro_vol_con_init = 1.0f; /* expected-error {{'volatile' is not a valid modifier for a global variable}} fxc-error {{X3008: 'g_gro_vol_con_init': global variables cannot be declared 'volatile'}} */ groupshared const float g_gro_con_init = 1.0f; extern float g_ext_init = 1.0f; /* expected-warning {{'extern' variable has an initializer}} fxc-pass {{}} */ extern precise float g_ext_pre_init = 1.0f; /* expected-warning {{'extern' variable has an initializer}} fxc-pass {{}} */ extern precise uniform float g_ext_pre_uni_init = 1.0f; /* expected-warning {{'extern' variable has an initializer}} fxc-pass {{}} */ -extern precise uniform volatile float g_ext_pre_uni_vol_init = 1.0f; /* expected-error {{'volatile' is a reserved keyword in HLSL}} fxc-error {{X3008: 'g_ext_pre_uni_vol_init': global variables cannot be declared 'volatile'}} expected-warning {{'extern' variable has an initializer}} */ -extern precise uniform volatile const float g_ext_pre_uni_vol_con_init = 1.0f; /* expected-error {{'volatile' is a reserved keyword in HLSL}} fxc-error {{X3008: 'g_ext_pre_uni_vol_con_init': global variables cannot be declared 'volatile'}} expected-warning {{'extern' variable has an initializer}} */ +extern precise uniform volatile float g_ext_pre_uni_vol_init = 1.0f; /* expected-error {{'volatile' is not a valid modifier for a global variable}} fxc-error {{X3008: 'g_ext_pre_uni_vol_init': global variables cannot be declared 'volatile'}} */ +extern precise uniform volatile const float g_ext_pre_uni_vol_con_init = 1.0f; /* expected-error {{'volatile' is not a valid modifier for a global variable}} fxc-error {{X3008: 'g_ext_pre_uni_vol_con_init': global variables cannot be declared 'volatile'}} */ extern precise uniform const float g_ext_pre_uni_con_init = 1.0f; /* expected-warning {{'extern' variable has an initializer}} fxc-warning {{X3207: Initializer used on a global 'const' variable. This requires setting an external constant. If a literal is desired, use 'static const' instead.}} */ -extern precise volatile float g_ext_pre_vol_init = 1.0f; /* expected-error {{'volatile' is a reserved keyword in HLSL}} fxc-error {{X3008: 'g_ext_pre_vol_init': global variables cannot be declared 'volatile'}} expected-warning {{'extern' variable has an initializer}} */ -extern precise volatile const float g_ext_pre_vol_con_init = 1.0f; /* expected-error {{'volatile' is a reserved keyword in HLSL}} fxc-error {{X3008: 'g_ext_pre_vol_con_init': global variables cannot be declared 'volatile'}} expected-warning {{'extern' variable has an initializer}} */ +extern precise volatile float g_ext_pre_vol_init = 1.0f; /* expected-error {{'volatile' is not a valid modifier for a global variable}} fxc-error {{X3008: 'g_ext_pre_vol_init': global variables cannot be declared 'volatile'}} */ +extern precise volatile const float g_ext_pre_vol_con_init = 1.0f; /* expected-error {{'volatile' is not a valid modifier for a global variable}} fxc-error {{X3008: 'g_ext_pre_vol_con_init': global variables cannot be declared 'volatile'}} */ extern precise const float g_ext_pre_con_init = 1.0f; /* expected-warning {{'extern' variable has an initializer}} fxc-warning {{X3207: Initializer used on a global 'const' variable. This requires setting an external constant. If a literal is desired, use 'static const' instead.}} */ extern uniform float g_ext_uni_init = 1.0f; /* expected-warning {{'extern' variable has an initializer}} fxc-pass {{}} */ -extern uniform volatile float g_ext_uni_vol_init = 1.0f; /* expected-error {{'volatile' is a reserved keyword in HLSL}} fxc-error {{X3008: 'g_ext_uni_vol_init': global variables cannot be declared 'volatile'}} expected-warning {{'extern' variable has an initializer}} */ -extern uniform volatile const float g_ext_uni_vol_con_init = 1.0f; /* expected-error {{'volatile' is a reserved keyword in HLSL}} fxc-error {{X3008: 'g_ext_uni_vol_con_init': global variables cannot be declared 'volatile'}} expected-warning {{'extern' variable has an initializer}} */ +extern uniform volatile float g_ext_uni_vol_init = 1.0f; /* expected-error {{'volatile' is not a valid modifier for a global variable}} fxc-error {{X3008: 'g_ext_uni_vol_init': global variables cannot be declared 'volatile'}} */ +extern uniform volatile const float g_ext_uni_vol_con_init = 1.0f; /* expected-error {{'volatile' is not a valid modifier for a global variable}} fxc-error {{X3008: 'g_ext_uni_vol_con_init': global variables cannot be declared 'volatile'}} */ extern uniform const float g_ext_uni_con_init = 1.0f; /* expected-warning {{'extern' variable has an initializer}} fxc-warning {{X3207: Initializer used on a global 'const' variable. This requires setting an external constant. If a literal is desired, use 'static const' instead.}} */ -extern volatile float g_ext_vol_init = 1.0f; /* expected-error {{'volatile' is a reserved keyword in HLSL}} fxc-error {{X3008: 'g_ext_vol_init': global variables cannot be declared 'volatile'}} expected-warning {{'extern' variable has an initializer}} */ -extern volatile const float g_ext_vol_con_init = 1.0f; /* expected-error {{'volatile' is a reserved keyword in HLSL}} fxc-error {{X3008: 'g_ext_vol_con_init': global variables cannot be declared 'volatile'}} expected-warning {{'extern' variable has an initializer}} */ +extern volatile float g_ext_vol_init = 1.0f; /* expected-error {{'volatile' is not a valid modifier for a global variable}} fxc-error {{X3008: 'g_ext_vol_init': global variables cannot be declared 'volatile'}} */ +extern volatile const float g_ext_vol_con_init = 1.0f; /* expected-error {{'volatile' is not a valid modifier for a global variable}} fxc-error {{X3008: 'g_ext_vol_con_init': global variables cannot be declared 'volatile'}} */ extern const float g_ext_con_init = 1.0f; /* expected-warning {{'extern' variable has an initializer}} fxc-warning {{X3207: Initializer used on a global 'const' variable. This requires setting an external constant. If a literal is desired, use 'static const' instead.}} */ precise float g_pre_init = 1.0f; precise static float g_pre_sta_init = 1.0f; -precise static volatile float g_pre_sta_vol_init = 1.0f; /* expected-error {{'volatile' is a reserved keyword in HLSL}} fxc-error {{X3008: 'g_pre_sta_vol_init': global variables cannot be declared 'volatile'}} */ -precise static volatile const float g_pre_sta_vol_con_init = 1.0f; /* expected-error {{'volatile' is a reserved keyword in HLSL}} fxc-error {{X3008: 'g_pre_sta_vol_con_init': global variables cannot be declared 'volatile'}} */ +precise static volatile float g_pre_sta_vol_init = 1.0f; /* expected-error {{'volatile' is not a valid modifier for a global variable}} fxc-error {{X3008: 'g_pre_sta_vol_init': global variables cannot be declared 'volatile'}} */ +precise static volatile const float g_pre_sta_vol_con_init = 1.0f; /* expected-error {{'volatile' is not a valid modifier for a global variable}} fxc-error {{X3008: 'g_pre_sta_vol_con_init': global variables cannot be declared 'volatile'}} */ precise static const float g_pre_sta_con_init = 1.0f; precise uniform float g_pre_uni_init = 1.0f; -precise uniform volatile float g_pre_uni_vol_init = 1.0f; /* expected-error {{'volatile' is a reserved keyword in HLSL}} fxc-error {{X3008: 'g_pre_uni_vol_init': global variables cannot be declared 'volatile'}} */ -precise uniform volatile const float g_pre_uni_vol_con_init = 1.0f; /* expected-error {{'volatile' is a reserved keyword in HLSL}} fxc-error {{X3008: 'g_pre_uni_vol_con_init': global variables cannot be declared 'volatile'}} */ +precise uniform volatile float g_pre_uni_vol_init = 1.0f; /* expected-error {{'volatile' is not a valid modifier for a global variable}} fxc-error {{X3008: 'g_pre_uni_vol_init': global variables cannot be declared 'volatile'}} */ +precise uniform volatile const float g_pre_uni_vol_con_init = 1.0f; /* expected-error {{'volatile' is not a valid modifier for a global variable}} fxc-error {{X3008: 'g_pre_uni_vol_con_init': global variables cannot be declared 'volatile'}} */ precise uniform const float g_pre_uni_con_init = 1.0f; /* fxc-warning {{X3207: Initializer used on a global 'const' variable. This requires setting an external constant. If a literal is desired, use 'static const' instead.}} */ -precise volatile float g_pre_vol_init = 1.0f; /* expected-error {{'volatile' is a reserved keyword in HLSL}} fxc-error {{X3008: 'g_pre_vol_init': global variables cannot be declared 'volatile'}} */ -precise volatile const float g_pre_vol_con_init = 1.0f; /* expected-error {{'volatile' is a reserved keyword in HLSL}} fxc-error {{X3008: 'g_pre_vol_con_init': global variables cannot be declared 'volatile'}} */ +precise volatile float g_pre_vol_init = 1.0f; /* expected-error {{'volatile' is not a valid modifier for a global variable}} fxc-error {{X3008: 'g_pre_vol_init': global variables cannot be declared 'volatile'}} */ +precise volatile const float g_pre_vol_con_init = 1.0f; /* expected-error {{'volatile' is not a valid modifier for a global variable}} fxc-error {{X3008: 'g_pre_vol_con_init': global variables cannot be declared 'volatile'}} */ precise const float g_pre_con_init = 1.0f; /* fxc-warning {{X3207: Initializer used on a global 'const' variable. This requires setting an external constant. If a literal is desired, use 'static const' instead.}} */ static float g_sta_init = 1.0f; -static volatile float g_sta_vol_init = 1.0f; /* expected-error {{'volatile' is a reserved keyword in HLSL}} fxc-error {{X3008: 'g_sta_vol_init': global variables cannot be declared 'volatile'}} */ -static volatile const float g_sta_vol_con_init = 1.0f; /* expected-error {{'volatile' is a reserved keyword in HLSL}} fxc-error {{X3008: 'g_sta_vol_con_init': global variables cannot be declared 'volatile'}} */ +static volatile float g_sta_vol_init = 1.0f; /* expected-error {{'volatile' is not a valid modifier for a global variable}} fxc-error {{X3008: 'g_sta_vol_init': global variables cannot be declared 'volatile'}} */ +static volatile const float g_sta_vol_con_init = 1.0f; /* expected-error {{'volatile' is not a valid modifier for a global variable}} fxc-error {{X3008: 'g_sta_vol_con_init': global variables cannot be declared 'volatile'}} */ static const float g_sta_con_init = 1.0f; uniform float g_uni_init = 1.0f; -uniform volatile float g_uni_vol_init = 1.0f; /* expected-error {{'volatile' is a reserved keyword in HLSL}} fxc-error {{X3008: 'g_uni_vol_init': global variables cannot be declared 'volatile'}} */ -uniform volatile const float g_uni_vol_con_init = 1.0f; /* expected-error {{'volatile' is a reserved keyword in HLSL}} fxc-error {{X3008: 'g_uni_vol_con_init': global variables cannot be declared 'volatile'}} */ +uniform volatile float g_uni_vol_init = 1.0f; /* expected-error {{'volatile' is not a valid modifier for a global variable}} fxc-error {{X3008: 'g_uni_vol_init': global variables cannot be declared 'volatile'}} */ +uniform volatile const float g_uni_vol_con_init = 1.0f; /* expected-error {{'volatile' is not a valid modifier for a global variable}} fxc-error {{X3008: 'g_uni_vol_con_init': global variables cannot be declared 'volatile'}} */ uniform const float g_uni_con_init = 1.0f; /* fxc-warning {{X3207: Initializer used on a global 'const' variable. This requires setting an external constant. If a literal is desired, use 'static const' instead.}} */ -volatile float g_vol_init = 1.0f; /* expected-error {{'volatile' is a reserved keyword in HLSL}} fxc-error {{X3008: 'g_vol_init': global variables cannot be declared 'volatile'}} */ -volatile const float g_vol_con_init = 1.0f; /* expected-error {{'volatile' is a reserved keyword in HLSL}} fxc-error {{X3008: 'g_vol_con_init': global variables cannot be declared 'volatile'}} */ +volatile float g_vol_init = 1.0f; /* expected-error {{'volatile' is not a valid modifier for a global variable}} fxc-error {{X3008: 'g_vol_init': global variables cannot be declared 'volatile'}} */ +volatile const float g_vol_con_init = 1.0f; /* expected-error {{'volatile' is not a valid modifier for a global variable}} fxc-error {{X3008: 'g_vol_con_init': global variables cannot be declared 'volatile'}} */ const float g_con_init = 1.0f; /* fxc-warning {{X3207: Initializer used on a global 'const' variable. This requires setting an external constant. If a literal is desired, use 'static const' instead.}} */ // GENERATED_CODE:END @@ -262,65 +262,65 @@ typedef static uniform float2 t_sta_uni; /* expected-error {{ typedef groupshared float2 t_gro; /* expected-error {{'groupshared' is not a valid modifier for a typedef}} fxc-error {{X3000: syntax error: unexpected token 'groupshared'}} */ typedef groupshared precise float2 t_gro_pre; /* expected-error {{'groupshared' is not a valid modifier for a typedef}} fxc-error {{X3000: syntax error: unexpected token 'groupshared'}} */ typedef groupshared precise static float2 t_gro_pre_sta; /* expected-error {{'groupshared' is not a valid modifier for a typedef}} expected-error {{cannot combine with previous 'typedef' declaration specifier}} fxc-error {{X3000: syntax error: unexpected token 'groupshared'}} */ -typedef groupshared precise static volatile float2 t_gro_pre_sta_vol; /* expected-error {{'groupshared' is not a valid modifier for a typedef}} expected-error {{cannot combine with previous 'typedef' declaration specifier}} fxc-error {{X3000: syntax error: unexpected token 'groupshared'}} expected-error {{'volatile' is a reserved keyword in HLSL}} */ -typedef groupshared precise static volatile const float2 t_gro_pre_sta_vol_con; /* expected-error {{'groupshared' is not a valid modifier for a typedef}} expected-error {{cannot combine with previous 'typedef' declaration specifier}} fxc-error {{X3000: syntax error: unexpected token 'groupshared'}} expected-error {{'volatile' is a reserved keyword in HLSL}} */ +typedef groupshared precise static volatile float2 t_gro_pre_sta_vol; /* expected-error {{'groupshared' is not a valid modifier for a typedef}} expected-error {{cannot combine with previous 'typedef' declaration specifier}} fxc-error {{X3000: syntax error: unexpected token 'groupshared'}} */ +typedef groupshared precise static volatile const float2 t_gro_pre_sta_vol_con; /* expected-error {{'groupshared' is not a valid modifier for a typedef}} expected-error {{cannot combine with previous 'typedef' declaration specifier}} fxc-error {{X3000: syntax error: unexpected token 'groupshared'}} */ typedef groupshared precise static const float2 t_gro_pre_sta_con; /* expected-error {{'groupshared' is not a valid modifier for a typedef}} expected-error {{cannot combine with previous 'typedef' declaration specifier}} fxc-error {{X3000: syntax error: unexpected token 'groupshared'}} */ typedef groupshared precise uniform float2 t_gro_pre_uni; /* expected-error {{'groupshared' is not a valid modifier for a typedef}} expected-error {{'uniform' is not a valid modifier for a typedef}} fxc-error {{X3000: syntax error: unexpected token 'groupshared'}} */ -typedef groupshared precise uniform volatile float2 t_gro_pre_uni_vol; /* expected-error {{'groupshared' is not a valid modifier for a typedef}} expected-error {{'uniform' is not a valid modifier for a typedef}} fxc-error {{X3000: syntax error: unexpected token 'groupshared'}} expected-error {{'volatile' is a reserved keyword in HLSL}} */ -typedef groupshared precise uniform volatile const float2 t_gro_pre_uni_vol_con; /* expected-error {{'groupshared' is not a valid modifier for a typedef}} expected-error {{'uniform' is not a valid modifier for a typedef}} fxc-error {{X3000: syntax error: unexpected token 'groupshared'}} expected-error {{'volatile' is a reserved keyword in HLSL}} */ +typedef groupshared precise uniform volatile float2 t_gro_pre_uni_vol; /* expected-error {{'groupshared' is not a valid modifier for a typedef}} expected-error {{'uniform' is not a valid modifier for a typedef}} fxc-error {{X3000: syntax error: unexpected token 'groupshared'}} */ +typedef groupshared precise uniform volatile const float2 t_gro_pre_uni_vol_con; /* expected-error {{'groupshared' is not a valid modifier for a typedef}} expected-error {{'uniform' is not a valid modifier for a typedef}} fxc-error {{X3000: syntax error: unexpected token 'groupshared'}} */ typedef groupshared precise uniform const float2 t_gro_pre_uni_con; /* expected-error {{'groupshared' is not a valid modifier for a typedef}} expected-error {{'uniform' is not a valid modifier for a typedef}} fxc-error {{X3000: syntax error: unexpected token 'groupshared'}} */ -typedef groupshared precise volatile float2 t_gro_pre_vol; /* expected-error {{'groupshared' is not a valid modifier for a typedef}} fxc-error {{X3000: syntax error: unexpected token 'groupshared'}} expected-error {{'volatile' is a reserved keyword in HLSL}} */ -typedef groupshared precise volatile const float2 t_gro_pre_vol_con; /* expected-error {{'groupshared' is not a valid modifier for a typedef}} fxc-error {{X3000: syntax error: unexpected token 'groupshared'}} expected-error {{'volatile' is a reserved keyword in HLSL}} */ +typedef groupshared precise volatile float2 t_gro_pre_vol; /* expected-error {{'groupshared' is not a valid modifier for a typedef}} fxc-error {{X3000: syntax error: unexpected token 'groupshared'}} */ +typedef groupshared precise volatile const float2 t_gro_pre_vol_con; /* expected-error {{'groupshared' is not a valid modifier for a typedef}} fxc-error {{X3000: syntax error: unexpected token 'groupshared'}} */ typedef groupshared precise const float2 t_gro_pre_con; /* expected-error {{'groupshared' is not a valid modifier for a typedef}} fxc-error {{X3000: syntax error: unexpected token 'groupshared'}} */ typedef groupshared static float2 t_gro_sta; /* expected-error {{'groupshared' is not a valid modifier for a typedef}} expected-error {{cannot combine with previous 'typedef' declaration specifier}} fxc-error {{X3000: syntax error: unexpected token 'groupshared'}} */ -typedef groupshared static volatile float2 t_gro_sta_vol; /* expected-error {{'groupshared' is not a valid modifier for a typedef}} expected-error {{cannot combine with previous 'typedef' declaration specifier}} fxc-error {{X3000: syntax error: unexpected token 'groupshared'}} expected-error {{'volatile' is a reserved keyword in HLSL}} */ -typedef groupshared static volatile const float2 t_gro_sta_vol_con; /* expected-error {{'groupshared' is not a valid modifier for a typedef}} expected-error {{cannot combine with previous 'typedef' declaration specifier}} fxc-error {{X3000: syntax error: unexpected token 'groupshared'}} expected-error {{'volatile' is a reserved keyword in HLSL}} */ +typedef groupshared static volatile float2 t_gro_sta_vol; /* expected-error {{'groupshared' is not a valid modifier for a typedef}} expected-error {{cannot combine with previous 'typedef' declaration specifier}} fxc-error {{X3000: syntax error: unexpected token 'groupshared'}} */ +typedef groupshared static volatile const float2 t_gro_sta_vol_con; /* expected-error {{'groupshared' is not a valid modifier for a typedef}} expected-error {{cannot combine with previous 'typedef' declaration specifier}} fxc-error {{X3000: syntax error: unexpected token 'groupshared'}} */ typedef groupshared static const float2 t_gro_sta_con; /* expected-error {{'groupshared' is not a valid modifier for a typedef}} expected-error {{cannot combine with previous 'typedef' declaration specifier}} fxc-error {{X3000: syntax error: unexpected token 'groupshared'}} */ typedef groupshared uniform float2 t_gro_uni; /* expected-error {{'groupshared' is not a valid modifier for a typedef}} expected-error {{'uniform' is not a valid modifier for a typedef}} fxc-error {{X3000: syntax error: unexpected token 'groupshared'}} */ -typedef groupshared uniform volatile float2 t_gro_uni_vol; /* expected-error {{'groupshared' is not a valid modifier for a typedef}} expected-error {{'uniform' is not a valid modifier for a typedef}} fxc-error {{X3000: syntax error: unexpected token 'groupshared'}} expected-error {{'volatile' is a reserved keyword in HLSL}} */ -typedef groupshared uniform volatile const float2 t_gro_uni_vol_con; /* expected-error {{'groupshared' is not a valid modifier for a typedef}} expected-error {{'uniform' is not a valid modifier for a typedef}} fxc-error {{X3000: syntax error: unexpected token 'groupshared'}} expected-error {{'volatile' is a reserved keyword in HLSL}} */ +typedef groupshared uniform volatile float2 t_gro_uni_vol; /* expected-error {{'groupshared' is not a valid modifier for a typedef}} expected-error {{'uniform' is not a valid modifier for a typedef}} fxc-error {{X3000: syntax error: unexpected token 'groupshared'}} */ +typedef groupshared uniform volatile const float2 t_gro_uni_vol_con; /* expected-error {{'groupshared' is not a valid modifier for a typedef}} expected-error {{'uniform' is not a valid modifier for a typedef}} fxc-error {{X3000: syntax error: unexpected token 'groupshared'}} */ typedef groupshared uniform const float2 t_gro_uni_con; /* expected-error {{'groupshared' is not a valid modifier for a typedef}} expected-error {{'uniform' is not a valid modifier for a typedef}} fxc-error {{X3000: syntax error: unexpected token 'groupshared'}} */ -typedef groupshared volatile float2 t_gro_vol; /* expected-error {{'groupshared' is not a valid modifier for a typedef}} fxc-error {{X3000: syntax error: unexpected token 'groupshared'}} expected-error {{'volatile' is a reserved keyword in HLSL}} */ -typedef groupshared volatile const float2 t_gro_vol_con; /* expected-error {{'groupshared' is not a valid modifier for a typedef}} fxc-error {{X3000: syntax error: unexpected token 'groupshared'}} expected-error {{'volatile' is a reserved keyword in HLSL}} */ +typedef groupshared volatile float2 t_gro_vol; /* expected-error {{'groupshared' is not a valid modifier for a typedef}} fxc-error {{X3000: syntax error: unexpected token 'groupshared'}} */ +typedef groupshared volatile const float2 t_gro_vol_con; /* expected-error {{'groupshared' is not a valid modifier for a typedef}} fxc-error {{X3000: syntax error: unexpected token 'groupshared'}} */ typedef groupshared const float2 t_gro_con; /* expected-error {{'groupshared' is not a valid modifier for a typedef}} fxc-error {{X3000: syntax error: unexpected token 'groupshared'}} */ typedef extern float2 t_ext; /* expected-error {{cannot combine with previous 'typedef' declaration specifier}} fxc-error {{X3000: syntax error: unexpected token 'extern'}} */ typedef extern precise float2 t_ext_pre; /* expected-error {{cannot combine with previous 'typedef' declaration specifier}} fxc-error {{X3000: syntax error: unexpected token 'extern'}} */ typedef extern precise uniform float2 t_ext_pre_uni; /* expected-error {{'uniform' is not a valid modifier for a typedef}} expected-error {{cannot combine with previous 'typedef' declaration specifier}} fxc-error {{X3000: syntax error: unexpected token 'extern'}} */ -typedef extern precise uniform volatile float2 t_ext_pre_uni_vol; /* expected-error {{'uniform' is not a valid modifier for a typedef}} expected-error {{cannot combine with previous 'typedef' declaration specifier}} fxc-error {{X3000: syntax error: unexpected token 'extern'}} expected-error {{'volatile' is a reserved keyword in HLSL}} */ -typedef extern precise uniform volatile const float2 t_ext_pre_uni_vol_con; /* expected-error {{'uniform' is not a valid modifier for a typedef}} expected-error {{cannot combine with previous 'typedef' declaration specifier}} fxc-error {{X3000: syntax error: unexpected token 'extern'}} expected-error {{'volatile' is a reserved keyword in HLSL}} */ +typedef extern precise uniform volatile float2 t_ext_pre_uni_vol; /* expected-error {{'uniform' is not a valid modifier for a typedef}} expected-error {{cannot combine with previous 'typedef' declaration specifier}} fxc-error {{X3000: syntax error: unexpected token 'extern'}} */ +typedef extern precise uniform volatile const float2 t_ext_pre_uni_vol_con; /* expected-error {{'uniform' is not a valid modifier for a typedef}} expected-error {{cannot combine with previous 'typedef' declaration specifier}} fxc-error {{X3000: syntax error: unexpected token 'extern'}} */ typedef extern precise uniform const float2 t_ext_pre_uni_con; /* expected-error {{'uniform' is not a valid modifier for a typedef}} expected-error {{cannot combine with previous 'typedef' declaration specifier}} fxc-error {{X3000: syntax error: unexpected token 'extern'}} */ -typedef extern precise volatile float2 t_ext_pre_vol; /* expected-error {{cannot combine with previous 'typedef' declaration specifier}} fxc-error {{X3000: syntax error: unexpected token 'extern'}} expected-error {{'volatile' is a reserved keyword in HLSL}} */ -typedef extern precise volatile const float2 t_ext_pre_vol_con; /* expected-error {{cannot combine with previous 'typedef' declaration specifier}} fxc-error {{X3000: syntax error: unexpected token 'extern'}} expected-error {{'volatile' is a reserved keyword in HLSL}} */ +typedef extern precise volatile float2 t_ext_pre_vol; /* expected-error {{cannot combine with previous 'typedef' declaration specifier}} fxc-error {{X3000: syntax error: unexpected token 'extern'}} */ +typedef extern precise volatile const float2 t_ext_pre_vol_con; /* expected-error {{cannot combine with previous 'typedef' declaration specifier}} fxc-error {{X3000: syntax error: unexpected token 'extern'}} */ typedef extern precise const float2 t_ext_pre_con; /* expected-error {{cannot combine with previous 'typedef' declaration specifier}} fxc-error {{X3000: syntax error: unexpected token 'extern'}} */ typedef extern uniform float2 t_ext_uni; /* expected-error {{'uniform' is not a valid modifier for a typedef}} expected-error {{cannot combine with previous 'typedef' declaration specifier}} fxc-error {{X3000: syntax error: unexpected token 'extern'}} */ -typedef extern uniform volatile float2 t_ext_uni_vol; /* expected-error {{'uniform' is not a valid modifier for a typedef}} expected-error {{cannot combine with previous 'typedef' declaration specifier}} fxc-error {{X3000: syntax error: unexpected token 'extern'}} expected-error {{'volatile' is a reserved keyword in HLSL}} */ -typedef extern uniform volatile const float2 t_ext_uni_vol_con; /* expected-error {{'uniform' is not a valid modifier for a typedef}} expected-error {{cannot combine with previous 'typedef' declaration specifier}} fxc-error {{X3000: syntax error: unexpected token 'extern'}} expected-error {{'volatile' is a reserved keyword in HLSL}} */ +typedef extern uniform volatile float2 t_ext_uni_vol; /* expected-error {{'uniform' is not a valid modifier for a typedef}} expected-error {{cannot combine with previous 'typedef' declaration specifier}} fxc-error {{X3000: syntax error: unexpected token 'extern'}} */ +typedef extern uniform volatile const float2 t_ext_uni_vol_con; /* expected-error {{'uniform' is not a valid modifier for a typedef}} expected-error {{cannot combine with previous 'typedef' declaration specifier}} fxc-error {{X3000: syntax error: unexpected token 'extern'}} */ typedef extern uniform const float2 t_ext_uni_con; /* expected-error {{'uniform' is not a valid modifier for a typedef}} expected-error {{cannot combine with previous 'typedef' declaration specifier}} fxc-error {{X3000: syntax error: unexpected token 'extern'}} */ -typedef extern volatile float2 t_ext_vol; /* expected-error {{cannot combine with previous 'typedef' declaration specifier}} fxc-error {{X3000: syntax error: unexpected token 'extern'}} expected-error {{'volatile' is a reserved keyword in HLSL}} */ -typedef extern volatile const float2 t_ext_vol_con; /* expected-error {{cannot combine with previous 'typedef' declaration specifier}} fxc-error {{X3000: syntax error: unexpected token 'extern'}} expected-error {{'volatile' is a reserved keyword in HLSL}} */ +typedef extern volatile float2 t_ext_vol; /* expected-error {{cannot combine with previous 'typedef' declaration specifier}} fxc-error {{X3000: syntax error: unexpected token 'extern'}} */ +typedef extern volatile const float2 t_ext_vol_con; /* expected-error {{cannot combine with previous 'typedef' declaration specifier}} fxc-error {{X3000: syntax error: unexpected token 'extern'}} */ typedef extern const float2 t_ext_con; /* expected-error {{cannot combine with previous 'typedef' declaration specifier}} fxc-error {{X3000: syntax error: unexpected token 'extern'}} */ typedef precise float2 t_pre; typedef precise static float2 t_pre_sta; /* expected-error {{cannot combine with previous 'typedef' declaration specifier}} fxc-error {{X3000: syntax error: unexpected token 'static'}} */ -typedef precise static volatile float2 t_pre_sta_vol; /* expected-error {{cannot combine with previous 'typedef' declaration specifier}} fxc-error {{X3000: syntax error: unexpected token 'static'}} expected-error {{'volatile' is a reserved keyword in HLSL}} */ -typedef precise static volatile const float2 t_pre_sta_vol_con; /* expected-error {{cannot combine with previous 'typedef' declaration specifier}} fxc-error {{X3000: syntax error: unexpected token 'static'}} expected-error {{'volatile' is a reserved keyword in HLSL}} */ +typedef precise static volatile float2 t_pre_sta_vol; /* expected-error {{cannot combine with previous 'typedef' declaration specifier}} fxc-error {{X3000: syntax error: unexpected token 'static'}} */ +typedef precise static volatile const float2 t_pre_sta_vol_con; /* expected-error {{cannot combine with previous 'typedef' declaration specifier}} fxc-error {{X3000: syntax error: unexpected token 'static'}} */ typedef precise static const float2 t_pre_sta_con; /* expected-error {{cannot combine with previous 'typedef' declaration specifier}} fxc-error {{X3000: syntax error: unexpected token 'static'}} */ typedef precise uniform float2 t_pre_uni; /* expected-error {{'uniform' is not a valid modifier for a typedef}} fxc-error {{X3000: syntax error: unexpected token 'uniform'}} */ -typedef precise uniform volatile float2 t_pre_uni_vol; /* expected-error {{'uniform' is not a valid modifier for a typedef}} fxc-error {{X3000: syntax error: unexpected token 'uniform'}} expected-error {{'volatile' is a reserved keyword in HLSL}} */ -typedef precise uniform volatile const float2 t_pre_uni_vol_con; /* expected-error {{'uniform' is not a valid modifier for a typedef}} fxc-error {{X3000: syntax error: unexpected token 'uniform'}} expected-error {{'volatile' is a reserved keyword in HLSL}} */ +typedef precise uniform volatile float2 t_pre_uni_vol; /* expected-error {{'uniform' is not a valid modifier for a typedef}} fxc-error {{X3000: syntax error: unexpected token 'uniform'}} */ +typedef precise uniform volatile const float2 t_pre_uni_vol_con; /* expected-error {{'uniform' is not a valid modifier for a typedef}} fxc-error {{X3000: syntax error: unexpected token 'uniform'}} */ typedef precise uniform const float2 t_pre_uni_con; /* expected-error {{'uniform' is not a valid modifier for a typedef}} fxc-error {{X3000: syntax error: unexpected token 'uniform'}} */ -typedef precise volatile float2 t_pre_vol; /* expected-error {{'volatile' is a reserved keyword in HLSL}} */ -typedef precise volatile const float2 t_pre_vol_con; /* expected-error {{'volatile' is a reserved keyword in HLSL}} */ +typedef precise volatile float2 t_pre_vol; +typedef precise volatile const float2 t_pre_vol_con; typedef precise const float2 t_pre_con; typedef static float2 t_sta; /* expected-error {{cannot combine with previous 'typedef' declaration specifier}} fxc-error {{X3000: syntax error: unexpected token 'static'}} */ -typedef static volatile float2 t_sta_vol; /* expected-error {{cannot combine with previous 'typedef' declaration specifier}} fxc-error {{X3000: syntax error: unexpected token 'static'}} expected-error {{'volatile' is a reserved keyword in HLSL}} */ -typedef static volatile const float2 t_sta_vol_con; /* expected-error {{cannot combine with previous 'typedef' declaration specifier}} fxc-error {{X3000: syntax error: unexpected token 'static'}} expected-error {{'volatile' is a reserved keyword in HLSL}} */ +typedef static volatile float2 t_sta_vol; /* expected-error {{cannot combine with previous 'typedef' declaration specifier}} fxc-error {{X3000: syntax error: unexpected token 'static'}} */ +typedef static volatile const float2 t_sta_vol_con; /* expected-error {{cannot combine with previous 'typedef' declaration specifier}} fxc-error {{X3000: syntax error: unexpected token 'static'}} */ typedef static const float2 t_sta_con; /* expected-error {{cannot combine with previous 'typedef' declaration specifier}} fxc-error {{X3000: syntax error: unexpected token 'static'}} */ typedef uniform float2 t_uni; /* expected-error {{'uniform' is not a valid modifier for a typedef}} fxc-error {{X3000: syntax error: unexpected token 'uniform'}} */ -typedef uniform volatile float2 t_uni_vol; /* expected-error {{'uniform' is not a valid modifier for a typedef}} fxc-error {{X3000: syntax error: unexpected token 'uniform'}} expected-error {{'volatile' is a reserved keyword in HLSL}} */ -typedef uniform volatile const float2 t_uni_vol_con; /* expected-error {{'uniform' is not a valid modifier for a typedef}} fxc-error {{X3000: syntax error: unexpected token 'uniform'}} expected-error {{'volatile' is a reserved keyword in HLSL}} */ +typedef uniform volatile float2 t_uni_vol; /* expected-error {{'uniform' is not a valid modifier for a typedef}} fxc-error {{X3000: syntax error: unexpected token 'uniform'}} */ +typedef uniform volatile const float2 t_uni_vol_con; /* expected-error {{'uniform' is not a valid modifier for a typedef}} fxc-error {{X3000: syntax error: unexpected token 'uniform'}} */ typedef uniform const float2 t_uni_con; /* expected-error {{'uniform' is not a valid modifier for a typedef}} fxc-error {{X3000: syntax error: unexpected token 'uniform'}} */ -typedef volatile float2 t_vol; /* expected-error {{'volatile' is a reserved keyword in HLSL}} */ -typedef volatile const float2 t_vol_con; /* expected-error {{'volatile' is a reserved keyword in HLSL}} */ +typedef volatile float2 t_vol; +typedef volatile const float2 t_vol_con; typedef const float2 t_con; // GENERATED_CODE:END @@ -380,65 +380,65 @@ struct s_storage_mods { groupshared float2 f_gro; /* expected-error {{'groupshared' is not a valid modifier for a field}} expected-warning {{'groupshared' attribute only applies to variables}} fxc-error {{X3010: 'f_gro': struct/class members cannot be declared 'groupshared'}} */ groupshared precise float2 f_gro_pre; /* expected-error {{'groupshared' is not a valid modifier for a field}} expected-warning {{'groupshared' attribute only applies to variables}} fxc-error {{X3010: 'f_gro_pre': struct/class members cannot be declared 'groupshared'}} */ groupshared precise static float2 f_gro_pre_sta; /* expected-error {{'groupshared' is not a valid modifier for a field}} fxc-error {{X3010: 'f_gro_pre_sta': struct/class members cannot be declared 'groupshared'}} */ - groupshared precise static volatile float2 f_gro_pre_sta_vol; /* expected-error {{'groupshared' is not a valid modifier for a field}} expected-error {{'volatile' is a reserved keyword in HLSL}} fxc-error {{X3008: 'f_gro_pre_sta_vol': struct/class members cannot be declared 'volatile'}} fxc-error {{X3010: 'f_gro_pre_sta_vol': struct/class members cannot be declared 'groupshared'}} */ - groupshared precise static volatile const float2 f_gro_pre_sta_vol_con; /* expected-error {{'groupshared' is not a valid modifier for a field}} expected-error {{'volatile' is a reserved keyword in HLSL}} fxc-error {{X3008: 'f_gro_pre_sta_vol_con': struct/class members cannot be declared 'volatile'}} fxc-error {{X3010: 'f_gro_pre_sta_vol_con': struct/class members cannot be declared 'groupshared'}} */ + groupshared precise static volatile float2 f_gro_pre_sta_vol; /* expected-error {{'groupshared' is not a valid modifier for a field}} expected-error {{'volatile' is not a valid modifier for a field}} fxc-error {{X3008: 'f_gro_pre_sta_vol': struct/class members cannot be declared 'volatile'}} fxc-error {{X3010: 'f_gro_pre_sta_vol': struct/class members cannot be declared 'groupshared'}} */ + groupshared precise static volatile const float2 f_gro_pre_sta_vol_con; /* expected-error {{'groupshared' is not a valid modifier for a field}} expected-error {{'volatile' is not a valid modifier for a field}} fxc-error {{X3008: 'f_gro_pre_sta_vol_con': struct/class members cannot be declared 'volatile'}} fxc-error {{X3010: 'f_gro_pre_sta_vol_con': struct/class members cannot be declared 'groupshared'}} */ groupshared precise static const float2 f_gro_pre_sta_con; /* expected-error {{'groupshared' is not a valid modifier for a field}} fxc-error {{X3010: 'f_gro_pre_sta_con': struct/class members cannot be declared 'groupshared'}} */ groupshared precise uniform float2 f_gro_pre_uni; /* expected-error {{'groupshared' is not a valid modifier for a field}} expected-error {{'uniform' is not a valid modifier for a field}} expected-warning {{'groupshared' attribute only applies to variables}} expected-warning {{'uniform' attribute only applies to variables and parameters}} fxc-error {{X3010: 'f_gro_pre_uni': struct/class members cannot be declared 'groupshared'}} fxc-error {{X3047: 'f_gro_pre_uni': struct/class members cannot be declared 'uniform'}} */ - groupshared precise uniform volatile float2 f_gro_pre_uni_vol; /* expected-error {{'groupshared' is not a valid modifier for a field}} expected-error {{'uniform' is not a valid modifier for a field}} expected-error {{'volatile' is a reserved keyword in HLSL}} expected-warning {{'groupshared' attribute only applies to variables}} expected-warning {{'uniform' attribute only applies to variables and parameters}} fxc-error {{X3008: 'f_gro_pre_uni_vol': struct/class members cannot be declared 'volatile'}} fxc-error {{X3010: 'f_gro_pre_uni_vol': struct/class members cannot be declared 'groupshared'}} fxc-error {{X3047: 'f_gro_pre_uni_vol': struct/class members cannot be declared 'uniform'}} */ - groupshared precise uniform volatile const float2 f_gro_pre_uni_vol_con; /* expected-error {{'const' is not a valid modifier for a field}} expected-error {{'groupshared' is not a valid modifier for a field}} expected-error {{'uniform' is not a valid modifier for a field}} expected-error {{'volatile' is a reserved keyword in HLSL}} expected-warning {{'groupshared' attribute only applies to variables}} expected-warning {{'uniform' attribute only applies to variables and parameters}} fxc-error {{X3008: 'f_gro_pre_uni_vol_con': struct/class members cannot be declared 'volatile'}} fxc-error {{X3010: 'f_gro_pre_uni_vol_con': struct/class members cannot be declared 'groupshared'}} fxc-error {{X3035: 'f_gro_pre_uni_vol_con': struct/class members cannot be declared 'const'}} fxc-error {{X3047: 'f_gro_pre_uni_vol_con': struct/class members cannot be declared 'uniform'}} */ + groupshared precise uniform volatile float2 f_gro_pre_uni_vol; /* expected-error {{'groupshared' is not a valid modifier for a field}} expected-error {{'uniform' is not a valid modifier for a field}} expected-error {{'volatile' is not a valid modifier for a field}} expected-warning {{'groupshared' attribute only applies to variables}} expected-warning {{'uniform' attribute only applies to variables and parameters}} fxc-error {{X3008: 'f_gro_pre_uni_vol': struct/class members cannot be declared 'volatile'}} fxc-error {{X3010: 'f_gro_pre_uni_vol': struct/class members cannot be declared 'groupshared'}} fxc-error {{X3047: 'f_gro_pre_uni_vol': struct/class members cannot be declared 'uniform'}} */ + groupshared precise uniform volatile const float2 f_gro_pre_uni_vol_con; /* expected-error {{'const' is not a valid modifier for a field}} expected-error {{'groupshared' is not a valid modifier for a field}} expected-error {{'uniform' is not a valid modifier for a field}} expected-error {{'volatile' is not a valid modifier for a field}} expected-warning {{'groupshared' attribute only applies to variables}} expected-warning {{'uniform' attribute only applies to variables and parameters}} fxc-error {{X3008: 'f_gro_pre_uni_vol_con': struct/class members cannot be declared 'volatile'}} fxc-error {{X3010: 'f_gro_pre_uni_vol_con': struct/class members cannot be declared 'groupshared'}} fxc-error {{X3035: 'f_gro_pre_uni_vol_con': struct/class members cannot be declared 'const'}} fxc-error {{X3047: 'f_gro_pre_uni_vol_con': struct/class members cannot be declared 'uniform'}} */ groupshared precise uniform const float2 f_gro_pre_uni_con; /* expected-error {{'const' is not a valid modifier for a field}} expected-error {{'groupshared' is not a valid modifier for a field}} expected-error {{'uniform' is not a valid modifier for a field}} expected-warning {{'groupshared' attribute only applies to variables}} expected-warning {{'uniform' attribute only applies to variables and parameters}} fxc-error {{X3010: 'f_gro_pre_uni_con': struct/class members cannot be declared 'groupshared'}} fxc-error {{X3035: 'f_gro_pre_uni_con': struct/class members cannot be declared 'const'}} fxc-error {{X3047: 'f_gro_pre_uni_con': struct/class members cannot be declared 'uniform'}} */ - groupshared precise volatile float2 f_gro_pre_vol; /* expected-error {{'groupshared' is not a valid modifier for a field}} expected-error {{'volatile' is a reserved keyword in HLSL}} expected-warning {{'groupshared' attribute only applies to variables}} fxc-error {{X3008: 'f_gro_pre_vol': struct/class members cannot be declared 'volatile'}} fxc-error {{X3010: 'f_gro_pre_vol': struct/class members cannot be declared 'groupshared'}} */ - groupshared precise volatile const float2 f_gro_pre_vol_con; /* expected-error {{'const' is not a valid modifier for a field}} expected-error {{'groupshared' is not a valid modifier for a field}} expected-error {{'volatile' is a reserved keyword in HLSL}} expected-warning {{'groupshared' attribute only applies to variables}} fxc-error {{X3008: 'f_gro_pre_vol_con': struct/class members cannot be declared 'volatile'}} fxc-error {{X3010: 'f_gro_pre_vol_con': struct/class members cannot be declared 'groupshared'}} fxc-error {{X3035: 'f_gro_pre_vol_con': struct/class members cannot be declared 'const'}} */ + groupshared precise volatile float2 f_gro_pre_vol; /* expected-error {{'groupshared' is not a valid modifier for a field}} expected-error {{'volatile' is not a valid modifier for a field}} expected-warning {{'groupshared' attribute only applies to variables}} fxc-error {{X3008: 'f_gro_pre_vol': struct/class members cannot be declared 'volatile'}} fxc-error {{X3010: 'f_gro_pre_vol': struct/class members cannot be declared 'groupshared'}} */ + groupshared precise volatile const float2 f_gro_pre_vol_con; /* expected-error {{'const' is not a valid modifier for a field}} expected-error {{'groupshared' is not a valid modifier for a field}} expected-error {{'volatile' is not a valid modifier for a field}} expected-warning {{'groupshared' attribute only applies to variables}} fxc-error {{X3008: 'f_gro_pre_vol_con': struct/class members cannot be declared 'volatile'}} fxc-error {{X3010: 'f_gro_pre_vol_con': struct/class members cannot be declared 'groupshared'}} fxc-error {{X3035: 'f_gro_pre_vol_con': struct/class members cannot be declared 'const'}} */ groupshared precise const float2 f_gro_pre_con; /* expected-error {{'const' is not a valid modifier for a field}} expected-error {{'groupshared' is not a valid modifier for a field}} expected-warning {{'groupshared' attribute only applies to variables}} fxc-error {{X3010: 'f_gro_pre_con': struct/class members cannot be declared 'groupshared'}} fxc-error {{X3035: 'f_gro_pre_con': struct/class members cannot be declared 'const'}} */ groupshared static float2 f_gro_sta; /* expected-error {{'groupshared' is not a valid modifier for a field}} fxc-error {{X3010: 'f_gro_sta': struct/class members cannot be declared 'groupshared'}} */ - groupshared static volatile float2 f_gro_sta_vol; /* expected-error {{'groupshared' is not a valid modifier for a field}} expected-error {{'volatile' is a reserved keyword in HLSL}} fxc-error {{X3008: 'f_gro_sta_vol': struct/class members cannot be declared 'volatile'}} fxc-error {{X3010: 'f_gro_sta_vol': struct/class members cannot be declared 'groupshared'}} */ - groupshared static volatile const float2 f_gro_sta_vol_con; /* expected-error {{'groupshared' is not a valid modifier for a field}} expected-error {{'volatile' is a reserved keyword in HLSL}} fxc-error {{X3008: 'f_gro_sta_vol_con': struct/class members cannot be declared 'volatile'}} fxc-error {{X3010: 'f_gro_sta_vol_con': struct/class members cannot be declared 'groupshared'}} */ + groupshared static volatile float2 f_gro_sta_vol; /* expected-error {{'groupshared' is not a valid modifier for a field}} expected-error {{'volatile' is not a valid modifier for a field}} fxc-error {{X3008: 'f_gro_sta_vol': struct/class members cannot be declared 'volatile'}} fxc-error {{X3010: 'f_gro_sta_vol': struct/class members cannot be declared 'groupshared'}} */ + groupshared static volatile const float2 f_gro_sta_vol_con; /* expected-error {{'groupshared' is not a valid modifier for a field}} expected-error {{'volatile' is not a valid modifier for a field}} fxc-error {{X3008: 'f_gro_sta_vol_con': struct/class members cannot be declared 'volatile'}} fxc-error {{X3010: 'f_gro_sta_vol_con': struct/class members cannot be declared 'groupshared'}} */ groupshared static const float2 f_gro_sta_con; /* expected-error {{'groupshared' is not a valid modifier for a field}} fxc-error {{X3010: 'f_gro_sta_con': struct/class members cannot be declared 'groupshared'}} */ groupshared uniform float2 f_gro_uni; /* expected-error {{'groupshared' is not a valid modifier for a field}} expected-error {{'uniform' is not a valid modifier for a field}} expected-warning {{'groupshared' attribute only applies to variables}} expected-warning {{'uniform' attribute only applies to variables and parameters}} fxc-error {{X3010: 'f_gro_uni': struct/class members cannot be declared 'groupshared'}} fxc-error {{X3047: 'f_gro_uni': struct/class members cannot be declared 'uniform'}} */ - groupshared uniform volatile float2 f_gro_uni_vol; /* expected-error {{'groupshared' is not a valid modifier for a field}} expected-error {{'uniform' is not a valid modifier for a field}} expected-error {{'volatile' is a reserved keyword in HLSL}} expected-warning {{'groupshared' attribute only applies to variables}} expected-warning {{'uniform' attribute only applies to variables and parameters}} fxc-error {{X3008: 'f_gro_uni_vol': struct/class members cannot be declared 'volatile'}} fxc-error {{X3010: 'f_gro_uni_vol': struct/class members cannot be declared 'groupshared'}} fxc-error {{X3047: 'f_gro_uni_vol': struct/class members cannot be declared 'uniform'}} */ - groupshared uniform volatile const float2 f_gro_uni_vol_con; /* expected-error {{'const' is not a valid modifier for a field}} expected-error {{'groupshared' is not a valid modifier for a field}} expected-error {{'uniform' is not a valid modifier for a field}} expected-error {{'volatile' is a reserved keyword in HLSL}} expected-warning {{'groupshared' attribute only applies to variables}} expected-warning {{'uniform' attribute only applies to variables and parameters}} fxc-error {{X3008: 'f_gro_uni_vol_con': struct/class members cannot be declared 'volatile'}} fxc-error {{X3010: 'f_gro_uni_vol_con': struct/class members cannot be declared 'groupshared'}} fxc-error {{X3035: 'f_gro_uni_vol_con': struct/class members cannot be declared 'const'}} fxc-error {{X3047: 'f_gro_uni_vol_con': struct/class members cannot be declared 'uniform'}} */ + groupshared uniform volatile float2 f_gro_uni_vol; /* expected-error {{'groupshared' is not a valid modifier for a field}} expected-error {{'uniform' is not a valid modifier for a field}} expected-error {{'volatile' is not a valid modifier for a field}} expected-warning {{'groupshared' attribute only applies to variables}} expected-warning {{'uniform' attribute only applies to variables and parameters}} fxc-error {{X3008: 'f_gro_uni_vol': struct/class members cannot be declared 'volatile'}} fxc-error {{X3010: 'f_gro_uni_vol': struct/class members cannot be declared 'groupshared'}} fxc-error {{X3047: 'f_gro_uni_vol': struct/class members cannot be declared 'uniform'}} */ + groupshared uniform volatile const float2 f_gro_uni_vol_con; /* expected-error {{'const' is not a valid modifier for a field}} expected-error {{'groupshared' is not a valid modifier for a field}} expected-error {{'uniform' is not a valid modifier for a field}} expected-error {{'volatile' is not a valid modifier for a field}} expected-warning {{'groupshared' attribute only applies to variables}} expected-warning {{'uniform' attribute only applies to variables and parameters}} fxc-error {{X3008: 'f_gro_uni_vol_con': struct/class members cannot be declared 'volatile'}} fxc-error {{X3010: 'f_gro_uni_vol_con': struct/class members cannot be declared 'groupshared'}} fxc-error {{X3035: 'f_gro_uni_vol_con': struct/class members cannot be declared 'const'}} fxc-error {{X3047: 'f_gro_uni_vol_con': struct/class members cannot be declared 'uniform'}} */ groupshared uniform const float2 f_gro_uni_con; /* expected-error {{'const' is not a valid modifier for a field}} expected-error {{'groupshared' is not a valid modifier for a field}} expected-error {{'uniform' is not a valid modifier for a field}} expected-warning {{'groupshared' attribute only applies to variables}} expected-warning {{'uniform' attribute only applies to variables and parameters}} fxc-error {{X3010: 'f_gro_uni_con': struct/class members cannot be declared 'groupshared'}} fxc-error {{X3035: 'f_gro_uni_con': struct/class members cannot be declared 'const'}} fxc-error {{X3047: 'f_gro_uni_con': struct/class members cannot be declared 'uniform'}} */ - groupshared volatile float2 f_gro_vol; /* expected-error {{'groupshared' is not a valid modifier for a field}} expected-error {{'volatile' is a reserved keyword in HLSL}} expected-warning {{'groupshared' attribute only applies to variables}} fxc-error {{X3008: 'f_gro_vol': struct/class members cannot be declared 'volatile'}} fxc-error {{X3010: 'f_gro_vol': struct/class members cannot be declared 'groupshared'}} */ - groupshared volatile const float2 f_gro_vol_con; /* expected-error {{'const' is not a valid modifier for a field}} expected-error {{'groupshared' is not a valid modifier for a field}} expected-error {{'volatile' is a reserved keyword in HLSL}} expected-warning {{'groupshared' attribute only applies to variables}} fxc-error {{X3008: 'f_gro_vol_con': struct/class members cannot be declared 'volatile'}} fxc-error {{X3010: 'f_gro_vol_con': struct/class members cannot be declared 'groupshared'}} fxc-error {{X3035: 'f_gro_vol_con': struct/class members cannot be declared 'const'}} */ + groupshared volatile float2 f_gro_vol; /* expected-error {{'groupshared' is not a valid modifier for a field}} expected-error {{'volatile' is not a valid modifier for a field}} expected-warning {{'groupshared' attribute only applies to variables}} fxc-error {{X3008: 'f_gro_vol': struct/class members cannot be declared 'volatile'}} fxc-error {{X3010: 'f_gro_vol': struct/class members cannot be declared 'groupshared'}} */ + groupshared volatile const float2 f_gro_vol_con; /* expected-error {{'const' is not a valid modifier for a field}} expected-error {{'groupshared' is not a valid modifier for a field}} expected-error {{'volatile' is not a valid modifier for a field}} expected-warning {{'groupshared' attribute only applies to variables}} fxc-error {{X3008: 'f_gro_vol_con': struct/class members cannot be declared 'volatile'}} fxc-error {{X3010: 'f_gro_vol_con': struct/class members cannot be declared 'groupshared'}} fxc-error {{X3035: 'f_gro_vol_con': struct/class members cannot be declared 'const'}} */ groupshared const float2 f_gro_con; /* expected-error {{'const' is not a valid modifier for a field}} expected-error {{'groupshared' is not a valid modifier for a field}} expected-warning {{'groupshared' attribute only applies to variables}} fxc-error {{X3010: 'f_gro_con': struct/class members cannot be declared 'groupshared'}} fxc-error {{X3035: 'f_gro_con': struct/class members cannot be declared 'const'}} */ extern float2 f_ext; /* expected-error {{storage class specified for a member declaration}} fxc-error {{X3006: 'f_ext': struct/class members cannot be declared 'extern'}} */ extern precise float2 f_ext_pre; /* expected-error {{storage class specified for a member declaration}} fxc-error {{X3006: 'f_ext_pre': struct/class members cannot be declared 'extern'}} */ extern precise uniform float2 f_ext_pre_uni; /* expected-error {{'uniform' is not a valid modifier for a field}} expected-error {{storage class specified for a member declaration}} expected-warning {{'uniform' attribute only applies to variables and parameters}} fxc-error {{X3006: 'f_ext_pre_uni': struct/class members cannot be declared 'extern'}} fxc-error {{X3047: 'f_ext_pre_uni': struct/class members cannot be declared 'uniform'}} */ - extern precise uniform volatile float2 f_ext_pre_uni_vol; /* expected-error {{'uniform' is not a valid modifier for a field}} expected-error {{'volatile' is a reserved keyword in HLSL}} expected-error {{storage class specified for a member declaration}} expected-warning {{'uniform' attribute only applies to variables and parameters}} fxc-error {{X3006: 'f_ext_pre_uni_vol': struct/class members cannot be declared 'extern'}} fxc-error {{X3008: 'f_ext_pre_uni_vol': struct/class members cannot be declared 'volatile'}} fxc-error {{X3047: 'f_ext_pre_uni_vol': struct/class members cannot be declared 'uniform'}} */ - extern precise uniform volatile const float2 f_ext_pre_uni_vol_con; /* expected-error {{'const' is not a valid modifier for a field}} expected-error {{'uniform' is not a valid modifier for a field}} expected-error {{'volatile' is a reserved keyword in HLSL}} expected-error {{storage class specified for a member declaration}} expected-warning {{'uniform' attribute only applies to variables and parameters}} fxc-error {{X3006: 'f_ext_pre_uni_vol_con': struct/class members cannot be declared 'extern'}} fxc-error {{X3008: 'f_ext_pre_uni_vol_con': struct/class members cannot be declared 'volatile'}} fxc-error {{X3035: 'f_ext_pre_uni_vol_con': struct/class members cannot be declared 'const'}} fxc-error {{X3047: 'f_ext_pre_uni_vol_con': struct/class members cannot be declared 'uniform'}} */ + extern precise uniform volatile float2 f_ext_pre_uni_vol; /* expected-error {{'uniform' is not a valid modifier for a field}} expected-error {{'volatile' is not a valid modifier for a field}} expected-error {{storage class specified for a member declaration}} expected-warning {{'uniform' attribute only applies to variables and parameters}} fxc-error {{X3006: 'f_ext_pre_uni_vol': struct/class members cannot be declared 'extern'}} fxc-error {{X3008: 'f_ext_pre_uni_vol': struct/class members cannot be declared 'volatile'}} fxc-error {{X3047: 'f_ext_pre_uni_vol': struct/class members cannot be declared 'uniform'}} */ + extern precise uniform volatile const float2 f_ext_pre_uni_vol_con; /* expected-error {{'const' is not a valid modifier for a field}} expected-error {{'uniform' is not a valid modifier for a field}} expected-error {{'volatile' is not a valid modifier for a field}} expected-error {{storage class specified for a member declaration}} expected-warning {{'uniform' attribute only applies to variables and parameters}} fxc-error {{X3006: 'f_ext_pre_uni_vol_con': struct/class members cannot be declared 'extern'}} fxc-error {{X3008: 'f_ext_pre_uni_vol_con': struct/class members cannot be declared 'volatile'}} fxc-error {{X3035: 'f_ext_pre_uni_vol_con': struct/class members cannot be declared 'const'}} fxc-error {{X3047: 'f_ext_pre_uni_vol_con': struct/class members cannot be declared 'uniform'}} */ extern precise uniform const float2 f_ext_pre_uni_con; /* expected-error {{'const' is not a valid modifier for a field}} expected-error {{'uniform' is not a valid modifier for a field}} expected-error {{storage class specified for a member declaration}} expected-warning {{'uniform' attribute only applies to variables and parameters}} fxc-error {{X3006: 'f_ext_pre_uni_con': struct/class members cannot be declared 'extern'}} fxc-error {{X3035: 'f_ext_pre_uni_con': struct/class members cannot be declared 'const'}} fxc-error {{X3047: 'f_ext_pre_uni_con': struct/class members cannot be declared 'uniform'}} */ - extern precise volatile float2 f_ext_pre_vol; /* expected-error {{'volatile' is a reserved keyword in HLSL}} expected-error {{storage class specified for a member declaration}} fxc-error {{X3006: 'f_ext_pre_vol': struct/class members cannot be declared 'extern'}} fxc-error {{X3008: 'f_ext_pre_vol': struct/class members cannot be declared 'volatile'}} */ - extern precise volatile const float2 f_ext_pre_vol_con; /* expected-error {{'const' is not a valid modifier for a field}} expected-error {{'volatile' is a reserved keyword in HLSL}} expected-error {{storage class specified for a member declaration}} fxc-error {{X3006: 'f_ext_pre_vol_con': struct/class members cannot be declared 'extern'}} fxc-error {{X3008: 'f_ext_pre_vol_con': struct/class members cannot be declared 'volatile'}} fxc-error {{X3035: 'f_ext_pre_vol_con': struct/class members cannot be declared 'const'}} */ + extern precise volatile float2 f_ext_pre_vol; /* expected-error {{'volatile' is not a valid modifier for a field}} expected-error {{storage class specified for a member declaration}} fxc-error {{X3006: 'f_ext_pre_vol': struct/class members cannot be declared 'extern'}} fxc-error {{X3008: 'f_ext_pre_vol': struct/class members cannot be declared 'volatile'}} */ + extern precise volatile const float2 f_ext_pre_vol_con; /* expected-error {{'const' is not a valid modifier for a field}} expected-error {{'volatile' is not a valid modifier for a field}} expected-error {{storage class specified for a member declaration}} fxc-error {{X3006: 'f_ext_pre_vol_con': struct/class members cannot be declared 'extern'}} fxc-error {{X3008: 'f_ext_pre_vol_con': struct/class members cannot be declared 'volatile'}} fxc-error {{X3035: 'f_ext_pre_vol_con': struct/class members cannot be declared 'const'}} */ extern precise const float2 f_ext_pre_con; /* expected-error {{'const' is not a valid modifier for a field}} expected-error {{storage class specified for a member declaration}} fxc-error {{X3006: 'f_ext_pre_con': struct/class members cannot be declared 'extern'}} fxc-error {{X3035: 'f_ext_pre_con': struct/class members cannot be declared 'const'}} */ extern uniform float2 f_ext_uni; /* expected-error {{'uniform' is not a valid modifier for a field}} expected-error {{storage class specified for a member declaration}} expected-warning {{'uniform' attribute only applies to variables and parameters}} fxc-error {{X3006: 'f_ext_uni': struct/class members cannot be declared 'extern'}} fxc-error {{X3047: 'f_ext_uni': struct/class members cannot be declared 'uniform'}} */ - extern uniform volatile float2 f_ext_uni_vol; /* expected-error {{'uniform' is not a valid modifier for a field}} expected-error {{'volatile' is a reserved keyword in HLSL}} expected-error {{storage class specified for a member declaration}} expected-warning {{'uniform' attribute only applies to variables and parameters}} fxc-error {{X3006: 'f_ext_uni_vol': struct/class members cannot be declared 'extern'}} fxc-error {{X3008: 'f_ext_uni_vol': struct/class members cannot be declared 'volatile'}} fxc-error {{X3047: 'f_ext_uni_vol': struct/class members cannot be declared 'uniform'}} */ - extern uniform volatile const float2 f_ext_uni_vol_con; /* expected-error {{'const' is not a valid modifier for a field}} expected-error {{'uniform' is not a valid modifier for a field}} expected-error {{'volatile' is a reserved keyword in HLSL}} expected-error {{storage class specified for a member declaration}} expected-warning {{'uniform' attribute only applies to variables and parameters}} fxc-error {{X3006: 'f_ext_uni_vol_con': struct/class members cannot be declared 'extern'}} fxc-error {{X3008: 'f_ext_uni_vol_con': struct/class members cannot be declared 'volatile'}} fxc-error {{X3035: 'f_ext_uni_vol_con': struct/class members cannot be declared 'const'}} fxc-error {{X3047: 'f_ext_uni_vol_con': struct/class members cannot be declared 'uniform'}} */ + extern uniform volatile float2 f_ext_uni_vol; /* expected-error {{'uniform' is not a valid modifier for a field}} expected-error {{'volatile' is not a valid modifier for a field}} expected-error {{storage class specified for a member declaration}} expected-warning {{'uniform' attribute only applies to variables and parameters}} fxc-error {{X3006: 'f_ext_uni_vol': struct/class members cannot be declared 'extern'}} fxc-error {{X3008: 'f_ext_uni_vol': struct/class members cannot be declared 'volatile'}} fxc-error {{X3047: 'f_ext_uni_vol': struct/class members cannot be declared 'uniform'}} */ + extern uniform volatile const float2 f_ext_uni_vol_con; /* expected-error {{'const' is not a valid modifier for a field}} expected-error {{'uniform' is not a valid modifier for a field}} expected-error {{'volatile' is not a valid modifier for a field}} expected-error {{storage class specified for a member declaration}} expected-warning {{'uniform' attribute only applies to variables and parameters}} fxc-error {{X3006: 'f_ext_uni_vol_con': struct/class members cannot be declared 'extern'}} fxc-error {{X3008: 'f_ext_uni_vol_con': struct/class members cannot be declared 'volatile'}} fxc-error {{X3035: 'f_ext_uni_vol_con': struct/class members cannot be declared 'const'}} fxc-error {{X3047: 'f_ext_uni_vol_con': struct/class members cannot be declared 'uniform'}} */ extern uniform const float2 f_ext_uni_con; /* expected-error {{'const' is not a valid modifier for a field}} expected-error {{'uniform' is not a valid modifier for a field}} expected-error {{storage class specified for a member declaration}} expected-warning {{'uniform' attribute only applies to variables and parameters}} fxc-error {{X3006: 'f_ext_uni_con': struct/class members cannot be declared 'extern'}} fxc-error {{X3035: 'f_ext_uni_con': struct/class members cannot be declared 'const'}} fxc-error {{X3047: 'f_ext_uni_con': struct/class members cannot be declared 'uniform'}} */ - extern volatile float2 f_ext_vol; /* expected-error {{'volatile' is a reserved keyword in HLSL}} expected-error {{storage class specified for a member declaration}} fxc-error {{X3006: 'f_ext_vol': struct/class members cannot be declared 'extern'}} fxc-error {{X3008: 'f_ext_vol': struct/class members cannot be declared 'volatile'}} */ - extern volatile const float2 f_ext_vol_con; /* expected-error {{'const' is not a valid modifier for a field}} expected-error {{'volatile' is a reserved keyword in HLSL}} expected-error {{storage class specified for a member declaration}} fxc-error {{X3006: 'f_ext_vol_con': struct/class members cannot be declared 'extern'}} fxc-error {{X3008: 'f_ext_vol_con': struct/class members cannot be declared 'volatile'}} fxc-error {{X3035: 'f_ext_vol_con': struct/class members cannot be declared 'const'}} */ + extern volatile float2 f_ext_vol; /* expected-error {{'volatile' is not a valid modifier for a field}} expected-error {{storage class specified for a member declaration}} fxc-error {{X3006: 'f_ext_vol': struct/class members cannot be declared 'extern'}} fxc-error {{X3008: 'f_ext_vol': struct/class members cannot be declared 'volatile'}} */ + extern volatile const float2 f_ext_vol_con; /* expected-error {{'const' is not a valid modifier for a field}} expected-error {{'volatile' is not a valid modifier for a field}} expected-error {{storage class specified for a member declaration}} fxc-error {{X3006: 'f_ext_vol_con': struct/class members cannot be declared 'extern'}} fxc-error {{X3008: 'f_ext_vol_con': struct/class members cannot be declared 'volatile'}} fxc-error {{X3035: 'f_ext_vol_con': struct/class members cannot be declared 'const'}} */ extern const float2 f_ext_con; /* expected-error {{'const' is not a valid modifier for a field}} expected-error {{storage class specified for a member declaration}} fxc-error {{X3006: 'f_ext_con': struct/class members cannot be declared 'extern'}} fxc-error {{X3035: 'f_ext_con': struct/class members cannot be declared 'const'}} */ precise float2 f_pre; precise static float2 f_pre_sta; /* fxc-error {{X3103: 's_storage_mods::f_pre_sta': variable declared but not defined}} */ - precise static volatile float2 f_pre_sta_vol; /* expected-error {{'volatile' is a reserved keyword in HLSL}} fxc-error {{X3008: 'f_pre_sta_vol': struct/class members cannot be declared 'volatile'}} */ - precise static volatile const float2 f_pre_sta_vol_con; /* expected-error {{'volatile' is a reserved keyword in HLSL}} fxc-error {{X3008: 'f_pre_sta_vol_con': struct/class members cannot be declared 'volatile'}} */ + precise static volatile float2 f_pre_sta_vol; /* expected-error {{'volatile' is not a valid modifier for a field}} fxc-error {{X3008: 'f_pre_sta_vol': struct/class members cannot be declared 'volatile'}} */ + precise static volatile const float2 f_pre_sta_vol_con; /* expected-error {{'volatile' is not a valid modifier for a field}} fxc-error {{X3008: 'f_pre_sta_vol_con': struct/class members cannot be declared 'volatile'}} */ precise static const float2 f_pre_sta_con; /* fxc-error {{X3103: 's_storage_mods::f_pre_sta_con': variable declared but not defined}} */ precise uniform float2 f_pre_uni; /* expected-error {{'uniform' is not a valid modifier for a field}} expected-warning {{'uniform' attribute only applies to variables and parameters}} fxc-error {{X3047: 'f_pre_uni': struct/class members cannot be declared 'uniform'}} */ - precise uniform volatile float2 f_pre_uni_vol; /* expected-error {{'uniform' is not a valid modifier for a field}} expected-error {{'volatile' is a reserved keyword in HLSL}} expected-warning {{'uniform' attribute only applies to variables and parameters}} fxc-error {{X3008: 'f_pre_uni_vol': struct/class members cannot be declared 'volatile'}} fxc-error {{X3047: 'f_pre_uni_vol': struct/class members cannot be declared 'uniform'}} */ - precise uniform volatile const float2 f_pre_uni_vol_con; /* expected-error {{'const' is not a valid modifier for a field}} expected-error {{'uniform' is not a valid modifier for a field}} expected-error {{'volatile' is a reserved keyword in HLSL}} expected-warning {{'uniform' attribute only applies to variables and parameters}} fxc-error {{X3008: 'f_pre_uni_vol_con': struct/class members cannot be declared 'volatile'}} fxc-error {{X3035: 'f_pre_uni_vol_con': struct/class members cannot be declared 'const'}} fxc-error {{X3047: 'f_pre_uni_vol_con': struct/class members cannot be declared 'uniform'}} */ + precise uniform volatile float2 f_pre_uni_vol; /* expected-error {{'uniform' is not a valid modifier for a field}} expected-error {{'volatile' is not a valid modifier for a field}} expected-warning {{'uniform' attribute only applies to variables and parameters}} fxc-error {{X3008: 'f_pre_uni_vol': struct/class members cannot be declared 'volatile'}} fxc-error {{X3047: 'f_pre_uni_vol': struct/class members cannot be declared 'uniform'}} */ + precise uniform volatile const float2 f_pre_uni_vol_con; /* expected-error {{'const' is not a valid modifier for a field}} expected-error {{'uniform' is not a valid modifier for a field}} expected-error {{'volatile' is not a valid modifier for a field}} expected-warning {{'uniform' attribute only applies to variables and parameters}} fxc-error {{X3008: 'f_pre_uni_vol_con': struct/class members cannot be declared 'volatile'}} fxc-error {{X3035: 'f_pre_uni_vol_con': struct/class members cannot be declared 'const'}} fxc-error {{X3047: 'f_pre_uni_vol_con': struct/class members cannot be declared 'uniform'}} */ precise uniform const float2 f_pre_uni_con; /* expected-error {{'const' is not a valid modifier for a field}} expected-error {{'uniform' is not a valid modifier for a field}} expected-warning {{'uniform' attribute only applies to variables and parameters}} fxc-error {{X3035: 'f_pre_uni_con': struct/class members cannot be declared 'const'}} fxc-error {{X3047: 'f_pre_uni_con': struct/class members cannot be declared 'uniform'}} */ - precise volatile float2 f_pre_vol; /* expected-error {{'volatile' is a reserved keyword in HLSL}} fxc-error {{X3008: 'f_pre_vol': struct/class members cannot be declared 'volatile'}} */ - precise volatile const float2 f_pre_vol_con; /* expected-error {{'const' is not a valid modifier for a field}} expected-error {{'volatile' is a reserved keyword in HLSL}} fxc-error {{X3008: 'f_pre_vol_con': struct/class members cannot be declared 'volatile'}} fxc-error {{X3035: 'f_pre_vol_con': struct/class members cannot be declared 'const'}} */ + precise volatile float2 f_pre_vol; /* expected-error {{'volatile' is not a valid modifier for a field}} fxc-error {{X3008: 'f_pre_vol': struct/class members cannot be declared 'volatile'}} */ + precise volatile const float2 f_pre_vol_con; /* expected-error {{'const' is not a valid modifier for a field}} expected-error {{'volatile' is not a valid modifier for a field}} fxc-error {{X3008: 'f_pre_vol_con': struct/class members cannot be declared 'volatile'}} fxc-error {{X3035: 'f_pre_vol_con': struct/class members cannot be declared 'const'}} */ precise const float2 f_pre_con; /* expected-error {{'const' is not a valid modifier for a field}} fxc-error {{X3035: 'f_pre_con': struct/class members cannot be declared 'const'}} */ static float2 f_sta; /* fxc-error {{X3103: 's_storage_mods::f_sta': variable declared but not defined}} */ - static volatile float2 f_sta_vol; /* expected-error {{'volatile' is a reserved keyword in HLSL}} fxc-error {{X3008: 'f_sta_vol': struct/class members cannot be declared 'volatile'}} */ - static volatile const float2 f_sta_vol_con; /* expected-error {{'volatile' is a reserved keyword in HLSL}} fxc-error {{X3008: 'f_sta_vol_con': struct/class members cannot be declared 'volatile'}} */ + static volatile float2 f_sta_vol; /* expected-error {{'volatile' is not a valid modifier for a field}} fxc-error {{X3008: 'f_sta_vol': struct/class members cannot be declared 'volatile'}} */ + static volatile const float2 f_sta_vol_con; /* expected-error {{'volatile' is not a valid modifier for a field}} fxc-error {{X3008: 'f_sta_vol_con': struct/class members cannot be declared 'volatile'}} */ static const float2 f_sta_con; /* fxc-error {{X3103: 's_storage_mods::f_sta_con': variable declared but not defined}} */ uniform float2 f_uni; /* expected-error {{'uniform' is not a valid modifier for a field}} expected-warning {{'uniform' attribute only applies to variables and parameters}} fxc-error {{X3047: 'f_uni': struct/class members cannot be declared 'uniform'}} */ - uniform volatile float2 f_uni_vol; /* expected-error {{'uniform' is not a valid modifier for a field}} expected-error {{'volatile' is a reserved keyword in HLSL}} expected-warning {{'uniform' attribute only applies to variables and parameters}} fxc-error {{X3008: 'f_uni_vol': struct/class members cannot be declared 'volatile'}} fxc-error {{X3047: 'f_uni_vol': struct/class members cannot be declared 'uniform'}} */ - uniform volatile const float2 f_uni_vol_con; /* expected-error {{'const' is not a valid modifier for a field}} expected-error {{'uniform' is not a valid modifier for a field}} expected-error {{'volatile' is a reserved keyword in HLSL}} expected-warning {{'uniform' attribute only applies to variables and parameters}} fxc-error {{X3008: 'f_uni_vol_con': struct/class members cannot be declared 'volatile'}} fxc-error {{X3035: 'f_uni_vol_con': struct/class members cannot be declared 'const'}} fxc-error {{X3047: 'f_uni_vol_con': struct/class members cannot be declared 'uniform'}} */ + uniform volatile float2 f_uni_vol; /* expected-error {{'uniform' is not a valid modifier for a field}} expected-error {{'volatile' is not a valid modifier for a field}} expected-warning {{'uniform' attribute only applies to variables and parameters}} fxc-error {{X3008: 'f_uni_vol': struct/class members cannot be declared 'volatile'}} fxc-error {{X3047: 'f_uni_vol': struct/class members cannot be declared 'uniform'}} */ + uniform volatile const float2 f_uni_vol_con; /* expected-error {{'const' is not a valid modifier for a field}} expected-error {{'uniform' is not a valid modifier for a field}} expected-error {{'volatile' is not a valid modifier for a field}} expected-warning {{'uniform' attribute only applies to variables and parameters}} fxc-error {{X3008: 'f_uni_vol_con': struct/class members cannot be declared 'volatile'}} fxc-error {{X3035: 'f_uni_vol_con': struct/class members cannot be declared 'const'}} fxc-error {{X3047: 'f_uni_vol_con': struct/class members cannot be declared 'uniform'}} */ uniform const float2 f_uni_con; /* expected-error {{'const' is not a valid modifier for a field}} expected-error {{'uniform' is not a valid modifier for a field}} expected-warning {{'uniform' attribute only applies to variables and parameters}} fxc-error {{X3035: 'f_uni_con': struct/class members cannot be declared 'const'}} fxc-error {{X3047: 'f_uni_con': struct/class members cannot be declared 'uniform'}} */ - volatile float2 f_vol; /* expected-error {{'volatile' is a reserved keyword in HLSL}} fxc-error {{X3008: 'f_vol': struct/class members cannot be declared 'volatile'}} */ - volatile const float2 f_vol_con; /* expected-error {{'const' is not a valid modifier for a field}} expected-error {{'volatile' is a reserved keyword in HLSL}} fxc-error {{X3008: 'f_vol_con': struct/class members cannot be declared 'volatile'}} fxc-error {{X3035: 'f_vol_con': struct/class members cannot be declared 'const'}} */ + volatile float2 f_vol; /* expected-error {{'volatile' is not a valid modifier for a field}} fxc-error {{X3008: 'f_vol': struct/class members cannot be declared 'volatile'}} */ + volatile const float2 f_vol_con; /* expected-error {{'const' is not a valid modifier for a field}} expected-error {{'volatile' is not a valid modifier for a field}} fxc-error {{X3008: 'f_vol_con': struct/class members cannot be declared 'volatile'}} fxc-error {{X3035: 'f_vol_con': struct/class members cannot be declared 'const'}} */ const float2 f_con; /* expected-error {{'const' is not a valid modifier for a field}} fxc-error {{X3035: 'f_con': struct/class members cannot be declared 'const'}} */ // GENERATED_CODE:END }; @@ -503,65 +503,65 @@ float4 foo_sta_uni(static uniform float4 val) { return val; } /* expected-err float4 foo_gro(groupshared float4 val) { return val; } /* fxc-error {{X3000: syntax error: unexpected token 'groupshared'}} fxc-error {{X3004: undeclared identifier 'val'}} fxc-error {{X3080: 'foo_gro': function must return a value}} */ float4 foo_gro_pre(groupshared precise float4 val) { return val; } /* fxc-error {{X3000: syntax error: unexpected token 'groupshared'}} fxc-error {{X3004: undeclared identifier 'val'}} fxc-error {{X3080: 'foo_gro_pre': function must return a value}} */ float4 foo_gro_pre_sta(groupshared precise static float4 val) { return val; } /* expected-error {{invalid storage class specifier in function declarator}} fxc-error {{X3000: syntax error: unexpected token 'groupshared'}} fxc-error {{X3004: undeclared identifier 'val'}} fxc-error {{X3080: 'foo_gro_pre_sta': function must return a value}} */ -float4 foo_gro_pre_sta_vol(groupshared precise static volatile float4 val) { return val; } /* expected-error {{'volatile' is a reserved keyword in HLSL}} expected-error {{invalid storage class specifier in function declarator}} fxc-error {{X3000: syntax error: unexpected token 'groupshared'}} fxc-error {{X3004: undeclared identifier 'val'}} fxc-error {{X3080: 'foo_gro_pre_sta_vol': function must return a value}} */ -float4 foo_gro_pre_sta_vol_con(groupshared precise static volatile const float4 val) { return val; } /* expected-error {{'volatile' is a reserved keyword in HLSL}} expected-error {{invalid storage class specifier in function declarator}} fxc-error {{X3000: syntax error: unexpected token 'groupshared'}} fxc-error {{X3004: undeclared identifier 'val'}} fxc-error {{X3080: 'foo_gro_pre_sta_vol_con': function must return a value}} */ +float4 foo_gro_pre_sta_vol(groupshared precise static volatile float4 val) { return val; } /* expected-error {{'volatile' is not a valid modifier for a parameter}} expected-error {{invalid storage class specifier in function declarator}} fxc-error {{X3000: syntax error: unexpected token 'groupshared'}} fxc-error {{X3004: undeclared identifier 'val'}} fxc-error {{X3080: 'foo_gro_pre_sta_vol': function must return a value}} */ +float4 foo_gro_pre_sta_vol_con(groupshared precise static volatile const float4 val) { return val; } /* expected-error {{'volatile' is not a valid modifier for a parameter}} expected-error {{invalid storage class specifier in function declarator}} fxc-error {{X3000: syntax error: unexpected token 'groupshared'}} fxc-error {{X3004: undeclared identifier 'val'}} fxc-error {{X3080: 'foo_gro_pre_sta_vol_con': function must return a value}} */ float4 foo_gro_pre_sta_con(groupshared precise static const float4 val) { return val; } /* expected-error {{invalid storage class specifier in function declarator}} fxc-error {{X3000: syntax error: unexpected token 'groupshared'}} fxc-error {{X3004: undeclared identifier 'val'}} fxc-error {{X3080: 'foo_gro_pre_sta_con': function must return a value}} */ float4 foo_gro_pre_uni(groupshared precise uniform float4 val) { return val; } /* fxc-error {{X3000: syntax error: unexpected token 'groupshared'}} fxc-error {{X3004: undeclared identifier 'val'}} fxc-error {{X3080: 'foo_gro_pre_uni': function must return a value}} */ -float4 foo_gro_pre_uni_vol(groupshared precise uniform volatile float4 val) { return val; } /* expected-error {{'volatile' is a reserved keyword in HLSL}} fxc-error {{X3000: syntax error: unexpected token 'groupshared'}} fxc-error {{X3004: undeclared identifier 'val'}} fxc-error {{X3080: 'foo_gro_pre_uni_vol': function must return a value}} */ -float4 foo_gro_pre_uni_vol_con(groupshared precise uniform volatile const float4 val) { return val; } /* expected-error {{'volatile' is a reserved keyword in HLSL}} fxc-error {{X3000: syntax error: unexpected token 'groupshared'}} fxc-error {{X3004: undeclared identifier 'val'}} fxc-error {{X3080: 'foo_gro_pre_uni_vol_con': function must return a value}} */ +float4 foo_gro_pre_uni_vol(groupshared precise uniform volatile float4 val) { return val; } /* expected-error {{'volatile' is not a valid modifier for a parameter}} fxc-error {{X3000: syntax error: unexpected token 'groupshared'}} fxc-error {{X3004: undeclared identifier 'val'}} fxc-error {{X3080: 'foo_gro_pre_uni_vol': function must return a value}} */ +float4 foo_gro_pre_uni_vol_con(groupshared precise uniform volatile const float4 val) { return val; } /* expected-error {{'volatile' is not a valid modifier for a parameter}} fxc-error {{X3000: syntax error: unexpected token 'groupshared'}} fxc-error {{X3004: undeclared identifier 'val'}} fxc-error {{X3080: 'foo_gro_pre_uni_vol_con': function must return a value}} */ float4 foo_gro_pre_uni_con(groupshared precise uniform const float4 val) { return val; } /* fxc-error {{X3000: syntax error: unexpected token 'groupshared'}} fxc-error {{X3004: undeclared identifier 'val'}} fxc-error {{X3080: 'foo_gro_pre_uni_con': function must return a value}} */ -float4 foo_gro_pre_vol(groupshared precise volatile float4 val) { return val; } /* expected-error {{'volatile' is a reserved keyword in HLSL}} fxc-error {{X3000: syntax error: unexpected token 'groupshared'}} fxc-error {{X3004: undeclared identifier 'val'}} fxc-error {{X3080: 'foo_gro_pre_vol': function must return a value}} */ -float4 foo_gro_pre_vol_con(groupshared precise volatile const float4 val) { return val; } /* expected-error {{'volatile' is a reserved keyword in HLSL}} fxc-error {{X3000: syntax error: unexpected token 'groupshared'}} fxc-error {{X3004: undeclared identifier 'val'}} fxc-error {{X3080: 'foo_gro_pre_vol_con': function must return a value}} */ +float4 foo_gro_pre_vol(groupshared precise volatile float4 val) { return val; } /* expected-error {{'volatile' is not a valid modifier for a parameter}} fxc-error {{X3000: syntax error: unexpected token 'groupshared'}} fxc-error {{X3004: undeclared identifier 'val'}} fxc-error {{X3080: 'foo_gro_pre_vol': function must return a value}} */ +float4 foo_gro_pre_vol_con(groupshared precise volatile const float4 val) { return val; } /* expected-error {{'volatile' is not a valid modifier for a parameter}} fxc-error {{X3000: syntax error: unexpected token 'groupshared'}} fxc-error {{X3004: undeclared identifier 'val'}} fxc-error {{X3080: 'foo_gro_pre_vol_con': function must return a value}} */ float4 foo_gro_pre_con(groupshared precise const float4 val) { return val; } /* fxc-error {{X3000: syntax error: unexpected token 'groupshared'}} fxc-error {{X3004: undeclared identifier 'val'}} fxc-error {{X3080: 'foo_gro_pre_con': function must return a value}} */ float4 foo_gro_sta(groupshared static float4 val) { return val; } /* expected-error {{invalid storage class specifier in function declarator}} fxc-error {{X3000: syntax error: unexpected token 'groupshared'}} fxc-error {{X3004: undeclared identifier 'val'}} fxc-error {{X3080: 'foo_gro_sta': function must return a value}} */ -float4 foo_gro_sta_vol(groupshared static volatile float4 val) { return val; } /* expected-error {{'volatile' is a reserved keyword in HLSL}} expected-error {{invalid storage class specifier in function declarator}} fxc-error {{X3000: syntax error: unexpected token 'groupshared'}} fxc-error {{X3004: undeclared identifier 'val'}} fxc-error {{X3080: 'foo_gro_sta_vol': function must return a value}} */ -float4 foo_gro_sta_vol_con(groupshared static volatile const float4 val) { return val; } /* expected-error {{'volatile' is a reserved keyword in HLSL}} expected-error {{invalid storage class specifier in function declarator}} fxc-error {{X3000: syntax error: unexpected token 'groupshared'}} fxc-error {{X3004: undeclared identifier 'val'}} fxc-error {{X3080: 'foo_gro_sta_vol_con': function must return a value}} */ +float4 foo_gro_sta_vol(groupshared static volatile float4 val) { return val; } /* expected-error {{'volatile' is not a valid modifier for a parameter}} expected-error {{invalid storage class specifier in function declarator}} fxc-error {{X3000: syntax error: unexpected token 'groupshared'}} fxc-error {{X3004: undeclared identifier 'val'}} fxc-error {{X3080: 'foo_gro_sta_vol': function must return a value}} */ +float4 foo_gro_sta_vol_con(groupshared static volatile const float4 val) { return val; } /* expected-error {{'volatile' is not a valid modifier for a parameter}} expected-error {{invalid storage class specifier in function declarator}} fxc-error {{X3000: syntax error: unexpected token 'groupshared'}} fxc-error {{X3004: undeclared identifier 'val'}} fxc-error {{X3080: 'foo_gro_sta_vol_con': function must return a value}} */ float4 foo_gro_sta_con(groupshared static const float4 val) { return val; } /* expected-error {{invalid storage class specifier in function declarator}} fxc-error {{X3000: syntax error: unexpected token 'groupshared'}} fxc-error {{X3004: undeclared identifier 'val'}} fxc-error {{X3080: 'foo_gro_sta_con': function must return a value}} */ float4 foo_gro_uni(groupshared uniform float4 val) { return val; } /* fxc-error {{X3000: syntax error: unexpected token 'groupshared'}} fxc-error {{X3004: undeclared identifier 'val'}} fxc-error {{X3080: 'foo_gro_uni': function must return a value}} */ -float4 foo_gro_uni_vol(groupshared uniform volatile float4 val) { return val; } /* expected-error {{'volatile' is a reserved keyword in HLSL}} fxc-error {{X3000: syntax error: unexpected token 'groupshared'}} fxc-error {{X3004: undeclared identifier 'val'}} fxc-error {{X3080: 'foo_gro_uni_vol': function must return a value}} */ -float4 foo_gro_uni_vol_con(groupshared uniform volatile const float4 val) { return val; } /* expected-error {{'volatile' is a reserved keyword in HLSL}} fxc-error {{X3000: syntax error: unexpected token 'groupshared'}} fxc-error {{X3004: undeclared identifier 'val'}} fxc-error {{X3080: 'foo_gro_uni_vol_con': function must return a value}} */ +float4 foo_gro_uni_vol(groupshared uniform volatile float4 val) { return val; } /* expected-error {{'volatile' is not a valid modifier for a parameter}} fxc-error {{X3000: syntax error: unexpected token 'groupshared'}} fxc-error {{X3004: undeclared identifier 'val'}} fxc-error {{X3080: 'foo_gro_uni_vol': function must return a value}} */ +float4 foo_gro_uni_vol_con(groupshared uniform volatile const float4 val) { return val; } /* expected-error {{'volatile' is not a valid modifier for a parameter}} fxc-error {{X3000: syntax error: unexpected token 'groupshared'}} fxc-error {{X3004: undeclared identifier 'val'}} fxc-error {{X3080: 'foo_gro_uni_vol_con': function must return a value}} */ float4 foo_gro_uni_con(groupshared uniform const float4 val) { return val; } /* fxc-error {{X3000: syntax error: unexpected token 'groupshared'}} fxc-error {{X3004: undeclared identifier 'val'}} fxc-error {{X3080: 'foo_gro_uni_con': function must return a value}} */ -float4 foo_gro_vol(groupshared volatile float4 val) { return val; } /* expected-error {{'volatile' is a reserved keyword in HLSL}} fxc-error {{X3000: syntax error: unexpected token 'groupshared'}} fxc-error {{X3004: undeclared identifier 'val'}} fxc-error {{X3080: 'foo_gro_vol': function must return a value}} */ -float4 foo_gro_vol_con(groupshared volatile const float4 val) { return val; } /* expected-error {{'volatile' is a reserved keyword in HLSL}} fxc-error {{X3000: syntax error: unexpected token 'groupshared'}} fxc-error {{X3004: undeclared identifier 'val'}} fxc-error {{X3080: 'foo_gro_vol_con': function must return a value}} */ +float4 foo_gro_vol(groupshared volatile float4 val) { return val; } /* expected-error {{'volatile' is not a valid modifier for a parameter}} fxc-error {{X3000: syntax error: unexpected token 'groupshared'}} fxc-error {{X3004: undeclared identifier 'val'}} fxc-error {{X3080: 'foo_gro_vol': function must return a value}} */ +float4 foo_gro_vol_con(groupshared volatile const float4 val) { return val; } /* expected-error {{'volatile' is not a valid modifier for a parameter}} fxc-error {{X3000: syntax error: unexpected token 'groupshared'}} fxc-error {{X3004: undeclared identifier 'val'}} fxc-error {{X3080: 'foo_gro_vol_con': function must return a value}} */ float4 foo_gro_con(groupshared const float4 val) { return val; } /* fxc-error {{X3000: syntax error: unexpected token 'groupshared'}} fxc-error {{X3004: undeclared identifier 'val'}} fxc-error {{X3080: 'foo_gro_con': function must return a value}} */ float4 foo_ext(extern float4 val) { return val; } /* expected-error {{invalid storage class specifier in function declarator}} fxc-error {{X3000: syntax error: unexpected token 'extern'}} fxc-error {{X3004: undeclared identifier 'val'}} fxc-error {{X3080: 'foo_ext': function must return a value}} */ float4 foo_ext_pre(extern precise float4 val) { return val; } /* expected-error {{invalid storage class specifier in function declarator}} fxc-error {{X3000: syntax error: unexpected token 'extern'}} fxc-error {{X3004: undeclared identifier 'val'}} fxc-error {{X3080: 'foo_ext_pre': function must return a value}} */ float4 foo_ext_pre_uni(extern precise uniform float4 val) { return val; } /* expected-error {{invalid storage class specifier in function declarator}} fxc-error {{X3000: syntax error: unexpected token 'extern'}} fxc-error {{X3004: undeclared identifier 'val'}} fxc-error {{X3080: 'foo_ext_pre_uni': function must return a value}} */ -float4 foo_ext_pre_uni_vol(extern precise uniform volatile float4 val) { return val; } /* expected-error {{'volatile' is a reserved keyword in HLSL}} expected-error {{invalid storage class specifier in function declarator}} fxc-error {{X3000: syntax error: unexpected token 'extern'}} fxc-error {{X3004: undeclared identifier 'val'}} fxc-error {{X3080: 'foo_ext_pre_uni_vol': function must return a value}} */ -float4 foo_ext_pre_uni_vol_con(extern precise uniform volatile const float4 val) { return val; } /* expected-error {{'volatile' is a reserved keyword in HLSL}} expected-error {{invalid storage class specifier in function declarator}} fxc-error {{X3000: syntax error: unexpected token 'extern'}} fxc-error {{X3004: undeclared identifier 'val'}} fxc-error {{X3080: 'foo_ext_pre_uni_vol_con': function must return a value}} */ +float4 foo_ext_pre_uni_vol(extern precise uniform volatile float4 val) { return val; } /* expected-error {{'volatile' is not a valid modifier for a parameter}} expected-error {{invalid storage class specifier in function declarator}} fxc-error {{X3000: syntax error: unexpected token 'extern'}} fxc-error {{X3004: undeclared identifier 'val'}} fxc-error {{X3080: 'foo_ext_pre_uni_vol': function must return a value}} */ +float4 foo_ext_pre_uni_vol_con(extern precise uniform volatile const float4 val) { return val; } /* expected-error {{'volatile' is not a valid modifier for a parameter}} expected-error {{invalid storage class specifier in function declarator}} fxc-error {{X3000: syntax error: unexpected token 'extern'}} fxc-error {{X3004: undeclared identifier 'val'}} fxc-error {{X3080: 'foo_ext_pre_uni_vol_con': function must return a value}} */ float4 foo_ext_pre_uni_con(extern precise uniform const float4 val) { return val; } /* expected-error {{invalid storage class specifier in function declarator}} fxc-error {{X3000: syntax error: unexpected token 'extern'}} fxc-error {{X3004: undeclared identifier 'val'}} fxc-error {{X3080: 'foo_ext_pre_uni_con': function must return a value}} */ -float4 foo_ext_pre_vol(extern precise volatile float4 val) { return val; } /* expected-error {{'volatile' is a reserved keyword in HLSL}} expected-error {{invalid storage class specifier in function declarator}} fxc-error {{X3000: syntax error: unexpected token 'extern'}} fxc-error {{X3004: undeclared identifier 'val'}} fxc-error {{X3080: 'foo_ext_pre_vol': function must return a value}} */ -float4 foo_ext_pre_vol_con(extern precise volatile const float4 val) { return val; } /* expected-error {{'volatile' is a reserved keyword in HLSL}} expected-error {{invalid storage class specifier in function declarator}} fxc-error {{X3000: syntax error: unexpected token 'extern'}} fxc-error {{X3004: undeclared identifier 'val'}} fxc-error {{X3080: 'foo_ext_pre_vol_con': function must return a value}} */ +float4 foo_ext_pre_vol(extern precise volatile float4 val) { return val; } /* expected-error {{'volatile' is not a valid modifier for a parameter}} expected-error {{invalid storage class specifier in function declarator}} fxc-error {{X3000: syntax error: unexpected token 'extern'}} fxc-error {{X3004: undeclared identifier 'val'}} fxc-error {{X3080: 'foo_ext_pre_vol': function must return a value}} */ +float4 foo_ext_pre_vol_con(extern precise volatile const float4 val) { return val; } /* expected-error {{'volatile' is not a valid modifier for a parameter}} expected-error {{invalid storage class specifier in function declarator}} fxc-error {{X3000: syntax error: unexpected token 'extern'}} fxc-error {{X3004: undeclared identifier 'val'}} fxc-error {{X3080: 'foo_ext_pre_vol_con': function must return a value}} */ float4 foo_ext_pre_con(extern precise const float4 val) { return val; } /* expected-error {{invalid storage class specifier in function declarator}} fxc-error {{X3000: syntax error: unexpected token 'extern'}} fxc-error {{X3004: undeclared identifier 'val'}} fxc-error {{X3080: 'foo_ext_pre_con': function must return a value}} */ float4 foo_ext_uni(extern uniform float4 val) { return val; } /* expected-error {{invalid storage class specifier in function declarator}} fxc-error {{X3000: syntax error: unexpected token 'extern'}} fxc-error {{X3004: undeclared identifier 'val'}} fxc-error {{X3080: 'foo_ext_uni': function must return a value}} */ -float4 foo_ext_uni_vol(extern uniform volatile float4 val) { return val; } /* expected-error {{'volatile' is a reserved keyword in HLSL}} expected-error {{invalid storage class specifier in function declarator}} fxc-error {{X3000: syntax error: unexpected token 'extern'}} fxc-error {{X3004: undeclared identifier 'val'}} fxc-error {{X3080: 'foo_ext_uni_vol': function must return a value}} */ -float4 foo_ext_uni_vol_con(extern uniform volatile const float4 val) { return val; } /* expected-error {{'volatile' is a reserved keyword in HLSL}} expected-error {{invalid storage class specifier in function declarator}} fxc-error {{X3000: syntax error: unexpected token 'extern'}} fxc-error {{X3004: undeclared identifier 'val'}} fxc-error {{X3080: 'foo_ext_uni_vol_con': function must return a value}} */ +float4 foo_ext_uni_vol(extern uniform volatile float4 val) { return val; } /* expected-error {{'volatile' is not a valid modifier for a parameter}} expected-error {{invalid storage class specifier in function declarator}} fxc-error {{X3000: syntax error: unexpected token 'extern'}} fxc-error {{X3004: undeclared identifier 'val'}} fxc-error {{X3080: 'foo_ext_uni_vol': function must return a value}} */ +float4 foo_ext_uni_vol_con(extern uniform volatile const float4 val) { return val; } /* expected-error {{'volatile' is not a valid modifier for a parameter}} expected-error {{invalid storage class specifier in function declarator}} fxc-error {{X3000: syntax error: unexpected token 'extern'}} fxc-error {{X3004: undeclared identifier 'val'}} fxc-error {{X3080: 'foo_ext_uni_vol_con': function must return a value}} */ float4 foo_ext_uni_con(extern uniform const float4 val) { return val; } /* expected-error {{invalid storage class specifier in function declarator}} fxc-error {{X3000: syntax error: unexpected token 'extern'}} fxc-error {{X3004: undeclared identifier 'val'}} fxc-error {{X3080: 'foo_ext_uni_con': function must return a value}} */ -float4 foo_ext_vol(extern volatile float4 val) { return val; } /* expected-error {{'volatile' is a reserved keyword in HLSL}} expected-error {{invalid storage class specifier in function declarator}} fxc-error {{X3000: syntax error: unexpected token 'extern'}} fxc-error {{X3004: undeclared identifier 'val'}} fxc-error {{X3080: 'foo_ext_vol': function must return a value}} */ -float4 foo_ext_vol_con(extern volatile const float4 val) { return val; } /* expected-error {{'volatile' is a reserved keyword in HLSL}} expected-error {{invalid storage class specifier in function declarator}} fxc-error {{X3000: syntax error: unexpected token 'extern'}} fxc-error {{X3004: undeclared identifier 'val'}} fxc-error {{X3080: 'foo_ext_vol_con': function must return a value}} */ +float4 foo_ext_vol(extern volatile float4 val) { return val; } /* expected-error {{'volatile' is not a valid modifier for a parameter}} expected-error {{invalid storage class specifier in function declarator}} fxc-error {{X3000: syntax error: unexpected token 'extern'}} fxc-error {{X3004: undeclared identifier 'val'}} fxc-error {{X3080: 'foo_ext_vol': function must return a value}} */ +float4 foo_ext_vol_con(extern volatile const float4 val) { return val; } /* expected-error {{'volatile' is not a valid modifier for a parameter}} expected-error {{invalid storage class specifier in function declarator}} fxc-error {{X3000: syntax error: unexpected token 'extern'}} fxc-error {{X3004: undeclared identifier 'val'}} fxc-error {{X3080: 'foo_ext_vol_con': function must return a value}} */ float4 foo_ext_con(extern const float4 val) { return val; } /* expected-error {{invalid storage class specifier in function declarator}} fxc-error {{X3000: syntax error: unexpected token 'extern'}} fxc-error {{X3004: undeclared identifier 'val'}} fxc-error {{X3080: 'foo_ext_con': function must return a value}} */ float4 foo_pre(precise float4 val) { return val; } float4 foo_pre_sta(precise static float4 val) { return val; } /* expected-error {{invalid storage class specifier in function declarator}} fxc-error {{X3000: syntax error: unexpected token 'static'}} fxc-error {{X3004: undeclared identifier 'val'}} fxc-error {{X3080: 'foo_pre_sta': function must return a value}} */ -float4 foo_pre_sta_vol(precise static volatile float4 val) { return val; } /* expected-error {{'volatile' is a reserved keyword in HLSL}} expected-error {{invalid storage class specifier in function declarator}} fxc-error {{X3000: syntax error: unexpected token 'static'}} fxc-error {{X3004: undeclared identifier 'val'}} fxc-error {{X3080: 'foo_pre_sta_vol': function must return a value}} */ -float4 foo_pre_sta_vol_con(precise static volatile const float4 val) { return val; } /* expected-error {{'volatile' is a reserved keyword in HLSL}} expected-error {{invalid storage class specifier in function declarator}} fxc-error {{X3000: syntax error: unexpected token 'static'}} fxc-error {{X3004: undeclared identifier 'val'}} fxc-error {{X3080: 'foo_pre_sta_vol_con': function must return a value}} */ +float4 foo_pre_sta_vol(precise static volatile float4 val) { return val; } /* expected-error {{'volatile' is not a valid modifier for a parameter}} expected-error {{invalid storage class specifier in function declarator}} fxc-error {{X3000: syntax error: unexpected token 'static'}} fxc-error {{X3004: undeclared identifier 'val'}} fxc-error {{X3080: 'foo_pre_sta_vol': function must return a value}} */ +float4 foo_pre_sta_vol_con(precise static volatile const float4 val) { return val; } /* expected-error {{'volatile' is not a valid modifier for a parameter}} expected-error {{invalid storage class specifier in function declarator}} fxc-error {{X3000: syntax error: unexpected token 'static'}} fxc-error {{X3004: undeclared identifier 'val'}} fxc-error {{X3080: 'foo_pre_sta_vol_con': function must return a value}} */ float4 foo_pre_sta_con(precise static const float4 val) { return val; } /* expected-error {{invalid storage class specifier in function declarator}} fxc-error {{X3000: syntax error: unexpected token 'static'}} fxc-error {{X3004: undeclared identifier 'val'}} fxc-error {{X3080: 'foo_pre_sta_con': function must return a value}} */ float4 foo_pre_uni(precise uniform float4 val) { return val; } -float4 foo_pre_uni_vol(precise uniform volatile float4 val) { return val; } /* expected-error {{'volatile' is a reserved keyword in HLSL}} fxc-pass {{}} */ -float4 foo_pre_uni_vol_con(precise uniform volatile const float4 val) { return val; } /* expected-error {{'volatile' is a reserved keyword in HLSL}} fxc-pass {{}} */ +float4 foo_pre_uni_vol(precise uniform volatile float4 val) { return val; } /* expected-error {{'volatile' is not a valid modifier for a parameter}} fxc-pass {{}} */ +float4 foo_pre_uni_vol_con(precise uniform volatile const float4 val) { return val; } /* expected-error {{'volatile' is not a valid modifier for a parameter}} fxc-pass {{}} */ float4 foo_pre_uni_con(precise uniform const float4 val) { return val; } -float4 foo_pre_vol(precise volatile float4 val) { return val; } /* expected-error {{'volatile' is a reserved keyword in HLSL}} fxc-pass {{}} */ -float4 foo_pre_vol_con(precise volatile const float4 val) { return val; } /* expected-error {{'volatile' is a reserved keyword in HLSL}} fxc-pass {{}} */ +float4 foo_pre_vol(precise volatile float4 val) { return val; } /* expected-error {{'volatile' is not a valid modifier for a parameter}} fxc-pass {{}} */ +float4 foo_pre_vol_con(precise volatile const float4 val) { return val; } /* expected-error {{'volatile' is not a valid modifier for a parameter}} fxc-pass {{}} */ float4 foo_pre_con(precise const float4 val) { return val; } float4 foo_sta(static float4 val) { return val; } /* expected-error {{invalid storage class specifier in function declarator}} fxc-error {{X3000: syntax error: unexpected token 'static'}} fxc-error {{X3004: undeclared identifier 'val'}} fxc-error {{X3080: 'foo_sta': function must return a value}} */ -float4 foo_sta_vol(static volatile float4 val) { return val; } /* expected-error {{'volatile' is a reserved keyword in HLSL}} expected-error {{invalid storage class specifier in function declarator}} fxc-error {{X3000: syntax error: unexpected token 'static'}} fxc-error {{X3004: undeclared identifier 'val'}} fxc-error {{X3080: 'foo_sta_vol': function must return a value}} */ -float4 foo_sta_vol_con(static volatile const float4 val) { return val; } /* expected-error {{'volatile' is a reserved keyword in HLSL}} expected-error {{invalid storage class specifier in function declarator}} fxc-error {{X3000: syntax error: unexpected token 'static'}} fxc-error {{X3004: undeclared identifier 'val'}} fxc-error {{X3080: 'foo_sta_vol_con': function must return a value}} */ +float4 foo_sta_vol(static volatile float4 val) { return val; } /* expected-error {{'volatile' is not a valid modifier for a parameter}} expected-error {{invalid storage class specifier in function declarator}} fxc-error {{X3000: syntax error: unexpected token 'static'}} fxc-error {{X3004: undeclared identifier 'val'}} fxc-error {{X3080: 'foo_sta_vol': function must return a value}} */ +float4 foo_sta_vol_con(static volatile const float4 val) { return val; } /* expected-error {{'volatile' is not a valid modifier for a parameter}} expected-error {{invalid storage class specifier in function declarator}} fxc-error {{X3000: syntax error: unexpected token 'static'}} fxc-error {{X3004: undeclared identifier 'val'}} fxc-error {{X3080: 'foo_sta_vol_con': function must return a value}} */ float4 foo_sta_con(static const float4 val) { return val; } /* expected-error {{invalid storage class specifier in function declarator}} fxc-error {{X3000: syntax error: unexpected token 'static'}} fxc-error {{X3004: undeclared identifier 'val'}} fxc-error {{X3080: 'foo_sta_con': function must return a value}} */ float4 foo_uni(uniform float4 val) { return val; } -float4 foo_uni_vol(uniform volatile float4 val) { return val; } /* expected-error {{'volatile' is a reserved keyword in HLSL}} fxc-pass {{}} */ -float4 foo_uni_vol_con(uniform volatile const float4 val) { return val; } /* expected-error {{'volatile' is a reserved keyword in HLSL}} fxc-pass {{}} */ +float4 foo_uni_vol(uniform volatile float4 val) { return val; } /* expected-error {{'volatile' is not a valid modifier for a parameter}} fxc-pass {{}} */ +float4 foo_uni_vol_con(uniform volatile const float4 val) { return val; } /* expected-error {{'volatile' is not a valid modifier for a parameter}} fxc-pass {{}} */ float4 foo_uni_con(uniform const float4 val) { return val; } -float4 foo_vol(volatile float4 val) { return val; } /* expected-error {{'volatile' is a reserved keyword in HLSL}} fxc-pass {{}} */ -float4 foo_vol_con(volatile const float4 val) { return val; } /* expected-error {{'volatile' is a reserved keyword in HLSL}} fxc-pass {{}} */ +float4 foo_vol(volatile float4 val) { return val; } /* expected-error {{'volatile' is not a valid modifier for a parameter}} fxc-pass {{}} */ +float4 foo_vol_con(volatile const float4 val) { return val; } /* expected-error {{'volatile' is not a valid modifier for a parameter}} fxc-pass {{}} */ float4 foo_con(const float4 val) { return val; } // GENERATED_CODE:END @@ -757,101 +757,101 @@ void vain() { groupshared float l_gro; /* expected-error {{'groupshared' is not a valid modifier for a local variable}} fxc-error {{X3010: 'l_gro': local variables cannot be declared 'groupshared'}} */ groupshared precise float l_gro_pre; /* expected-error {{'groupshared' is not a valid modifier for a local variable}} fxc-error {{X3010: 'l_gro_pre': local variables cannot be declared 'groupshared'}} */ groupshared precise static float l_gro_pre_sta; /* expected-error {{'groupshared' is not a valid modifier for a local variable}} fxc-error {{X3010: 'l_gro_pre_sta': local variables cannot be declared 'groupshared'}} */ - groupshared precise static volatile float l_gro_pre_sta_vol; /* expected-error {{'groupshared' is not a valid modifier for a local variable}} fxc-error {{X3010: 'l_gro_pre_sta_vol': local variables cannot be declared 'groupshared'}} expected-error {{'volatile' is a reserved keyword in HLSL}} */ - groupshared precise static volatile const float l_gro_pre_sta_vol_con; /* expected-error {{'groupshared' is not a valid modifier for a local variable}} fxc-error {{X3010: 'l_gro_pre_sta_vol_con': local variables cannot be declared 'groupshared'}} expected-error {{'volatile' is a reserved keyword in HLSL}} */ + groupshared precise static volatile float l_gro_pre_sta_vol; /* expected-error {{'groupshared' is not a valid modifier for a local variable}} fxc-error {{X3010: 'l_gro_pre_sta_vol': local variables cannot be declared 'groupshared'}} */ + groupshared precise static volatile const float l_gro_pre_sta_vol_con; /* expected-error {{'groupshared' is not a valid modifier for a local variable}} fxc-error {{X3010: 'l_gro_pre_sta_vol_con': local variables cannot be declared 'groupshared'}} */ groupshared precise static const float l_gro_pre_sta_con; /* expected-error {{'groupshared' is not a valid modifier for a local variable}} fxc-error {{X3010: 'l_gro_pre_sta_con': local variables cannot be declared 'groupshared'}} */ groupshared precise uniform float l_gro_pre_uni; /* expected-error {{'groupshared' is not a valid modifier for a local variable}} expected-error {{'uniform' is not a valid modifier for a local variable}} fxc-error {{X3010: 'l_gro_pre_uni': local variables cannot be declared 'groupshared'}} fxc-error {{X3047: 'l_gro_pre_uni': local variables cannot be declared 'uniform'}} */ - groupshared precise uniform volatile float l_gro_pre_uni_vol; /* expected-error {{'groupshared' is not a valid modifier for a local variable}} expected-error {{'uniform' is not a valid modifier for a local variable}} fxc-error {{X3010: 'l_gro_pre_uni_vol': local variables cannot be declared 'groupshared'}} fxc-error {{X3047: 'l_gro_pre_uni_vol': local variables cannot be declared 'uniform'}} expected-error {{'volatile' is a reserved keyword in HLSL}} */ - groupshared precise uniform volatile const float l_gro_pre_uni_vol_con; /* expected-error {{'groupshared' is not a valid modifier for a local variable}} expected-error {{'uniform' is not a valid modifier for a local variable}} fxc-error {{X3010: 'l_gro_pre_uni_vol_con': local variables cannot be declared 'groupshared'}} fxc-error {{X3047: 'l_gro_pre_uni_vol_con': local variables cannot be declared 'uniform'}} expected-error {{'volatile' is a reserved keyword in HLSL}} */ + groupshared precise uniform volatile float l_gro_pre_uni_vol; /* expected-error {{'groupshared' is not a valid modifier for a local variable}} expected-error {{'uniform' is not a valid modifier for a local variable}} fxc-error {{X3010: 'l_gro_pre_uni_vol': local variables cannot be declared 'groupshared'}} fxc-error {{X3047: 'l_gro_pre_uni_vol': local variables cannot be declared 'uniform'}} */ + groupshared precise uniform volatile const float l_gro_pre_uni_vol_con; /* expected-error {{'groupshared' is not a valid modifier for a local variable}} expected-error {{'uniform' is not a valid modifier for a local variable}} fxc-error {{X3010: 'l_gro_pre_uni_vol_con': local variables cannot be declared 'groupshared'}} fxc-error {{X3047: 'l_gro_pre_uni_vol_con': local variables cannot be declared 'uniform'}} */ groupshared precise uniform const float l_gro_pre_uni_con; /* expected-error {{'groupshared' is not a valid modifier for a local variable}} expected-error {{'uniform' is not a valid modifier for a local variable}} fxc-error {{X3010: 'l_gro_pre_uni_con': local variables cannot be declared 'groupshared'}} fxc-error {{X3047: 'l_gro_pre_uni_con': local variables cannot be declared 'uniform'}} */ - groupshared precise volatile float l_gro_pre_vol; /* expected-error {{'groupshared' is not a valid modifier for a local variable}} fxc-error {{X3010: 'l_gro_pre_vol': local variables cannot be declared 'groupshared'}} expected-error {{'volatile' is a reserved keyword in HLSL}} */ - groupshared precise volatile const float l_gro_pre_vol_con; /* expected-error {{'groupshared' is not a valid modifier for a local variable}} fxc-error {{X3010: 'l_gro_pre_vol_con': local variables cannot be declared 'groupshared'}} expected-error {{'volatile' is a reserved keyword in HLSL}} */ + groupshared precise volatile float l_gro_pre_vol; /* expected-error {{'groupshared' is not a valid modifier for a local variable}} fxc-error {{X3010: 'l_gro_pre_vol': local variables cannot be declared 'groupshared'}} */ + groupshared precise volatile const float l_gro_pre_vol_con; /* expected-error {{'groupshared' is not a valid modifier for a local variable}} fxc-error {{X3010: 'l_gro_pre_vol_con': local variables cannot be declared 'groupshared'}} */ groupshared precise const float l_gro_pre_con; /* expected-error {{'groupshared' is not a valid modifier for a local variable}} fxc-error {{X3010: 'l_gro_pre_con': local variables cannot be declared 'groupshared'}} */ groupshared static float l_gro_sta; /* expected-error {{'groupshared' is not a valid modifier for a local variable}} fxc-error {{X3010: 'l_gro_sta': local variables cannot be declared 'groupshared'}} */ - groupshared static volatile float l_gro_sta_vol; /* expected-error {{'groupshared' is not a valid modifier for a local variable}} fxc-error {{X3010: 'l_gro_sta_vol': local variables cannot be declared 'groupshared'}} expected-error {{'volatile' is a reserved keyword in HLSL}} */ - groupshared static volatile const float l_gro_sta_vol_con; /* expected-error {{'groupshared' is not a valid modifier for a local variable}} fxc-error {{X3010: 'l_gro_sta_vol_con': local variables cannot be declared 'groupshared'}} expected-error {{'volatile' is a reserved keyword in HLSL}} */ + groupshared static volatile float l_gro_sta_vol; /* expected-error {{'groupshared' is not a valid modifier for a local variable}} fxc-error {{X3010: 'l_gro_sta_vol': local variables cannot be declared 'groupshared'}} */ + groupshared static volatile const float l_gro_sta_vol_con; /* expected-error {{'groupshared' is not a valid modifier for a local variable}} fxc-error {{X3010: 'l_gro_sta_vol_con': local variables cannot be declared 'groupshared'}} */ groupshared static const float l_gro_sta_con; /* expected-error {{'groupshared' is not a valid modifier for a local variable}} fxc-error {{X3010: 'l_gro_sta_con': local variables cannot be declared 'groupshared'}} */ groupshared uniform float l_gro_uni; /* expected-error {{'groupshared' is not a valid modifier for a local variable}} expected-error {{'uniform' is not a valid modifier for a local variable}} fxc-error {{X3010: 'l_gro_uni': local variables cannot be declared 'groupshared'}} fxc-error {{X3047: 'l_gro_uni': local variables cannot be declared 'uniform'}} */ - groupshared uniform volatile float l_gro_uni_vol; /* expected-error {{'groupshared' is not a valid modifier for a local variable}} expected-error {{'uniform' is not a valid modifier for a local variable}} fxc-error {{X3010: 'l_gro_uni_vol': local variables cannot be declared 'groupshared'}} fxc-error {{X3047: 'l_gro_uni_vol': local variables cannot be declared 'uniform'}} expected-error {{'volatile' is a reserved keyword in HLSL}} */ - groupshared uniform volatile const float l_gro_uni_vol_con; /* expected-error {{'groupshared' is not a valid modifier for a local variable}} expected-error {{'uniform' is not a valid modifier for a local variable}} fxc-error {{X3010: 'l_gro_uni_vol_con': local variables cannot be declared 'groupshared'}} fxc-error {{X3047: 'l_gro_uni_vol_con': local variables cannot be declared 'uniform'}} expected-error {{'volatile' is a reserved keyword in HLSL}} */ + groupshared uniform volatile float l_gro_uni_vol; /* expected-error {{'groupshared' is not a valid modifier for a local variable}} expected-error {{'uniform' is not a valid modifier for a local variable}} fxc-error {{X3010: 'l_gro_uni_vol': local variables cannot be declared 'groupshared'}} fxc-error {{X3047: 'l_gro_uni_vol': local variables cannot be declared 'uniform'}} */ + groupshared uniform volatile const float l_gro_uni_vol_con; /* expected-error {{'groupshared' is not a valid modifier for a local variable}} expected-error {{'uniform' is not a valid modifier for a local variable}} fxc-error {{X3010: 'l_gro_uni_vol_con': local variables cannot be declared 'groupshared'}} fxc-error {{X3047: 'l_gro_uni_vol_con': local variables cannot be declared 'uniform'}} */ groupshared uniform const float l_gro_uni_con; /* expected-error {{'groupshared' is not a valid modifier for a local variable}} expected-error {{'uniform' is not a valid modifier for a local variable}} fxc-error {{X3010: 'l_gro_uni_con': local variables cannot be declared 'groupshared'}} fxc-error {{X3047: 'l_gro_uni_con': local variables cannot be declared 'uniform'}} */ - groupshared volatile float l_gro_vol; /* expected-error {{'groupshared' is not a valid modifier for a local variable}} fxc-error {{X3010: 'l_gro_vol': local variables cannot be declared 'groupshared'}} expected-error {{'volatile' is a reserved keyword in HLSL}} */ - groupshared volatile const float l_gro_vol_con; /* expected-error {{'groupshared' is not a valid modifier for a local variable}} fxc-error {{X3010: 'l_gro_vol_con': local variables cannot be declared 'groupshared'}} expected-error {{'volatile' is a reserved keyword in HLSL}} */ + groupshared volatile float l_gro_vol; /* expected-error {{'groupshared' is not a valid modifier for a local variable}} fxc-error {{X3010: 'l_gro_vol': local variables cannot be declared 'groupshared'}} */ + groupshared volatile const float l_gro_vol_con; /* expected-error {{'groupshared' is not a valid modifier for a local variable}} fxc-error {{X3010: 'l_gro_vol_con': local variables cannot be declared 'groupshared'}} */ groupshared const float l_gro_con; /* expected-error {{'groupshared' is not a valid modifier for a local variable}} fxc-error {{X3010: 'l_gro_con': local variables cannot be declared 'groupshared'}} */ extern float l_ext; /* expected-error {{'extern' is not a valid modifier for a local variable}} fxc-error {{X3006: 'l_ext': local variables cannot be declared 'extern'}} */ extern precise float l_ext_pre; /* expected-error {{'extern' is not a valid modifier for a local variable}} fxc-error {{X3006: 'l_ext_pre': local variables cannot be declared 'extern'}} */ extern precise uniform float l_ext_pre_uni; /* expected-error {{'extern' is not a valid modifier for a local variable}} expected-error {{'uniform' is not a valid modifier for a local variable}} fxc-error {{X3006: 'l_ext_pre_uni': local variables cannot be declared 'extern'}} fxc-error {{X3047: 'l_ext_pre_uni': local variables cannot be declared 'uniform'}} */ - extern precise uniform volatile float l_ext_pre_uni_vol; /* expected-error {{'extern' is not a valid modifier for a local variable}} expected-error {{'uniform' is not a valid modifier for a local variable}} fxc-error {{X3006: 'l_ext_pre_uni_vol': local variables cannot be declared 'extern'}} fxc-error {{X3047: 'l_ext_pre_uni_vol': local variables cannot be declared 'uniform'}} expected-error {{'volatile' is a reserved keyword in HLSL}} */ - extern precise uniform volatile const float l_ext_pre_uni_vol_con; /* expected-error {{'extern' is not a valid modifier for a local variable}} expected-error {{'uniform' is not a valid modifier for a local variable}} fxc-error {{X3006: 'l_ext_pre_uni_vol_con': local variables cannot be declared 'extern'}} fxc-error {{X3047: 'l_ext_pre_uni_vol_con': local variables cannot be declared 'uniform'}} expected-error {{'volatile' is a reserved keyword in HLSL}} */ + extern precise uniform volatile float l_ext_pre_uni_vol; /* expected-error {{'extern' is not a valid modifier for a local variable}} expected-error {{'uniform' is not a valid modifier for a local variable}} fxc-error {{X3006: 'l_ext_pre_uni_vol': local variables cannot be declared 'extern'}} fxc-error {{X3047: 'l_ext_pre_uni_vol': local variables cannot be declared 'uniform'}} */ + extern precise uniform volatile const float l_ext_pre_uni_vol_con; /* expected-error {{'extern' is not a valid modifier for a local variable}} expected-error {{'uniform' is not a valid modifier for a local variable}} fxc-error {{X3006: 'l_ext_pre_uni_vol_con': local variables cannot be declared 'extern'}} fxc-error {{X3047: 'l_ext_pre_uni_vol_con': local variables cannot be declared 'uniform'}} */ extern precise uniform const float l_ext_pre_uni_con; /* expected-error {{'extern' is not a valid modifier for a local variable}} expected-error {{'uniform' is not a valid modifier for a local variable}} fxc-error {{X3006: 'l_ext_pre_uni_con': local variables cannot be declared 'extern'}} fxc-error {{X3047: 'l_ext_pre_uni_con': local variables cannot be declared 'uniform'}} */ - extern precise volatile float l_ext_pre_vol; /* expected-error {{'extern' is not a valid modifier for a local variable}} fxc-error {{X3006: 'l_ext_pre_vol': local variables cannot be declared 'extern'}} expected-error {{'volatile' is a reserved keyword in HLSL}} */ - extern precise volatile const float l_ext_pre_vol_con; /* expected-error {{'extern' is not a valid modifier for a local variable}} fxc-error {{X3006: 'l_ext_pre_vol_con': local variables cannot be declared 'extern'}} expected-error {{'volatile' is a reserved keyword in HLSL}} */ + extern precise volatile float l_ext_pre_vol; /* expected-error {{'extern' is not a valid modifier for a local variable}} fxc-error {{X3006: 'l_ext_pre_vol': local variables cannot be declared 'extern'}} */ + extern precise volatile const float l_ext_pre_vol_con; /* expected-error {{'extern' is not a valid modifier for a local variable}} fxc-error {{X3006: 'l_ext_pre_vol_con': local variables cannot be declared 'extern'}} */ extern precise const float l_ext_pre_con; /* expected-error {{'extern' is not a valid modifier for a local variable}} fxc-error {{X3006: 'l_ext_pre_con': local variables cannot be declared 'extern'}} */ extern uniform float l_ext_uni; /* expected-error {{'extern' is not a valid modifier for a local variable}} expected-error {{'uniform' is not a valid modifier for a local variable}} fxc-error {{X3006: 'l_ext_uni': local variables cannot be declared 'extern'}} fxc-error {{X3047: 'l_ext_uni': local variables cannot be declared 'uniform'}} */ - extern uniform volatile float l_ext_uni_vol; /* expected-error {{'extern' is not a valid modifier for a local variable}} expected-error {{'uniform' is not a valid modifier for a local variable}} fxc-error {{X3006: 'l_ext_uni_vol': local variables cannot be declared 'extern'}} fxc-error {{X3047: 'l_ext_uni_vol': local variables cannot be declared 'uniform'}} expected-error {{'volatile' is a reserved keyword in HLSL}} */ - extern uniform volatile const float l_ext_uni_vol_con; /* expected-error {{'extern' is not a valid modifier for a local variable}} expected-error {{'uniform' is not a valid modifier for a local variable}} fxc-error {{X3006: 'l_ext_uni_vol_con': local variables cannot be declared 'extern'}} fxc-error {{X3047: 'l_ext_uni_vol_con': local variables cannot be declared 'uniform'}} expected-error {{'volatile' is a reserved keyword in HLSL}} */ + extern uniform volatile float l_ext_uni_vol; /* expected-error {{'extern' is not a valid modifier for a local variable}} expected-error {{'uniform' is not a valid modifier for a local variable}} fxc-error {{X3006: 'l_ext_uni_vol': local variables cannot be declared 'extern'}} fxc-error {{X3047: 'l_ext_uni_vol': local variables cannot be declared 'uniform'}} */ + extern uniform volatile const float l_ext_uni_vol_con; /* expected-error {{'extern' is not a valid modifier for a local variable}} expected-error {{'uniform' is not a valid modifier for a local variable}} fxc-error {{X3006: 'l_ext_uni_vol_con': local variables cannot be declared 'extern'}} fxc-error {{X3047: 'l_ext_uni_vol_con': local variables cannot be declared 'uniform'}} */ extern uniform const float l_ext_uni_con; /* expected-error {{'extern' is not a valid modifier for a local variable}} expected-error {{'uniform' is not a valid modifier for a local variable}} fxc-error {{X3006: 'l_ext_uni_con': local variables cannot be declared 'extern'}} fxc-error {{X3047: 'l_ext_uni_con': local variables cannot be declared 'uniform'}} */ - extern volatile float l_ext_vol; /* expected-error {{'extern' is not a valid modifier for a local variable}} fxc-error {{X3006: 'l_ext_vol': local variables cannot be declared 'extern'}} expected-error {{'volatile' is a reserved keyword in HLSL}} */ - extern volatile const float l_ext_vol_con; /* expected-error {{'extern' is not a valid modifier for a local variable}} fxc-error {{X3006: 'l_ext_vol_con': local variables cannot be declared 'extern'}} expected-error {{'volatile' is a reserved keyword in HLSL}} */ + extern volatile float l_ext_vol; /* expected-error {{'extern' is not a valid modifier for a local variable}} fxc-error {{X3006: 'l_ext_vol': local variables cannot be declared 'extern'}} */ + extern volatile const float l_ext_vol_con; /* expected-error {{'extern' is not a valid modifier for a local variable}} fxc-error {{X3006: 'l_ext_vol_con': local variables cannot be declared 'extern'}} */ extern const float l_ext_con; /* expected-error {{'extern' is not a valid modifier for a local variable}} fxc-error {{X3006: 'l_ext_con': local variables cannot be declared 'extern'}} */ precise float l_pre; precise static float l_pre_sta; - precise static volatile float l_pre_sta_vol; /* expected-error {{'volatile' is a reserved keyword in HLSL}} */ - precise static volatile const float l_pre_sta_vol_con; /* expected-error {{'volatile' is a reserved keyword in HLSL}} */ + precise static volatile float l_pre_sta_vol; + precise static volatile const float l_pre_sta_vol_con; precise static const float l_pre_sta_con; precise uniform float l_pre_uni; /* expected-error {{'uniform' is not a valid modifier for a local variable}} fxc-error {{X3047: 'l_pre_uni': local variables cannot be declared 'uniform'}} */ - precise uniform volatile float l_pre_uni_vol; /* expected-error {{'uniform' is not a valid modifier for a local variable}} fxc-error {{X3047: 'l_pre_uni_vol': local variables cannot be declared 'uniform'}} expected-error {{'volatile' is a reserved keyword in HLSL}} */ - precise uniform volatile const float l_pre_uni_vol_con; /* expected-error {{'uniform' is not a valid modifier for a local variable}} fxc-error {{X3047: 'l_pre_uni_vol_con': local variables cannot be declared 'uniform'}} expected-error {{'volatile' is a reserved keyword in HLSL}} */ + precise uniform volatile float l_pre_uni_vol; /* expected-error {{'uniform' is not a valid modifier for a local variable}} fxc-error {{X3047: 'l_pre_uni_vol': local variables cannot be declared 'uniform'}} */ + precise uniform volatile const float l_pre_uni_vol_con; /* expected-error {{'uniform' is not a valid modifier for a local variable}} fxc-error {{X3047: 'l_pre_uni_vol_con': local variables cannot be declared 'uniform'}} */ precise uniform const float l_pre_uni_con; /* expected-error {{'uniform' is not a valid modifier for a local variable}} fxc-error {{X3047: 'l_pre_uni_con': local variables cannot be declared 'uniform'}} */ - precise volatile float l_pre_vol; /* expected-error {{'volatile' is a reserved keyword in HLSL}} */ - precise volatile const float l_pre_vol_con; /* fxc-error {{X3012: 'l_pre_vol_con': missing initial value}} expected-error {{'volatile' is a reserved keyword in HLSL}} */ + precise volatile float l_pre_vol; + precise volatile const float l_pre_vol_con; /* fxc-error {{X3012: 'l_pre_vol_con': missing initial value}} */ precise const float l_pre_con; /* fxc-error {{X3012: 'l_pre_con': missing initial value}} */ static float l_sta; - static volatile float l_sta_vol; /* expected-error {{'volatile' is a reserved keyword in HLSL}} */ - static volatile const float l_sta_vol_con; /* expected-error {{'volatile' is a reserved keyword in HLSL}} */ + static volatile float l_sta_vol; + static volatile const float l_sta_vol_con; static const float l_sta_con; uniform float l_uni; /* expected-error {{'uniform' is not a valid modifier for a local variable}} fxc-error {{X3047: 'l_uni': local variables cannot be declared 'uniform'}} */ - uniform volatile float l_uni_vol; /* expected-error {{'uniform' is not a valid modifier for a local variable}} fxc-error {{X3047: 'l_uni_vol': local variables cannot be declared 'uniform'}} expected-error {{'volatile' is a reserved keyword in HLSL}} */ - uniform volatile const float l_uni_vol_con; /* expected-error {{'uniform' is not a valid modifier for a local variable}} fxc-error {{X3047: 'l_uni_vol_con': local variables cannot be declared 'uniform'}} expected-error {{'volatile' is a reserved keyword in HLSL}} */ + uniform volatile float l_uni_vol; /* expected-error {{'uniform' is not a valid modifier for a local variable}} fxc-error {{X3047: 'l_uni_vol': local variables cannot be declared 'uniform'}} */ + uniform volatile const float l_uni_vol_con; /* expected-error {{'uniform' is not a valid modifier for a local variable}} fxc-error {{X3047: 'l_uni_vol_con': local variables cannot be declared 'uniform'}} */ uniform const float l_uni_con; /* expected-error {{'uniform' is not a valid modifier for a local variable}} fxc-error {{X3047: 'l_uni_con': local variables cannot be declared 'uniform'}} */ - volatile float l_vol; /* expected-error {{'volatile' is a reserved keyword in HLSL}} */ - volatile const float l_vol_con; /* fxc-error {{X3012: 'l_vol_con': missing initial value}} expected-error {{'volatile' is a reserved keyword in HLSL}} */ + volatile float l_vol; + volatile const float l_vol_con; /* fxc-error {{X3012: 'l_vol_con': missing initial value}} */ const float l_con; /* fxc-error {{X3012: 'l_con': missing initial value}} */ // GENERATED_CODE:END // Now with const vars initialized: // modify(lines, gen_code('%(mods)s float l_%(id)s_init = 0.0;', filter(lambda combo: 'const' in combo, storage_combos))) // GENERATED_CODE:BEGIN - groupshared precise static volatile const float l_gro_pre_sta_vol_con_init = 0.0; /* expected-error {{'groupshared' is not a valid modifier for a local variable}} fxc-error {{X3010: 'l_gro_pre_sta_vol_con_init': local variables cannot be declared 'groupshared'}} expected-error {{'volatile' is a reserved keyword in HLSL}} */ + groupshared precise static volatile const float l_gro_pre_sta_vol_con_init = 0.0; /* expected-error {{'groupshared' is not a valid modifier for a local variable}} fxc-error {{X3010: 'l_gro_pre_sta_vol_con_init': local variables cannot be declared 'groupshared'}} */ groupshared precise static const float l_gro_pre_sta_con_init = 0.0; /* expected-error {{'groupshared' is not a valid modifier for a local variable}} fxc-error {{X3010: 'l_gro_pre_sta_con_init': local variables cannot be declared 'groupshared'}} */ - groupshared precise uniform volatile const float l_gro_pre_uni_vol_con_init = 0.0; /* expected-error {{'groupshared' is not a valid modifier for a local variable}} expected-error {{'uniform' is not a valid modifier for a local variable}} fxc-error {{X3010: 'l_gro_pre_uni_vol_con_init': local variables cannot be declared 'groupshared'}} fxc-error {{X3047: 'l_gro_pre_uni_vol_con_init': local variables cannot be declared 'uniform'}} expected-error {{'volatile' is a reserved keyword in HLSL}} */ + groupshared precise uniform volatile const float l_gro_pre_uni_vol_con_init = 0.0; /* expected-error {{'groupshared' is not a valid modifier for a local variable}} expected-error {{'uniform' is not a valid modifier for a local variable}} fxc-error {{X3010: 'l_gro_pre_uni_vol_con_init': local variables cannot be declared 'groupshared'}} fxc-error {{X3047: 'l_gro_pre_uni_vol_con_init': local variables cannot be declared 'uniform'}} */ groupshared precise uniform const float l_gro_pre_uni_con_init = 0.0; /* expected-error {{'groupshared' is not a valid modifier for a local variable}} expected-error {{'uniform' is not a valid modifier for a local variable}} fxc-error {{X3010: 'l_gro_pre_uni_con_init': local variables cannot be declared 'groupshared'}} fxc-error {{X3047: 'l_gro_pre_uni_con_init': local variables cannot be declared 'uniform'}} */ - groupshared precise volatile const float l_gro_pre_vol_con_init = 0.0; /* expected-error {{'groupshared' is not a valid modifier for a local variable}} fxc-error {{X3010: 'l_gro_pre_vol_con_init': local variables cannot be declared 'groupshared'}} expected-error {{'volatile' is a reserved keyword in HLSL}} */ + groupshared precise volatile const float l_gro_pre_vol_con_init = 0.0; /* expected-error {{'groupshared' is not a valid modifier for a local variable}} fxc-error {{X3010: 'l_gro_pre_vol_con_init': local variables cannot be declared 'groupshared'}} */ groupshared precise const float l_gro_pre_con_init = 0.0; /* expected-error {{'groupshared' is not a valid modifier for a local variable}} fxc-error {{X3010: 'l_gro_pre_con_init': local variables cannot be declared 'groupshared'}} */ - groupshared static volatile const float l_gro_sta_vol_con_init = 0.0; /* expected-error {{'groupshared' is not a valid modifier for a local variable}} fxc-error {{X3010: 'l_gro_sta_vol_con_init': local variables cannot be declared 'groupshared'}} expected-error {{'volatile' is a reserved keyword in HLSL}} */ + groupshared static volatile const float l_gro_sta_vol_con_init = 0.0; /* expected-error {{'groupshared' is not a valid modifier for a local variable}} fxc-error {{X3010: 'l_gro_sta_vol_con_init': local variables cannot be declared 'groupshared'}} */ groupshared static const float l_gro_sta_con_init = 0.0; /* expected-error {{'groupshared' is not a valid modifier for a local variable}} fxc-error {{X3010: 'l_gro_sta_con_init': local variables cannot be declared 'groupshared'}} */ - groupshared uniform volatile const float l_gro_uni_vol_con_init = 0.0; /* expected-error {{'groupshared' is not a valid modifier for a local variable}} expected-error {{'uniform' is not a valid modifier for a local variable}} fxc-error {{X3010: 'l_gro_uni_vol_con_init': local variables cannot be declared 'groupshared'}} fxc-error {{X3047: 'l_gro_uni_vol_con_init': local variables cannot be declared 'uniform'}} expected-error {{'volatile' is a reserved keyword in HLSL}} */ + groupshared uniform volatile const float l_gro_uni_vol_con_init = 0.0; /* expected-error {{'groupshared' is not a valid modifier for a local variable}} expected-error {{'uniform' is not a valid modifier for a local variable}} fxc-error {{X3010: 'l_gro_uni_vol_con_init': local variables cannot be declared 'groupshared'}} fxc-error {{X3047: 'l_gro_uni_vol_con_init': local variables cannot be declared 'uniform'}} */ groupshared uniform const float l_gro_uni_con_init = 0.0; /* expected-error {{'groupshared' is not a valid modifier for a local variable}} expected-error {{'uniform' is not a valid modifier for a local variable}} fxc-error {{X3010: 'l_gro_uni_con_init': local variables cannot be declared 'groupshared'}} fxc-error {{X3047: 'l_gro_uni_con_init': local variables cannot be declared 'uniform'}} */ - groupshared volatile const float l_gro_vol_con_init = 0.0; /* expected-error {{'groupshared' is not a valid modifier for a local variable}} fxc-error {{X3010: 'l_gro_vol_con_init': local variables cannot be declared 'groupshared'}} expected-error {{'volatile' is a reserved keyword in HLSL}} */ + groupshared volatile const float l_gro_vol_con_init = 0.0; /* expected-error {{'groupshared' is not a valid modifier for a local variable}} fxc-error {{X3010: 'l_gro_vol_con_init': local variables cannot be declared 'groupshared'}} */ groupshared const float l_gro_con_init = 0.0; /* expected-error {{'groupshared' is not a valid modifier for a local variable}} fxc-error {{X3010: 'l_gro_con_init': local variables cannot be declared 'groupshared'}} */ - extern precise uniform volatile const float l_ext_pre_uni_vol_con_init = 0.0; /* expected-error {{'extern' is not a valid modifier for a local variable}} expected-error {{'uniform' is not a valid modifier for a local variable}} fxc-error {{X3006: 'l_ext_pre_uni_vol_con_init': local variables cannot be declared 'extern'}} fxc-error {{X3047: 'l_ext_pre_uni_vol_con_init': local variables cannot be declared 'uniform'}} expected-error {{'volatile' is a reserved keyword in HLSL}} */ + extern precise uniform volatile const float l_ext_pre_uni_vol_con_init = 0.0; /* expected-error {{'extern' is not a valid modifier for a local variable}} expected-error {{'uniform' is not a valid modifier for a local variable}} fxc-error {{X3006: 'l_ext_pre_uni_vol_con_init': local variables cannot be declared 'extern'}} fxc-error {{X3047: 'l_ext_pre_uni_vol_con_init': local variables cannot be declared 'uniform'}} */ extern precise uniform const float l_ext_pre_uni_con_init = 0.0; /* expected-error {{'extern' is not a valid modifier for a local variable}} expected-error {{'uniform' is not a valid modifier for a local variable}} fxc-error {{X3006: 'l_ext_pre_uni_con_init': local variables cannot be declared 'extern'}} fxc-error {{X3047: 'l_ext_pre_uni_con_init': local variables cannot be declared 'uniform'}} */ - extern precise volatile const float l_ext_pre_vol_con_init = 0.0; /* expected-error {{'extern' is not a valid modifier for a local variable}} fxc-error {{X3006: 'l_ext_pre_vol_con_init': local variables cannot be declared 'extern'}} expected-error {{'volatile' is a reserved keyword in HLSL}} */ + extern precise volatile const float l_ext_pre_vol_con_init = 0.0; /* expected-error {{'extern' is not a valid modifier for a local variable}} fxc-error {{X3006: 'l_ext_pre_vol_con_init': local variables cannot be declared 'extern'}} */ extern precise const float l_ext_pre_con_init = 0.0; /* expected-error {{'extern' is not a valid modifier for a local variable}} fxc-error {{X3006: 'l_ext_pre_con_init': local variables cannot be declared 'extern'}} */ - extern uniform volatile const float l_ext_uni_vol_con_init = 0.0; /* expected-error {{'extern' is not a valid modifier for a local variable}} expected-error {{'uniform' is not a valid modifier for a local variable}} fxc-error {{X3006: 'l_ext_uni_vol_con_init': local variables cannot be declared 'extern'}} fxc-error {{X3047: 'l_ext_uni_vol_con_init': local variables cannot be declared 'uniform'}} expected-error {{'volatile' is a reserved keyword in HLSL}} */ + extern uniform volatile const float l_ext_uni_vol_con_init = 0.0; /* expected-error {{'extern' is not a valid modifier for a local variable}} expected-error {{'uniform' is not a valid modifier for a local variable}} fxc-error {{X3006: 'l_ext_uni_vol_con_init': local variables cannot be declared 'extern'}} fxc-error {{X3047: 'l_ext_uni_vol_con_init': local variables cannot be declared 'uniform'}} */ extern uniform const float l_ext_uni_con_init = 0.0; /* expected-error {{'extern' is not a valid modifier for a local variable}} expected-error {{'uniform' is not a valid modifier for a local variable}} fxc-error {{X3006: 'l_ext_uni_con_init': local variables cannot be declared 'extern'}} fxc-error {{X3047: 'l_ext_uni_con_init': local variables cannot be declared 'uniform'}} */ - extern volatile const float l_ext_vol_con_init = 0.0; /* expected-error {{'extern' is not a valid modifier for a local variable}} fxc-error {{X3006: 'l_ext_vol_con_init': local variables cannot be declared 'extern'}} expected-error {{'volatile' is a reserved keyword in HLSL}} */ + extern volatile const float l_ext_vol_con_init = 0.0; /* expected-error {{'extern' is not a valid modifier for a local variable}} fxc-error {{X3006: 'l_ext_vol_con_init': local variables cannot be declared 'extern'}} */ extern const float l_ext_con_init = 0.0; /* expected-error {{'extern' is not a valid modifier for a local variable}} fxc-error {{X3006: 'l_ext_con_init': local variables cannot be declared 'extern'}} */ - precise static volatile const float l_pre_sta_vol_con_init = 0.0; /* expected-error {{'volatile' is a reserved keyword in HLSL}} */ + precise static volatile const float l_pre_sta_vol_con_init = 0.0; precise static const float l_pre_sta_con_init = 0.0; - precise uniform volatile const float l_pre_uni_vol_con_init = 0.0; /* expected-error {{'uniform' is not a valid modifier for a local variable}} fxc-error {{X3047: 'l_pre_uni_vol_con_init': local variables cannot be declared 'uniform'}} expected-error {{'volatile' is a reserved keyword in HLSL}} */ + precise uniform volatile const float l_pre_uni_vol_con_init = 0.0; /* expected-error {{'uniform' is not a valid modifier for a local variable}} fxc-error {{X3047: 'l_pre_uni_vol_con_init': local variables cannot be declared 'uniform'}} */ precise uniform const float l_pre_uni_con_init = 0.0; /* expected-error {{'uniform' is not a valid modifier for a local variable}} fxc-error {{X3047: 'l_pre_uni_con_init': local variables cannot be declared 'uniform'}} */ - precise volatile const float l_pre_vol_con_init = 0.0; /* expected-error {{'volatile' is a reserved keyword in HLSL}} */ + precise volatile const float l_pre_vol_con_init = 0.0; precise const float l_pre_con_init = 0.0; - static volatile const float l_sta_vol_con_init = 0.0; /* expected-error {{'volatile' is a reserved keyword in HLSL}} */ + static volatile const float l_sta_vol_con_init = 0.0; static const float l_sta_con_init = 0.0; - uniform volatile const float l_uni_vol_con_init = 0.0; /* expected-error {{'uniform' is not a valid modifier for a local variable}} fxc-error {{X3047: 'l_uni_vol_con_init': local variables cannot be declared 'uniform'}} expected-error {{'volatile' is a reserved keyword in HLSL}} */ + uniform volatile const float l_uni_vol_con_init = 0.0; /* expected-error {{'uniform' is not a valid modifier for a local variable}} fxc-error {{X3047: 'l_uni_vol_con_init': local variables cannot be declared 'uniform'}} */ uniform const float l_uni_con_init = 0.0; /* expected-error {{'uniform' is not a valid modifier for a local variable}} fxc-error {{X3047: 'l_uni_con_init': local variables cannot be declared 'uniform'}} */ - volatile const float l_vol_con_init = 0.0; /* expected-error {{'volatile' is a reserved keyword in HLSL}} */ + volatile const float l_vol_con_init = 0.0; const float l_con_init = 0.0; // GENERATED_CODE:END @@ -922,65 +922,65 @@ static uniform float fn_sta_uni() { return 1.0f; } /* expected-erro groupshared float fn_gro() { return 1.0f; } /* expected-error {{'groupshared' is not a valid modifier for a function}} fxc-pass {{}} */ groupshared precise float fn_gro_pre() { return 1.0f; } /* expected-error {{'groupshared' is not a valid modifier for a function}} fxc-pass {{}} */ groupshared precise static float fn_gro_pre_sta() { return 1.0f; } /* expected-error {{'groupshared' is not a valid modifier for a function}} fxc-pass {{}} */ -groupshared precise static volatile float fn_gro_pre_sta_vol() { return 1.0f; } /* expected-error {{'groupshared' is not a valid modifier for a function}} expected-error {{'volatile' is a reserved keyword in HLSL}} fxc-pass {{}} */ -groupshared precise static volatile const float fn_gro_pre_sta_vol_con() { return 1.0f; } /* expected-error {{'groupshared' is not a valid modifier for a function}} expected-error {{'volatile' is a reserved keyword in HLSL}} fxc-error {{X3025: l-value specifies const object}} */ +groupshared precise static volatile float fn_gro_pre_sta_vol() { return 1.0f; } /* expected-error {{'groupshared' is not a valid modifier for a function}} expected-error {{'volatile' is not a valid modifier for a function}} fxc-pass {{}} */ +groupshared precise static volatile const float fn_gro_pre_sta_vol_con() { return 1.0f; } /* expected-error {{'groupshared' is not a valid modifier for a function}} expected-error {{'volatile' is not a valid modifier for a function}} fxc-error {{X3025: l-value specifies const object}} */ groupshared precise static const float fn_gro_pre_sta_con() { return 1.0f; } /* expected-error {{'groupshared' is not a valid modifier for a function}} fxc-error {{X3025: l-value specifies const object}} */ groupshared precise uniform float fn_gro_pre_uni() { return 1.0f; } /* expected-error {{'groupshared' is not a valid modifier for a function}} expected-error {{'uniform' is not a valid modifier for a function}} fxc-error {{X3047: 'fn_gro_pre_uni': functions cannot be declared 'uniform'}} */ -groupshared precise uniform volatile float fn_gro_pre_uni_vol() { return 1.0f; } /* expected-error {{'groupshared' is not a valid modifier for a function}} expected-error {{'uniform' is not a valid modifier for a function}} expected-error {{'volatile' is a reserved keyword in HLSL}} fxc-error {{X3047: 'fn_gro_pre_uni_vol': functions cannot be declared 'uniform'}} */ -groupshared precise uniform volatile const float fn_gro_pre_uni_vol_con() { return 1.0f; } /* expected-error {{'groupshared' is not a valid modifier for a function}} expected-error {{'uniform' is not a valid modifier for a function}} expected-error {{'volatile' is a reserved keyword in HLSL}} fxc-error {{X3047: 'fn_gro_pre_uni_vol_con': functions cannot be declared 'uniform'}} */ +groupshared precise uniform volatile float fn_gro_pre_uni_vol() { return 1.0f; } /* expected-error {{'groupshared' is not a valid modifier for a function}} expected-error {{'uniform' is not a valid modifier for a function}} expected-error {{'volatile' is not a valid modifier for a function}} fxc-error {{X3047: 'fn_gro_pre_uni_vol': functions cannot be declared 'uniform'}} */ +groupshared precise uniform volatile const float fn_gro_pre_uni_vol_con() { return 1.0f; } /* expected-error {{'groupshared' is not a valid modifier for a function}} expected-error {{'uniform' is not a valid modifier for a function}} expected-error {{'volatile' is not a valid modifier for a function}} fxc-error {{X3047: 'fn_gro_pre_uni_vol_con': functions cannot be declared 'uniform'}} */ groupshared precise uniform const float fn_gro_pre_uni_con() { return 1.0f; } /* expected-error {{'groupshared' is not a valid modifier for a function}} expected-error {{'uniform' is not a valid modifier for a function}} fxc-error {{X3047: 'fn_gro_pre_uni_con': functions cannot be declared 'uniform'}} */ -groupshared precise volatile float fn_gro_pre_vol() { return 1.0f; } /* expected-error {{'groupshared' is not a valid modifier for a function}} expected-error {{'volatile' is a reserved keyword in HLSL}} fxc-pass {{}} */ -groupshared precise volatile const float fn_gro_pre_vol_con() { return 1.0f; } /* expected-error {{'groupshared' is not a valid modifier for a function}} expected-error {{'volatile' is a reserved keyword in HLSL}} fxc-error {{X3025: l-value specifies const object}} */ +groupshared precise volatile float fn_gro_pre_vol() { return 1.0f; } /* expected-error {{'groupshared' is not a valid modifier for a function}} expected-error {{'volatile' is not a valid modifier for a function}} fxc-pass {{}} */ +groupshared precise volatile const float fn_gro_pre_vol_con() { return 1.0f; } /* expected-error {{'groupshared' is not a valid modifier for a function}} expected-error {{'volatile' is not a valid modifier for a function}} fxc-error {{X3025: l-value specifies const object}} */ groupshared precise const float fn_gro_pre_con() { return 1.0f; } /* expected-error {{'groupshared' is not a valid modifier for a function}} fxc-error {{X3025: l-value specifies const object}} */ groupshared static float fn_gro_sta() { return 1.0f; } /* expected-error {{'groupshared' is not a valid modifier for a function}} fxc-pass {{}} */ -groupshared static volatile float fn_gro_sta_vol() { return 1.0f; } /* expected-error {{'groupshared' is not a valid modifier for a function}} expected-error {{'volatile' is a reserved keyword in HLSL}} fxc-pass {{}} */ -groupshared static volatile const float fn_gro_sta_vol_con() { return 1.0f; } /* expected-error {{'groupshared' is not a valid modifier for a function}} expected-error {{'volatile' is a reserved keyword in HLSL}} fxc-pass {{}} */ +groupshared static volatile float fn_gro_sta_vol() { return 1.0f; } /* expected-error {{'groupshared' is not a valid modifier for a function}} expected-error {{'volatile' is not a valid modifier for a function}} fxc-pass {{}} */ +groupshared static volatile const float fn_gro_sta_vol_con() { return 1.0f; } /* expected-error {{'groupshared' is not a valid modifier for a function}} expected-error {{'volatile' is not a valid modifier for a function}} fxc-pass {{}} */ groupshared static const float fn_gro_sta_con() { return 1.0f; } /* expected-error {{'groupshared' is not a valid modifier for a function}} fxc-pass {{}} */ groupshared uniform float fn_gro_uni() { return 1.0f; } /* expected-error {{'groupshared' is not a valid modifier for a function}} expected-error {{'uniform' is not a valid modifier for a function}} fxc-error {{X3047: 'fn_gro_uni': functions cannot be declared 'uniform'}} */ -groupshared uniform volatile float fn_gro_uni_vol() { return 1.0f; } /* expected-error {{'groupshared' is not a valid modifier for a function}} expected-error {{'uniform' is not a valid modifier for a function}} expected-error {{'volatile' is a reserved keyword in HLSL}} fxc-error {{X3047: 'fn_gro_uni_vol': functions cannot be declared 'uniform'}} */ -groupshared uniform volatile const float fn_gro_uni_vol_con() { return 1.0f; } /* expected-error {{'groupshared' is not a valid modifier for a function}} expected-error {{'uniform' is not a valid modifier for a function}} expected-error {{'volatile' is a reserved keyword in HLSL}} fxc-error {{X3047: 'fn_gro_uni_vol_con': functions cannot be declared 'uniform'}} */ +groupshared uniform volatile float fn_gro_uni_vol() { return 1.0f; } /* expected-error {{'groupshared' is not a valid modifier for a function}} expected-error {{'uniform' is not a valid modifier for a function}} expected-error {{'volatile' is not a valid modifier for a function}} fxc-error {{X3047: 'fn_gro_uni_vol': functions cannot be declared 'uniform'}} */ +groupshared uniform volatile const float fn_gro_uni_vol_con() { return 1.0f; } /* expected-error {{'groupshared' is not a valid modifier for a function}} expected-error {{'uniform' is not a valid modifier for a function}} expected-error {{'volatile' is not a valid modifier for a function}} fxc-error {{X3047: 'fn_gro_uni_vol_con': functions cannot be declared 'uniform'}} */ groupshared uniform const float fn_gro_uni_con() { return 1.0f; } /* expected-error {{'groupshared' is not a valid modifier for a function}} expected-error {{'uniform' is not a valid modifier for a function}} fxc-error {{X3047: 'fn_gro_uni_con': functions cannot be declared 'uniform'}} */ -groupshared volatile float fn_gro_vol() { return 1.0f; } /* expected-error {{'groupshared' is not a valid modifier for a function}} expected-error {{'volatile' is a reserved keyword in HLSL}} fxc-pass {{}} */ -groupshared volatile const float fn_gro_vol_con() { return 1.0f; } /* expected-error {{'groupshared' is not a valid modifier for a function}} expected-error {{'volatile' is a reserved keyword in HLSL}} fxc-pass {{}} */ +groupshared volatile float fn_gro_vol() { return 1.0f; } /* expected-error {{'groupshared' is not a valid modifier for a function}} expected-error {{'volatile' is not a valid modifier for a function}} fxc-pass {{}} */ +groupshared volatile const float fn_gro_vol_con() { return 1.0f; } /* expected-error {{'groupshared' is not a valid modifier for a function}} expected-error {{'volatile' is not a valid modifier for a function}} fxc-pass {{}} */ groupshared const float fn_gro_con() { return 1.0f; } /* expected-error {{'groupshared' is not a valid modifier for a function}} fxc-pass {{}} */ extern float fn_ext() { return 1.0f; } /* expected-error {{'extern' is not a valid modifier for a function}} fxc-error {{X3006: 'fn_ext': functions cannot be declared 'extern'}} */ extern precise float fn_ext_pre() { return 1.0f; } /* expected-error {{'extern' is not a valid modifier for a function}} fxc-error {{X3006: 'fn_ext_pre': functions cannot be declared 'extern'}} */ extern precise uniform float fn_ext_pre_uni() { return 1.0f; } /* expected-error {{'uniform' is not a valid modifier for a function}} fxc-error {{X3006: 'fn_ext_pre_uni': functions cannot be declared 'extern'}} fxc-error {{X3047: 'fn_ext_pre_uni': functions cannot be declared 'uniform'}} */ -extern precise uniform volatile float fn_ext_pre_uni_vol() { return 1.0f; } /* expected-error {{'uniform' is not a valid modifier for a function}} expected-error {{'volatile' is a reserved keyword in HLSL}} fxc-error {{X3006: 'fn_ext_pre_uni_vol': functions cannot be declared 'extern'}} fxc-error {{X3047: 'fn_ext_pre_uni_vol': functions cannot be declared 'uniform'}} */ -extern precise uniform volatile const float fn_ext_pre_uni_vol_con() { return 1.0f; } /* expected-error {{'uniform' is not a valid modifier for a function}} expected-error {{'volatile' is a reserved keyword in HLSL}} fxc-error {{X3006: 'fn_ext_pre_uni_vol_con': functions cannot be declared 'extern'}} fxc-error {{X3047: 'fn_ext_pre_uni_vol_con': functions cannot be declared 'uniform'}} */ +extern precise uniform volatile float fn_ext_pre_uni_vol() { return 1.0f; } /* expected-error {{'uniform' is not a valid modifier for a function}} expected-error {{'volatile' is not a valid modifier for a function}} fxc-error {{X3006: 'fn_ext_pre_uni_vol': functions cannot be declared 'extern'}} fxc-error {{X3047: 'fn_ext_pre_uni_vol': functions cannot be declared 'uniform'}} */ +extern precise uniform volatile const float fn_ext_pre_uni_vol_con() { return 1.0f; } /* expected-error {{'uniform' is not a valid modifier for a function}} expected-error {{'volatile' is not a valid modifier for a function}} fxc-error {{X3006: 'fn_ext_pre_uni_vol_con': functions cannot be declared 'extern'}} fxc-error {{X3047: 'fn_ext_pre_uni_vol_con': functions cannot be declared 'uniform'}} */ extern precise uniform const float fn_ext_pre_uni_con() { return 1.0f; } /* expected-error {{'uniform' is not a valid modifier for a function}} fxc-error {{X3006: 'fn_ext_pre_uni_con': functions cannot be declared 'extern'}} fxc-error {{X3047: 'fn_ext_pre_uni_con': functions cannot be declared 'uniform'}} */ -extern precise volatile float fn_ext_pre_vol() { return 1.0f; } /* expected-error {{'volatile' is a reserved keyword in HLSL}} fxc-error {{X3006: 'fn_ext_pre_vol': functions cannot be declared 'extern'}} expected-error {{'extern' is not a valid modifier for a function}} */ -extern precise volatile const float fn_ext_pre_vol_con() { return 1.0f; } /* expected-error {{'volatile' is a reserved keyword in HLSL}} fxc-error {{X3006: 'fn_ext_pre_vol_con': functions cannot be declared 'extern'}} expected-error {{'extern' is not a valid modifier for a function}} */ +extern precise volatile float fn_ext_pre_vol() { return 1.0f; } /* expected-error {{'volatile' is not a valid modifier for a function}} fxc-error {{X3006: 'fn_ext_pre_vol': functions cannot be declared 'extern'}} */ +extern precise volatile const float fn_ext_pre_vol_con() { return 1.0f; } /* expected-error {{'volatile' is not a valid modifier for a function}} fxc-error {{X3006: 'fn_ext_pre_vol_con': functions cannot be declared 'extern'}} */ extern precise const float fn_ext_pre_con() { return 1.0f; } /* expected-error {{'extern' is not a valid modifier for a function}} fxc-error {{X3006: 'fn_ext_pre_con': functions cannot be declared 'extern'}} */ extern uniform float fn_ext_uni() { return 1.0f; } /* expected-error {{'uniform' is not a valid modifier for a function}} fxc-error {{X3006: 'fn_ext_uni': functions cannot be declared 'extern'}} fxc-error {{X3047: 'fn_ext_uni': functions cannot be declared 'uniform'}} */ -extern uniform volatile float fn_ext_uni_vol() { return 1.0f; } /* expected-error {{'uniform' is not a valid modifier for a function}} expected-error {{'volatile' is a reserved keyword in HLSL}} fxc-error {{X3006: 'fn_ext_uni_vol': functions cannot be declared 'extern'}} fxc-error {{X3047: 'fn_ext_uni_vol': functions cannot be declared 'uniform'}} */ -extern uniform volatile const float fn_ext_uni_vol_con() { return 1.0f; } /* expected-error {{'uniform' is not a valid modifier for a function}} expected-error {{'volatile' is a reserved keyword in HLSL}} fxc-error {{X3006: 'fn_ext_uni_vol_con': functions cannot be declared 'extern'}} fxc-error {{X3047: 'fn_ext_uni_vol_con': functions cannot be declared 'uniform'}} */ +extern uniform volatile float fn_ext_uni_vol() { return 1.0f; } /* expected-error {{'uniform' is not a valid modifier for a function}} expected-error {{'volatile' is not a valid modifier for a function}} fxc-error {{X3006: 'fn_ext_uni_vol': functions cannot be declared 'extern'}} fxc-error {{X3047: 'fn_ext_uni_vol': functions cannot be declared 'uniform'}} */ +extern uniform volatile const float fn_ext_uni_vol_con() { return 1.0f; } /* expected-error {{'uniform' is not a valid modifier for a function}} expected-error {{'volatile' is not a valid modifier for a function}} fxc-error {{X3006: 'fn_ext_uni_vol_con': functions cannot be declared 'extern'}} fxc-error {{X3047: 'fn_ext_uni_vol_con': functions cannot be declared 'uniform'}} */ extern uniform const float fn_ext_uni_con() { return 1.0f; } /* expected-error {{'uniform' is not a valid modifier for a function}} fxc-error {{X3006: 'fn_ext_uni_con': functions cannot be declared 'extern'}} fxc-error {{X3047: 'fn_ext_uni_con': functions cannot be declared 'uniform'}} */ -extern volatile float fn_ext_vol() { return 1.0f; } /* expected-error {{'volatile' is a reserved keyword in HLSL}} fxc-error {{X3006: 'fn_ext_vol': functions cannot be declared 'extern'}} expected-error {{'extern' is not a valid modifier for a function}} */ -extern volatile const float fn_ext_vol_con() { return 1.0f; } /* expected-error {{'volatile' is a reserved keyword in HLSL}} fxc-error {{X3006: 'fn_ext_vol_con': functions cannot be declared 'extern'}} expected-error {{'extern' is not a valid modifier for a function}} */ +extern volatile float fn_ext_vol() { return 1.0f; } /* expected-error {{'volatile' is not a valid modifier for a function}} fxc-error {{X3006: 'fn_ext_vol': functions cannot be declared 'extern'}} */ +extern volatile const float fn_ext_vol_con() { return 1.0f; } /* expected-error {{'volatile' is not a valid modifier for a function}} fxc-error {{X3006: 'fn_ext_vol_con': functions cannot be declared 'extern'}} */ extern const float fn_ext_con() { return 1.0f; } /* expected-error {{'extern' is not a valid modifier for a function}} fxc-error {{X3006: 'fn_ext_con': functions cannot be declared 'extern'}} */ precise float fn_pre() { return 1.0f; } precise static float fn_pre_sta() { return 1.0f; } -precise static volatile float fn_pre_sta_vol() { return 1.0f; } /* expected-error {{'volatile' is a reserved keyword in HLSL}} fxc-pass {{}} */ -precise static volatile const float fn_pre_sta_vol_con() { return 1.0f; } /* expected-error {{'volatile' is a reserved keyword in HLSL}} fxc-error {{X3025: l-value specifies const object}} */ +precise static volatile float fn_pre_sta_vol() { return 1.0f; } /* expected-error {{'volatile' is not a valid modifier for a function}} fxc-pass {{}} */ +precise static volatile const float fn_pre_sta_vol_con() { return 1.0f; } /* expected-error {{'volatile' is not a valid modifier for a function}} fxc-error {{X3025: l-value specifies const object}} */ precise static const float fn_pre_sta_con() { return 1.0f; } /* fxc-error {{X3025: l-value specifies const object}} */ precise uniform float fn_pre_uni() { return 1.0f; } /* expected-error {{'uniform' is not a valid modifier for a function}} fxc-error {{X3047: 'fn_pre_uni': functions cannot be declared 'uniform'}} */ -precise uniform volatile float fn_pre_uni_vol() { return 1.0f; } /* expected-error {{'uniform' is not a valid modifier for a function}} expected-error {{'volatile' is a reserved keyword in HLSL}} fxc-error {{X3047: 'fn_pre_uni_vol': functions cannot be declared 'uniform'}} */ -precise uniform volatile const float fn_pre_uni_vol_con() { return 1.0f; } /* expected-error {{'uniform' is not a valid modifier for a function}} expected-error {{'volatile' is a reserved keyword in HLSL}} fxc-error {{X3047: 'fn_pre_uni_vol_con': functions cannot be declared 'uniform'}} */ +precise uniform volatile float fn_pre_uni_vol() { return 1.0f; } /* expected-error {{'uniform' is not a valid modifier for a function}} expected-error {{'volatile' is not a valid modifier for a function}} fxc-error {{X3047: 'fn_pre_uni_vol': functions cannot be declared 'uniform'}} */ +precise uniform volatile const float fn_pre_uni_vol_con() { return 1.0f; } /* expected-error {{'uniform' is not a valid modifier for a function}} expected-error {{'volatile' is not a valid modifier for a function}} fxc-error {{X3047: 'fn_pre_uni_vol_con': functions cannot be declared 'uniform'}} */ precise uniform const float fn_pre_uni_con() { return 1.0f; } /* expected-error {{'uniform' is not a valid modifier for a function}} fxc-error {{X3047: 'fn_pre_uni_con': functions cannot be declared 'uniform'}} */ -precise volatile float fn_pre_vol() { return 1.0f; } /* expected-error {{'volatile' is a reserved keyword in HLSL}} fxc-pass {{}} */ -precise volatile const float fn_pre_vol_con() { return 1.0f; } /* expected-error {{'volatile' is a reserved keyword in HLSL}} fxc-error {{X3025: l-value specifies const object}} */ +precise volatile float fn_pre_vol() { return 1.0f; } /* expected-error {{'volatile' is not a valid modifier for a function}} fxc-pass {{}} */ +precise volatile const float fn_pre_vol_con() { return 1.0f; } /* expected-error {{'volatile' is not a valid modifier for a function}} fxc-error {{X3025: l-value specifies const object}} */ precise const float fn_pre_con() { return 1.0f; } /* fxc-error {{X3025: l-value specifies const object}} */ static float fn_sta() { return 1.0f; } -static volatile float fn_sta_vol() { return 1.0f; } /* expected-error {{'volatile' is a reserved keyword in HLSL}} fxc-pass {{}} */ -static volatile const float fn_sta_vol_con() { return 1.0f; } /* expected-error {{'volatile' is a reserved keyword in HLSL}} fxc-pass {{}} */ +static volatile float fn_sta_vol() { return 1.0f; } /* expected-error {{'volatile' is not a valid modifier for a function}} fxc-pass {{}} */ +static volatile const float fn_sta_vol_con() { return 1.0f; } /* expected-error {{'volatile' is not a valid modifier for a function}} fxc-pass {{}} */ static const float fn_sta_con() { return 1.0f; } uniform float fn_uni() { return 1.0f; } /* expected-error {{'uniform' is not a valid modifier for a function}} fxc-error {{X3047: 'fn_uni': functions cannot be declared 'uniform'}} */ -uniform volatile float fn_uni_vol() { return 1.0f; } /* expected-error {{'uniform' is not a valid modifier for a function}} expected-error {{'volatile' is a reserved keyword in HLSL}} fxc-error {{X3047: 'fn_uni_vol': functions cannot be declared 'uniform'}} */ -uniform volatile const float fn_uni_vol_con() { return 1.0f; } /* expected-error {{'uniform' is not a valid modifier for a function}} expected-error {{'volatile' is a reserved keyword in HLSL}} fxc-error {{X3047: 'fn_uni_vol_con': functions cannot be declared 'uniform'}} */ +uniform volatile float fn_uni_vol() { return 1.0f; } /* expected-error {{'uniform' is not a valid modifier for a function}} expected-error {{'volatile' is not a valid modifier for a function}} fxc-error {{X3047: 'fn_uni_vol': functions cannot be declared 'uniform'}} */ +uniform volatile const float fn_uni_vol_con() { return 1.0f; } /* expected-error {{'uniform' is not a valid modifier for a function}} expected-error {{'volatile' is not a valid modifier for a function}} fxc-error {{X3047: 'fn_uni_vol_con': functions cannot be declared 'uniform'}} */ uniform const float fn_uni_con() { return 1.0f; } /* expected-error {{'uniform' is not a valid modifier for a function}} fxc-error {{X3047: 'fn_uni_con': functions cannot be declared 'uniform'}} */ -volatile float fn_vol() { return 1.0f; } /* expected-error {{'volatile' is a reserved keyword in HLSL}} fxc-pass {{}} */ -volatile const float fn_vol_con() { return 1.0f; } /* expected-error {{'volatile' is a reserved keyword in HLSL}} fxc-pass {{}} */ +volatile float fn_vol() { return 1.0f; } /* expected-error {{'volatile' is not a valid modifier for a function}} fxc-pass {{}} */ +volatile const float fn_vol_con() { return 1.0f; } /* expected-error {{'volatile' is not a valid modifier for a function}} fxc-pass {{}} */ const float fn_con() { return 1.0f; } // GENERATED_CODE:END @@ -1041,65 +1041,65 @@ class C groupshared float fn_gro() { return 1.0f; } /* expected-error {{'groupshared' is not a valid modifier for a method}} fxc-pass {{}} */ groupshared precise float fn_gro_pre() { return 1.0f; } /* expected-error {{'groupshared' is not a valid modifier for a method}} fxc-pass {{}} */ groupshared precise static float fn_gro_pre_sta() { return 1.0f; } /* expected-error {{'groupshared' is not a valid modifier for a method}} fxc-pass {{}} */ - groupshared precise static volatile float fn_gro_pre_sta_vol() { return 1.0f; } /* expected-error {{'groupshared' is not a valid modifier for a method}} expected-error {{'volatile' is a reserved keyword in HLSL}} fxc-pass {{}} */ - groupshared precise static volatile const float fn_gro_pre_sta_vol_con() { return 1.0f; } /* expected-error {{'groupshared' is not a valid modifier for a method}} expected-error {{'volatile' is a reserved keyword in HLSL}} fxc-error {{X3025: l-value specifies const object}} */ + groupshared precise static volatile float fn_gro_pre_sta_vol() { return 1.0f; } /* expected-error {{'groupshared' is not a valid modifier for a method}} expected-error {{'volatile' is not a valid modifier for a method}} fxc-pass {{}} */ + groupshared precise static volatile const float fn_gro_pre_sta_vol_con() { return 1.0f; } /* expected-error {{'groupshared' is not a valid modifier for a method}} expected-error {{'volatile' is not a valid modifier for a method}} fxc-error {{X3025: l-value specifies const object}} */ groupshared precise static const float fn_gro_pre_sta_con() { return 1.0f; } /* expected-error {{'groupshared' is not a valid modifier for a method}} fxc-error {{X3025: l-value specifies const object}} */ groupshared precise uniform float fn_gro_pre_uni() { return 1.0f; } /* expected-error {{'groupshared' is not a valid modifier for a method}} expected-error {{'uniform' is not a valid modifier for a method}} fxc-error {{X3047: 'fn_gro_pre_uni': functions cannot be declared 'uniform'}} */ - groupshared precise uniform volatile float fn_gro_pre_uni_vol() { return 1.0f; } /* expected-error {{'groupshared' is not a valid modifier for a method}} expected-error {{'uniform' is not a valid modifier for a method}} expected-error {{'volatile' is a reserved keyword in HLSL}} fxc-error {{X3047: 'fn_gro_pre_uni_vol': functions cannot be declared 'uniform'}} */ - groupshared precise uniform volatile const float fn_gro_pre_uni_vol_con() { return 1.0f; } /* expected-error {{'groupshared' is not a valid modifier for a method}} expected-error {{'uniform' is not a valid modifier for a method}} expected-error {{'volatile' is a reserved keyword in HLSL}} fxc-error {{X3047: 'fn_gro_pre_uni_vol_con': functions cannot be declared 'uniform'}} */ + groupshared precise uniform volatile float fn_gro_pre_uni_vol() { return 1.0f; } /* expected-error {{'groupshared' is not a valid modifier for a method}} expected-error {{'uniform' is not a valid modifier for a method}} expected-error {{'volatile' is not a valid modifier for a method}} fxc-error {{X3047: 'fn_gro_pre_uni_vol': functions cannot be declared 'uniform'}} */ + groupshared precise uniform volatile const float fn_gro_pre_uni_vol_con() { return 1.0f; } /* expected-error {{'groupshared' is not a valid modifier for a method}} expected-error {{'uniform' is not a valid modifier for a method}} expected-error {{'volatile' is not a valid modifier for a method}} fxc-error {{X3047: 'fn_gro_pre_uni_vol_con': functions cannot be declared 'uniform'}} */ groupshared precise uniform const float fn_gro_pre_uni_con() { return 1.0f; } /* expected-error {{'groupshared' is not a valid modifier for a method}} expected-error {{'uniform' is not a valid modifier for a method}} fxc-error {{X3047: 'fn_gro_pre_uni_con': functions cannot be declared 'uniform'}} */ - groupshared precise volatile float fn_gro_pre_vol() { return 1.0f; } /* expected-error {{'groupshared' is not a valid modifier for a method}} expected-error {{'volatile' is a reserved keyword in HLSL}} fxc-pass {{}} */ - groupshared precise volatile const float fn_gro_pre_vol_con() { return 1.0f; } /* expected-error {{'groupshared' is not a valid modifier for a method}} expected-error {{'volatile' is a reserved keyword in HLSL}} fxc-error {{X3025: l-value specifies const object}} */ + groupshared precise volatile float fn_gro_pre_vol() { return 1.0f; } /* expected-error {{'groupshared' is not a valid modifier for a method}} expected-error {{'volatile' is not a valid modifier for a method}} fxc-pass {{}} */ + groupshared precise volatile const float fn_gro_pre_vol_con() { return 1.0f; } /* expected-error {{'groupshared' is not a valid modifier for a method}} expected-error {{'volatile' is not a valid modifier for a method}} fxc-error {{X3025: l-value specifies const object}} */ groupshared precise const float fn_gro_pre_con() { return 1.0f; } /* expected-error {{'groupshared' is not a valid modifier for a method}} fxc-error {{X3025: l-value specifies const object}} */ groupshared static float fn_gro_sta() { return 1.0f; } /* expected-error {{'groupshared' is not a valid modifier for a method}} fxc-pass {{}} */ - groupshared static volatile float fn_gro_sta_vol() { return 1.0f; } /* expected-error {{'groupshared' is not a valid modifier for a method}} expected-error {{'volatile' is a reserved keyword in HLSL}} fxc-pass {{}} */ - groupshared static volatile const float fn_gro_sta_vol_con() { return 1.0f; } /* expected-error {{'groupshared' is not a valid modifier for a method}} expected-error {{'volatile' is a reserved keyword in HLSL}} fxc-pass {{}} */ + groupshared static volatile float fn_gro_sta_vol() { return 1.0f; } /* expected-error {{'groupshared' is not a valid modifier for a method}} expected-error {{'volatile' is not a valid modifier for a method}} fxc-pass {{}} */ + groupshared static volatile const float fn_gro_sta_vol_con() { return 1.0f; } /* expected-error {{'groupshared' is not a valid modifier for a method}} expected-error {{'volatile' is not a valid modifier for a method}} fxc-pass {{}} */ groupshared static const float fn_gro_sta_con() { return 1.0f; } /* expected-error {{'groupshared' is not a valid modifier for a method}} fxc-pass {{}} */ groupshared uniform float fn_gro_uni() { return 1.0f; } /* expected-error {{'groupshared' is not a valid modifier for a method}} expected-error {{'uniform' is not a valid modifier for a method}} fxc-error {{X3047: 'fn_gro_uni': functions cannot be declared 'uniform'}} */ - groupshared uniform volatile float fn_gro_uni_vol() { return 1.0f; } /* expected-error {{'groupshared' is not a valid modifier for a method}} expected-error {{'uniform' is not a valid modifier for a method}} expected-error {{'volatile' is a reserved keyword in HLSL}} fxc-error {{X3047: 'fn_gro_uni_vol': functions cannot be declared 'uniform'}} */ - groupshared uniform volatile const float fn_gro_uni_vol_con() { return 1.0f; } /* expected-error {{'groupshared' is not a valid modifier for a method}} expected-error {{'uniform' is not a valid modifier for a method}} expected-error {{'volatile' is a reserved keyword in HLSL}} fxc-error {{X3047: 'fn_gro_uni_vol_con': functions cannot be declared 'uniform'}} */ + groupshared uniform volatile float fn_gro_uni_vol() { return 1.0f; } /* expected-error {{'groupshared' is not a valid modifier for a method}} expected-error {{'uniform' is not a valid modifier for a method}} expected-error {{'volatile' is not a valid modifier for a method}} fxc-error {{X3047: 'fn_gro_uni_vol': functions cannot be declared 'uniform'}} */ + groupshared uniform volatile const float fn_gro_uni_vol_con() { return 1.0f; } /* expected-error {{'groupshared' is not a valid modifier for a method}} expected-error {{'uniform' is not a valid modifier for a method}} expected-error {{'volatile' is not a valid modifier for a method}} fxc-error {{X3047: 'fn_gro_uni_vol_con': functions cannot be declared 'uniform'}} */ groupshared uniform const float fn_gro_uni_con() { return 1.0f; } /* expected-error {{'groupshared' is not a valid modifier for a method}} expected-error {{'uniform' is not a valid modifier for a method}} fxc-error {{X3047: 'fn_gro_uni_con': functions cannot be declared 'uniform'}} */ - groupshared volatile float fn_gro_vol() { return 1.0f; } /* expected-error {{'groupshared' is not a valid modifier for a method}} expected-error {{'volatile' is a reserved keyword in HLSL}} fxc-pass {{}} */ - groupshared volatile const float fn_gro_vol_con() { return 1.0f; } /* expected-error {{'groupshared' is not a valid modifier for a method}} expected-error {{'volatile' is a reserved keyword in HLSL}} fxc-pass {{}} */ + groupshared volatile float fn_gro_vol() { return 1.0f; } /* expected-error {{'groupshared' is not a valid modifier for a method}} expected-error {{'volatile' is not a valid modifier for a method}} fxc-pass {{}} */ + groupshared volatile const float fn_gro_vol_con() { return 1.0f; } /* expected-error {{'groupshared' is not a valid modifier for a method}} expected-error {{'volatile' is not a valid modifier for a method}} fxc-pass {{}} */ groupshared const float fn_gro_con() { return 1.0f; } /* expected-error {{'groupshared' is not a valid modifier for a method}} fxc-pass {{}} */ extern float fn_ext() { return 1.0f; } /* expected-error {{storage class specified for a member declaration}} fxc-error {{X3006: 'fn_ext': functions cannot be declared 'extern'}} */ extern precise float fn_ext_pre() { return 1.0f; } /* expected-error {{storage class specified for a member declaration}} fxc-error {{X3006: 'fn_ext_pre': functions cannot be declared 'extern'}} */ extern precise uniform float fn_ext_pre_uni() { return 1.0f; } /* expected-error {{'uniform' is not a valid modifier for a method}} expected-error {{storage class specified for a member declaration}} fxc-error {{X3006: 'fn_ext_pre_uni': functions cannot be declared 'extern'}} fxc-error {{X3047: 'fn_ext_pre_uni': functions cannot be declared 'uniform'}} */ - extern precise uniform volatile float fn_ext_pre_uni_vol() { return 1.0f; } /* expected-error {{'uniform' is not a valid modifier for a method}} expected-error {{'volatile' is a reserved keyword in HLSL}} expected-error {{storage class specified for a member declaration}} fxc-error {{X3006: 'fn_ext_pre_uni_vol': functions cannot be declared 'extern'}} fxc-error {{X3047: 'fn_ext_pre_uni_vol': functions cannot be declared 'uniform'}} */ - extern precise uniform volatile const float fn_ext_pre_uni_vol_con() { return 1.0f; } /* expected-error {{'uniform' is not a valid modifier for a method}} expected-error {{'volatile' is a reserved keyword in HLSL}} expected-error {{storage class specified for a member declaration}} fxc-error {{X3006: 'fn_ext_pre_uni_vol_con': functions cannot be declared 'extern'}} fxc-error {{X3047: 'fn_ext_pre_uni_vol_con': functions cannot be declared 'uniform'}} */ + extern precise uniform volatile float fn_ext_pre_uni_vol() { return 1.0f; } /* expected-error {{'uniform' is not a valid modifier for a method}} expected-error {{'volatile' is not a valid modifier for a method}} expected-error {{storage class specified for a member declaration}} fxc-error {{X3006: 'fn_ext_pre_uni_vol': functions cannot be declared 'extern'}} fxc-error {{X3047: 'fn_ext_pre_uni_vol': functions cannot be declared 'uniform'}} */ + extern precise uniform volatile const float fn_ext_pre_uni_vol_con() { return 1.0f; } /* expected-error {{'uniform' is not a valid modifier for a method}} expected-error {{'volatile' is not a valid modifier for a method}} expected-error {{storage class specified for a member declaration}} fxc-error {{X3006: 'fn_ext_pre_uni_vol_con': functions cannot be declared 'extern'}} fxc-error {{X3047: 'fn_ext_pre_uni_vol_con': functions cannot be declared 'uniform'}} */ extern precise uniform const float fn_ext_pre_uni_con() { return 1.0f; } /* expected-error {{'uniform' is not a valid modifier for a method}} expected-error {{storage class specified for a member declaration}} fxc-error {{X3006: 'fn_ext_pre_uni_con': functions cannot be declared 'extern'}} fxc-error {{X3047: 'fn_ext_pre_uni_con': functions cannot be declared 'uniform'}} */ - extern precise volatile float fn_ext_pre_vol() { return 1.0f; } /* expected-error {{'volatile' is a reserved keyword in HLSL}} expected-error {{storage class specified for a member declaration}} fxc-error {{X3006: 'fn_ext_pre_vol': functions cannot be declared 'extern'}} */ - extern precise volatile const float fn_ext_pre_vol_con() { return 1.0f; } /* expected-error {{'volatile' is a reserved keyword in HLSL}} expected-error {{storage class specified for a member declaration}} fxc-error {{X3006: 'fn_ext_pre_vol_con': functions cannot be declared 'extern'}} */ + extern precise volatile float fn_ext_pre_vol() { return 1.0f; } /* expected-error {{'volatile' is not a valid modifier for a method}} expected-error {{storage class specified for a member declaration}} fxc-error {{X3006: 'fn_ext_pre_vol': functions cannot be declared 'extern'}} */ + extern precise volatile const float fn_ext_pre_vol_con() { return 1.0f; } /* expected-error {{'volatile' is not a valid modifier for a method}} expected-error {{storage class specified for a member declaration}} fxc-error {{X3006: 'fn_ext_pre_vol_con': functions cannot be declared 'extern'}} */ extern precise const float fn_ext_pre_con() { return 1.0f; } /* expected-error {{storage class specified for a member declaration}} fxc-error {{X3006: 'fn_ext_pre_con': functions cannot be declared 'extern'}} */ extern uniform float fn_ext_uni() { return 1.0f; } /* expected-error {{'uniform' is not a valid modifier for a method}} expected-error {{storage class specified for a member declaration}} fxc-error {{X3006: 'fn_ext_uni': functions cannot be declared 'extern'}} fxc-error {{X3047: 'fn_ext_uni': functions cannot be declared 'uniform'}} */ - extern uniform volatile float fn_ext_uni_vol() { return 1.0f; } /* expected-error {{'uniform' is not a valid modifier for a method}} expected-error {{'volatile' is a reserved keyword in HLSL}} expected-error {{storage class specified for a member declaration}} fxc-error {{X3006: 'fn_ext_uni_vol': functions cannot be declared 'extern'}} fxc-error {{X3047: 'fn_ext_uni_vol': functions cannot be declared 'uniform'}} */ - extern uniform volatile const float fn_ext_uni_vol_con() { return 1.0f; } /* expected-error {{'uniform' is not a valid modifier for a method}} expected-error {{'volatile' is a reserved keyword in HLSL}} expected-error {{storage class specified for a member declaration}} fxc-error {{X3006: 'fn_ext_uni_vol_con': functions cannot be declared 'extern'}} fxc-error {{X3047: 'fn_ext_uni_vol_con': functions cannot be declared 'uniform'}} */ + extern uniform volatile float fn_ext_uni_vol() { return 1.0f; } /* expected-error {{'uniform' is not a valid modifier for a method}} expected-error {{'volatile' is not a valid modifier for a method}} expected-error {{storage class specified for a member declaration}} fxc-error {{X3006: 'fn_ext_uni_vol': functions cannot be declared 'extern'}} fxc-error {{X3047: 'fn_ext_uni_vol': functions cannot be declared 'uniform'}} */ + extern uniform volatile const float fn_ext_uni_vol_con() { return 1.0f; } /* expected-error {{'uniform' is not a valid modifier for a method}} expected-error {{'volatile' is not a valid modifier for a method}} expected-error {{storage class specified for a member declaration}} fxc-error {{X3006: 'fn_ext_uni_vol_con': functions cannot be declared 'extern'}} fxc-error {{X3047: 'fn_ext_uni_vol_con': functions cannot be declared 'uniform'}} */ extern uniform const float fn_ext_uni_con() { return 1.0f; } /* expected-error {{'uniform' is not a valid modifier for a method}} expected-error {{storage class specified for a member declaration}} fxc-error {{X3006: 'fn_ext_uni_con': functions cannot be declared 'extern'}} fxc-error {{X3047: 'fn_ext_uni_con': functions cannot be declared 'uniform'}} */ - extern volatile float fn_ext_vol() { return 1.0f; } /* expected-error {{'volatile' is a reserved keyword in HLSL}} expected-error {{storage class specified for a member declaration}} fxc-error {{X3006: 'fn_ext_vol': functions cannot be declared 'extern'}} */ - extern volatile const float fn_ext_vol_con() { return 1.0f; } /* expected-error {{'volatile' is a reserved keyword in HLSL}} expected-error {{storage class specified for a member declaration}} fxc-error {{X3006: 'fn_ext_vol_con': functions cannot be declared 'extern'}} */ + extern volatile float fn_ext_vol() { return 1.0f; } /* expected-error {{'volatile' is not a valid modifier for a method}} expected-error {{storage class specified for a member declaration}} fxc-error {{X3006: 'fn_ext_vol': functions cannot be declared 'extern'}} */ + extern volatile const float fn_ext_vol_con() { return 1.0f; } /* expected-error {{'volatile' is not a valid modifier for a method}} expected-error {{storage class specified for a member declaration}} fxc-error {{X3006: 'fn_ext_vol_con': functions cannot be declared 'extern'}} */ extern const float fn_ext_con() { return 1.0f; } /* expected-error {{storage class specified for a member declaration}} fxc-error {{X3006: 'fn_ext_con': functions cannot be declared 'extern'}} */ precise float fn_pre() { return 1.0f; } precise static float fn_pre_sta() { return 1.0f; } - precise static volatile float fn_pre_sta_vol() { return 1.0f; } /* expected-error {{'volatile' is a reserved keyword in HLSL}} fxc-pass {{}} */ - precise static volatile const float fn_pre_sta_vol_con() { return 1.0f; } /* expected-error {{'volatile' is a reserved keyword in HLSL}} fxc-error {{X3025: l-value specifies const object}} */ + precise static volatile float fn_pre_sta_vol() { return 1.0f; } /* expected-error {{'volatile' is not a valid modifier for a method}} fxc-pass {{}} */ + precise static volatile const float fn_pre_sta_vol_con() { return 1.0f; } /* expected-error {{'volatile' is not a valid modifier for a method}} fxc-error {{X3025: l-value specifies const object}} */ precise static const float fn_pre_sta_con() { return 1.0f; } /* fxc-error {{X3025: l-value specifies const object}} */ precise uniform float fn_pre_uni() { return 1.0f; } /* expected-error {{'uniform' is not a valid modifier for a method}} fxc-error {{X3047: 'fn_pre_uni': functions cannot be declared 'uniform'}} */ - precise uniform volatile float fn_pre_uni_vol() { return 1.0f; } /* expected-error {{'uniform' is not a valid modifier for a method}} expected-error {{'volatile' is a reserved keyword in HLSL}} fxc-error {{X3047: 'fn_pre_uni_vol': functions cannot be declared 'uniform'}} */ - precise uniform volatile const float fn_pre_uni_vol_con() { return 1.0f; } /* expected-error {{'uniform' is not a valid modifier for a method}} expected-error {{'volatile' is a reserved keyword in HLSL}} fxc-error {{X3047: 'fn_pre_uni_vol_con': functions cannot be declared 'uniform'}} */ + precise uniform volatile float fn_pre_uni_vol() { return 1.0f; } /* expected-error {{'uniform' is not a valid modifier for a method}} expected-error {{'volatile' is not a valid modifier for a method}} fxc-error {{X3047: 'fn_pre_uni_vol': functions cannot be declared 'uniform'}} */ + precise uniform volatile const float fn_pre_uni_vol_con() { return 1.0f; } /* expected-error {{'uniform' is not a valid modifier for a method}} expected-error {{'volatile' is not a valid modifier for a method}} fxc-error {{X3047: 'fn_pre_uni_vol_con': functions cannot be declared 'uniform'}} */ precise uniform const float fn_pre_uni_con() { return 1.0f; } /* expected-error {{'uniform' is not a valid modifier for a method}} fxc-error {{X3047: 'fn_pre_uni_con': functions cannot be declared 'uniform'}} */ - precise volatile float fn_pre_vol() { return 1.0f; } /* expected-error {{'volatile' is a reserved keyword in HLSL}} fxc-pass {{}} */ - precise volatile const float fn_pre_vol_con() { return 1.0f; } /* expected-error {{'volatile' is a reserved keyword in HLSL}} fxc-error {{X3025: l-value specifies const object}} */ + precise volatile float fn_pre_vol() { return 1.0f; } /* expected-error {{'volatile' is not a valid modifier for a method}} fxc-pass {{}} */ + precise volatile const float fn_pre_vol_con() { return 1.0f; } /* expected-error {{'volatile' is not a valid modifier for a method}} fxc-error {{X3025: l-value specifies const object}} */ precise const float fn_pre_con() { return 1.0f; } /* fxc-error {{X3025: l-value specifies const object}} */ static float fn_sta() { return 1.0f; } - static volatile float fn_sta_vol() { return 1.0f; } /* expected-error {{'volatile' is a reserved keyword in HLSL}} fxc-pass {{}} */ - static volatile const float fn_sta_vol_con() { return 1.0f; } /* expected-error {{'volatile' is a reserved keyword in HLSL}} fxc-pass {{}} */ + static volatile float fn_sta_vol() { return 1.0f; } /* expected-error {{'volatile' is not a valid modifier for a method}} fxc-pass {{}} */ + static volatile const float fn_sta_vol_con() { return 1.0f; } /* expected-error {{'volatile' is not a valid modifier for a method}} fxc-pass {{}} */ static const float fn_sta_con() { return 1.0f; } uniform float fn_uni() { return 1.0f; } /* expected-error {{'uniform' is not a valid modifier for a method}} fxc-error {{X3047: 'fn_uni': functions cannot be declared 'uniform'}} */ - uniform volatile float fn_uni_vol() { return 1.0f; } /* expected-error {{'uniform' is not a valid modifier for a method}} expected-error {{'volatile' is a reserved keyword in HLSL}} fxc-error {{X3047: 'fn_uni_vol': functions cannot be declared 'uniform'}} */ - uniform volatile const float fn_uni_vol_con() { return 1.0f; } /* expected-error {{'uniform' is not a valid modifier for a method}} expected-error {{'volatile' is a reserved keyword in HLSL}} fxc-error {{X3047: 'fn_uni_vol_con': functions cannot be declared 'uniform'}} */ + uniform volatile float fn_uni_vol() { return 1.0f; } /* expected-error {{'uniform' is not a valid modifier for a method}} expected-error {{'volatile' is not a valid modifier for a method}} fxc-error {{X3047: 'fn_uni_vol': functions cannot be declared 'uniform'}} */ + uniform volatile const float fn_uni_vol_con() { return 1.0f; } /* expected-error {{'uniform' is not a valid modifier for a method}} expected-error {{'volatile' is not a valid modifier for a method}} fxc-error {{X3047: 'fn_uni_vol_con': functions cannot be declared 'uniform'}} */ uniform const float fn_uni_con() { return 1.0f; } /* expected-error {{'uniform' is not a valid modifier for a method}} fxc-error {{X3047: 'fn_uni_con': functions cannot be declared 'uniform'}} */ - volatile float fn_vol() { return 1.0f; } /* expected-error {{'volatile' is a reserved keyword in HLSL}} fxc-pass {{}} */ - volatile const float fn_vol_con() { return 1.0f; } /* expected-error {{'volatile' is a reserved keyword in HLSL}} fxc-pass {{}} */ + volatile float fn_vol() { return 1.0f; } /* expected-error {{'volatile' is not a valid modifier for a method}} fxc-pass {{}} */ + volatile const float fn_vol_con() { return 1.0f; } /* expected-error {{'volatile' is not a valid modifier for a method}} fxc-pass {{}} */ const float fn_con() { return 1.0f; } // GENERATED_CODE:END From ae9b8668619d81e09ee60e6818fe1f1ec6603af6 Mon Sep 17 00:00:00 2001 From: EnterTheArcane <96613937+EnterTheArcane@users.noreply.github.com> Date: Sat, 22 Aug 2026 15:34:26 -0600 Subject: [PATCH 7/8] Add O3DE DXC compatibility regression tests Signed-off-by: EnterTheArcane <96613937+EnterTheArcane@users.noreply.github.com> --- tools/clang/test/CMakeLists.txt | 2 +- .../CodeGenSPIRV/o3de.disable-depth-hint.hlsl | 18 ++++ .../o3de.precise-position-invariant.hlsl | 21 +++++ .../test/DXC/Inputs/verify_dxsc_offsets.py | 93 +++++++++++++++++++ .../DXC/dxsc-specialization-constants.hlsl | 45 +++++++++ tools/clang/test/lit.cfg | 3 + tools/clang/tools/dxsc/dxsc.cpp | 10 +- 7 files changed, 190 insertions(+), 2 deletions(-) create mode 100644 tools/clang/test/CodeGenSPIRV/o3de.disable-depth-hint.hlsl create mode 100644 tools/clang/test/CodeGenSPIRV/o3de.precise-position-invariant.hlsl create mode 100644 tools/clang/test/DXC/Inputs/verify_dxsc_offsets.py create mode 100644 tools/clang/test/DXC/dxsc-specialization-constants.hlsl diff --git a/tools/clang/test/CMakeLists.txt b/tools/clang/test/CMakeLists.txt index 2c8eb6f609..7867d762a4 100644 --- a/tools/clang/test/CMakeLists.txt +++ b/tools/clang/test/CMakeLists.txt @@ -80,7 +80,7 @@ endif() # HLSL Change Begin # Explicitly overriding check-clang dependencies for HLSL -set(CLANG_TEST_DEPS dxc dxa dxopt dxl dxv dxr dxcompiler clang-tblgen llvm-config opt FileCheck count not ClangUnitTests) +set(CLANG_TEST_DEPS dxc dxsc dxa dxopt dxl dxv dxr dxcompiler clang-tblgen llvm-config opt FileCheck count not ClangUnitTests) if (WIN32) list(APPEND CLANG_TEST_DEPS dxc_batch ExecHLSLTests dxildll diff --git a/tools/clang/test/CodeGenSPIRV/o3de.disable-depth-hint.hlsl b/tools/clang/test/CodeGenSPIRV/o3de.disable-depth-hint.hlsl new file mode 100644 index 0000000000..6473e53854 --- /dev/null +++ b/tools/clang/test/CodeGenSPIRV/o3de.disable-depth-hint.hlsl @@ -0,0 +1,18 @@ +// RUN: %dxc -T ps_6_0 -E main -spirv -fcgl %s | FileCheck %s --check-prefix=DEFAULT +// RUN: %dxc -T ps_6_0 -E main -spirv -fcgl -fvk-disable-depth-hint %s | FileCheck %s --check-prefix=DISABLED + +// DEFAULT-DAG: OpTypeImage %float 2D 2 0 0 2 Rgba32f +// DEFAULT-DAG: OpTypeImage %float 2D 2 0 0 1 Unknown + +// DISABLED-DAG: OpTypeImage %float 2D 0 0 0 2 Rgba32f +// DISABLED-DAG: OpTypeImage %float 2D 2 0 0 1 Unknown + +RWTexture2D outputTexture : register(u0); +Texture2D inputTexture : register(t0); + +float4 main(float2 uv : TEXCOORD) : SV_Target { + const uint2 location = uint2(uv); + const float4 value = inputTexture.Load(int3(location, 0)); + outputTexture[location] = value; + return value; +} diff --git a/tools/clang/test/CodeGenSPIRV/o3de.precise-position-invariant.hlsl b/tools/clang/test/CodeGenSPIRV/o3de.precise-position-invariant.hlsl new file mode 100644 index 0000000000..78acf188a7 --- /dev/null +++ b/tools/clang/test/CodeGenSPIRV/o3de.precise-position-invariant.hlsl @@ -0,0 +1,21 @@ +// RUN: %dxc -T vs_6_0 -E main -spirv -fcgl -DPRECISE_POSITION %s | FileCheck %s --check-prefix=PRECISE +// RUN: %dxc -T vs_6_0 -E main -spirv -fcgl %s | FileCheck %s --check-prefix=DEFAULT + +// PRECISE: OpDecorate %gl_Position BuiltIn Position +// PRECISE-NEXT: OpDecorate %gl_Position Invariant + +// DEFAULT: OpDecorate %gl_Position BuiltIn Position +// DEFAULT-NOT: OpDecorate %gl_Position Invariant + +struct VertexOutput { +#ifdef PRECISE_POSITION + precise +#endif + float4 position : SV_Position; +}; + +VertexOutput main(float3 position : POSITION) { + VertexOutput output; + output.position = float4(position, 1.0); + return output; +} diff --git a/tools/clang/test/DXC/Inputs/verify_dxsc_offsets.py b/tools/clang/test/DXC/Inputs/verify_dxsc_offsets.py new file mode 100644 index 0000000000..98cec42711 --- /dev/null +++ b/tools/clang/test/DXC/Inputs/verify_dxsc_offsets.py @@ -0,0 +1,93 @@ +#!/usr/bin/env python3 + +import json +import pathlib +import sys + + +BITS_PER_GROUP = 8 +PAYLOAD_BITS_PER_GROUP = 7 +VBR_GROUP_COUNT = 5 + + +def get_bit(data, bit_offset): + return (data[bit_offset // 8] >> (bit_offset % 8)) & 1 + + +def set_bit(data, bit_offset, value): + mask = 1 << (bit_offset % 8) + byte_offset = bit_offset // 8 + if value: + data[byte_offset] |= mask + else: + data[byte_offset] &= ~mask + + +def read_vbr32(data, bit_offset): + encoded = 0 + encoded_bit = 0 + current = bit_offset + for group in range(VBR_GROUP_COUNT): + for _ in range(PAYLOAD_BITS_PER_GROUP): + encoded |= get_bit(data, current) << encoded_bit + current += 1 + encoded_bit += 1 + continuation = get_bit(data, current) + current += 1 + expected_continuation = group != VBR_GROUP_COUNT - 1 + if continuation != expected_continuation: + raise ValueError( + "unexpected VBR continuation bit at group {}".format(group)) + return encoded >> 1 + + +def write_vbr32(data, bit_offset, value): + encoded = value << 1 + current = bit_offset + for group in range(VBR_GROUP_COUNT): + for _ in range(PAYLOAD_BITS_PER_GROUP): + set_bit(data, current, encoded & 1) + encoded >>= 1 + current += 1 + set_bit(data, current, group != VBR_GROUP_COUNT - 1) + current += 1 + + +def main(): + if len(sys.argv) < 6: + raise ValueError( + "usage: verify_dxsc_offsets.py INPUT OFFSETS OUTPUT SENTINEL " + "ID=VALUE ID=VALUE [ID=VALUE ...]") + + input_path = pathlib.Path(sys.argv[1]) + offsets_path = pathlib.Path(sys.argv[2]) + output_path = pathlib.Path(sys.argv[3]) + sentinel = int(sys.argv[4], 0) + patches = { + int(shader_id): int(value, 0) + for shader_id, value in (item.split("=", 1) for item in sys.argv[5:]) + } + + offsets_json = json.loads(offsets_path.read_text(encoding="utf-8")) + offsets = {int(shader_id): int(offset) for shader_id, offset in offsets_json.items()} + if set(offsets) != set(patches): + raise ValueError( + "expected specialization IDs {}, found {}".format( + sorted(patches), sorted(offsets))) + + bytecode = bytearray(input_path.read_bytes()) + for shader_id, replacement in patches.items(): + bit_offset = offsets[shader_id] + original = read_vbr32(bytecode, bit_offset) + expected = sentinel + shader_id + if original != expected: + raise ValueError( + "specialization ID {} points to {:#x}, expected {:#x}".format( + shader_id, original, expected)) + write_vbr32(bytecode, bit_offset, replacement) + + output_path.write_bytes(bytecode) + + +if __name__ == "__main__": + main() diff --git a/tools/clang/test/DXC/dxsc-specialization-constants.hlsl b/tools/clang/test/DXC/dxsc-specialization-constants.hlsl new file mode 100644 index 0000000000..18bb2e06b8 --- /dev/null +++ b/tools/clang/test/DXC/dxsc-specialization-constants.hlsl @@ -0,0 +1,45 @@ +// RUN: %dxc -T ps_6_0 -E main -Fo %t.dxil -Fc %t.ll %s +// RUN: FileCheck %s --check-prefix=MARKERS < %t.ll +// RUN: %dxsc -sv=1164413184 -o=%t.patched.dxil -f=%t.offsets.json %t.dxil | FileCheck %s --check-prefix=DXSC +// RUN: %dxc -dumpbin %t.patched.dxil | FileCheck %s --check-prefix=SENTINELS +// RUN: python %S/Inputs/verify_dxsc_offsets.py %t.patched.dxil %t.offsets.json %t.tampered.dxil 0x45678900 0=42 255=17 +// RUN: %dxv %t.tampered.dxil -o %t.resigned.dxil | FileCheck %s --check-prefix=VALIDATED +// RUN: %dxc -dumpbin %t.resigned.dxil | FileCheck %s --check-prefix=PATCHED +// RUN: not %dxsc -sv=1164413184 -o=%t.missing-input.dxil -f=%t.missing-input.json 2>&1 | FileCheck %s --check-prefix=MISSING-INPUT +// RUN: not %dxsc -o=%t.missing-sentinel.dxil -f=%t.missing-sentinel.json %t.dxil 2>&1 | FileCheck %s --check-prefix=MISSING-SENTINEL +// RUN: %dxsc --help 2>&1 | FileCheck %s --check-prefix=HELP + +// MARKERS-DAG: store volatile i32 0 +// MARKERS-DAG: store volatile i32 255 +// MARKERS-DAG: load volatile i32 + +// DXSC: Specialized Constants Patching succeeded. + +// SENTINELS-DAG: i32 1164413184 +// SENTINELS-DAG: i32 1164413439 + +// VALIDATED: Validation succeeded. + +// PATCHED-DAG: i32 42 +// PATCHED-DAG: i32 17 + +// MISSING-INPUT: dxsc: error: missing input DXIL file +// MISSING-SENTINEL: dxsc: error: missing -sv sentinel value + +// HELP: OVERVIEW: dxsc patching +// HELP: -sv= + +int GetSpecializationConstant_Zero() { + volatile int sc_Zero = 0; + return sc_Zero; +} + +int GetSpecializationConstant_Max() { + volatile int sc_Max = 255; + return sc_Max; +} + +int2 main() : SV_Target { + return int2(GetSpecializationConstant_Zero(), + GetSpecializationConstant_Max()); +} diff --git a/tools/clang/test/lit.cfg b/tools/clang/test/lit.cfg index 53c51a4720..f7b2851575 100644 --- a/tools/clang/test/lit.cfg +++ b/tools/clang/test/lit.cfg @@ -293,6 +293,9 @@ config.substitutions.append( ('%itanium_abi_triple', makeItaniumABITriple(config config.substitutions.append( ('%ms_abi_triple', makeMSABITriple(config.target_triple)) ) config.substitutions.append( ('%dxc', lit.util.which('dxc', llvm_tools_dir)) ) +config.substitutions.append( ('%dxsc', + lit.util.which('dxsc', llvm_tools_dir)) ) + config.substitutions.append( ('%dxv', lit.util.which('dxv', llvm_tools_dir)) ) diff --git a/tools/clang/tools/dxsc/dxsc.cpp b/tools/clang/tools/dxsc/dxsc.cpp index 19347c5f54..d7c3b5766e 100644 --- a/tools/clang/tools/dxsc/dxsc.cpp +++ b/tools/clang/tools/dxsc/dxsc.cpp @@ -125,8 +125,16 @@ int main(int argc, const char **argv) { cl::ParseCommandLineOptions(argc, argStrings.getArrayRef().data(), "dxsc patching\n"); - if (InputFilename == "" || !SentinelValue || Help) { + if (Help) { cl::PrintHelpMessage(); + return 0; + } + if (InputFilename == "") { + llvm::errs() << "dxsc: error: missing input DXIL file\n"; + return 2; + } + if (SentinelValue.getNumOccurrences() == 0) { + llvm::errs() << "dxsc: error: missing -sv sentinel value\n"; return 2; } From 07c7dda1d7eec09fb3e525c9440da3f6a6334109 Mon Sep 17 00:00:00 2001 From: EnterTheArcane <96613937+EnterTheArcane@users.noreply.github.com> Date: Sat, 22 Aug 2026 15:47:21 -0600 Subject: [PATCH 8/8] Clean up replayed O3DE whitespace Signed-off-by: EnterTheArcane <96613937+EnterTheArcane@users.noreply.github.com> --- include/llvm/Bitcode/BitstreamWriter.h | 2 +- tools/clang/tools/dxsc/CMakeLists.txt | 1 - tools/clang/tools/dxsc/dxsc.cpp | 6 +++--- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/include/llvm/Bitcode/BitstreamWriter.h b/include/llvm/Bitcode/BitstreamWriter.h index de5ce4ecf9..484f391183 100644 --- a/include/llvm/Bitcode/BitstreamWriter.h +++ b/include/llvm/Bitcode/BitstreamWriter.h @@ -380,7 +380,7 @@ class BitstreamWriter { WriteByte(0); } else { // Single scalar field. assert(RecordIdx < Vals.size() && "Invalid abbrev/record"); - + // O3DE Change Start if (WriteConstantCallback && Vals[0] == bitc::CST_CODE_INTEGER && diff --git a/tools/clang/tools/dxsc/CMakeLists.txt b/tools/clang/tools/dxsc/CMakeLists.txt index 11dfd9624e..5abea7b04b 100644 --- a/tools/clang/tools/dxsc/CMakeLists.txt +++ b/tools/clang/tools/dxsc/CMakeLists.txt @@ -36,4 +36,3 @@ endif() install(TARGETS dxsc RUNTIME DESTINATION bin) - diff --git a/tools/clang/tools/dxsc/dxsc.cpp b/tools/clang/tools/dxsc/dxsc.cpp index d7c3b5766e..e41469ff91 100644 --- a/tools/clang/tools/dxsc/dxsc.cpp +++ b/tools/clang/tools/dxsc/dxsc.cpp @@ -140,7 +140,7 @@ int main(int argc, const char **argv) { DXCLibraryDllLoader dxcSupport; dxc::EnsureEnabled(dxcSupport); - + CComPtr pSource; ReadFileIntoBlob(dxcSupport, StringRefWide(InputFilename), &pSource); @@ -255,7 +255,7 @@ int main(int argc, const char **argv) { I->replaceAllUsesWith(scConstant); } - // Step 3: + // Step 3: // Remove any other instructions using the slot the load happened // from, // which includes not only volatile stores but also any other @@ -371,7 +371,7 @@ int main(int argc, const char **argv) { std::string msg(pStart); IFTMSG(status, msg); } - + // Write the blob if (!OutputFilename.empty()) { // Write the signed blob to a file