diff --git a/AIToolPolicy.md b/AIToolPolicy.md new file mode 100644 index 0000000000..bd0d062594 --- /dev/null +++ b/AIToolPolicy.md @@ -0,0 +1,57 @@ +# AI Tool Use Policy + +This policy aims to be compatible with the [LLVM AI Tool Use +Policy](https://llvm.org/docs/AIToolPolicy.html) so that people contributing to +both projects have a similar policy to work with. + +Contributors to DirectXShaderCompiler can use whatever tools they would like to +craft their contributions, but there must be a **human in the loop. Contributors +must read and review all LLM-generated code or text before they ask other +project members to review it.** The contributor is always the author and is +fully accountable for their contributions. Contributors should be sufficiently +confident that the contribution is high enough quality that asking for a review +is a good use of scarce maintainer time, and they should be **able to answer +questions about their work during review.** + +We expect that new contributors will be less confident in their contributions, +and our guidance to them is to **start with small contributions** that they can +fully understand to build confidence. We aspire to be a welcoming community that +helps new contributors grow their expertise, but learning involves taking small +steps, getting feedback, and iterating. Passing maintainer feedback to an LLM +doesn't help anyone grow and does not sustain our community. + +Contributors are expected to **be transparent and label contributions that +contain substantial amounts of tool-generated content.** Our policy on labelling +is intended to facilitate reviews, and not track which parts of the project are +generated. Contributors should note tool usage in their pull request +description, commit message, or wherever authorship is normally indicated for +the work. For instance, use a commit message trailer like Assisted-by: Copilot. +This transparency helps the community develop best practices and understand the +role of these new tools. + +## Copilot Code Reviews + +Copilot code reviews are allowed. It's TBD whether we will enable these by +default for all PRs - but feel free to request a review from Copilot. + +## Cloud Agents + +The cloud-based version of GitHub Copilot is a great way to have multiple agents +work simultaneously and autonomously on issues. However, we require that these +run in a fork of the repo rather than in the main repo itself. Then, once the +change has been crafted such that it is ready for others to review, a PR can be +opened to merge it into upstream. Rationale: + +* Everyone should be working in a fork rather than creating branches in the main + repo, agents are no different. +* We shouldn't be spamming people watching the main repo with the agent's work. +* As you're responsible for the work Copilot is doing, the PR into upstream + should come from you, not from Copilot. + +Note that cloud agents are only able to build and test on Linux, and this +affects the sort of work an agent can do. + +## Local Agents + +CLI, or editor-hosted agents, run on your own machine, so there is less concern +about the activity of these agents impacting others. diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 4eae96bf2a..b0e1cbeaf2 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -27,8 +27,13 @@ stages: matrix: VS2022_Release: configuration: Release + spirvBuildFlag: -spirvtest VS2022_Debug: configuration: Debug + spirvBuildFlag: -spirvtest + VS2022_Release_NoSPIRV: + configuration: Release + spirvBuildFlag: '' steps: - checkout: self @@ -36,7 +41,7 @@ stages: submodules: true - script: | call utils\hct\hctstart.cmd %HLSL_SRC_DIR% %HLSL_BLD_DIR% - call utils\hct\hctbuild.cmd -vs2022 -$(platform) -$(configuration) -show-cmake-log -spirvtest -warp-nuget-version 1.0.16.1 + call utils\hct\hctbuild.cmd -vs2022 -$(platform) -$(configuration) -show-cmake-log $(spirvBuildFlag) -warp-nuget-version 1.0.16.1 displayName: 'Building' - script: | call utils\hct\hctstart.cmd %HLSL_SRC_DIR% %HLSL_BLD_DIR% diff --git a/docs/DXIL.rst b/docs/DXIL.rst index 8891e7e056..89ad4c5661 100644 --- a/docs/DXIL.rst +++ b/docs/DXIL.rst @@ -3096,8 +3096,8 @@ ID Name Description 2147483676 LinAlgMatrixAccumulateToMemory accumulates a matrix to groupshared memory 2147483677 LinAlgMatrixOuterProduct Outer products an M sized vector and a N sized vector producing an MxN matrix 2147483678 LinAlgConvert Convert vector components from one interpretation to another -2147483679 ReservedE0 reserved -2147483680 ReservedE1 reserved +2147483679 LinAlgVectorAccumulateToDescriptor Accumulates given vector to the buffer at the given offset +2147483680 ReservedE0 reserved 2147483681 DebugBreak triggers a breakpoint if a debugger is attached 2147483682 IsDebuggerPresent returns true if a debugger is attached ========== ======================================== =================================================================================================================== diff --git a/docs/ReleaseNotes.md b/docs/ReleaseNotes.md index d5789a630e..23b0cb51ba 100644 --- a/docs/ReleaseNotes.md +++ b/docs/ReleaseNotes.md @@ -17,6 +17,23 @@ The included licenses apply to the following files: ## Changelog +### Version 1.10.2605.1 (preview) + +#### Experimental Shader Model 6.10 +- Added VectorAccumlate operaton to LinAlg Matrix API [#8448](https://github.com/microsoft/DirectXShaderCompiler/pull/8448) + +#### Experimental Shader Model 6.10 Bug Fixes +- Fixed validator rejecting LinAlgMatrix type in DXIL [#8441](https://github.com/microsoft/DirectXShaderCompiler/pull/8441) +- Fixed float trunc and coord calc errors in ExecTests [#8420](https://github.com/microsoft/DirectXShaderCompiler/pull/8420) +- Convert Bias Vector to match the output type [#8394](https://github.com/microsoft/DirectXShaderCompiler/pull/8394) + +#### Bug Fixes +- Fixed build break on certain platforms [#8307](https://github.com/microsoft/DirectXShaderCompiler/pull/8307) +- SPIR-V: Fix compiler error for certain pointer casts [#7891](https://github.com/microsoft/DirectXShaderCompiler/issues/7891) +- Raise a compliation error when invalid `volatile` keyword is used [8397](https://github.com/microsoft/DirectXShaderCompiler/pull/8397) +- Fixed codegen that emitted illigal-width integerse [#8444](https://github.com/microsoft/DirectXShaderCompiler/pull/8444) +- Fixed crash when using `-fcgl` when container has a resource arg function [#8442](https://github.com/microsoft/DirectXShaderCompiler/pull/8442) + ### Version 1.10.2605 (preview) #### Experimental Shader Model 6.10 @@ -75,10 +92,13 @@ The included licenses apply to the following files: default, with `/Fi` to override the output filename. The old FXC-style `/P ` positional syntax has been renamed to `/Po`. [#4611](https://github.com/microsoft/DirectXShaderCompiler/issues/4611). +- SPIR-V: Support `vk::SampledTexture` types (GLSL's `samplerND` equivalent) + [#7979](https://github.com/microsoft/DirectXShaderCompiler/issues/7979). With + this type, users no longer need to define both Sampler and Texture resources + with the same binding number. - Added support for -Fre for Metal [#8159](https://github.com/microsoft/DirectXShaderCompiler/pull/8159) - ### Version 1.9.2602 #### Shader Model 6.9 Release diff --git a/external/SPIRV-Headers b/external/SPIRV-Headers index ce9dfb0149..ad9184e76a 160000 --- a/external/SPIRV-Headers +++ b/external/SPIRV-Headers @@ -1 +1 @@ -Subproject commit ce9dfb01496073a02d74581ae909384763b41ff8 +Subproject commit ad9184e76a66b1001c29db9b0a3e87f646c64de0 diff --git a/external/SPIRV-Tools b/external/SPIRV-Tools index a52828d672..0539c81f69 160000 --- a/external/SPIRV-Tools +++ b/external/SPIRV-Tools @@ -1 +1 @@ -Subproject commit a52828d672ab1622c308d0a6fc99630b79561609 +Subproject commit 0539c81f69a3daeb706fd3477dca61435b475156 diff --git a/include/dxc/DXIL/DxilConstants.h b/include/dxc/DXIL/DxilConstants.h index a535b8d768..4705b90c55 100644 --- a/include/dxc/DXIL/DxilConstants.h +++ b/include/dxc/DXIL/DxilConstants.h @@ -533,8 +533,7 @@ static const OpCodeTableID TableID = OpCodeTableID::ExperimentalOps; // Enumeration for ExperimentalOps DXIL operations enum class OpCode : unsigned { // - ReservedE0 = 31, // reserved - ReservedE1 = 32, // reserved + ReservedE0 = 32, // reserved // Debugging DebugBreak = 33, // triggers a breakpoint if a debugger is attached @@ -597,6 +596,8 @@ enum class OpCode : unsigned { LinAlgMatrixStoreToDescriptor = 20, // stores a matrix to a RWByteAddressBuffer LinAlgMatrixStoreToMemory = 21, // stores a matrix to groupshared memory + LinAlgVectorAccumulateToDescriptor = + 31, // Accumulates given vector to the buffer at the given offset // No-op ExperimentalNop = 0, // nop does nothing @@ -1355,10 +1356,13 @@ enum class OpCode : unsigned { // LinAlgConvert = 0x8000001E, 2147483678U, -2147483618 EXP_OPCODE(ExperimentalOps, LinAlgConvert), // Convert vector components from // one interpretation to another - // ReservedE0 = 0x8000001F, 2147483679U, -2147483617 + // LinAlgVectorAccumulateToDescriptor = 0x8000001F, 2147483679U, -2147483617 + EXP_OPCODE( + ExperimentalOps, + LinAlgVectorAccumulateToDescriptor), // Accumulates given vector to the + // buffer at the given offset + // ReservedE0 = 0x80000020, 2147483680U, -2147483616 EXP_OPCODE(ExperimentalOps, ReservedE0), // reserved - // ReservedE1 = 0x80000020, 2147483680U, -2147483616 - EXP_OPCODE(ExperimentalOps, ReservedE1), // reserved // DebugBreak = 0x80000021, 2147483681U, -2147483615 EXP_OPCODE(ExperimentalOps, DebugBreak), // triggers a breakpoint if a debugger is attached @@ -1544,6 +1548,7 @@ enum class OpCodeClass : unsigned { LinAlgMatrixSetElement, LinAlgMatrixStoreToDescriptor, LinAlgMatrixStoreToMemory, + LinAlgVectorAccumulateToDescriptor, // Mesh shader instructions EmitIndices, @@ -1730,7 +1735,7 @@ enum class OpCodeClass : unsigned { NodeOutputIsValid, OutputComplete, - NumOpClasses = 222, // exclusive last value of enumeration + NumOpClasses = 223, // exclusive last value of enumeration }; // OPCODECLASS-ENUM:END diff --git a/include/dxc/DXIL/DxilInstructions.h b/include/dxc/DXIL/DxilInstructions.h index 511f5b476f..b1c1bbaf73 100644 --- a/include/dxc/DXIL/DxilInstructions.h +++ b/include/dxc/DXIL/DxilInstructions.h @@ -10960,6 +10960,43 @@ struct DxilInst_LinAlgConvert { void set_outputInterpretation(llvm::Value *val) { Instr->setOperand(3, val); } }; +/// This instruction Accumulates given vector to the buffer at the given offset +struct DxilInst_LinAlgVectorAccumulateToDescriptor { + llvm::Instruction *Instr; + // Construction and identification + DxilInst_LinAlgVectorAccumulateToDescriptor(llvm::Instruction *pInstr) + : Instr(pInstr) {} + operator bool() const { + return hlsl::OP::IsDxilOpFuncCallInst( + Instr, hlsl::OP::OpCode::LinAlgVectorAccumulateToDescriptor); + } + // Validation support + bool isAllowed() const { return true; } + bool isArgumentListValid() const { + if (5 != llvm::dyn_cast(Instr)->getNumArgOperands()) + return false; + return true; + } + // Metadata + bool requiresUniformInputs() const { return false; } + // Operand indexes + enum OperandIdx { + arg_vector = 1, + arg_handle = 2, + arg_offset = 3, + arg_align = 4, + }; + // Accessors + llvm::Value *get_vector() const { return Instr->getOperand(1); } + void set_vector(llvm::Value *val) { Instr->setOperand(1, val); } + llvm::Value *get_handle() const { return Instr->getOperand(2); } + void set_handle(llvm::Value *val) { Instr->setOperand(2, val); } + llvm::Value *get_offset() const { return Instr->getOperand(3); } + void set_offset(llvm::Value *val) { Instr->setOperand(3, val); } + llvm::Value *get_align() const { return Instr->getOperand(4); } + void set_align(llvm::Value *val) { Instr->setOperand(4, val); } +}; + /// This instruction triggers a breakpoint if a debugger is attached struct DxilInst_DebugBreak { llvm::Instruction *Instr; diff --git a/include/dxc/DXIL/DxilResourceProperties.h b/include/dxc/DXIL/DxilResourceProperties.h index 2f4ff58969..7136f90d7e 100644 --- a/include/dxc/DXIL/DxilResourceProperties.h +++ b/include/dxc/DXIL/DxilResourceProperties.h @@ -16,6 +16,7 @@ namespace llvm { class Constant; class Type; +class Module; } // namespace llvm namespace hlsl { @@ -89,6 +90,7 @@ struct DxilInst_AnnotateHandle; namespace resource_helper { llvm::Constant *getAsConstant(const DxilResourceProperties &, llvm::Type *Ty, const ShaderModel &); +llvm::Type *GetResourcePropertiesType(llvm::Module &M); DxilResourceProperties loadPropsFromConstant(const llvm::Constant &C); DxilResourceProperties loadPropsFromAnnotateHandle(DxilInst_AnnotateHandle &annotateHandle, diff --git a/include/dxc/HlslIntrinsicOp.h b/include/dxc/HlslIntrinsicOp.h index 03e439b6b0..f70013a006 100644 --- a/include/dxc/HlslIntrinsicOp.h +++ b/include/dxc/HlslIntrinsicOp.h @@ -132,6 +132,7 @@ enum class IntrinsicOp { IOP___builtin_LinAlg_MatrixStoreToMemory = 410, IOP___builtin_LinAlg_MatrixVectorMultiply = 418, IOP___builtin_LinAlg_MatrixVectorMultiplyAdd = 419, + IOP___builtin_LinAlg_VectorAccumulateToDescriptor = 423, IOP_abort = 102, IOP_abs = 103, IOP_acos = 104, @@ -429,7 +430,7 @@ enum class IntrinsicOp { IOP_usign = 355, MOP_InterlockedUMax = 356, MOP_InterlockedUMin = 357, - Num_Intrinsics = 423, + Num_Intrinsics = 424, }; inline bool HasUnsignedIntrinsicOpcode(IntrinsicOp opcode) { switch (opcode) { diff --git a/include/llvm/ADT/StringRef.h b/include/llvm/ADT/StringRef.h index c103fdbf3b..df58c78b53 100644 --- a/include/llvm/ADT/StringRef.h +++ b/include/llvm/ADT/StringRef.h @@ -571,9 +571,12 @@ namespace llvm { } // HLSL Change Starts -// StringRef provides an operator string; that trips up the std::pair noexcept specification, -// which (a) enables the moves constructor (because conversion is allowed), but (b) -// misclassifies the the construction as nothrow. +// StringRef provides an operator string; that trips up the std::pair noexcept +// specification, which (a) enables the moves constructor (because conversion is +// allowed), but (b) misclassifies the the construction as nothrow. Newer libc++ +// releases reject user specializations of this trait outright, and also compute +// the trait correctly without help. +#if !defined(_LIBCPP_VERSION) namespace std { template<> struct is_nothrow_constructible @@ -588,6 +591,7 @@ namespace std { : std::false_type { }; } +#endif // HLSL Change Ends #endif diff --git a/lib/DXIL/DxilMetadataHelper.cpp b/lib/DXIL/DxilMetadataHelper.cpp index 9598fa3da4..60e7a04183 100644 --- a/lib/DXIL/DxilMetadataHelper.cpp +++ b/lib/DXIL/DxilMetadataHelper.cpp @@ -1345,8 +1345,7 @@ Metadata *DxilMDHelper::EmitDxilFieldAnnotation(const DxilFieldAnnotation &FA) { MDVals.emplace_back(Uint32ToConstMD(kDxilFieldAnnotationResPropTag)); MDVals.emplace_back(ValueAsMetadata::get(resource_helper::getAsConstant( FA.GetResourceProperties(), - m_pModule->GetDxilModule().GetOP()->GetResourcePropertiesType(), - *m_pSM))); + resource_helper::GetResourcePropertiesType(*m_pModule), *m_pSM))); } if (DXIL::CompareVersions(m_MinValMajor, m_MinValMinor, 1, 7) >= 0) { if (FA.HasBitFields()) { diff --git a/lib/DXIL/DxilOperations.cpp b/lib/DXIL/DxilOperations.cpp index b786fee9fc..7ca45b544d 100644 --- a/lib/DXIL/DxilOperations.cpp +++ b/lib/DXIL/DxilOperations.cpp @@ -2984,6 +2984,14 @@ static const OP::OpCodeProperty ExperimentalOps_OpCodeProps[] = { 2, {{0x400}, {0x400}}, {{0xe7}, {0xe7}}}, // Overloads: getNumParams() <= 1) return nullptr; return FT->getParamType(1); @@ -7009,7 +7014,6 @@ llvm::Type *OP::GetOverloadType(OpCode opCode, llvm::Function *F) { case OpCode::ClusterID: case OpCode::LinAlgMatrixQueryAccumulatorLayout: case OpCode::ReservedE0: - case OpCode::ReservedE1: case OpCode::DebugBreak: case OpCode::IsDebuggerPresent: return Type::getVoidTy(Ctx); diff --git a/lib/DXIL/DxilResourceProperties.cpp b/lib/DXIL/DxilResourceProperties.cpp index 54ab24f36e..8ad6db4b72 100644 --- a/lib/DXIL/DxilResourceProperties.cpp +++ b/lib/DXIL/DxilResourceProperties.cpp @@ -19,6 +19,7 @@ #include "llvm/IR/Constant.h" #include "llvm/IR/Constants.h" #include "llvm/IR/DerivedTypes.h" +#include "llvm/IR/Module.h" using namespace llvm; @@ -104,6 +105,17 @@ Constant *getAsConstant(const DxilResourceProperties &RP, Type *Ty, return nullptr; } +llvm::Type *GetResourcePropertiesType(Module &M) { + LLVMContext &Ctx = M.getContext(); + StringRef Name = "dx.types.ResourceProperties"; + if (StructType *ST = M.getTypeByName(Name)) + return ST; + + Type *Int32Ty = Type::getInt32Ty(Ctx); + Type *Elements[] = {Int32Ty, Int32Ty}; + return StructType::create(Ctx, Elements, Name); +} + DxilResourceProperties loadPropsFromConstant(const Constant &C) { DxilResourceProperties RP; diff --git a/lib/DxcSupport/FileIOHelper.cpp b/lib/DxcSupport/FileIOHelper.cpp index ed2593dfc3..b2f3dfb67d 100644 --- a/lib/DxcSupport/FileIOHelper.cpp +++ b/lib/DxcSupport/FileIOHelper.cpp @@ -527,14 +527,16 @@ static bool TryCreateEmptyBlobUtf(UINT32 codePage, IMalloc *pMalloc, IDxcBlobEncoding **ppBlobEncoding) { if (codePage == CP_UTF8) { InternalDxcBlobUtf8 *internalUtf8; - IFR(InternalDxcBlobUtf8::CreateFromMalloc(nullptr, pMalloc, 0, true, - codePage, &internalUtf8)); + if (DXC_FAILED(InternalDxcBlobUtf8::CreateFromMalloc( + nullptr, pMalloc, 0, true, codePage, &internalUtf8))) + return false; *ppBlobEncoding = internalUtf8; return true; } else if (codePage == DXC_CP_WIDE) { InternalDxcBlobWide *internalWide; - IFR(InternalDxcBlobWide::CreateFromMalloc(nullptr, pMalloc, 0, true, - codePage, &internalWide)); + if (DXC_FAILED(InternalDxcBlobWide::CreateFromMalloc( + nullptr, pMalloc, 0, true, codePage, &internalWide))) + return false; *ppBlobEncoding = internalWide; return true; } @@ -551,14 +553,16 @@ static bool TryCreateBlobUtfFromBlob(IDxcBlob *pFromBlob, UINT32 codePage, pFromBlob->GetBufferSize(), codePage)) { if (codePage == CP_UTF8) { InternalDxcBlobUtf8 *internalUtf8; - IFR(InternalDxcBlobUtf8::CreateFromBlob(pFromBlob, pMalloc, true, - codePage, &internalUtf8)); + if (DXC_FAILED(InternalDxcBlobUtf8::CreateFromBlob( + pFromBlob, pMalloc, true, codePage, &internalUtf8))) + return false; *ppBlobEncoding = internalUtf8; return true; } else if (codePage == DXC_CP_WIDE) { InternalDxcBlobWide *internalWide; - IFR(InternalDxcBlobWide::CreateFromBlob(pFromBlob, pMalloc, true, - codePage, &internalWide)); + if (DXC_FAILED(InternalDxcBlobWide::CreateFromBlob( + pFromBlob, pMalloc, true, codePage, &internalWide))) + return false; *ppBlobEncoding = internalWide; return true; } diff --git a/lib/DxilValidation/DxilValidation.cpp b/lib/DxilValidation/DxilValidation.cpp index ab9dd697d9..9625359c2e 100644 --- a/lib/DxilValidation/DxilValidation.cpp +++ b/lib/DxilValidation/DxilValidation.cpp @@ -2414,6 +2414,9 @@ static bool ValidateType(Type *Ty, ValidationContext &ValCtx, // Allow HitObject type. if (ST == HlslOP->GetHitObjectType()) return true; + // Allow LinAlgMatrix type. + if (dxilutil::IsHLSLLinAlgMatrixType(ST)) + return true; if (IsDxilBuiltinStructType(ST, HlslOP)) { ValCtx.EmitTypeError(Ty, ValidationRule::InstrDxilStructUser); Result = false; diff --git a/lib/HLSL/HLOperationLower.cpp b/lib/HLSL/HLOperationLower.cpp index abf0ad86be..ff30dcbf20 100644 --- a/lib/HLSL/HLOperationLower.cpp +++ b/lib/HLSL/HLOperationLower.cpp @@ -7163,6 +7163,28 @@ Value *TranslateLinAlgConvert(CallInst *CI, IntrinsicOp IOP, OP::OpCode OpCode, return nullptr; } +Value *TranslateLinAlgVectorAccumulateToDescriptor( + CallInst *CI, IntrinsicOp IOP, OP::OpCode OpCode, + HLOperationLowerHelper &Helper, HLObjectOperationLowerHelper *ObjHelper, + bool &Translated) { + + hlsl::OP *HlslOp = &Helper.hlslOP; + IRBuilder<> Builder(CI); + + Constant *OpArg = HlslOp->GetU32Const(static_cast(OpCode)); + + Value *Vector = CI->getArgOperand(1); + Value *ResHandle = CI->getArgOperand(2); + Value *Offset = CI->getArgOperand(3); + Value *Align = CI->getArgOperand(4); + + // Get the DXIL function for the operation + Function *DxilFunc = HlslOp->GetOpFunc(OpCode, Vector->getType()); + + return Builder.CreateCall(DxilFunc, + {OpArg, Vector, ResHandle, Offset, Align}); +} + } // namespace // Lower table. @@ -7957,6 +7979,9 @@ constexpr IntrinsicLower gLowerTable[] = { {IntrinsicOp::IOP___builtin_LinAlg_Convert, TranslateLinAlgConvert, DXIL::OpCode::LinAlgConvert}, + {IntrinsicOp::IOP___builtin_LinAlg_VectorAccumulateToDescriptor, + TranslateLinAlgVectorAccumulateToDescriptor, + DXIL::OpCode::LinAlgVectorAccumulateToDescriptor}, }; constexpr size_t NumLowerTableEntries = sizeof(gLowerTable) / sizeof(gLowerTable[0]); diff --git a/lib/Transforms/Utils/SimplifyCFG.cpp b/lib/Transforms/Utils/SimplifyCFG.cpp index 5b36485692..aa9596f38a 100644 --- a/lib/Transforms/Utils/SimplifyCFG.cpp +++ b/lib/Transforms/Utils/SimplifyCFG.cpp @@ -3855,7 +3855,13 @@ SwitchLookupTable::SwitchLookupTable( // If the type is integer and the table fits in a register, build a bitmap. if (WouldFitInRegister(DL, TableSize, ValueType)) { IntegerType *IT = cast(ValueType); - APInt TableInt(TableSize * IT->getBitWidth(), 0); + // HLSL Change Begin: Round bitmap width up to size supported by DXIL (i16 + // or i32) + uint64_t RawBitMapWidth = TableSize * IT->getBitWidth(); + uint64_t BitMapWidth = + NextPowerOf2(std::max(UINT64_C(15), RawBitMapWidth - 1)); + APInt TableInt(BitMapWidth, 0); + // HLSL Change End for (uint64_t I = TableSize; I > 0; --I) { TableInt <<= IT->getBitWidth(); // Insert values into the bitmap. Undef values are set to zero. @@ -3950,6 +3956,11 @@ bool SwitchLookupTable::WouldFitInRegister(const DataLayout &DL, // Avoid overflow, fitsInLegalInteger uses unsigned int for the width. if (TableSize >= UINT_MAX/IT->getBitWidth()) return false; + // HLSL Change Begin: Cap at 32 bits so the bitmap stays in a DXIL-supported + // integer width and never promotes to i64 (which would set Int64Ops). + if (TableSize * IT->getBitWidth() > 32) + return false; + // HLSL Change End return DL.fitsInLegalInteger(TableSize * IT->getBitWidth()); } diff --git a/tools/clang/include/clang/Basic/DiagnosticParseKinds.td b/tools/clang/include/clang/Basic/DiagnosticParseKinds.td index 0fe0d22bbf..e328393726 100644 --- a/tools/clang/include/clang/Basic/DiagnosticParseKinds.td +++ b/tools/clang/include/clang/Basic/DiagnosticParseKinds.td @@ -994,8 +994,6 @@ def err_hlsl_unsupported_member_default : Error< "struct/class members cannot have default values">; def err_hlsl_unsupported_packoffset_component : Error< "packoffset component should indicate offset with one of x, y, z, w, r, g, b, or a">; -def err_hlsl_unsupported_pointer : Error< - "pointers are unsupported in HLSL">; def err_hlsl_unsupported_register_number : Error< "register number should be an integral numeric string">; def err_hlsl_unsupported_register_noninteger : Error< diff --git a/tools/clang/include/clang/Basic/DiagnosticSemaKinds.td b/tools/clang/include/clang/Basic/DiagnosticSemaKinds.td index eaffd4ee79..c35d14f7b2 100644 --- a/tools/clang/include/clang/Basic/DiagnosticSemaKinds.td +++ b/tools/clang/include/clang/Basic/DiagnosticSemaKinds.td @@ -8061,6 +8061,9 @@ def err_hlsl_linalg_attributed_matrix_required def err_hlsl_linalg_unsupported_stage : Error< "builtin unavailable in shader stage '%0' (requires 'compute', 'mesh' or 'amplification')">; +def err_hlsl_pointers_unsupported : Error< + "%select{pointers|references}0 are unsupported in HLSL">; + // HLSL Change Ends // SPIRV Change Starts diff --git a/tools/clang/include/clang/Lex/Token.h b/tools/clang/include/clang/Lex/Token.h index 6d8d94457c..7cb0118596 100644 --- a/tools/clang/include/clang/Lex/Token.h +++ b/tools/clang/include/clang/Lex/Token.h @@ -294,25 +294,18 @@ class Token { // HLSL Change Starts bool isHLSLReserved() const { - return - is(tok::kw___is_signed) || - is(tok::kw___declspec) || - is(tok::kw___forceinline) || - is(tok::kw_auto) || - is(tok::kw_catch) || is(tok::kw_const_cast) || - is(tok::kw_delete) || is(tok::kw_dynamic_cast) || - is(tok::kw_enum) || is(tok::kw_explicit) || - is(tok::kw_friend) || - is(tok::kw_goto) || - is(tok::kw_mutable) || - is(tok::kw_new) || - is(tok::kw_operator) || - is(tok::kw_protected) || is(tok::kw_private) || is(tok::kw_public) || - is(tok::kw_reinterpret_cast) || - is(tok::kw_signed) || 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); + return is(tok::kw___is_signed) || is(tok::kw___declspec) || + is(tok::kw___forceinline) || is(tok::kw_auto) || is(tok::kw_catch) || + is(tok::kw_const_cast) || is(tok::kw_delete) || + is(tok::kw_dynamic_cast) || is(tok::kw_enum) || + is(tok::kw_explicit) || is(tok::kw_friend) || is(tok::kw_goto) || + is(tok::kw_mutable) || is(tok::kw_new) || is(tok::kw_operator) || + is(tok::kw_protected) || is(tok::kw_private) || is(tok::kw_public) || + is(tok::kw_reinterpret_cast) || is(tok::kw_signed) || + 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); } // HLSL Change Starts diff --git a/tools/clang/lib/Headers/hlsl/dx/.clang-format b/tools/clang/lib/Headers/hlsl/dx/.clang-format new file mode 100644 index 0000000000..0dbd4febf7 --- /dev/null +++ b/tools/clang/lib/Headers/hlsl/dx/.clang-format @@ -0,0 +1,2 @@ +BasedOnStyle: LLVM +SpacesInAngles: Leave diff --git a/tools/clang/lib/Headers/hlsl/dx/linalg.h b/tools/clang/lib/Headers/hlsl/dx/linalg.h index 9b43dcc6cb..e223f2286e 100644 --- a/tools/clang/lib/Headers/hlsl/dx/linalg.h +++ b/tools/clang/lib/Headers/hlsl/dx/linalg.h @@ -165,11 +165,19 @@ template struct ComponentTypeTraits { static const uint ElementsPerScalar = 4; }; +template struct TypeTraits { + static const ComponentEnum CompType = + (ComponentEnum)dxil::ComponentType::Invalid; +}; + #define __MATRIX_SCALAR_COMPONENT_MAPPING(enum_val, type) \ template <> struct ComponentTypeTraits { \ using Type = type; \ static const bool IsNativeScalar = true; \ static const uint ElementsPerScalar = 1; \ + }; \ + template <> struct TypeTraits { \ + static const ComponentEnum CompType = enum_val; \ }; #if __HLSL_ENABLE_16_BIT @@ -233,8 +241,11 @@ InterpretedVector MakeInterpretedVector(vector Vec) { } template -InterpretedVector::Type, - __detail::DstN::Value, DestTy> +typename hlsl::enable_if< + DestTy != OriginTy, + InterpretedVector::Type, + __detail::DstN::Value, + DestTy> >::type Convert(vector Vec) { vector::Type, __detail::DstN::Value> @@ -243,6 +254,13 @@ Convert(vector Vec) { return MakeInterpretedVector(Result); } +template +typename hlsl::enable_if >::type +Convert(vector Vec) { + return MakeInterpretedVector(Vec); +} + template class Matrix { @@ -483,9 +501,8 @@ Matrix Multiply( template -// clang-format off -typename hlsl::enable_if::value, vector >::type -// clang-format on +typename hlsl::enable_if::value, + vector >::type Multiply(Matrix MatrixA, vector Vec) { vector Result; @@ -497,72 +514,130 @@ Multiply(Matrix MatrixA, template -// clang-format off -typename hlsl::enable_if::value, vector >::type -// clang-format on +typename hlsl::enable_if::value, + vector >::type MultiplyAdd(Matrix MatrixA, vector Vec, vector Bias) { + + InterpretedVector::CompType> + BiasConvInterp = Convert<__detail::TypeTraits::CompType, + __detail::TypeTraits::CompType>(Bias); + vector Result; - __builtin_LinAlg_MatrixVectorMultiplyAdd(Result, MatrixA.__handle, - hlsl::is_signed::value, - Vec, MatrixDT, Bias, MatrixDT); + __builtin_LinAlg_MatrixVectorMultiplyAdd( + Result, MatrixA.__handle, hlsl::is_signed::value, Vec, + __detail::TypeTraits::CompType, BiasConvInterp.Data, + BiasConvInterp.Interpretation); return Result; } template -// clang-format off typename hlsl::enable_if< VecK == __detail::ScalarCountFromPackedComponents::Value, vector >::type -// clang-format on MultiplyAdd(Matrix MatrixA, InterpretedVector InterpVec, vector Bias) { + + InterpretedVector::CompType> + BiasConvInterp = Convert<__detail::TypeTraits::CompType, + __detail::TypeTraits::CompType>(Bias); + vector Result; __builtin_LinAlg_MatrixVectorMultiplyAdd( Result, MatrixA.__handle, hlsl::is_signed::value, - InterpVec.Data, InterpVec.Interpretation, Bias, MatrixDT); + InterpVec.Data, InterpVec.Interpretation, BiasConvInterp.Data, + BiasConvInterp.Interpretation); return Result; } -template -// clang-format off typename hlsl::enable_if::value, vector >::type -// clang-format on MultiplyAdd(Matrix MatrixA, - vector Vec, VectorRef BiasRef) { + vector Vec, VectorRef BiasRef) { + using BiasVecTy = - vector::Type, M>; - BiasVecTy BiasVec = BiasRef.Buf.template Load(BiasRef.Offset); + vector::Type, + __detail::ScalarCountFromPackedComponents::Value>; + BiasVecTy Bias = BiasRef.Buf.template Load(BiasRef.Offset); + + // FIXME: Convert currently does not support packed type vector sizes that + // are not a multiple of the number of elements per scalar, so we + // need to do an extra conversion here to get it into the right shape. + // For example if BiasRef is F8_E4M3FN and M is 7, it gets loaded to into + // vector, and if OutputElTy is half, Convert will return + // vector instead of vector. + // https://github.com/microsoft/DirectXShaderCompiler/issues/8418 + + // Convert to OutputElTy vector with padding + using BiasConvInterpPaddedTy = InterpretedVector< + OutputElTy, + __detail::DstN<__detail::TypeTraits::CompType, BiasInterp, + __detail::ScalarCountFromPackedComponents< + BiasInterp, M>::Value>::Value, + __detail::TypeTraits::CompType>; + + BiasConvInterpPaddedTy BiasConvInterpPadded = + Convert<__detail::TypeTraits::CompType, BiasInterp>(Bias); + + // Truncate the vector to the correct size M + vector BiasConv = + (vector)BiasConvInterpPadded.Data; + vector Result; - __builtin_LinAlg_MatrixVectorMultiplyAdd(Result, MatrixA.__handle, - hlsl::is_signed::value, - Vec, MatrixDT, BiasVec, BiasElTy); + __builtin_LinAlg_MatrixVectorMultiplyAdd( + Result, MatrixA.__handle, hlsl::is_signed::value, Vec, + __detail::TypeTraits::CompType, BiasConv, + __detail::TypeTraits::CompType); return Result; } template -// clang-format off typename hlsl::enable_if< VecK == __detail::ScalarCountFromPackedComponents::Value, vector >::type -// clang-format on MultiplyAdd(Matrix MatrixA, InterpretedVector InterpVec, - VectorRef BiasRef) { + VectorRef BiasRef) { using BiasVecTy = - vector::Type, M>; - BiasVecTy BiasVec = BiasRef.Buf.template Load(BiasRef.Offset); + vector::Type, + __detail::ScalarCountFromPackedComponents::Value>; + BiasVecTy Bias = BiasRef.Buf.template Load(BiasRef.Offset); + + // FIXME: Convert currently does not support packed type vector sizes that + // are not a multiple of the number of elements per scalar, so we + // need to do an extra conversion here to get it into the right shape. + // For example if BiasRef is F8_E4M3FN and M is 7, it gets loaded to into + // vector, and if OutputElTy is half, Convert will return + // vector instead of vector. + // https://github.com/microsoft/DirectXShaderCompiler/issues/8418 + + // Convert to OutputElTy vector with padding + using BiasConvInterpPaddedTy = InterpretedVector< + OutputElTy, + __detail::DstN<__detail::TypeTraits::CompType, BiasInterp, + __detail::ScalarCountFromPackedComponents< + BiasInterp, M>::Value>::Value, + __detail::TypeTraits::CompType>; + + BiasConvInterpPaddedTy BiasConvInterpPadded = + Convert<__detail::TypeTraits::CompType, BiasInterp>(Bias); + + // Truncate the vector to the correct size M + vector BiasConv = + (vector)BiasConvInterpPadded.Data; + vector Result; __builtin_LinAlg_MatrixVectorMultiplyAdd( Result, MatrixA.__handle, hlsl::is_signed::value, - InterpVec.Data, InterpVec.Interpretation, BiasVec, BiasElTy); + InterpVec.Data, InterpVec.Interpretation, BiasConv, + __detail::TypeTraits::CompType); return Result; } @@ -575,6 +650,13 @@ OuterProduct(vector VecA, vector VecB) { return Result; } +template +typename hlsl::enable_if::value, void>::type +InterlockedAccumulate(RWByteAddressBuffer Res, vector Vec, + uint StartOffset, uint Align = 64) { + __builtin_LinAlg_VectorAccumulateToDescriptor(Vec, Res, StartOffset, Align); +} + } // namespace linalg } // namespace dx diff --git a/tools/clang/lib/Parse/ParseDecl.cpp b/tools/clang/lib/Parse/ParseDecl.cpp index 23d86923c2..c91c8940a4 100644 --- a/tools/clang/lib/Parse/ParseDecl.cpp +++ b/tools/clang/lib/Parse/ParseDecl.cpp @@ -4193,6 +4193,10 @@ 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; @@ -5883,15 +5887,6 @@ void Parser::ParseDeclaratorInternal(Declarator &D, return; } - // HLSL Change Starts - No pointer support in HLSL. - if (getLangOpts().HLSL) { - Diag(Tok, diag::err_hlsl_unsupported_pointer); - D.SetIdentifier(0, Tok.getLocation()); - D.setInvalidType(); - return; - } - // HLSL Change Ends - SourceLocation Loc = ConsumeToken(); D.SetRangeEnd(Loc); DeclSpec DS(AttrFactory); @@ -5913,12 +5908,6 @@ void Parser::ParseDeclaratorInternal(Declarator &D, tok::TokenKind Kind = Tok.getKind(); - // HLSL Change Starts - HLSL doesn't support pointers, references or blocks - if (getLangOpts().HLSL && isPtrOperatorToken(Kind, getLangOpts(), D.getContext())) { - Diag(Tok, diag::err_hlsl_unsupported_pointer); - } - // HLSL Change Ends - // Not a pointer, C++ reference, or block. if (!isPtrOperatorToken(Kind, getLangOpts(), D.getContext())) { if (DirectDeclParser) diff --git a/tools/clang/lib/SPIRV/DeclResultIdMapper.cpp b/tools/clang/lib/SPIRV/DeclResultIdMapper.cpp index 97d81844fb..1a1078bf0b 100644 --- a/tools/clang/lib/SPIRV/DeclResultIdMapper.cpp +++ b/tools/clang/lib/SPIRV/DeclResultIdMapper.cpp @@ -1838,7 +1838,7 @@ SpirvFunction *DeclResultIdMapper::getOrRegisterFn(const FunctionDecl *fn) { return spirvFunction; } -const CounterIdAliasPair *DeclResultIdMapper::getCounterIdAliasPair( +const CounterIdAliasPair *DeclResultIdMapper::getOrCreateCounterIdAliasPair( const DeclaratorDecl *decl, const llvm::SmallVector *indices) { if (!decl) return nullptr; @@ -1867,24 +1867,6 @@ const CounterIdAliasPair *DeclResultIdMapper::getCounterIdAliasPair( return nullptr; } -const CounterIdAliasPair * -DeclResultIdMapper::createOrGetCounterIdAliasPair(const DeclaratorDecl *decl) { - auto counterPair = getCounterIdAliasPair(decl); - if (counterPair) - return counterPair; - if (!decl) - return nullptr; - // If deferred RWStructuredBuffer, try creating the counter now - auto declInstr = declRWSBuffers[decl]; - if (declInstr) { - createCounterVar(decl, declInstr, /*isAlias*/ false); - auto counter = counterVars.find(decl); - assert(counter != counterVars.end() && "counter not found"); - return &counter->second; - } - return nullptr; -} - const CounterVarFields * DeclResultIdMapper::getCounterVarFields(const DeclaratorDecl *decl) { if (!decl) diff --git a/tools/clang/lib/SPIRV/DeclResultIdMapper.h b/tools/clang/lib/SPIRV/DeclResultIdMapper.h index 17ea739fee..6e8177edf2 100644 --- a/tools/clang/lib/SPIRV/DeclResultIdMapper.h +++ b/tools/clang/lib/SPIRV/DeclResultIdMapper.h @@ -492,18 +492,12 @@ class DeclResultIdMapper { /// \brief Returns the associated counter's (instr-ptr, is-alias-or-not) /// pair for the given {RW|Append|Consume}StructuredBuffer variable. /// If indices is not nullptr, walks trhough the fields of the decl, expected - /// to be of struct type, using the indices to find the field. Returns nullptr - /// if the given decl has no associated counter variable created. - const CounterIdAliasPair *getCounterIdAliasPair( + /// to be of struct type, using the indices to find the field. + /// Creates counter for RW buffer if not already created. + const CounterIdAliasPair *getOrCreateCounterIdAliasPair( const DeclaratorDecl *decl, const llvm::SmallVector *indices = nullptr); - /// \brief Returns the associated counter's (instr-ptr, is-alias-or-not) - /// pair for the given {RW|Append|Consume}StructuredBuffer variable. Creates - /// counter for RW buffer if not already created. - const CounterIdAliasPair * - createOrGetCounterIdAliasPair(const DeclaratorDecl *decl); - /// \brief Returns all the associated counters for the given decl. The decl is /// expected to be a struct containing alias RW/Append/Consume structured /// buffers. Returns nullptr if it does not. diff --git a/tools/clang/lib/SPIRV/SpirvEmitter.cpp b/tools/clang/lib/SPIRV/SpirvEmitter.cpp index 936359e25c..288b926f24 100644 --- a/tools/clang/lib/SPIRV/SpirvEmitter.cpp +++ b/tools/clang/lib/SPIRV/SpirvEmitter.cpp @@ -2967,13 +2967,13 @@ void SpirvEmitter::doReturnStmt(const ReturnStmt *stmt) { declIdMapper.createResourceHeap(decl, resourceType); } - // Update counter variable associated with function returns - tryToAssignCounterVar(curFunction, retVal); - auto *retInfo = loadIfGLValue(retVal); if (!retInfo) return; + // Update counter variable associated with function returns + tryToAssignCounterVar(curFunction, retVal); + auto retType = retVal->getType(); if (retInfo->getLayoutRule() != SpirvLayoutRule::Void && retType->isStructureType()) { @@ -5105,7 +5105,7 @@ bool SpirvEmitter::tryToAssignCounterVar(const DeclaratorDecl *dstDecl, // Handle AssocCounter#1 (see CounterVarFields comment) if (const auto *dstPair = - declIdMapper.createOrGetCounterIdAliasPair(dstDecl)) { + declIdMapper.getOrCreateCounterIdAliasPair(dstDecl)) { auto *srcCounter = getFinalACSBufferCounterInstruction(srcExpr); if (!srcCounter) { emitFatalError("cannot find the associated counter variable", @@ -5213,13 +5213,13 @@ const CounterIdAliasPair * SpirvEmitter::getFinalACSBufferCounter(const Expr *expr) { // AssocCounter#1: referencing some stand-alone variable if (const auto *decl = getReferencedDef(expr)) - return declIdMapper.createOrGetCounterIdAliasPair(decl); + return declIdMapper.getOrCreateCounterIdAliasPair(decl); const Expr *expr_withoutcasts = expr->IgnoreParenCasts(); if (isResourceDescriptorHeap(expr_withoutcasts->getType())) { const Expr *base = nullptr; getDescriptorHeapOperands(expr_withoutcasts, &base, /* index= */ nullptr); - return declIdMapper.createOrGetCounterIdAliasPair(getReferencedDef(base)); + return declIdMapper.getOrCreateCounterIdAliasPair(getReferencedDef(base)); } // AssocCounter#2: referencing some non-struct field @@ -5230,7 +5230,7 @@ SpirvEmitter::getFinalACSBufferCounter(const Expr *expr) { (base && isa(base)) ? getOrCreateDeclForMethodObject(cast(curFunction)) : getReferencedDef(base); - return declIdMapper.getCounterIdAliasPair(decl, &rawIndices); + return declIdMapper.getOrCreateCounterIdAliasPair(decl, &rawIndices); } const CounterVarFields *SpirvEmitter::getIntermediateACSBufferCounter( diff --git a/tools/clang/lib/Sema/SemaHLSL.cpp b/tools/clang/lib/Sema/SemaHLSL.cpp index 9c5628a2c1..127733e71e 100644 --- a/tools/clang/lib/Sema/SemaHLSL.cpp +++ b/tools/clang/lib/Sema/SemaHLSL.cpp @@ -5368,8 +5368,8 @@ class HLSLExternalSource : public ExternalSemaSource { /// use for the signature, with the first being the return type. bool MatchArguments(const IntrinsicDefIter &cursor, QualType objectType, QualType objectElement, QualType functionTemplateTypeArg, - ArrayRef Args, std::vector *, - size_t &badArgIdx); + unsigned functionTemplateIntArg, ArrayRef Args, + std::vector *, size_t &badArgIdx); /// Validate object element on intrinsic to catch case like integer /// on Sample. Intrinsic function to @@ -5418,6 +5418,19 @@ class HLSLExternalSource : public ExternalSemaSource { nameIdentifier, argumentCount)); } + static unsigned GetIntegralTemplateArg(ASTContext &context, + const TemplateArgument &arg) { + if (arg.getKind() == TemplateArgument::Integral) + return arg.getAsIntegral().getZExtValue(); + if (arg.getKind() == TemplateArgument::Expression) { + llvm::APSInt result; + Expr *expr = arg.getAsExpr(); + if (expr != nullptr && expr->isIntegerConstantExpr(result, context)) + return result.getZExtValue(); + } + return 0; + } + bool AddOverloadedCallCandidates(UnresolvedLookupExpr *ULE, ArrayRef Args, OverloadCandidateSet &CandidateSet, Scope *S, @@ -5512,11 +5525,22 @@ class HLSLExternalSource : public ExternalSemaSource { "otherwise g_MaxIntrinsicParamCount needs to be updated for " "wider signatures"); + QualType templateTypeArg; + unsigned templateIntArg = 0; std::vector functionArgTypes; size_t badArgIdx; + if (ULE->hasExplicitTemplateArgs() && ULE->getNumTemplateArgs() >= 1) { + const TemplateArgumentLoc &TypeArgLoc = ULE->getTemplateArgs()[0]; + if (TypeArgLoc.getArgument().getKind() == TemplateArgument::Type) + templateTypeArg = TypeArgLoc.getArgument().getAsType(); + if (ULE->getNumTemplateArgs() >= 2) + templateIntArg = GetIntegralTemplateArg( + *m_context, ULE->getTemplateArgs()[1].getArgument()); + } + bool argsMatch = - MatchArguments(cursor, QualType(), QualType(), QualType(), Args, - &functionArgTypes, badArgIdx); + MatchArguments(cursor, QualType(), QualType(), templateTypeArg, + templateIntArg, Args, &functionArgTypes, badArgIdx); if (!functionArgTypes.size()) return false; @@ -6925,8 +6949,9 @@ bool HLSLExternalSource::IsValidObjectElement(LPCSTR tableName, bool HLSLExternalSource::MatchArguments( const IntrinsicDefIter &cursor, QualType objectType, QualType objectElement, - QualType functionTemplateTypeArg, ArrayRef Args, - std::vector *argTypesVector, size_t &badArgIdx) { + QualType functionTemplateTypeArg, unsigned functionTemplateIntArg, + ArrayRef Args, std::vector *argTypesVector, + size_t &badArgIdx) { const HLSL_INTRINSIC *pIntrinsic = *cursor; LPCSTR tableName = cursor.GetTableName(); IntrinsicOp builtinOp = IntrinsicOp::Num_Intrinsics; @@ -7418,7 +7443,51 @@ bool HLSLExternalSource::MatchArguments( if (i == 0 && (builtinOp == hlsl::IntrinsicOp::IOP_Vkreinterpret_pointer_cast || builtinOp == hlsl::IntrinsicOp::IOP_Vkstatic_pointer_cast)) { - pNewType = Args[0]->getType(); +#ifdef ENABLE_SPIRV_CODEGEN + if (functionTemplateTypeArg.isNull()) { + badArgIdx = std::min(badArgIdx, i); + continue; + } + + // Build BufferPointer where T is the template type argument and + // A is the template alignment argument (or the alignment of the + // source pointer if none is given). + unsigned srcAlignment = + functionTemplateIntArg + ? functionTemplateIntArg + : hlsl::GetVKBufferPointerAlignment(Args[0]->getType()); + TemplateArgument TemplateArgs[] = { + TemplateArgument(functionTemplateTypeArg), + TemplateArgument(*m_context, + llvm::APSInt(llvm::APInt(32, srcAlignment)), + m_context->UnsignedIntTy)}; + void *InsertPos = nullptr; + ClassTemplateSpecializationDecl *Spec = + m_vkBufferPointerTemplateDecl->findSpecialization( + llvm::ArrayRef(TemplateArgs, 2), InsertPos); + if (!Spec) { + Spec = ClassTemplateSpecializationDecl::Create( + *m_context, TagDecl::TagKind::TTK_Struct, + m_vkBufferPointerTemplateDecl->getDeclContext(), SourceLocation(), + SourceLocation(), m_vkBufferPointerTemplateDecl, TemplateArgs, 2, + nullptr); + m_vkBufferPointerTemplateDecl->AddSpecialization(Spec, InsertPos); + Spec->setImplicit(true); + DXVERIFY_NOMSG( + false == + getSema()->InstantiateClassTemplateSpecialization( + SourceLocation(), Spec, + TemplateSpecializationKind::TSK_ImplicitInstantiation, true)); + } + + pNewType = m_context->getTemplateSpecializationType( + TemplateName(m_vkBufferPointerTemplateDecl), TemplateArgs, 2, + m_context->getTypeDeclType(Spec)); +#else + // The IOP_Vk* opcodes are only reachable when ENABLE_SPIRV_CODEGEN is + // defined. + llvm_unreachable("vk:: pointer cast intrinsics require SPIR-V codegen"); +#endif // ENABLE_SPIRV_CODEGEN } else { badArgIdx = std::min(badArgIdx, i); } @@ -11155,11 +11224,18 @@ HLSLExternalSource::DeduceTemplateArgumentsForHLSL( QualType objectType = m_context->getTagDeclType(functionParentRecord); QualType functionTemplateTypeArg{}; - if (ExplicitTemplateArgs != nullptr && ExplicitTemplateArgs->size() == 1) { + unsigned functionTemplateIntArg = 0; + if (ExplicitTemplateArgs != nullptr && ExplicitTemplateArgs->size() >= 1) { const TemplateArgument &firstTemplateArg = (*ExplicitTemplateArgs)[0].getArgument(); if (firstTemplateArg.getKind() == TemplateArgument::ArgKind::Type) functionTemplateTypeArg = firstTemplateArg.getAsType(); + if (ExplicitTemplateArgs->size() > 1) { + const TemplateArgument &secondTemplateArg = + (*ExplicitTemplateArgs)[1].getArgument(); + functionTemplateIntArg = + GetIntegralTemplateArg(*m_context, secondTemplateArg); + } } // Handle subscript overloads. @@ -11233,7 +11309,8 @@ HLSLExternalSource::DeduceTemplateArgumentsForHLSL( while (cursor != end) { size_t badArgIdx; if (!MatchArguments(cursor, objectType, objectElement, - functionTemplateTypeArg, Args, &argTypes, badArgIdx)) { + functionTemplateTypeArg, functionTemplateIntArg, Args, + &argTypes, badArgIdx)) { ++cursor; continue; } @@ -11276,8 +11353,9 @@ HLSLExternalSource::DeduceTemplateArgumentsForHLSL( if (!IsNull && getSema()->RequireCompleteType(Loc, functionTemplateTypeArg, 0)) return Sema::TemplateDeductionResult::TDK_Invalid; - if (IsNull || !hlsl::IsHLSLNumericOrAggregateOfNumericType( - functionTemplateTypeArg)) { + if (IsNull || ExplicitTemplateArgs->size() > 1 || + !hlsl::IsHLSLNumericOrAggregateOfNumericType( + functionTemplateTypeArg)) { getSema()->Diag(Loc, diag::err_hlsl_intrinsic_template_arg_numeric) << intrinsicName; DiagnoseTypeElements( @@ -12007,8 +12085,18 @@ static bool CheckBarrierCall(Sema &S, FunctionDecl *FD, CallExpr *CE, } #ifdef ENABLE_SPIRV_CODEGEN -static bool CheckVKBufferPointerCast(Sema &S, FunctionDecl *FD, CallExpr *CE, - bool isStatic) { +static bool CheckVKBufferPointerCast(Sema &S, CallExpr *CE, bool isStatic) { + const auto *callee = dyn_cast(CE->getCallee()->IgnoreImpCasts()); + if (callee && callee->hasExplicitTemplateArgs() && + callee->getNumTemplateArgs() > 2) { + StringRef castName = + isStatic ? "static_pointer_cast" : "reinterpret_pointer_cast"; + S.Diags.Report(CE->getExprLoc(), + diag::err_template_arg_list_different_arity) + << /*too many*/ 1 << /*function template*/ 1 << castName; + return true; + } + const Expr *argExpr = CE->getArg(0); QualType srcType = argExpr->getType(); QualType destType = CE->getType(); @@ -12146,10 +12234,10 @@ void Sema::CheckHLSLFunctionCall(FunctionDecl *FDecl, CallExpr *TheCall) { break; #ifdef ENABLE_SPIRV_CODEGEN case hlsl::IntrinsicOp::IOP_Vkreinterpret_pointer_cast: - CheckVKBufferPointerCast(*this, FDecl, TheCall, false); + CheckVKBufferPointerCast(*this, TheCall, false); break; case hlsl::IntrinsicOp::IOP_Vkstatic_pointer_cast: - CheckVKBufferPointerCast(*this, FDecl, TheCall, true); + CheckVKBufferPointerCast(*this, TheCall, true); break; #endif default: @@ -15386,6 +15474,24 @@ bool Sema::DiagnoseHLSLDecl(Declarator &D, DeclContext *DC, Expr *BitWidth, if (!isFunction) hlslSource->WarnMinPrecision(qt, D.getLocStart()); + // HLSL Change Starts - disallow pointers through __decltype. + if (!D.isInvalidType() && pType && !qt->isDependentType()) { + if (const auto *DTT = dyn_cast(pType)) { + QualType Underlying = DTT->getUnderlyingType(); + if (Underlying->isPointerType()) { + Diag(D.getLocStart(), diag::err_hlsl_pointers_unsupported) << 0; + D.setInvalidType(); + return false; + } + if (Underlying->isReferenceType()) { + Diag(D.getLocStart(), diag::err_hlsl_pointers_unsupported) << 1; + D.setInvalidType(); + return false; + } + } + } + // HLSL Change Ends + // Early checks - these are not simple attribution errors, but constructs that // are fundamentally unsupported, // and so we avoid errors that might indicate they can be repaired. diff --git a/tools/clang/lib/Sema/SemaTemplate.cpp b/tools/clang/lib/Sema/SemaTemplate.cpp index 37b296aefd..b5945017da 100644 --- a/tools/clang/lib/Sema/SemaTemplate.cpp +++ b/tools/clang/lib/Sema/SemaTemplate.cpp @@ -421,8 +421,14 @@ Sema::ActOnDependentIdExpression(const CXXScopeSpec &SS, NamedDecl *FirstQualifierInScope = nullptr; // HLSL Change begin - This is a reference. + // In HLSL, 'this' is an lvalue reference (not a pointer), so implicit + // member accesses use '.' (IsArrow=false). The base type must be the + // class type T, not the pointer type T*. + QualType MemberBaseType = + getLangOpts().HLSL ? ThisType->getPointeeType() : ThisType; return CXXDependentScopeMemberExpr::Create( - Context, /*This*/ nullptr, ThisType, /*IsArrow*/ !getLangOpts().HLSL, + Context, /*This*/ nullptr, MemberBaseType, + /*IsArrow*/ !getLangOpts().HLSL, /*Op*/ SourceLocation(), SS.getWithLocInContext(Context), TemplateKWLoc, FirstQualifierInScope, NameInfo, TemplateArgs); // HLSL Change end - This is a reference. diff --git a/tools/clang/lib/Sema/SemaType.cpp b/tools/clang/lib/Sema/SemaType.cpp index 52c55df6ae..7465cc2cec 100644 --- a/tools/clang/lib/Sema/SemaType.cpp +++ b/tools/clang/lib/Sema/SemaType.cpp @@ -1849,6 +1849,13 @@ QualType Sema::BuildPointerType(QualType T, return QualType(); } + // HLSL Change Begin - Disallow pointers. + if (getLangOpts().HLSL && Loc.isValid()) { + Diag(Loc, diag::err_hlsl_pointers_unsupported) << 0; + return QualType(); + } + // HLSL Change End. + if (checkQualifiedFunction(*this, T, Loc, QFK_Pointer)) return QualType(); @@ -1911,6 +1918,13 @@ QualType Sema::BuildReferenceType(QualType T, bool SpelledAsLValue, return QualType(); } + // HLSL Change Begin - Disallow references. + if (getLangOpts().HLSL && Loc.isValid()) { + Diag(Loc, diag::err_hlsl_pointers_unsupported) << 1; + return QualType(); + } + // HLSL Change End. + if (checkQualifiedFunction(*this, T, Loc, QFK_Reference)) return QualType(); @@ -2313,6 +2327,13 @@ QualType Sema::BuildMemberPointerType(QualType T, QualType Class, return QualType(); } + // HLSL Change Begin - Disallow pointers. + if (getLangOpts().HLSL && Loc.isValid()) { + Diag(Loc, diag::err_hlsl_pointers_unsupported) << 0; + return QualType(); + } + // HLSL Change End. + // Adjust the default free function calling convention to the default method // calling convention. if (T->isFunctionType()) diff --git a/tools/clang/lib/Sema/TreeTransform.h b/tools/clang/lib/Sema/TreeTransform.h index 2d2e692cd4..ef3a83c988 100644 --- a/tools/clang/lib/Sema/TreeTransform.h +++ b/tools/clang/lib/Sema/TreeTransform.h @@ -9852,7 +9852,12 @@ TreeTransform::TransformCXXDependentScopeMemberExpr( } else { OldBase = nullptr; BaseType = getDerived().TransformType(E->getBaseType()); - ObjectType = BaseType->getPointeeType(); + // HLSL Change - Begin + // In HLSL, 'this' is an lvalue reference so implicit member accesses use + // '.' (IsArrow=false) and the stored base type IS the object type, not a + // pointer to it. + ObjectType = E->isArrow() ? BaseType->getPointeeType() : BaseType; + // HLSL Change - End } // Transform the first part of the nested-name-specifier that qualifies diff --git a/tools/clang/test/CodeGenDXIL/hlsl/functions/hl-annotation-resource-param.hlsl b/tools/clang/test/CodeGenDXIL/hlsl/functions/hl-annotation-resource-param.hlsl new file mode 100644 index 0000000000..8df685f0d5 --- /dev/null +++ b/tools/clang/test/CodeGenDXIL/hlsl/functions/hl-annotation-resource-param.hlsl @@ -0,0 +1,22 @@ +// REQUIRES: dxil-1-8 +// RUN: %dxc -T cs_6_8 -fcgl %s | FileCheck %s + +// CHECK: %dx.types.ResourceProperties = type { i32, i32 } +// CHECK: !dx.typeAnnotations = !{![[TYPE_ANNOTATIONS:[0-9]+]]} +// CHECK: ![[TYPE_ANNOTATIONS]] = !{ +// CHECK-SAME: void (%struct.RWByteAddressBuffer*)* @"\01?foo@@YAXURWByteAddressBuffer@@@Z", ![[FN_ANN:[0-9]+]] +// CHECK: ![[FN_ANN]] = !{!{{[0-9]+}}, ![[PARAM_ANN:[0-9]+]]} +// CHECK: ![[PARAM_ANN]] = !{i32 0, ![[FIELD_ANN:[0-9]+]], !{{[0-9]+}}} +// CHECK: ![[FIELD_ANN]] = !{ +// CHECK-SAME: i32 10, %dx.types.ResourceProperties { i32 4107, i32 0 } + +RWByteAddressBuffer OutBuff : register(u0); + +void foo(RWByteAddressBuffer Buf) { + Buf.Store(0, 42); +} + +[numthreads(8, 1, 1)] +void main() { + foo(OutBuff); +} diff --git a/tools/clang/test/CodeGenDXIL/hlsl/functions/hl-annotation-resource-param.ll b/tools/clang/test/CodeGenDXIL/hlsl/functions/hl-annotation-resource-param.ll new file mode 100644 index 0000000000..0f700b6da2 --- /dev/null +++ b/tools/clang/test/CodeGenDXIL/hlsl/functions/hl-annotation-resource-param.ll @@ -0,0 +1,87 @@ +; RUN: %dxopt %s -hlsl-passes-resume -hlsl-passes-pause -S | FileCheck %s + +; Test round-trip metadata serialization for ResourceProperties type annotation. + +; CHECK: %dx.types.ResourceProperties = type { i32, i32 } +; CHECK: !dx.typeAnnotations = !{![[TYPE_ANNOTATIONS:[0-9]+]]} +; CHECK: ![[TYPE_ANNOTATIONS]] = !{ +; CHECK-SAME: void (%struct.RWByteAddressBuffer*)* @"\01?foo@@YAXURWByteAddressBuffer@@@Z", ![[FN_ANN:[0-9]+]] +; CHECK: ![[FN_ANN]] = !{!{{[0-9]+}}, ![[PARAM_ANN:[0-9]+]]} +; CHECK: ![[PARAM_ANN]] = !{i32 0, ![[FIELD_ANN:[0-9]+]], !{{[0-9]+}}} +; CHECK: ![[FIELD_ANN]] = !{ +; CHECK-SAME: i32 10, %dx.types.ResourceProperties { i32 4107, i32 0 } + +target datalayout = "e-m:e-p:32:32-i1:32-i8:32-i16:32-i32:32-i64:64-f16:32-f32:32-f64:64-n8:16:32:64" +target triple = "dxil-ms-dx" + +%struct.RWByteAddressBuffer = type { i32 } +%ConstantBuffer = type opaque +%dx.types.Handle = type { i8* } +%dx.types.ResourceProperties = type { i32, i32 } + +@"\01?OutBuff@@3URWByteAddressBuffer@@A" = external global %struct.RWByteAddressBuffer, align 4 +@"$Globals" = external constant %ConstantBuffer + +; Function Attrs: nounwind +define void @main() #0 { +entry: + call void @"\01?foo@@YAXURWByteAddressBuffer@@@Z"(%struct.RWByteAddressBuffer* @"\01?OutBuff@@3URWByteAddressBuffer@@A") + ret void +} + +; Function Attrs: alwaysinline nounwind +define internal void @"\01?foo@@YAXURWByteAddressBuffer@@@Z"(%struct.RWByteAddressBuffer* %Buf) #1 { +entry: + %0 = load %struct.RWByteAddressBuffer, %struct.RWByteAddressBuffer* %Buf + %1 = call %dx.types.Handle @"dx.hl.createhandle..%dx.types.Handle (i32, %struct.RWByteAddressBuffer)"(i32 0, %struct.RWByteAddressBuffer %0) + %2 = call %dx.types.Handle @"dx.hl.annotatehandle..%dx.types.Handle (i32, %dx.types.Handle, %dx.types.ResourceProperties, %struct.RWByteAddressBuffer)"(i32 14, %dx.types.Handle %1, %dx.types.ResourceProperties { i32 4107, i32 0 }, %struct.RWByteAddressBuffer undef) + call void @"dx.hl.op..void (i32, %dx.types.Handle, i32, i32)"(i32 277, %dx.types.Handle %2, i32 0, i32 42) + ret void +} + +; Function Attrs: nounwind +declare void @"dx.hl.op..void (i32, %dx.types.Handle, i32, i32)"(i32, %dx.types.Handle, i32, i32) #0 + +; Function Attrs: nounwind readnone +declare %dx.types.Handle @"dx.hl.createhandle..%dx.types.Handle (i32, %struct.RWByteAddressBuffer)"(i32, %struct.RWByteAddressBuffer) #2 + +; Function Attrs: nounwind readnone +declare %dx.types.Handle @"dx.hl.annotatehandle..%dx.types.Handle (i32, %dx.types.Handle, %dx.types.ResourceProperties, %struct.RWByteAddressBuffer)"(i32, %dx.types.Handle, %dx.types.ResourceProperties, %struct.RWByteAddressBuffer) #2 + +attributes #0 = { nounwind } +attributes #1 = { alwaysinline nounwind } +attributes #2 = { nounwind readnone } + +!llvm.module.flags = !{!0} +!pauseresume = !{!1} +!llvm.ident = !{!2} +!dx.version = !{!3} +!dx.valver = !{!4} +!dx.shaderModel = !{!5} +!dx.typeAnnotations = !{!6} +!dx.entryPoints = !{!13} +!dx.fnprops = !{!19} +!dx.options = !{!20, !21} + +!0 = !{i32 2, !"Debug Info Version", i32 3} +!1 = !{!"hlsl-hlemit", !"hlsl-hlensure"} +!2 = !{!"dxc(private) 1.9.0.15350 (main, 348fc7832)"} +!3 = !{i32 1, i32 8} +!4 = !{i32 1, i32 10} +!5 = !{!"cs", i32 6, i32 8} +!6 = !{i32 1, void ()* @main, !7, void (%struct.RWByteAddressBuffer*)* @"\01?foo@@YAXURWByteAddressBuffer@@@Z", !10} +!7 = !{!8} +!8 = !{i32 1, !9, !9} +!9 = !{} +!10 = !{!8, !11} +!11 = !{i32 0, !12, !9} +!12 = !{i32 10, %dx.types.ResourceProperties { i32 4107, i32 0 }} +!13 = !{void ()* @main, !"main", null, !14, null} +!14 = !{null, !15, !17, null} +!15 = !{!16} +!16 = !{i32 0, %struct.RWByteAddressBuffer* @"\01?OutBuff@@3URWByteAddressBuffer@@A", !"OutBuff", i32 0, i32 0, i32 1, i32 11, i1 false, i1 false, i1 false, null} +!17 = !{!18} +!18 = !{i32 0, %ConstantBuffer* @"$Globals", !"$Globals", i32 0, i32 -1, i32 1, i32 0, null} +!19 = !{void ()* @main, i32 5, i32 8, i32 1, i32 1} +!20 = !{i32 64} +!21 = !{i32 -1} diff --git a/tools/clang/test/CodeGenDXIL/hlsl/linalg/api/vectors.hlsl b/tools/clang/test/CodeGenDXIL/hlsl/linalg/api/vectors.hlsl index 58f19b887c..3d1735aa9c 100644 --- a/tools/clang/test/CodeGenDXIL/hlsl/linalg/api/vectors.hlsl +++ b/tools/clang/test/CodeGenDXIL/hlsl/linalg/api/vectors.hlsl @@ -8,36 +8,38 @@ using MatrixATy = Matrix; using MatrixAccum_8_4_Ty = Matrix; using Matrix_7_15_ATy = Matrix; +using MatrixPacked_7_15_ATy = Matrix; +RWByteAddressBuffer RWBAB : register(u0); ByteAddressBuffer BAB : register(t0); [numthreads(4, 4, 4)] void main(uint ID : SV_GroupID) { -// CHECK: %[[MAT1:.*]] = call %dx.types.LinAlgMatrixC8M8N4U0S0 @dx.op.linAlgMatrixLoadFromDescriptor.mC8M8N4U0S0( -// CHECK-SAME: i32 -2147483634, %dx.types.Handle %{{[0-9]+}}, i32 0, i32 8, i32 1, i32 128) -// CHECK-SAME: ; LinAlgMatrixLoadFromDescriptor(handle,offset,stride,layout,align) + // CHECK: %[[MAT1:.*]] = call %dx.types.LinAlgMatrixC8M8N4U0S0 @dx.op.linAlgMatrixLoadFromDescriptor.mC8M8N4U0S0( + // CHECK-SAME: i32 -2147483634, %dx.types.Handle %{{[0-9]+}}, i32 0, i32 8, i32 1, i32 128) + // CHECK-SAME: ; LinAlgMatrixLoadFromDescriptor(handle,offset,stride,layout,align) MatrixATy Mat1 = MatrixATy::Load(BAB, 0, 8); vector vec1 = 10.3f; -// CHECK: %[[VEC2:.*]] = call <8 x half> @dx.op.linAlgMatVecMul.v8f16.mC8M8N4U0S0.v4f16(i32 -2147483623, -// CHECK-SAME: %dx.types.LinAlgMatrixC8M8N4U0S0 %[[MAT1]], i1 true, <4 x half> , i32 8) ; LinAlgMatVecMul(matrix,isOutputSigned,inputVector,interpretation) + // CHECK: %[[VEC2:.*]] = call <8 x half> @dx.op.linAlgMatVecMul.v8f16.mC8M8N4U0S0.v4f16(i32 -2147483623, + // CHECK-SAME: %dx.types.LinAlgMatrixC8M8N4U0S0 %[[MAT1]], i1 true, <4 x half> , i32 8) ; LinAlgMatVecMul(matrix,isOutputSigned,inputVector,interpretation) vector vec2 = Multiply(Mat1, vec1); -// CHECK: %[[VEC3:.*]] = call <8 x half> @dx.op.linAlgMatVecMulAdd.v8f16.mC8M8N4U0S0.v4f16.v8f16(i32 -2147483622, -// CHECK-SAME: %dx.types.LinAlgMatrixC8M8N4U0S0 %[[MAT1]], i1 true, <4 x half> , i32 8, <8 x half> %[[VEC2]], i32 8) -// CHECK-SAME: ; LinAlgMatVecMulAdd(matrix,isOutputSigned,inputVector,inputInterpretation,biasVector,biasInterpretation) + // CHECK: %[[VEC3:.*]] = call <8 x half> @dx.op.linAlgMatVecMulAdd.v8f16.mC8M8N4U0S0.v4f16.v8f16(i32 -2147483622, + // CHECK-SAME: %dx.types.LinAlgMatrixC8M8N4U0S0 %[[MAT1]], i1 true, <4 x half> , i32 8, <8 x half> %[[VEC2]], i32 8) + // CHECK-SAME: ; LinAlgMatVecMulAdd(matrix,isOutputSigned,inputVector,inputInterpretation,biasVector,biasInterpretation) vector vec3 = MultiplyAdd(Mat1, vec1, vec2); -// CHECK: %[[VEC20:.*]] = shufflevector + // CHECK: %[[VEC20:.*]] = shufflevector vector vec20 = (vector)vec2; -// CHECK: %[[VEC4:.*]] = call <8 x half> @dx.op.linAlgMatVecMulAdd.v8f16.mC8M8N4U0S0.v4f16.v8f16(i32 -2147483622, -// CHECK-SAME: %dx.types.LinAlgMatrixC8M8N4U0S0 %[[MAT1]], i1 true, <4 x half> %[[VEC20]], i32 8, <8 x half> %[[VEC3]], i32 8) -// CHECK-SAME: ; LinAlgMatVecMulAdd(matrix,isOutputSigned,inputVector,inputInterpretation,biasVector,biasInterpretation) + // CHECK: %[[VEC4:.*]] = call <8 x half> @dx.op.linAlgMatVecMulAdd.v8f16.mC8M8N4U0S0.v4f16.v8f16(i32 -2147483622, + // CHECK-SAME: %dx.types.LinAlgMatrixC8M8N4U0S0 %[[MAT1]], i1 true, <4 x half> %[[VEC20]], i32 8, <8 x half> %[[VEC3]], i32 8) + // CHECK-SAME: ; LinAlgMatVecMulAdd(matrix,isOutputSigned,inputVector,inputInterpretation,biasVector,biasInterpretation) InterpretedVector interpVec2 = MakeInterpretedVector(vec20); vector vec4 = MultiplyAdd(Mat1, interpVec2, vec3); @@ -46,8 +48,10 @@ void main(uint ID : SV_GroupID) { // CHECK: %[[VEC_BIAS:.*]] = extractvalue %dx.types.ResRet.v8i16 %[[RAWLOAD]], 0 - // CHECK: %[[VEC5:.*]] = call <8 x half> @dx.op.linAlgMatVecMulAdd.v8f16.mC8M8N4U0S0.v4f16.v8i16(i32 -2147483622, - // CHECK-SAME: %dx.types.LinAlgMatrixC8M8N4U0S0 %[[MAT1]], i1 true, <4 x half> %[[VEC20]], i32 8, <8 x i16> %[[VEC_BIAS]], i32 2) + // CHECK: %[[BIAS_CONV:.*]] = call <8 x half> @dx.op.linAlgConvert.v8f16.v8i16(i32 -2147483618, <8 x i16> %[[VEC_BIAS]], i32 2, i32 8) + // CHECK-SAME: ; LinAlgConvert(inputVector,inputInterpretation,outputInterpretation) + // CHECK: %[[VEC5:.*]] = call <8 x half> @dx.op.linAlgMatVecMulAdd.v8f16.mC8M8N4U0S0.v4f16.v8f16(i32 -2147483622, + // CHECK-SAME: %dx.types.LinAlgMatrixC8M8N4U0S0 %[[MAT1]], i1 true, <4 x half> %[[VEC20]], i32 8, <8 x half> %[[BIAS_CONV]], i32 8) // CHECK-SAME:; LinAlgMatVecMulAdd(matrix,isOutputSigned,inputVector,inputInterpretation,biasVector,biasInterpretation) VectorRef memBias = {BAB, 4096}; vector vec5 = MultiplyAdd(Mat1, interpVec2, memBias); @@ -58,8 +62,10 @@ void main(uint ID : SV_GroupID) { // CHECK: %[[VEC_BIAS:.*]] = extractvalue %dx.types.ResRet.v8i16 %[[RAWLOAD]], 0 - // CHECK: %[[VEC6:.*]] = call <8 x half> @dx.op.linAlgMatVecMulAdd.v8f16.mC8M8N4U0S0.v4f16.v8i16(i32 -2147483622, - // CHECK-SAME: %dx.types.LinAlgMatrixC8M8N4U0S0 %[[MAT1]], i1 true, <4 x half> %[[VEC20]], i32 8, <8 x i16> %[[VEC_BIAS]], i32 2) + // CHECK: %[[BIAS_CONV:.*]] = call <8 x half> @dx.op.linAlgConvert.v8f16.v8i16(i32 -2147483618, <8 x i16> %[[VEC_BIAS]], i32 2, i32 8) + // CHECK-SAME: ; LinAlgConvert(inputVector,inputInterpretation,outputInterpretation) + // CHECK: %[[VEC6:.*]] = call <8 x half> @dx.op.linAlgMatVecMulAdd.v8f16.mC8M8N4U0S0.v4f16.v8f16(i32 -2147483622, + // CHECK-SAME: %dx.types.LinAlgMatrixC8M8N4U0S0 %[[MAT1]], i1 true, <4 x half> %[[VEC20]], i32 8, <8 x half> %[[BIAS_CONV]], i32 8) // CHECK-SAME: ; LinAlgMatVecMulAdd(matrix,isOutputSigned,inputVector,inputInterpretation,biasVector,biasInterpretation) vector vec6 = MultiplyAdd(Mat1, interpVec2, memBias); @@ -77,20 +83,19 @@ void main(uint ID : SV_GroupID) { InterpretedVector convertedVec; convertedVec = Convert(vec6); - // CHECK: call <4 x i32> @dx.op.linAlgConvert.v4i32.v16f16(i32 -2147483618, <16 x half> %21, i32 8, i32 21) + // CHECK: call <4 x i32> @dx.op.linAlgConvert.v4i32.v16f16(i32 -2147483618, <16 x half> %{{[0-9]+}}, i32 8, i32 21) // CHECK: ; LinAlgConvert(inputVector,inputInterpretation,outputInterpretation) typedef vector half16; half16 srcF16 = BAB.Load(128); InterpretedVector convertedPacked = Convert(srcF16); - // CHECK: call <1 x i32> @dx.op.linAlgConvert.v1i32.v3f16(i32 -2147483618, <3 x half> %25, i32 8, i32 21) + // CHECK: call <1 x i32> @dx.op.linAlgConvert.v1i32.v3f16(i32 -2147483618, <3 x half> %{{[0-9]+}}, i32 8, i32 21) // CHECK-SAME: ; LinAlgConvert(inputVector,inputInterpretation,outputInterpretation) half3 ThreeF16 = BAB.Load(256); InterpretedVector convertedPacked2 = Convert(ThreeF16); // Test MultiplyAdd with odd sizes - // vector vecH15 = BAB.Load< vector >(168); vector vecH7 = BAB.Load< vector >(64); @@ -104,7 +109,7 @@ void main(uint ID : SV_GroupID) { // CHECK-SAME: %dx.types.LinAlgMatrixC8M7N15U0S0 %[[MAT_7_15]], i1 true, <15 x half> %{{[0-9]+}}, i32 8, <7 x half> %{{[0-9]+}}, i32 8) // CHECK-SAME: ; LinAlgMatVecMulAdd(matrix,isOutputSigned,inputVector,inputInterpretation,biasVector,biasInterpretation) vector vec7 = MultiplyAdd(Mat_7_15, vecH15, vecH7); - + // CHECK: call <7 x half> @dx.op.linAlgMatVecMulAdd.v7f16.mC8M7N15U0S0.v15f16.v7f16(i32 -2147483622, %dx.types.LinAlgMatrixC8M7N15U0S0 %[[MAT_7_15]], // CHECK-SAME; i1 true, <15 x half> %{{[0-9]+}}, i32 8, <7 x half> %{{[0-9]+}}, i32 8) // CHECK-SAME: ; LinAlgMatVecMulAdd(matrix,isOutputSigned,inputVector,inputInterpretation,biasVector,biasInterpretation) @@ -112,16 +117,16 @@ void main(uint ID : SV_GroupID) { // CHECK: %[[LOAD1:.*]] = call %dx.types.ResRet.v7f16 @dx.op.rawBufferVectorLoad.v7f16(i32 303, %dx.types.Handle %{{[0-9]+}}, i32 512, i32 undef, i32 2) // CHECK-SAME: ; RawBufferVectorLoad(buf,index,elementOffset,alignment) - // CHECK: %[[MEM_BIAS1:.*]] = extractvalue %dx.types.ResRet.v7f16 %[[LOAD1]], 0 - // CHECK: call <7 x half> @dx.op.linAlgMatVecMulAdd.v7f16.mC8M7N15U0S0.v15f16.v7f16(i32 -2147483622, - // CHECK-SAME: %dx.types.LinAlgMatrixC8M7N15U0S0 %[[MAT_7_15]], i1 true, <15 x half> %29, i32 8, <7 x half> %37, i32 8) + // CHECK-NEXT: %[[MEM_BIAS1:.*]] = extractvalue %dx.types.ResRet.v7f16 %[[LOAD1]], 0 + // CHECK-NEXT: call <7 x half> @dx.op.linAlgMatVecMulAdd.v7f16.mC8M7N15U0S0.v15f16.v7f16(i32 -2147483622, + // CHECK-SAME: %dx.types.LinAlgMatrixC8M7N15U0S0 %[[MAT_7_15]], i1 true, <15 x half> %{{[0-9]+}}, i32 8, <7 x half> %{{[0-9]+}}, i32 8) // CHECK-SAME: ; LinAlgMatVecMulAdd(matrix,isOutputSigned,inputVector,inputInterpretation,biasVector,biasInterpretation) VectorRef memBias7 = {BAB, 512}; vector vec9 = MultiplyAdd(Mat_7_15, vecH15, memBias7); // CHECK: %[[LOAD2:.*]] = call %dx.types.ResRet.v7f16 @dx.op.rawBufferVectorLoad.v7f16(i32 303, %dx.types.Handle %{{[0-9]+}}, i32 512, i32 undef, i32 2) // CHECK-SAME: ; RawBufferVectorLoad(buf,index,elementOffset,alignment) - // CHECK: %[[MEM_BIAS2:.*]] = extractvalue %dx.types.ResRet.v7f16 %[[LOAD2]], 0 + // CHECK-NEXT: %[[MEM_BIAS2:.*]] = extractvalue %dx.types.ResRet.v7f16 %[[LOAD2]], 0 // CHECK-NEXT: %dx.types.LinAlgMatrixC8M7N15U0S0 %[[MAT_7_15]], i1 true, <15 x half> %{{[0-9]+}}, i32 8, <7 x half> %[[MEM_BIAS2]], i32 8) // CHECK-SAME: ; LinAlgMatVecMulAdd(matrix,isOutputSigned,inputVector,inputInterpretation,biasVector,biasInterpretation) vector vec10 = MultiplyAdd(Mat_7_15, interpVecH15, memBias7); @@ -133,15 +138,64 @@ void main(uint ID : SV_GroupID) { InterpretedVector interpVecH15Packed = Convert(vecH15); // CHECK: call <7 x half> @dx.op.linAlgMatVecMulAdd.v7f16.mC8M7N15U0S0.v4i32.v7f16(i32 -2147483622, - // CHECK-SAME: %dx.types.LinAlgMatrixC8M7N15U0S0 %[[MAT_7_15]], i1 true, <4 x i32> %43, i32 21, <7 x half> %31, i32 8) + // CHECK-SAME: %dx.types.LinAlgMatrixC8M7N15U0S0 %[[MAT_7_15]], i1 true, <4 x i32> %{{[0-9]+}}, i32 21, <7 x half> %{{[0-9]+}}, i32 8) // CHECK-SAME: ; LinAlgMatVecMulAdd(matrix,isOutputSigned,inputVector,inputInterpretation,biasVector,biasInterpretation) vector vec11 = MultiplyAdd(Mat_7_15, interpVecH15Packed, vecH7); - // CHECK: %[[LOAD3:.+]] = call %dx.types.ResRet.v7f16 @dx.op.rawBufferVectorLoad.v7f16(i32 303, %dx.types.Handle %45, i32 512, i32 undef, i32 2) + // CHECK: %[[LOAD3:.+]] = call %dx.types.ResRet.v7f16 @dx.op.rawBufferVectorLoad.v7f16(i32 303, %dx.types.Handle %{{[0-9]+}}, i32 512, i32 undef, i32 2) // CHECK-SAME: ; RawBufferVectorLoad(buf,index,elementOffset,alignment) - // CHECK-NEXT: %[[MEM_BIAS3:.*]] = extractvalue %dx.types.ResRet.v7f16 %46, 0 + // CHECK-NEXT: %[[MEM_BIAS3:.*]] = extractvalue %dx.types.ResRet.v7f16 %{{[0-9]+}}, 0 // CHECK-NEXT: call <7 x half> @dx.op.linAlgMatVecMulAdd.v7f16.mC8M7N15U0S0.v4i32.v7f16(i32 -2147483622, // CHECK-SAME: %dx.types.LinAlgMatrixC8M7N15U0S0 %[[MAT_7_15]], i1 true, <4 x i32> %[[INTERP_VEC_H15_PACKED]], i32 21, <7 x half> %[[MEM_BIAS3]], i32 8) // CHECK-SAME: ; LinAlgMatVecMulAdd(matrix,isOutputSigned,inputVector,inputInterpretation,biasVector,biasInterpretation) + vector vec12 = MultiplyAdd(Mat_7_15, interpVecH15Packed, memBias7); + + // Test Convert and MultiplyAdd with odd sizes and packed types + + // CHECK: %[[MAT_7_15_PACKED:.*]] = call %dx.types.LinAlgMatrixC21M7N15U0S0 @dx.op.linAlgMatrixLoadFromDescriptor.mC21M7N15U0S0(i32 -2147483634, + // CHECK-SAME: %dx.types.Handle %{{[0-9]+}}, i32 0, i32 16, i32 1, i32 128) ; LinAlgMatrixLoadFromDescriptor(handle,offset,stride,layout,align) + MatrixPacked_7_15_ATy Mat_7_15_Packed = MatrixPacked_7_15_ATy::Load(BAB, 0, 16); + + // CHECK: call <7 x half> @dx.op.linAlgMatVecMulAdd.v7f16.mC21M7N15U0S0.v15f16.v7f16(i32 -2147483622, + // CHECK-SAME: %dx.types.LinAlgMatrixC21M7N15U0S0 %[[MAT_7_15_PACKED]], i1 true, <15 x half> %{{[0-9]+}}, i32 8, <7 x half> %{{[0-9]+}}, i32 8) + // CHECK-SAME: ; LinAlgMatVecMulAdd(matrix,isOutputSigned,inputVector,inputInterpretation,biasVector,biasInterpretation) + vector vec21 = MultiplyAdd(Mat_7_15_Packed, vecH15, vecH7); + + // CHECK: call <7 x half> @dx.op.linAlgMatVecMulAdd.v7f16.mC21M7N15U0S0.v4i32.v7f16(i32 -2147483622, %dx.types.LinAlgMatrixC21M7N15U0S0 %[[MAT_7_15_PACKED]], + // CHECK-SAME: i1 true, <4 x i32> %[[INTERP_VEC_H15_PACKED]], i32 21, <7 x half> %{{[0-9]+}}, i32 8) + // CHECK-SAME: ; LinAlgMatVecMulAdd(matrix,isOutputSigned,inputVector,inputInterpretation,biasVector,biasInterpretation) + vector vec22 = MultiplyAdd(Mat_7_15_Packed, interpVecH15Packed, vecH7); + + // CHECK: %[[LOAD4:.*]] = call %dx.types.ResRet.v2i32 @dx.op.rawBufferVectorLoad.v2i32(i32 303, %dx.types.Handle %{{[0-9]+}}, i32 512, i32 undef, i32 4) + // CHECK-SAME: ; RawBufferVectorLoad(buf,index,elementOffset,alignment) + // CHECK-NEXT: %[[MEM_BIAS_PACKED1:.*]] = extractvalue %dx.types.ResRet.v2i32 %[[LOAD4]], 0 + // CHECK-NEXT: %[[MEM_BIAS_CONV_PADDED:.*]] = call <8 x half> @dx.op.linAlgConvert.v8f16.v2i32(i32 -2147483618, + // CHECK-SAME: <2 x i32> %[[MEM_BIAS_PACKED1]], i32 21, i32 8) ; LinAlgConvert(inputVector,inputInterpretation,outputInterpretation) + // CHECK-NEXT: %[[MEM_BIAS_CONV1:.*]] = shufflevector <8 x half> %[[MEM_BIAS_CONV_PADDED]], <8 x half> undef, <7 x i32> + // CHECK-NEXT: call <7 x half> @dx.op.linAlgMatVecMulAdd.v7f16.mC21M7N15U0S0.v15f16.v7f16(i32 -2147483622, + // CHECK-SAME: %dx.types.LinAlgMatrixC21M7N15U0S0 %[[MAT_7_15_PACKED]], i1 true, <15 x half> %{{[0-9]+}}, i32 8, <7 x half> %[[MEM_BIAS_CONV1]], i32 8) + // CHECK-SAME: ; LinAlgMatVecMulAdd(matrix,isOutputSigned,inputVector,inputInterpretation,biasVector,biasInterpretation) + VectorRef memBias7Packed = {BAB, 512}; + vector vec23 = MultiplyAdd(Mat_7_15_Packed, vecH15, memBias7Packed); + + // CHECK: %[[LOAD5:.*]] = call %dx.types.ResRet.v2i32 @dx.op.rawBufferVectorLoad.v2i32(i32 303, %dx.types.Handle %{{[0-9]+}}, i32 512, i32 undef, i32 4) + // CHECK-SAME: ; RawBufferVectorLoad(buf,index,elementOffset,alignment) + // CHECK-NEXT: %[[MEM_BIAS_PACKED2:.*]] = extractvalue %dx.types.ResRet.v2i32 %[[LOAD5]], 0 + // CHECK-NEXT: %[[MEM_BIAS_CONV_PADDED2:.*]] = call <8 x half> @dx.op.linAlgConvert.v8f16.v2i32(i32 -2147483618, + // CHECK-SAME: <2 x i32> %[[MEM_BIAS_PACKED2]], i32 21, i32 8) ; LinAlgConvert(inputVector,inputInterpretation,outputInterpretation) + // CHECK-NEXT: %[[MEM_BIAS_CONV2:.*]] = shufflevector <8 x half> %[[MEM_BIAS_CONV_PADDED2]], <8 x half> undef, <7 x i32> + // CHECK-NEXT: call <7 x half> @dx.op.linAlgMatVecMulAdd.v7f16.mC21M7N15U0S0.v4i32.v7f16(i32 -2147483622, + // CHECK-SAME: %dx.types.LinAlgMatrixC21M7N15U0S0 %[[MAT_7_15_PACKED]], i1 true, <4 x i32> %[[INTERP_VEC_H15_PACKED]], i32 21, <7 x half> %[[MEM_BIAS_CONV2]], i32 8) + // CHECK-SAME: ; LinAlgMatVecMulAdd(matrix,isOutputSigned,inputVector,inputInterpretation,biasVector,biasInterpretation) + vector vec24 = MultiplyAdd(Mat_7_15_Packed, interpVecH15Packed, memBias7Packed); + + // CHECK: call void @dx.op.linAlgVectorAccumulateToDescriptor.v4f16(i32 -2147483617, <4 x half> + // CHECK-SAME: , %dx.types.Handle %{{[0-9]+}}, i32 0, i32 64) + // CHECK-SAME: ; LinAlgVectorAccumulateToDescriptor(vector,handle,offset,align) + InterlockedAccumulate(RWBAB, vec1, 0); + + // CHECK: call void @dx.op.linAlgVectorAccumulateToDescriptor.v8f16(i32 -2147483617, <8 x half> %{{[0-9]+}}, + // CHECK-SAME: %dx.types.Handle %{{[0-9]+}}, i32 8, i32 64) ; LinAlgVectorAccumulateToDescriptor(vector,handle,offset,align) + InterlockedAccumulate(RWBAB, vec2, 8); } diff --git a/tools/clang/test/CodeGenDXIL/hlsl/linalg/builtins/vectoraccumulatetodescriptor/nominal.hlsl b/tools/clang/test/CodeGenDXIL/hlsl/linalg/builtins/vectoraccumulatetodescriptor/nominal.hlsl new file mode 100644 index 0000000000..b10ca59831 --- /dev/null +++ b/tools/clang/test/CodeGenDXIL/hlsl/linalg/builtins/vectoraccumulatetodescriptor/nominal.hlsl @@ -0,0 +1,19 @@ +// REQUIRES: dxil-1-10 +// RUN: %dxc -T cs_6_10 -HV 202x -E main %s | FileCheck %s +// RUN: %dxc -T cs_6_10 -HV 202x -E main -fcgl %s | FileCheck %s --check-prefix=CHECK2 + +RWByteAddressBuffer outbuf; + +[numthreads(4,1,1)] +void main() { + // CHECK-LABEL: define void @main() + + // CHECK: call void @dx.op.linAlgVectorAccumulateToDescriptor.v4f32(i32 -2147483617, <4 x float> + // CHECK-SAME: , %dx.types.Handle %{{.*}}, i32 16, i32 64) + // CHECK-SAME: ; LinAlgVectorAccumulateToDescriptor(vector,handle,offset,align) + + // CHECK2: call void @"dx.hl.op..void (i32, <4 x float>, %dx.types.Handle, i32, i32)" + // CHECK2-SAME: (i32 423, <4 x float> %{{.*}}, %dx.types.Handle %{{.*}}, i32 16, i32 64) + float4 vec = {9.0, 8.0, 7.0, 6.0}; + __builtin_LinAlg_VectorAccumulateToDescriptor(vec, outbuf, 16, 64); +} diff --git a/tools/clang/test/CodeGenSPIRV/inline-spirv/spv.inline.decorate.member.hlsl b/tools/clang/test/CodeGenSPIRV/inline-spirv/spv.inline.decorate.member.hlsl index 88a902d326..719be2df64 100644 --- a/tools/clang/test/CodeGenSPIRV/inline-spirv/spv.inline.decorate.member.hlsl +++ b/tools/clang/test/CodeGenSPIRV/inline-spirv/spv.inline.decorate.member.hlsl @@ -40,9 +40,9 @@ PixelOutput main() PointerType ptr = Bitcast(address); PixelOutput output; -// CHECK: [[LD:%[0-9]+]] = OpLoad %S [[BC]] Aligned 32 -// CHECK: [[RET:%[0-9]+]] = OpCompositeExtract %v4float [[LD]] 0 -// CHECK: OpStore %out_var_SV_TARGET [[RET]] +// CHECK: [[AC:%[0-9]+]] = OpAccessChain %_ptr_PhysicalStorageBuffer_v4float [[BC]] %uint_0 +// CHECK: [[LD:%[0-9]+]] = OpLoad %v4float [[AC]] Aligned 32 +// CHECK: OpStore %out_var_SV_TARGET [[LD]] output.rt0 = Load(ptr).f1; return output; } diff --git a/tools/clang/test/CodeGenSPIRV/sm6_6.descriptorheap.return.counter.nested.call.hlsl b/tools/clang/test/CodeGenSPIRV/sm6_6.descriptorheap.return.counter.nested.call.hlsl new file mode 100644 index 0000000000..5a7d177e47 --- /dev/null +++ b/tools/clang/test/CodeGenSPIRV/sm6_6.descriptorheap.return.counter.nested.call.hlsl @@ -0,0 +1,27 @@ +// RUN: %dxc -T cs_6_6 -E main -O3 %s -spirv | FileCheck %s + +RWStructuredBuffer GetBindlessResource_UIntBuffer_inner() { + return ResourceDescriptorHeap[1]; +} + +RWStructuredBuffer GetBindlessResource_UIntBuffer_outter() { + return GetBindlessResource_UIntBuffer_inner(); +} + +RWStructuredBuffer GetBindlessResource_UIntBuffer() { + return ResourceDescriptorHeap[0]; +} + +[numthreads(1, 1, 1)] +void main() { + RWStructuredBuffer a = GetBindlessResource_UIntBuffer(); + RWStructuredBuffer b = GetBindlessResource_UIntBuffer_outter(); +// CHECK-DAG: [[counter_a:%[0-9]+]] = OpAccessChain %_ptr_Uniform_int %counter_var_ResourceDescriptorHeap %uint_0 %uint_0 +// CHECK-DAG: [[counter_b:%[0-9]+]] = OpAccessChain %_ptr_Uniform_int %counter_var_ResourceDescriptorHeap %uint_1 %uint_0 + + a.IncrementCounter(); + b.IncrementCounter(); + +// CHECK-DAG: {{%[0-9]+}} = OpAtomicIAdd %int [[counter_a]] %uint_1 %uint_0 %int_1 +// CHECK-DAG: {{%[0-9]+}} = OpAtomicIAdd %int [[counter_b]] %uint_1 %uint_0 %int_1 +} diff --git a/tools/clang/test/CodeGenSPIRV/spirv.legal.sbuffer.usage.hlsl b/tools/clang/test/CodeGenSPIRV/spirv.legal.sbuffer.usage.hlsl index a123809d6b..3756424f10 100644 --- a/tools/clang/test/CodeGenSPIRV/spirv.legal.sbuffer.usage.hlsl +++ b/tools/clang/test/CodeGenSPIRV/spirv.legal.sbuffer.usage.hlsl @@ -87,6 +87,6 @@ float4 useAsStaticRWSBuffer() { // CHECK: %paramRWSBuffer = OpFunctionParameter %_ptr_Function__ptr_Uniform_type_RWStructuredBuffer_S RWStructuredBuffer returnRWSBuffer(RWStructuredBuffer paramRWSBuffer) { // CHECK: [[ptr_1:%[0-9]+]] = OpLoad %_ptr_Uniform_type_RWStructuredBuffer_S %paramRWSBuffer -// CHECK-NEXT: OpReturnValue [[ptr_1]] +// CHECK: OpReturnValue [[ptr_1]] return paramRWSBuffer; } diff --git a/tools/clang/test/CodeGenSPIRV/type.rwstructured-buffer.return.counter.hlsl b/tools/clang/test/CodeGenSPIRV/type.rwstructured-buffer.return.counter.hlsl new file mode 100644 index 0000000000..7815c5f421 --- /dev/null +++ b/tools/clang/test/CodeGenSPIRV/type.rwstructured-buffer.return.counter.hlsl @@ -0,0 +1,28 @@ +// RUN: %dxc -T cs_6_6 -E main -O3 %s -spirv | FileCheck %s + +RWStructuredBuffer resource; + +RWStructuredBuffer get_resource_inner() { + return resource; +} + +RWStructuredBuffer get_resource_outter() { + return get_resource_inner(); +} + +RWStructuredBuffer get_resource() { + return resource; +} + +[numthreads(1, 1, 1)] +void main() { + RWStructuredBuffer a = get_resource(); + RWStructuredBuffer b = get_resource_outter(); +// CHECK-DAG: [[counter:%[0-9]+]] = OpAccessChain %_ptr_Uniform_int %counter_var_resource %uint_0 + + a.IncrementCounter(); + b.IncrementCounter(); + +// CHECK-DAG: {{%[0-9]+}} = OpAtomicIAdd %int [[counter]] %uint_1 %uint_0 %int_1 +// CHECK-DAG: {{%[0-9]+}} = OpAtomicIAdd %int [[counter]] %uint_1 %uint_0 %int_1 +} diff --git a/tools/clang/test/CodeGenSPIRV/vk.binding.global-struct-of-resources.optimized.hlsl b/tools/clang/test/CodeGenSPIRV/vk.binding.global-struct-of-resources.optimized.hlsl index 1656e7f50f..e442f75bc2 100644 --- a/tools/clang/test/CodeGenSPIRV/vk.binding.global-struct-of-resources.optimized.hlsl +++ b/tools/clang/test/CodeGenSPIRV/vk.binding.global-struct-of-resources.optimized.hlsl @@ -135,9 +135,10 @@ S secondGlobal; float4 main() : SV_Target { return -// CHECK: [[fg_0_0_t:%[0-9]+]] = OpLoad %_arr_type_2d_image_uint_2 %[[fg0]] -// CHECK: [[fg_1_t_0:%[0-9]+]] = OpCompositeExtract %type_2d_image [[fg_0_0_t]] 0 -// CHECK: [[fg_1_t_1:%[0-9]+]] = OpCompositeExtract %type_2d_image [[fg_0_0_t]] 1 +// CHECK: [[ac_0_0_t0:%[0-9]+]] = OpAccessChain %_ptr_UniformConstant_type_2d_image %[[fg0]] %uint_0 +// CHECK: [[fg_1_t_0:%[0-9]+]] = OpLoad %type_2d_image [[ac_0_0_t0]] +// CHECK: [[ac_0_0_t1:%[0-9]+]] = OpAccessChain %_ptr_UniformConstant_type_2d_image %[[fg0]] %uint_1 +// CHECK: [[fg_1_t_1:%[0-9]+]] = OpLoad %type_2d_image [[ac_0_0_t1]] // CHECK: [[tmp:%[0-9]+]] = OpAccessChain %_ptr_UniformConstant_type_sampler %[[fgtt0_0]] %uint_1 // CHECK: [[fg_1_tt_0_s_1:%[0-9]+]] = OpLoad %type_sampler [[tmp]] // CHECK: [[tmp:%[0-9]+]] = OpAccessChain %_ptr_UniformConstant_type_sampler %[[fgtt0_1]] %uint_2 @@ -149,9 +150,10 @@ float4 main() : SV_Target { // CHECK: OpFAdd tex2D(firstGlobal[0][0], float2(0,0)) + -// CHECK: [[fg_0_1_t:%[0-9]+]] = OpLoad %_arr_type_2d_image_uint_2 %[[fg1]] -// CHECK: [[fg_0_1_t_0:%[0-9]+]] = OpCompositeExtract %type_2d_image [[fg_0_1_t]] 0 -// CHECK: [[fg_0_1_t_1:%[0-9]+]] = OpCompositeExtract %type_2d_image [[fg_0_1_t]] 1 +// CHECK: [[ac_0_1_t0:%[0-9]+]] = OpAccessChain %_ptr_UniformConstant_type_2d_image %[[fg1]] %uint_0 +// CHECK: [[fg_0_1_t_0:%[0-9]+]] = OpLoad %type_2d_image [[ac_0_1_t0]] +// CHECK: [[ac_0_1_t1:%[0-9]+]] = OpAccessChain %_ptr_UniformConstant_type_2d_image %[[fg1]] %uint_1 +// CHECK: [[fg_0_1_t_1:%[0-9]+]] = OpLoad %type_2d_image [[ac_0_1_t1]] // CHECK: [[tmp:%[0-9]+]] = OpAccessChain %_ptr_UniformConstant_type_sampler %[[fgtt1_0]] %uint_1 // CHECK: [[fg_0_1_tt_0_s_1:%[0-9]+]] = OpLoad %type_sampler [[tmp]] // CHECK: [[tmp:%[0-9]+]] = OpAccessChain %_ptr_UniformConstant_type_sampler %[[fgtt1_1]] %uint_2 @@ -162,9 +164,10 @@ float4 main() : SV_Target { // CHECK: {{%[0-9]+}} = OpImageSampleImplicitLod %v4float [[sampled_img_4]] // CHECK: OpFAdd tex2D(firstGlobal[0][1], float2(0,0)) + -// CHECK: [[fg_1_0_t:%[0-9]+]] = OpLoad %_arr_type_2d_image_uint_2 %[[fg2]] -// CHECK: [[fg_1_0_t_0:%[0-9]+]] = OpCompositeExtract %type_2d_image [[fg_1_0_t]] 0 -// CHECK: [[fg_1_0_t_1:%[0-9]+]] = OpCompositeExtract %type_2d_image [[fg_1_0_t]] 1 +// CHECK: [[ac_1_0_t0:%[0-9]+]] = OpAccessChain %_ptr_UniformConstant_type_2d_image %[[fg2]] %uint_0 +// CHECK: [[fg_1_0_t_0:%[0-9]+]] = OpLoad %type_2d_image [[ac_1_0_t0]] +// CHECK: [[ac_1_0_t1:%[0-9]+]] = OpAccessChain %_ptr_UniformConstant_type_2d_image %[[fg2]] %uint_1 +// CHECK: [[fg_1_0_t_1:%[0-9]+]] = OpLoad %type_2d_image [[ac_1_0_t1]] // CHECK: [[tmp:%[0-9]+]] = OpAccessChain %_ptr_UniformConstant_type_sampler %[[fgtt2_0]] %uint_1 // CHECK: [[fg_1_0_tt_0_s_1:%[0-9]+]] = OpLoad %type_sampler [[tmp]] // CHECK: [[tmp:%[0-9]+]] = OpAccessChain %_ptr_UniformConstant_type_sampler %[[fgtt2_1]] %uint_2 @@ -175,9 +178,10 @@ float4 main() : SV_Target { // CHECK: {{%[0-9]+}} = OpImageSampleImplicitLod %v4float [[sampled_img_6]] // CHECK: OpFAdd tex2D(firstGlobal[1][0], float2(0,0)) + -// CHECK: [[fg_1_1_t:%[0-9]+]] = OpLoad %_arr_type_2d_image_uint_2 %[[fg3]] -// CHECK: [[fg_1_1_t_0:%[0-9]+]] = OpCompositeExtract %type_2d_image [[fg_1_1_t]] 0 -// CHECK: [[fg_1_1_t_1:%[0-9]+]] = OpCompositeExtract %type_2d_image [[fg_1_1_t]] 1 +// CHECK: [[ac_1_1_t0:%[0-9]+]] = OpAccessChain %_ptr_UniformConstant_type_2d_image %[[fg3]] %uint_0 +// CHECK: [[fg_1_1_t_0:%[0-9]+]] = OpLoad %type_2d_image [[ac_1_1_t0]] +// CHECK: [[ac_1_1_t1:%[0-9]+]] = OpAccessChain %_ptr_UniformConstant_type_2d_image %[[fg3]] %uint_1 +// CHECK: [[fg_1_1_t_1:%[0-9]+]] = OpLoad %type_2d_image [[ac_1_1_t1]] // CHECK: [[tmp:%[0-9]+]] = OpAccessChain %_ptr_UniformConstant_type_sampler %[[fgtt3_0]] %uint_1 // CHECK: [[fg_1_1_tt_0_s_1:%[0-9]+]] = OpLoad %type_sampler [[tmp]] // CHECK: [[tmp:%[0-9]+]] = OpAccessChain %_ptr_UniformConstant_type_sampler %[[fgtt3_1]] %uint_2 diff --git a/tools/clang/test/CodeGenSPIRV/vk.buffer-pointer.casts.hlsl b/tools/clang/test/CodeGenSPIRV/vk.buffer-pointer.casts.hlsl new file mode 100644 index 0000000000..9481aa2b68 --- /dev/null +++ b/tools/clang/test/CodeGenSPIRV/vk.buffer-pointer.casts.hlsl @@ -0,0 +1,45 @@ +// RUN: %dxc -T cs_6_6 -spirv -fspv-target-env=vulkan1.3 %s | FileCheck %s --check-prefix=GOOD +// RUN: not %dxc -T cs_6_6 -spirv -fspv-target-env=vulkan1.3 -DBAD %s 2>&1 | FileCheck %s --check-prefix=BAD + +struct Base { +}; + +struct Derived : Base { + int val; +}; + +cbuffer Test { + vk::BufferPointer derivedBuf; + vk::BufferPointer intBuf; +}; + +[shader("compute")] +[numthreads(256, 1, 1)] +void main(in uint3 threadId : SV_DispatchThreadID) { +#ifdef BAD + vk::BufferPointer derivedBufAsBase = vk::static_pointer_cast(derivedBuf); + vk::BufferPointer intBufAsFloat = vk::static_pointer_cast(intBuf); +#else + vk::BufferPointer derivedBufAsBase = vk::static_pointer_cast(derivedBuf); + vk::BufferPointer intBufAsFloat = vk::reinterpret_pointer_cast(intBuf); +#endif + + intBuf.Get() = (int)intBufAsFloat.Get(); +} + +// GOOD: [[INT:%[^ ]*]] = OpTypeInt 32 1 +// GOOD: [[I1:%[^ ]*]] = OpConstant [[INT]] 1 +// GOOD: [[PINT:%[^ ]*]] = OpTypePointer PhysicalStorageBuffer [[INT]] +// GOOD: [[FLOAT:%[^ ]*]] = OpTypeFloat 32 +// GOOD: [[PFLOAT:%[^ ]*]] = OpTypePointer PhysicalStorageBuffer [[FLOAT]] +// GOOD: %Test = OpVariable %{{[^ ]*}} Uniform +// GOOD: [[V0:%[^ ]*]] = OpAccessChain %{{[^ ]*}} %Test [[I1]] +// GOOD: [[V1:%[^ ]*]] = OpLoad [[PINT]] [[V0]] +// GOOD: [[V2:%[^ ]*]] = OpBitcast [[PFLOAT]] [[V1]] +// GOOD: [[V3:%[^ ]*]] = OpLoad [[FLOAT]] [[V2]] Aligned 4 +// GOOD: [[V4:%[^ ]*]] = OpConvertFToS [[INT]] [[V3]] +// GOOD: OpStore [[V1]] [[V4]] Aligned 4 + +// BAD: error: Vulkan buffer pointer cannot be cast to greater alignment +// BAD: error: vk::static_pointer_cast() content type must be base class of argument's content type + diff --git a/tools/clang/test/CodeGenSPIRV/vk.buffer-pointer.initlist.hlsl b/tools/clang/test/CodeGenSPIRV/vk.buffer-pointer.initlist.hlsl index e872da1f6c..2dad04505c 100644 --- a/tools/clang/test/CodeGenSPIRV/vk.buffer-pointer.initlist.hlsl +++ b/tools/clang/test/CodeGenSPIRV/vk.buffer-pointer.initlist.hlsl @@ -11,12 +11,11 @@ cbuffer Test { [numthreads(256, 1, 1)] void main(in uint3 threadId : SV_DispatchThreadID) { -// CHECK: [[LD:%[_0-9A-Za-z]*]] = OpLoad %_ptr_PhysicalStorageBuffer_float -// CHECK: [[CC:%[_0-9A-Za-z]*]] = OpCompositeConstruct {{%[_0-9A-Za-z]*}} [[LD]] +// CHECK: [[AC:%[_0-9A-Za-z]*]] = OpAccessChain %_ptr_Uniform__ptr_PhysicalStorageBuffer_float %Test %int_0 +// CHECK: [[PTR:%[_0-9A-Za-z]*]] = OpLoad %_ptr_PhysicalStorageBuffer_float [[AC]] BufferAccessor accessor = BufferAccessor(buffer); -// CHECK: [[COPY:%[_0-9A-Za-z]*]] = OpCopyLogical {{%[_0-9A-Za-z]*}} [[CC]] -// CHECK: [[PTR:%[_0-9A-Za-z]*]] = OpCompositeExtract %_ptr_PhysicalStorageBuffer_float [[COPY]] 0 -// CHECK: OpLoad %float [[PTR]] Aligned 4 +// CHECK: [[VAL:%[_0-9A-Za-z]*]] = OpLoad %float [[PTR]] Aligned 4 +// CHECK: OpStore [[PTR]] [[VAL]] Aligned 4 buffer.Get() = accessor.ptr.Get(); } diff --git a/tools/clang/test/CodeGenSPIRV/vk.buffer-pointer.linked-list.hlsl b/tools/clang/test/CodeGenSPIRV/vk.buffer-pointer.linked-list.hlsl index 75380d3f4e..4f12218783 100644 --- a/tools/clang/test/CodeGenSPIRV/vk.buffer-pointer.linked-list.hlsl +++ b/tools/clang/test/CodeGenSPIRV/vk.buffer-pointer.linked-list.hlsl @@ -53,8 +53,7 @@ struct TestPushConstant_t float4 MainPs(void) : SV_Target0 { if (__has_feature(hlsl_vk_buffer_pointer)) { - [[vk::aliased_pointer]] block_p g_p = - vk::static_pointer_cast(g_PushConstants.root); + [[vk::aliased_pointer]] block_p g_p = g_PushConstants.root; g_p = g_p.Get().next; uint64_t addr = (uint64_t)g_p; block_p copy1 = block_p(addr); diff --git a/tools/clang/test/HLSL/cpp-errors-hv2015.hlsl b/tools/clang/test/HLSL/cpp-errors-hv2015.hlsl index 7312eb4ac2..57c512741c 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 {{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}} void fn_throw() throw() { } // expected-error {{exception specification is unsupported in HLSL}} @@ -94,10 +94,10 @@ typename typedef float4 TFloat4; // expected-error {{'typename' is a reserved ke class C { int fn_eq_default() = default; // expected-error {{function deletion and defaulting is unsupported in HLSL}} - // Errors are a bit misleading here, but ultimate we don't support these. - void* operator new(); // expected-error {{'operator' is a reserved keyword in HLSL}} expected-error {{pointers are unsupported in HLSL}} - void* operator new(int); // expected-error {{'operator' is a reserved keyword in HLSL}} expected-error {{pointers are unsupported in HLSL}} - void* operator new(size_t); // expected-error {{'operator' is a reserved keyword in HLSL}} expected-error {{pointers are unsupported in HLSL}} + // Pointer return type is no longer caught at parse time; operator keyword error is still reported. + void* operator new(); // expected-error {{'operator' is a reserved keyword in HLSL}} + void* operator new(int); // expected-error {{'operator' is a reserved keyword in HLSL}} + void* operator new(size_t); // expected-error {{'operator' is a reserved keyword in HLSL}} C() = delete; // expected-error {{HLSL requires a type specifier for all declarations}} expected-error {{constructor cannot have a return type}} }; diff --git a/tools/clang/test/HLSL/cpp-errors.hlsl b/tools/clang/test/HLSL/cpp-errors.hlsl index 7b2c96c4d5..bee34d249b 100644 --- a/tools/clang/test/HLSL/cpp-errors.hlsl +++ b/tools/clang/test/HLSL/cpp-errors.hlsl @@ -33,6 +33,7 @@ _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}} @@ -56,7 +57,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 {{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}} void fn_throw() throw() { } // expected-error {{exception specification is unsupported in HLSL}} @@ -90,10 +91,10 @@ typename typedef float4 TFloat4; // expected-error {{'typename' is a reserved ke class C { int fn_eq_default() = default; // expected-error {{function deletion and defaulting is unsupported in HLSL}} - // Errors are a bit misleading here, but ultimate we don't support these. - void* operator new(); // expected-error {{'operator' is a reserved keyword in HLSL}} expected-error {{pointers are unsupported in HLSL}} - void* operator new(int); // expected-error {{'operator' is a reserved keyword in HLSL}} expected-error {{pointers are unsupported in HLSL}} - void* operator new(size_t); // expected-error {{'operator' is a reserved keyword in HLSL}} expected-error {{pointers are unsupported in HLSL}} + // Pointer return type is no longer caught at parse time; operator keyword error is still reported. + void* operator new(); // expected-error {{'operator' is a reserved keyword in HLSL}} + void* operator new(int); // expected-error {{'operator' is a reserved keyword in HLSL}} + void* operator new(size_t); // expected-error {{'operator' is a reserved keyword in HLSL}} C() = delete; // expected-error {{HLSL requires a type specifier for all declarations}} expected-error {{constructor cannot have a return type}} }; 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 b62daecb5c..2432bbcaae 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,11 +37,7 @@ 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; @@ -222,22 +218,12 @@ 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 0f8f143d00..b0e205a869 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; -typedef precise volatile const float2 t_pre_vol_con; +//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 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; -typedef volatile const float2 t_vol_con; +//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 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; - precise static volatile const float l_pre_sta_vol_con; + //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 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; - //precise volatile const float l_pre_vol_con; /* fxc-error {{X3012: 'l_pre_vol_con': missing initial value}} */ + //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 const float l_pre_con; /* fxc-error {{X3012: 'l_pre_con': missing initial value}} */ static float l_sta; - static volatile float l_sta_vol; - static volatile const float l_sta_vol_con; + //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 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; - //volatile const float l_vol_con; /* fxc-error {{X3012: 'l_vol_con': missing initial value}} */ + //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}} */ //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; + //precise static volatile const float l_pre_sta_vol_con_init = 0.0; /* expected-error {{'volatile' is a reserved keyword in HLSL}} */ 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; + //precise volatile const float l_pre_vol_con_init = 0.0; /* expected-error {{'volatile' is a reserved keyword in HLSL}} */ precise const float l_pre_con_init = 0.0; - static volatile const float l_sta_vol_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 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; + //volatile const float l_vol_con_init = 0.0; /* expected-error {{'volatile' is a reserved keyword in HLSL}} */ 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 fa2c367051..1ec583e9f7 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 volatile const'.split() +storage_mods = 'groupshared extern precise static uniform const'.split() bad_storage_combos = [('groupshared', 'extern'), ('extern', 'static'), ('static', 'uniform')] @@ -127,11 +127,7 @@ 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 @@ -294,26 +290,16 @@ 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 @@ -378,4 +364,4 @@ class C // GENERATED_CODE:END -}; \ No newline at end of file +}; diff --git a/tools/clang/test/HLSLFileCheck/passes/llvm/simplifycfg/dxil_switch_bitmap_avoids_int64.ll b/tools/clang/test/HLSLFileCheck/passes/llvm/simplifycfg/dxil_switch_bitmap_avoids_int64.ll new file mode 100644 index 0000000000..4b94f9f530 --- /dev/null +++ b/tools/clang/test/HLSLFileCheck/passes/llvm/simplifycfg/dxil_switch_bitmap_avoids_int64.ll @@ -0,0 +1,69 @@ +; RUN: %opt %s -simplifycfg -S | FileCheck %s +; +; Companion test for https://github.com/microsoft/DirectXShaderCompiler/issues/8421 +; +; A switch with 33 boolean cases would naively build an i33 bitmap. Rounding up +; to i64 would emit i64 ops and silently set the Int64Ops shader flag, so the +; bitmap optimization is capped at 32 bits and the switch is preserved instead. + +target datalayout = "e-m:e-p:32:32-i1:32-i8:32-i16:32-i32:32-i64:64-f16:32-f32:32-f64:64-n8:16:32:64" +target triple = "dxil-ms-dx" + +; CHECK-LABEL: @switch_bool_33_cases +; CHECK-NOT: i33 +; CHECK-NOT: lshr i64 +; CHECK-NOT: trunc i64 +; CHECK: switch i32 +; CHECK: ret i1 + +define i1 @switch_bool_33_cases(i32 %x) { +entry: + switch i32 %x, label %default [ + i32 1, label %case_true + i32 2, label %case_true + i32 3, label %case_false + i32 4, label %case_true + i32 5, label %case_false + i32 6, label %case_true + i32 7, label %case_true + i32 8, label %case_false + i32 9, label %case_false + i32 10, label %case_true + i32 11, label %case_true + i32 12, label %case_false + i32 13, label %case_true + i32 14, label %case_false + i32 15, label %case_true + i32 16, label %case_true + i32 17, label %case_false + i32 18, label %case_true + i32 19, label %case_false + i32 20, label %case_false + i32 21, label %case_true + i32 22, label %case_true + i32 23, label %case_false + i32 24, label %case_true + i32 25, label %case_false + i32 26, label %case_true + i32 27, label %case_false + i32 28, label %case_true + i32 29, label %case_true + i32 30, label %case_false + i32 31, label %case_true + i32 32, label %case_false + i32 33, label %case_true + ] + +case_true: + br label %end + +case_false: + br label %end + +default: + br label %end + +end: + %result = phi i1 [ true, %case_true ], [ false, %case_false ], [ false, %default ] + ret i1 %result +} diff --git a/tools/clang/test/HLSLFileCheck/passes/llvm/simplifycfg/dxil_switch_bitmap_legal_types.ll b/tools/clang/test/HLSLFileCheck/passes/llvm/simplifycfg/dxil_switch_bitmap_legal_types.ll new file mode 100644 index 0000000000..96d7f26b63 --- /dev/null +++ b/tools/clang/test/HLSLFileCheck/passes/llvm/simplifycfg/dxil_switch_bitmap_legal_types.ll @@ -0,0 +1,176 @@ +; RUN: %opt %s -simplifycfg -S | FileCheck %s +; +; Regression test for https://github.com/microsoft/DirectXShaderCompiler/issues/8421 +; +; SimplifyCFG's switch-to-lookup-table built bitmaps of width +; "TableSize * ValueBitWidth", producing illegal widths like i9, i17, i26 or +; i48. The fix rounds the bitmap up to i16 or i32, and skips the lookup table +; entirely if the bitmap would exceed 32 bits. + +target datalayout = "e-m:e-p:32:32-i1:32-i8:32-i16:32-i32:32-i64:64-f16:32-f32:32-f64:64-n8:16:32:64" +target triple = "dxil-ms-dx" + +; 5 boolean cases with mixed values would naively build an i5 bitmap; rounded +; to i16 by the fix. +; +; CHECK-LABEL: @switch_bool_5_cases +; CHECK: switch.lookup: +; CHECK: lshr i16 +; CHECK-NOT: i5 +; CHECK: ret i1 + +define i1 @switch_bool_5_cases(i32 %x) { +entry: + switch i32 %x, label %default [ + i32 0, label %case_t + i32 1, label %case_t + i32 2, label %case_f + i32 3, label %case_t + i32 4, label %case_f + ] + +case_t: + br label %end + +case_f: + br label %end + +default: + br label %end + +end: + %result = phi i1 [ true, %case_t ], [ false, %case_f ], [ false, %default ] + ret i1 %result +} + +; 9 boolean cases would naively build an i9 bitmap; rounded to i16 by the fix. +; +; CHECK-LABEL: @switch_bool_9_cases +; CHECK: switch.lookup: +; CHECK: lshr i16 +; CHECK-NOT: i9 +; CHECK: ret i1 + +define i1 @switch_bool_9_cases(i32 %x) { +entry: + switch i32 %x, label %default [ + i32 0, label %case_true + i32 1, label %case_true + i32 3, label %case_true + i32 4, label %case_true + i32 5, label %case_true + i32 6, label %case_true + i32 7, label %case_true + i32 8, label %case_true + ] + +case_true: + br label %end + +default: + br label %end + +end: + %result = phi i1 [ true, %case_true ], [ false, %default ] + ret i1 %result +} + +; 17 boolean cases would naively build an i17 bitmap; rounded to i32 by the +; fix. +; +; CHECK-LABEL: @switch_bool_17_cases +; CHECK: switch.lookup: +; CHECK: lshr i32 +; CHECK-NOT: i17 +; CHECK: ret i1 + +define i1 @switch_bool_17_cases(i32 %x) { +entry: + switch i32 %x, label %default [ + i32 0, label %case_true + i32 1, label %case_true + i32 3, label %case_true + i32 4, label %case_true + i32 5, label %case_true + i32 7, label %case_true + i32 8, label %case_true + i32 10, label %case_true + i32 11, label %case_true + i32 12, label %case_true + i32 14, label %case_true + i32 15, label %case_true + i32 16, label %case_true + ] + +case_true: + br label %end + +default: + br label %end + +end: + %result = phi i1 [ true, %case_true ], [ false, %default ] + ret i1 %result +} + +; 26 boolean cases (the original #8421 repro) would naively build an i26 +; bitmap; rounded to i32 by the fix. +; +; CHECK-LABEL: @switch_bool_26_cases +; CHECK: switch.lookup: +; CHECK: lshr i32 +; CHECK-NOT: i26 +; CHECK: ret i1 + +define i1 @switch_bool_26_cases(i32 %x) { +entry: + switch i32 %x, label %default [ + i32 1, label %case_true + i32 6, label %case_true + i32 11, label %case_true + i32 16, label %case_true + i32 21, label %case_true + i32 26, label %case_true + ] + +case_true: + br label %end + +default: + br label %end + +end: + %result = phi i1 [ true, %case_true ], [ false, %default ] + ret i1 %result +} + +; Non-i1 result: 3 i16 cases would naively build an i48 bitmap. The fix makes +; bitmaps wider than 32 bits skip the lookup table; the original switch is +; preserved. +; +; CHECK-LABEL: @switch_i16_3_cases +; CHECK: switch i32 +; CHECK-NOT: switch.lookup +; CHECK-NOT: i48 +; CHECK: ret i16 + +define i16 @switch_i16_3_cases(i32 %x) { +entry: + switch i32 %x, label %default [ + i32 0, label %c0 + i32 1, label %c1 + i32 2, label %c2 + ] + +c0: br label %end +c1: br label %end +c2: br label %end +default: br label %end + +end: + ; Non-linear values prevent the LinearMap fast path so the bitmap path is + ; the one that would have been chosen, but since this would want to use an i48 + ; (which isn't valid in DXIL) the switch is preserved. + %result = phi i16 [ 73, %c0 ], [ 42, %c1 ], [ 88, %c2 ], [ 0, %default ] + ret i16 %result +} diff --git a/tools/clang/test/LitDXILValidation/LinAlgMatrix/linalgmatrix-as.ll b/tools/clang/test/LitDXILValidation/LinAlgMatrix/linalgmatrix-as.ll index 297dd692f5..47c2f48629 100644 --- a/tools/clang/test/LitDXILValidation/LinAlgMatrix/linalgmatrix-as.ll +++ b/tools/clang/test/LitDXILValidation/LinAlgMatrix/linalgmatrix-as.ll @@ -33,7 +33,7 @@ target triple = "dxil-ms-dx" @"\01?SharedArr@@3PAMA" = external addrspace(3) global [64 x float], align 4 define void @mainAS() { - + %1 = call %dx.types.Handle @dx.op.createHandleFromBinding(i32 217, %dx.types.ResBind { i32 0, i32 0, i32 0, i8 1 }, i32 0, i1 false) ; CreateHandleFromBinding(bind,index,nonUniformIndex) %handle = call %dx.types.Handle @dx.op.annotateHandle(i32 216, %dx.types.Handle %1, %dx.types.ResourceProperties { i32 4107, i32 0 }) ; AnnotateHandle(res,props) resource: RWByteAddressBuffer @@ -43,71 +43,74 @@ define void @mainAS() { ; dx.op.linAlgMatrixAccumulate %v1 = call %dx.types.LinAlgMatrixC4M5N4U2S2 @dx.op.linAlgMatrixAccumulate.mC4M5N4U2S2.mC4M5N4U0S2.mC4M4N5U1S2(i32 -2147483624, %dx.types.LinAlgMatrixC4M5N4U0S2 undef, %dx.types.LinAlgMatrixC4M4N5U1S2 undef) ; LinAlgMatrixAccumulate(matrixLHS,matrixRHS) - + ; dx.op.linAlgMatrixAccumulateToDescriptor call void @dx.op.linAlgMatrixAccumulateToDescriptor.mC4M5N4U0S2(i32 -2147483621, %dx.types.LinAlgMatrixC4M5N4U0S2 undef, %dx.types.Handle %handle, i32 1, i32 2, i32 3, i32 4) ; LinAlgMatrixAccumulateToDescriptor(matrix,handle,offset,stride,layout,align) - + ; dx.op.linAlgMatrixLength %v2 = call i32 @dx.op.linAlgMatrixLength.mC4M5N4U0S2(i32 -2147483632, %dx.types.LinAlgMatrixC4M5N4U0S2 undef) ; LinAlgMatrixLength(matrix) - + ; dx.op.linAlgMatrixLoadFromDescriptor %v3 = call %dx.types.LinAlgMatrixC4M5N4U0S2 @dx.op.linAlgMatrixLoadFromDescriptor.mC4M5N4U0S2(i32 -2147483634, %dx.types.Handle %handle, i32 5, i32 5, i32 5, i32 4) ; LinAlgMatrixLoadFromDescriptor(handle,offset,stride,layout,align) - + ; dx.op.linAlgMatrixOuterProduct %v4 = call %dx.types.LinAlgMatrixC4M5N4U0S2 @dx.op.linAlgMatrixOuterProduct.mC4M5N4U0S2.v4i32.v4i32(i32 -2147483619, <4 x i32> , <4 x i32> ) ; LinAlgMatrixOuterProduct(vectorA,vectorB) - + ; dx.op.linAlgMatrixQueryAccumulatorLayout %v5 = call i32 @dx.op.linAlgMatrixQueryAccumulatorLayout(i32 -2147483626) ; LinAlgMatrixQueryAccumulatorLayout() - + ; dx.op.linAlgMatVecMul %v6 = call <4 x i32> @dx.op.linAlgMatVecMul.v4i32.mC4M5N4U0S2.v4i32(i32 -2147483623, %dx.types.LinAlgMatrixC4M5N4U0S2 %v4, i1 true, <4 x i32> , i32 1) ; LinAlgMatVecMul(matrix,isOutputSigned,inputVector,interpretation) - + ; dx.op.linAlgMatVecMulAdd %v7 = call <4 x i32> @dx.op.linAlgMatVecMulAdd.v4i32.mC4M5N4U0S2.v4i32.v4i32(i32 -2147483622, %dx.types.LinAlgMatrixC4M5N4U0S2 %v4, i1 true, <4 x i32> , i32 2, <4 x i32> , i32 3) ; LinAlgMatVecMulAdd(matrix,isOutputSigned,inputVector,inputInterpretation,biasVector,biasInterpretation) - + ; dx.op.linAlgConvert %v16 = call <4 x float> @dx.op.linAlgConvert.v4f32.v4i32(i32 -2147483618, <4 x i32> zeroinitializer, i32 1, i32 2) ; LinAlgConvert(inputVector,inputInterpretation,outputInterpretation) + ; dx.op.linAlgVectorAccumulateToDescriptor + call void @dx.op.linAlgVectorAccumulateToDescriptor.v4f32(i32 -2147483617, <4 x float> zeroinitializer, %dx.types.Handle %handle, i32 0, i32 64) ; LinAlgVectorAccumulateToDescriptor(vector,handle,offset,align) + ; ; Built-ins restricted to compute, mesh and amplification shaders ; ; dx.op.linAlgCopyConvertMatrix %v8 = call %dx.types.LinAlgMatrixC4M4N5U1S2 @dx.op.linAlgCopyConvertMatrix.mC4M4N5U1S2.mC4M5N4U0S2(i32 -2147483635, %dx.types.LinAlgMatrixC4M5N4U0S2 %v4, i1 true) ; LinAlgCopyConvertMatrix(srcMatrix,transpose) - + ; dx.op.linAlgFillMatrix %v9 = call %dx.types.LinAlgMatrixC4M5N4U0S2 @dx.op.linAlgFillMatrix.mC4M5N4U0S2.i32(i32 -2147483636, i32 15) ; LinAlgFillMatrix(value) - + ; dx.op.linAlgMatrixGetCoordinate %v10 = call <2 x i32> @dx.op.linAlgMatrixGetCoordinate.mC4M5N4U0S2(i32 -2147483631, %dx.types.LinAlgMatrixC4M5N4U0S2 %v9, i32 0) ; LinAlgMatrixGetCoordinate(matrix,threadLocalIndex) - + ; dx.op.linAlgMatrixGetElement %v11 = call float @dx.op.linAlgMatrixGetElement.f32.mC4M5N4U0S2(i32 -2147483630, %dx.types.LinAlgMatrixC4M5N4U0S2 %v9, i32 0) ; LinAlgMatrixGetElement(matrix,threadLocalIndex) - + ; dx.op.linAlgMatrixMultiply %v12 = call %dx.types.LinAlgMatrixC4M5N4U2S2 @dx.op.linAlgMatrixMultiply.mC4M5N4U2S2.mC4M5N4U0S2.mC4M4N5U1S2(i32 -2147483625, %dx.types.LinAlgMatrixC4M5N4U0S2 %v9, %dx.types.LinAlgMatrixC4M4N5U1S2 %v8) ; LinAlgMatrixMultiply(matrixA,matrixB) - + ; dx.op.linAlgMatrixMultiplyAccumulate %v13 = call %dx.types.LinAlgMatrixC4M5N4U2S2 @dx.op.linAlgMatrixMultiplyAccumulate.mC4M5N4U2S2.mC4M5N4U0S2.mC4M4N5U1S2.mC4M5N4U2S2(i32 -2147483637, %dx.types.LinAlgMatrixC4M5N4U0S2 %v9, %dx.types.LinAlgMatrixC4M4N5U1S2 %v8, %dx.types.LinAlgMatrixC4M5N4U2S2 %v12) ; LinAlgMatrixMultiplyAccumulate(matrixA,matrixB,matrixC) - + ; dx.op.linAlgMatrixSetElement %v14 = call %dx.types.LinAlgMatrixC4M5N4U0S2 @dx.op.linAlgMatrixSetElement.mC4M5N4U0S2.mC4M5N4U0S2.i32(i32 -2147483629, %dx.types.LinAlgMatrixC4M5N4U0S2 %v9, i32 1, i32 1) ; LinAlgMatrixSetElement(matrix,threadLocalIndex,value) ; dx.op.linAlgMatrixStoreToDescriptor call void @dx.op.linAlgMatrixStoreToDescriptor.mC4M5N4U0S2(i32 -2147483628, %dx.types.LinAlgMatrixC4M5N4U0S2 %v14, %dx.types.Handle %handle, i32 1, i32 2, i32 3, i32 4) ; LinAlgMatrixStoreToDescriptor(matrix,handle,offset,stride,layout,align) - + ; dx.op.linAlgMatrixAccumulateToMemory call void @dx.op.linAlgMatrixAccumulateToMemory.mC4M5N4U0S2.f32(i32 -2147483620, %dx.types.LinAlgMatrixC4M5N4U0S2 %v14, float addrspace(3)* getelementptr inbounds ([64 x float], [64 x float] addrspace(3)* @"\01?SharedArr@@3PAMA", i32 0, i32 0), i32 0, i32 0, i32 0) ; LinAlgMatrixAccumulateToMemory(matrix,memory,offset,stride,layout) - + ; dx.op.linAlgMatrixLoadFromMemory %v15 = call %dx.types.LinAlgMatrixC4M5N4U0S2 @dx.op.linAlgMatrixLoadFromMemory.mC4M5N4U0S2.f32(i32 -2147483633, float addrspace(3)* getelementptr inbounds ([64 x float], [64 x float] addrspace(3)* @"\01?SharedArr@@3PAMA", i32 0, i32 0), i32 0, i32 0, i32 0) ; LinAlgMatrixLoadFromMemory(memory,offset,stride,layout) - + ; dx.op.linAlgMatrixStoreToMemory call void @dx.op.linAlgMatrixStoreToMemory.mC4M5N4U0S2.f32(i32 -2147483627, %dx.types.LinAlgMatrixC4M5N4U0S2 %v15, float addrspace(3)* getelementptr inbounds ([64 x float], [64 x float] addrspace(3)* @"\01?SharedArr@@3PAMA", i32 0, i32 0), i32 0, i32 0, i32 0) ; LinAlgMatrixStoreToMemory(matrix,memory,offset,stride,layout) %2 = alloca %struct.AmpPayload.0, align 8 call void @dx.op.dispatchMesh.struct.AmpPayload.0(i32 173, i32 8, i32 1, i32 1, %struct.AmpPayload.0* nonnull %2) ; DispatchMesh(threadGroupCountX,threadGroupCountY,threadGroupCountZ,payload) - + ret void } @@ -144,6 +147,9 @@ declare <4 x i32> @dx.op.linAlgMatVecMulAdd.v4i32.mC4M5N4U0S2.v4i32.v4i32(i32, % ; Function Attrs: nounwind declare <4 x float> @dx.op.linAlgConvert.v4f32.v4i32(i32, <4 x i32>, i32, i32) #0 +; Function Attrs: nounwind +declare void @dx.op.linAlgVectorAccumulateToDescriptor.v4f32(i32, <4 x float>, %dx.types.Handle, i32, i32) #0 + ; Function Attrs: nounwind declare %dx.types.LinAlgMatrixC4M4N5U1S2 @dx.op.linAlgCopyConvertMatrix.mC4M4N5U1S2.mC4M5N4U0S2(i32, %dx.types.LinAlgMatrixC4M5N4U0S2, i1) #0 diff --git a/tools/clang/test/LitDXILValidation/LinAlgMatrix/linalgmatrix-cs.ll b/tools/clang/test/LitDXILValidation/LinAlgMatrix/linalgmatrix-cs.ll index c5b2ccfec7..576758b9b1 100644 --- a/tools/clang/test/LitDXILValidation/LinAlgMatrix/linalgmatrix-cs.ll +++ b/tools/clang/test/LitDXILValidation/LinAlgMatrix/linalgmatrix-cs.ll @@ -17,7 +17,7 @@ target triple = "dxil-ms-dx" @"\01?SharedArr@@3PAMA" = external addrspace(3) global [64 x float], align 4 define void @mainCS() { - + %1 = call %dx.types.Handle @dx.op.createHandleFromBinding(i32 217, %dx.types.ResBind { i32 0, i32 0, i32 0, i8 1 }, i32 0, i1 false) ; CreateHandleFromBinding(bind,index,nonUniformIndex) %handle = call %dx.types.Handle @dx.op.annotateHandle(i32 216, %dx.types.Handle %1, %dx.types.ResourceProperties { i32 4107, i32 0 }) ; AnnotateHandle(res,props) resource: RWByteAddressBuffer @@ -27,68 +27,71 @@ define void @mainCS() { ; dx.op.linAlgMatrixAccumulate %v1 = call %dx.types.LinAlgMatrixC4M5N4U2S2 @dx.op.linAlgMatrixAccumulate.mC4M5N4U2S2.mC4M5N4U0S2.mC4M4N5U1S2(i32 -2147483624, %dx.types.LinAlgMatrixC4M5N4U0S2 undef, %dx.types.LinAlgMatrixC4M4N5U1S2 undef) ; LinAlgMatrixAccumulate(matrixLHS,matrixRHS) - + ; dx.op.linAlgMatrixAccumulateToDescriptor call void @dx.op.linAlgMatrixAccumulateToDescriptor.mC4M5N4U0S2(i32 -2147483621, %dx.types.LinAlgMatrixC4M5N4U0S2 undef, %dx.types.Handle %handle, i32 1, i32 2, i32 3, i32 4) ; LinAlgMatrixAccumulateToDescriptor(matrix,handle,offset,stride,layout,align) - + ; dx.op.linAlgMatrixLength %v2 = call i32 @dx.op.linAlgMatrixLength.mC4M5N4U0S2(i32 -2147483632, %dx.types.LinAlgMatrixC4M5N4U0S2 undef) ; LinAlgMatrixLength(matrix) - + ; dx.op.linAlgMatrixLoadFromDescriptor %v3 = call %dx.types.LinAlgMatrixC4M5N4U0S2 @dx.op.linAlgMatrixLoadFromDescriptor.mC4M5N4U0S2(i32 -2147483634, %dx.types.Handle %handle, i32 5, i32 5, i32 5, i32 4) ; LinAlgMatrixLoadFromDescriptor(handle,offset,stride,layout,align) - + ; dx.op.linAlgMatrixOuterProduct %v4 = call %dx.types.LinAlgMatrixC4M5N4U0S2 @dx.op.linAlgMatrixOuterProduct.mC4M5N4U0S2.v4i32.v4i32(i32 -2147483619, <4 x i32> , <4 x i32> ) ; LinAlgMatrixOuterProduct(vectorA,vectorB) - + ; dx.op.linAlgMatrixQueryAccumulatorLayout %v5 = call i32 @dx.op.linAlgMatrixQueryAccumulatorLayout(i32 -2147483626) ; LinAlgMatrixQueryAccumulatorLayout() - + ; dx.op.linAlgMatVecMul %v6 = call <4 x i32> @dx.op.linAlgMatVecMul.v4i32.mC4M5N4U0S2.v4i32(i32 -2147483623, %dx.types.LinAlgMatrixC4M5N4U0S2 %v4, i1 true, <4 x i32> , i32 1) ; LinAlgMatVecMul(matrix,isOutputSigned,inputVector,interpretation) - + ; dx.op.linAlgMatVecMulAdd %v7 = call <4 x i32> @dx.op.linAlgMatVecMulAdd.v4i32.mC4M5N4U0S2.v4i32.v4i32(i32 -2147483622, %dx.types.LinAlgMatrixC4M5N4U0S2 %v4, i1 true, <4 x i32> , i32 2, <4 x i32> , i32 3) ; LinAlgMatVecMulAdd(matrix,isOutputSigned,inputVector,inputInterpretation,biasVector,biasInterpretation) - + ; dx.op.linAlgConvert %v16 = call <4 x float> @dx.op.linAlgConvert.v4f32.v4i32(i32 -2147483618, <4 x i32> zeroinitializer, i32 1, i32 2) ; LinAlgConvert(inputVector,inputInterpretation,outputInterpretation) + ; dx.op.linAlgVectorAccumulateToDescriptor + call void @dx.op.linAlgVectorAccumulateToDescriptor.v4f32(i32 -2147483617, <4 x float> zeroinitializer, %dx.types.Handle %handle, i32 0, i32 64) ; LinAlgVectorAccumulateToDescriptor(vector,handle,offset,align) + ; ; Built-ins restricted to compute, mesh and amplification shaders ; ; dx.op.linAlgCopyConvertMatrix %v8 = call %dx.types.LinAlgMatrixC4M4N5U1S2 @dx.op.linAlgCopyConvertMatrix.mC4M4N5U1S2.mC4M5N4U0S2(i32 -2147483635, %dx.types.LinAlgMatrixC4M5N4U0S2 %v4, i1 true) ; LinAlgCopyConvertMatrix(srcMatrix,transpose) - + ; dx.op.linAlgFillMatrix %v9 = call %dx.types.LinAlgMatrixC4M5N4U0S2 @dx.op.linAlgFillMatrix.mC4M5N4U0S2.i32(i32 -2147483636, i32 15) ; LinAlgFillMatrix(value) - + ; dx.op.linAlgMatrixGetCoordinate %v10 = call <2 x i32> @dx.op.linAlgMatrixGetCoordinate.mC4M5N4U0S2(i32 -2147483631, %dx.types.LinAlgMatrixC4M5N4U0S2 %v9, i32 0) ; LinAlgMatrixGetCoordinate(matrix,threadLocalIndex) - + ; dx.op.linAlgMatrixGetElement %v11 = call float @dx.op.linAlgMatrixGetElement.f32.mC4M5N4U0S2(i32 -2147483630, %dx.types.LinAlgMatrixC4M5N4U0S2 %v9, i32 0) ; LinAlgMatrixGetElement(matrix,threadLocalIndex) - + ; dx.op.linAlgMatrixMultiply %v12 = call %dx.types.LinAlgMatrixC4M5N4U2S2 @dx.op.linAlgMatrixMultiply.mC4M5N4U2S2.mC4M5N4U0S2.mC4M4N5U1S2(i32 -2147483625, %dx.types.LinAlgMatrixC4M5N4U0S2 %v9, %dx.types.LinAlgMatrixC4M4N5U1S2 %v8) ; LinAlgMatrixMultiply(matrixA,matrixB) - + ; dx.op.linAlgMatrixMultiplyAccumulate %v13 = call %dx.types.LinAlgMatrixC4M5N4U2S2 @dx.op.linAlgMatrixMultiplyAccumulate.mC4M5N4U2S2.mC4M5N4U0S2.mC4M4N5U1S2.mC4M5N4U2S2(i32 -2147483637, %dx.types.LinAlgMatrixC4M5N4U0S2 %v9, %dx.types.LinAlgMatrixC4M4N5U1S2 %v8, %dx.types.LinAlgMatrixC4M5N4U2S2 %v12) ; LinAlgMatrixMultiplyAccumulate(matrixA,matrixB,matrixC) - + ; dx.op.linAlgMatrixSetElement %v14 = call %dx.types.LinAlgMatrixC4M5N4U0S2 @dx.op.linAlgMatrixSetElement.mC4M5N4U0S2.mC4M5N4U0S2.i32(i32 -2147483629, %dx.types.LinAlgMatrixC4M5N4U0S2 %v9, i32 1, i32 1) ; LinAlgMatrixSetElement(matrix,threadLocalIndex,value) ; dx.op.linAlgMatrixStoreToDescriptor call void @dx.op.linAlgMatrixStoreToDescriptor.mC4M5N4U0S2(i32 -2147483628, %dx.types.LinAlgMatrixC4M5N4U0S2 %v14, %dx.types.Handle %handle, i32 1, i32 2, i32 3, i32 4) ; LinAlgMatrixStoreToDescriptor(matrix,handle,offset,stride,layout,align) - + ; dx.op.linAlgMatrixAccumulateToMemory call void @dx.op.linAlgMatrixAccumulateToMemory.mC4M5N4U0S2.f32(i32 -2147483620, %dx.types.LinAlgMatrixC4M5N4U0S2 %v14, float addrspace(3)* getelementptr inbounds ([64 x float], [64 x float] addrspace(3)* @"\01?SharedArr@@3PAMA", i32 0, i32 0), i32 0, i32 0, i32 0) ; LinAlgMatrixAccumulateToMemory(matrix,memory,offset,stride,layout) - + ; dx.op.linAlgMatrixLoadFromMemory %v15 = call %dx.types.LinAlgMatrixC4M5N4U0S2 @dx.op.linAlgMatrixLoadFromMemory.mC4M5N4U0S2.f32(i32 -2147483633, float addrspace(3)* getelementptr inbounds ([64 x float], [64 x float] addrspace(3)* @"\01?SharedArr@@3PAMA", i32 0, i32 0), i32 0, i32 0, i32 0) ; LinAlgMatrixLoadFromMemory(memory,offset,stride,layout) - + ; dx.op.linAlgMatrixStoreToMemory call void @dx.op.linAlgMatrixStoreToMemory.mC4M5N4U0S2.f32(i32 -2147483627, %dx.types.LinAlgMatrixC4M5N4U0S2 %v15, float addrspace(3)* getelementptr inbounds ([64 x float], [64 x float] addrspace(3)* @"\01?SharedArr@@3PAMA", i32 0, i32 0), i32 0, i32 0, i32 0) ; LinAlgMatrixStoreToMemory(matrix,memory,offset,stride,layout) - + ret void } @@ -125,6 +128,9 @@ declare <4 x i32> @dx.op.linAlgMatVecMulAdd.v4i32.mC4M5N4U0S2.v4i32.v4i32(i32, % ; Function Attrs: nounwind declare <4 x float> @dx.op.linAlgConvert.v4f32.v4i32(i32, <4 x i32>, i32, i32) #0 +; Function Attrs: nounwind +declare void @dx.op.linAlgVectorAccumulateToDescriptor.v4f32(i32, <4 x float>, %dx.types.Handle, i32, i32) #0 + ; Function Attrs: nounwind declare %dx.types.LinAlgMatrixC4M4N5U1S2 @dx.op.linAlgCopyConvertMatrix.mC4M4N5U1S2.mC4M5N4U0S2(i32, %dx.types.LinAlgMatrixC4M5N4U0S2, i1) #0 diff --git a/tools/clang/test/LitDXILValidation/LinAlgMatrix/linalgmatrix-ds.ll b/tools/clang/test/LitDXILValidation/LinAlgMatrix/linalgmatrix-ds.ll index b2a7eb0c53..c4292d7d7e 100644 --- a/tools/clang/test/LitDXILValidation/LinAlgMatrix/linalgmatrix-ds.ll +++ b/tools/clang/test/LitDXILValidation/LinAlgMatrix/linalgmatrix-ds.ll @@ -43,65 +43,68 @@ define void @MainDS() { ; dx.op.linAlgMatrixAccumulate %v1 = call %dx.types.LinAlgMatrixC4M5N4U2S2 @dx.op.linAlgMatrixAccumulate.mC4M5N4U2S2.mC4M5N4U0S2.mC4M4N5U1S2(i32 -2147483624, %dx.types.LinAlgMatrixC4M5N4U0S2 undef, %dx.types.LinAlgMatrixC4M4N5U1S2 undef) ; LinAlgMatrixAccumulate(matrixLHS,matrixRHS) - + ; dx.op.linAlgMatrixAccumulateToDescriptor call void @dx.op.linAlgMatrixAccumulateToDescriptor.mC4M5N4U0S2(i32 -2147483621, %dx.types.LinAlgMatrixC4M5N4U0S2 undef, %dx.types.Handle %handle, i32 1, i32 2, i32 3, i32 4) ; LinAlgMatrixAccumulateToDescriptor(matrix,handle,offset,stride,layout,align) - + ; dx.op.linAlgMatrixLength %v2 = call i32 @dx.op.linAlgMatrixLength.mC4M5N4U0S2(i32 -2147483632, %dx.types.LinAlgMatrixC4M5N4U0S2 undef) ; LinAlgMatrixLength(matrix) - + ; dx.op.linAlgMatrixLoadFromDescriptor %v3 = call %dx.types.LinAlgMatrixC4M5N4U0S2 @dx.op.linAlgMatrixLoadFromDescriptor.mC4M5N4U0S2(i32 -2147483634, %dx.types.Handle %handle, i32 5, i32 5, i32 5, i32 4) ; LinAlgMatrixLoadFromDescriptor(handle,offset,stride,layout,align) - + ; dx.op.linAlgMatrixOuterProduct %v4 = call %dx.types.LinAlgMatrixC4M5N4U0S2 @dx.op.linAlgMatrixOuterProduct.mC4M5N4U0S2.v4i32.v4i32(i32 -2147483619, <4 x i32> , <4 x i32> ) ; LinAlgMatrixOuterProduct(vectorA,vectorB) - + ; dx.op.linAlgMatrixQueryAccumulatorLayout %v5 = call i32 @dx.op.linAlgMatrixQueryAccumulatorLayout(i32 -2147483626) ; LinAlgMatrixQueryAccumulatorLayout() - + ; dx.op.linAlgMatVecMul %v6 = call <4 x i32> @dx.op.linAlgMatVecMul.v4i32.mC4M5N4U0S2.v4i32(i32 -2147483623, %dx.types.LinAlgMatrixC4M5N4U0S2 %v4, i1 true, <4 x i32> , i32 1) ; LinAlgMatVecMul(matrix,isOutputSigned,inputVector,interpretation) - + ; dx.op.linAlgMatVecMulAdd %v7 = call <4 x i32> @dx.op.linAlgMatVecMulAdd.v4i32.mC4M5N4U0S2.v4i32.v4i32(i32 -2147483622, %dx.types.LinAlgMatrixC4M5N4U0S2 %v4, i1 true, <4 x i32> , i32 2, <4 x i32> , i32 3) ; LinAlgMatVecMulAdd(matrix,isOutputSigned,inputVector,inputInterpretation,biasVector,biasInterpretation) - + ; dx.op.linAlgConvert %v16 = call <4 x float> @dx.op.linAlgConvert.v4f32.v4i32(i32 -2147483618, <4 x i32> zeroinitializer, i32 1, i32 2) ; LinAlgConvert(inputVector,inputInterpretation,outputInterpretation) + ; dx.op.linAlgVectorAccumulateToDescriptor + call void @dx.op.linAlgVectorAccumulateToDescriptor.v4f32(i32 -2147483617, <4 x float> zeroinitializer, %dx.types.Handle %handle, i32 0, i32 64) ; LinAlgVectorAccumulateToDescriptor(vector,handle,offset,align) + ; ; Built-ins restricted to compute, mesh and amplification shaders ; ; dx.op.linAlgCopyConvertMatrix %v8 = call %dx.types.LinAlgMatrixC4M4N5U1S2 @dx.op.linAlgCopyConvertMatrix.mC4M4N5U1S2.mC4M5N4U0S2(i32 -2147483635, %dx.types.LinAlgMatrixC4M5N4U0S2 %v4, i1 true) ; LinAlgCopyConvertMatrix(srcMatrix,transpose) - + ; dx.op.linAlgFillMatrix %v9 = call %dx.types.LinAlgMatrixC4M5N4U0S2 @dx.op.linAlgFillMatrix.mC4M5N4U0S2.i32(i32 -2147483636, i32 15) ; LinAlgFillMatrix(value) - + ; dx.op.linAlgMatrixGetCoordinate %v10 = call <2 x i32> @dx.op.linAlgMatrixGetCoordinate.mC4M5N4U0S2(i32 -2147483631, %dx.types.LinAlgMatrixC4M5N4U0S2 %v9, i32 0) ; LinAlgMatrixGetCoordinate(matrix,threadLocalIndex) - + ; dx.op.linAlgMatrixGetElement %v11 = call float @dx.op.linAlgMatrixGetElement.f32.mC4M5N4U0S2(i32 -2147483630, %dx.types.LinAlgMatrixC4M5N4U0S2 %v9, i32 0) ; LinAlgMatrixGetElement(matrix,threadLocalIndex) - + ; dx.op.linAlgMatrixMultiply %v12 = call %dx.types.LinAlgMatrixC4M5N4U2S2 @dx.op.linAlgMatrixMultiply.mC4M5N4U2S2.mC4M5N4U0S2.mC4M4N5U1S2(i32 -2147483625, %dx.types.LinAlgMatrixC4M5N4U0S2 %v9, %dx.types.LinAlgMatrixC4M4N5U1S2 %v8) ; LinAlgMatrixMultiply(matrixA,matrixB) - + ; dx.op.linAlgMatrixMultiplyAccumulate %v13 = call %dx.types.LinAlgMatrixC4M5N4U2S2 @dx.op.linAlgMatrixMultiplyAccumulate.mC4M5N4U2S2.mC4M5N4U0S2.mC4M4N5U1S2.mC4M5N4U2S2(i32 -2147483637, %dx.types.LinAlgMatrixC4M5N4U0S2 %v9, %dx.types.LinAlgMatrixC4M4N5U1S2 %v8, %dx.types.LinAlgMatrixC4M5N4U2S2 %v12) ; LinAlgMatrixMultiplyAccumulate(matrixA,matrixB,matrixC) - + ; dx.op.linAlgMatrixSetElement %v14 = call %dx.types.LinAlgMatrixC4M5N4U0S2 @dx.op.linAlgMatrixSetElement.mC4M5N4U0S2.mC4M5N4U0S2.i32(i32 -2147483629, %dx.types.LinAlgMatrixC4M5N4U0S2 %v9, i32 1, i32 1) ; LinAlgMatrixSetElement(matrix,threadLocalIndex,value) ; dx.op.linAlgMatrixStoreToDescriptor call void @dx.op.linAlgMatrixStoreToDescriptor.mC4M5N4U0S2(i32 -2147483628, %dx.types.LinAlgMatrixC4M5N4U0S2 %v14, %dx.types.Handle %handle, i32 1, i32 2, i32 3, i32 4) ; LinAlgMatrixStoreToDescriptor(matrix,handle,offset,stride,layout,align) - + ; dx.op.linAlgMatrixAccumulateToMemory call void @dx.op.linAlgMatrixAccumulateToMemory.mC4M5N4U0S2.f32(i32 -2147483620, %dx.types.LinAlgMatrixC4M5N4U0S2 %v14, float addrspace(3)* getelementptr inbounds ([64 x float], [64 x float] addrspace(3)* @"\01?SharedArr@@3PAMA", i32 0, i32 0), i32 0, i32 0, i32 0) ; LinAlgMatrixAccumulateToMemory(matrix,memory,offset,stride,layout) - + ; dx.op.linAlgMatrixLoadFromMemory %v15 = call %dx.types.LinAlgMatrixC4M5N4U0S2 @dx.op.linAlgMatrixLoadFromMemory.mC4M5N4U0S2.f32(i32 -2147483633, float addrspace(3)* getelementptr inbounds ([64 x float], [64 x float] addrspace(3)* @"\01?SharedArr@@3PAMA", i32 0, i32 0), i32 0, i32 0, i32 0) ; LinAlgMatrixLoadFromMemory(memory,offset,stride,layout) - + ; dx.op.linAlgMatrixStoreToMemory call void @dx.op.linAlgMatrixStoreToMemory.mC4M5N4U0S2.f32(i32 -2147483627, %dx.types.LinAlgMatrixC4M5N4U0S2 %v15, float addrspace(3)* getelementptr inbounds ([64 x float], [64 x float] addrspace(3)* @"\01?SharedArr@@3PAMA", i32 0, i32 0), i32 0, i32 0, i32 0) ; LinAlgMatrixStoreToMemory(matrix,memory,offset,stride,layout) @@ -112,7 +115,7 @@ define void @MainDS() { call void @dx.op.storeOutput.f32(i32 5, i32 0, i32 0, i8 0, float %2) ; StoreOutput(outputSigId,rowIndex,colIndex,value) call void @dx.op.storeOutput.f32(i32 5, i32 0, i32 0, i8 1, float %3) ; StoreOutput(outputSigId,rowIndex,colIndex,value) call void @dx.op.storeOutput.f32(i32 5, i32 0, i32 0, i8 2, float %4) ; StoreOutput(outputSigId,rowIndex,colIndex,value) - call void @dx.op.storeOutput.f32(i32 5, i32 0, i32 0, i8 3, float %5) ; StoreOutput(outputSigId,rowIndex,colIndex,value) + call void @dx.op.storeOutput.f32(i32 5, i32 0, i32 0, i8 3, float %5) ; StoreOutput(outputSigId,rowIndex,colIndex,value) ret void } @@ -149,6 +152,9 @@ declare <4 x i32> @dx.op.linAlgMatVecMulAdd.v4i32.mC4M5N4U0S2.v4i32.v4i32(i32, % ; Function Attrs: nounwind declare <4 x float> @dx.op.linAlgConvert.v4f32.v4i32(i32, <4 x i32>, i32, i32) #0 +; Function Attrs: nounwind +declare void @dx.op.linAlgVectorAccumulateToDescriptor.v4f32(i32, <4 x float>, %dx.types.Handle, i32, i32) #0 + ; Function Attrs: nounwind declare %dx.types.LinAlgMatrixC4M4N5U1S2 @dx.op.linAlgCopyConvertMatrix.mC4M4N5U1S2.mC4M5N4U0S2(i32, %dx.types.LinAlgMatrixC4M5N4U0S2, i1) #0 diff --git a/tools/clang/test/LitDXILValidation/LinAlgMatrix/linalgmatrix-gs.ll b/tools/clang/test/LitDXILValidation/LinAlgMatrix/linalgmatrix-gs.ll index edbca57b0b..d14a983ab4 100644 --- a/tools/clang/test/LitDXILValidation/LinAlgMatrix/linalgmatrix-gs.ll +++ b/tools/clang/test/LitDXILValidation/LinAlgMatrix/linalgmatrix-gs.ll @@ -43,65 +43,68 @@ define void @MainGS() { ; dx.op.linAlgMatrixAccumulate %v1 = call %dx.types.LinAlgMatrixC4M5N4U2S2 @dx.op.linAlgMatrixAccumulate.mC4M5N4U2S2.mC4M5N4U0S2.mC4M4N5U1S2(i32 -2147483624, %dx.types.LinAlgMatrixC4M5N4U0S2 undef, %dx.types.LinAlgMatrixC4M4N5U1S2 undef) ; LinAlgMatrixAccumulate(matrixLHS,matrixRHS) - + ; dx.op.linAlgMatrixAccumulateToDescriptor call void @dx.op.linAlgMatrixAccumulateToDescriptor.mC4M5N4U0S2(i32 -2147483621, %dx.types.LinAlgMatrixC4M5N4U0S2 undef, %dx.types.Handle %handle, i32 1, i32 2, i32 3, i32 4) ; LinAlgMatrixAccumulateToDescriptor(matrix,handle,offset,stride,layout,align) - + ; dx.op.linAlgMatrixLength %v2 = call i32 @dx.op.linAlgMatrixLength.mC4M5N4U0S2(i32 -2147483632, %dx.types.LinAlgMatrixC4M5N4U0S2 undef) ; LinAlgMatrixLength(matrix) - + ; dx.op.linAlgMatrixLoadFromDescriptor %v3 = call %dx.types.LinAlgMatrixC4M5N4U0S2 @dx.op.linAlgMatrixLoadFromDescriptor.mC4M5N4U0S2(i32 -2147483634, %dx.types.Handle %handle, i32 5, i32 5, i32 5, i32 4) ; LinAlgMatrixLoadFromDescriptor(handle,offset,stride,layout,align) - + ; dx.op.linAlgMatrixOuterProduct %v4 = call %dx.types.LinAlgMatrixC4M5N4U0S2 @dx.op.linAlgMatrixOuterProduct.mC4M5N4U0S2.v4i32.v4i32(i32 -2147483619, <4 x i32> , <4 x i32> ) ; LinAlgMatrixOuterProduct(vectorA,vectorB) - + ; dx.op.linAlgMatrixQueryAccumulatorLayout %v5 = call i32 @dx.op.linAlgMatrixQueryAccumulatorLayout(i32 -2147483626) ; LinAlgMatrixQueryAccumulatorLayout() - + ; dx.op.linAlgMatVecMul %v6 = call <4 x i32> @dx.op.linAlgMatVecMul.v4i32.mC4M5N4U0S2.v4i32(i32 -2147483623, %dx.types.LinAlgMatrixC4M5N4U0S2 %v4, i1 true, <4 x i32> , i32 1) ; LinAlgMatVecMul(matrix,isOutputSigned,inputVector,interpretation) - + ; dx.op.linAlgMatVecMulAdd %v7 = call <4 x i32> @dx.op.linAlgMatVecMulAdd.v4i32.mC4M5N4U0S2.v4i32.v4i32(i32 -2147483622, %dx.types.LinAlgMatrixC4M5N4U0S2 %v4, i1 true, <4 x i32> , i32 2, <4 x i32> , i32 3) ; LinAlgMatVecMulAdd(matrix,isOutputSigned,inputVector,inputInterpretation,biasVector,biasInterpretation) - + ; dx.op.linAlgConvert %v16 = call <4 x float> @dx.op.linAlgConvert.v4f32.v4i32(i32 -2147483618, <4 x i32> zeroinitializer, i32 1, i32 2) ; LinAlgConvert(inputVector,inputInterpretation,outputInterpretation) + ; dx.op.linAlgVectorAccumulateToDescriptor + call void @dx.op.linAlgVectorAccumulateToDescriptor.v4f32(i32 -2147483617, <4 x float> zeroinitializer, %dx.types.Handle %handle, i32 0, i32 64) ; LinAlgVectorAccumulateToDescriptor(vector,handle,offset,align) + ; ; Built-ins restricted to compute, mesh and amplification shaders ; ; dx.op.linAlgCopyConvertMatrix %v8 = call %dx.types.LinAlgMatrixC4M4N5U1S2 @dx.op.linAlgCopyConvertMatrix.mC4M4N5U1S2.mC4M5N4U0S2(i32 -2147483635, %dx.types.LinAlgMatrixC4M5N4U0S2 %v4, i1 true) ; LinAlgCopyConvertMatrix(srcMatrix,transpose) - + ; dx.op.linAlgFillMatrix %v9 = call %dx.types.LinAlgMatrixC4M5N4U0S2 @dx.op.linAlgFillMatrix.mC4M5N4U0S2.i32(i32 -2147483636, i32 15) ; LinAlgFillMatrix(value) - + ; dx.op.linAlgMatrixGetCoordinate %v10 = call <2 x i32> @dx.op.linAlgMatrixGetCoordinate.mC4M5N4U0S2(i32 -2147483631, %dx.types.LinAlgMatrixC4M5N4U0S2 %v9, i32 0) ; LinAlgMatrixGetCoordinate(matrix,threadLocalIndex) - + ; dx.op.linAlgMatrixGetElement %v11 = call float @dx.op.linAlgMatrixGetElement.f32.mC4M5N4U0S2(i32 -2147483630, %dx.types.LinAlgMatrixC4M5N4U0S2 %v9, i32 0) ; LinAlgMatrixGetElement(matrix,threadLocalIndex) - + ; dx.op.linAlgMatrixMultiply %v12 = call %dx.types.LinAlgMatrixC4M5N4U2S2 @dx.op.linAlgMatrixMultiply.mC4M5N4U2S2.mC4M5N4U0S2.mC4M4N5U1S2(i32 -2147483625, %dx.types.LinAlgMatrixC4M5N4U0S2 %v9, %dx.types.LinAlgMatrixC4M4N5U1S2 %v8) ; LinAlgMatrixMultiply(matrixA,matrixB) - + ; dx.op.linAlgMatrixMultiplyAccumulate %v13 = call %dx.types.LinAlgMatrixC4M5N4U2S2 @dx.op.linAlgMatrixMultiplyAccumulate.mC4M5N4U2S2.mC4M5N4U0S2.mC4M4N5U1S2.mC4M5N4U2S2(i32 -2147483637, %dx.types.LinAlgMatrixC4M5N4U0S2 %v9, %dx.types.LinAlgMatrixC4M4N5U1S2 %v8, %dx.types.LinAlgMatrixC4M5N4U2S2 %v12) ; LinAlgMatrixMultiplyAccumulate(matrixA,matrixB,matrixC) - + ; dx.op.linAlgMatrixSetElement %v14 = call %dx.types.LinAlgMatrixC4M5N4U0S2 @dx.op.linAlgMatrixSetElement.mC4M5N4U0S2.mC4M5N4U0S2.i32(i32 -2147483629, %dx.types.LinAlgMatrixC4M5N4U0S2 %v9, i32 1, i32 1) ; LinAlgMatrixSetElement(matrix,threadLocalIndex,value) ; dx.op.linAlgMatrixStoreToDescriptor call void @dx.op.linAlgMatrixStoreToDescriptor.mC4M5N4U0S2(i32 -2147483628, %dx.types.LinAlgMatrixC4M5N4U0S2 %v14, %dx.types.Handle %handle, i32 1, i32 2, i32 3, i32 4) ; LinAlgMatrixStoreToDescriptor(matrix,handle,offset,stride,layout,align) - + ; dx.op.linAlgMatrixAccumulateToMemory call void @dx.op.linAlgMatrixAccumulateToMemory.mC4M5N4U0S2.f32(i32 -2147483620, %dx.types.LinAlgMatrixC4M5N4U0S2 %v14, float addrspace(3)* getelementptr inbounds ([64 x float], [64 x float] addrspace(3)* @"\01?SharedArr@@3PAMA", i32 0, i32 0), i32 0, i32 0, i32 0) ; LinAlgMatrixAccumulateToMemory(matrix,memory,offset,stride,layout) - + ; dx.op.linAlgMatrixLoadFromMemory %v15 = call %dx.types.LinAlgMatrixC4M5N4U0S2 @dx.op.linAlgMatrixLoadFromMemory.mC4M5N4U0S2.f32(i32 -2147483633, float addrspace(3)* getelementptr inbounds ([64 x float], [64 x float] addrspace(3)* @"\01?SharedArr@@3PAMA", i32 0, i32 0), i32 0, i32 0, i32 0) ; LinAlgMatrixLoadFromMemory(memory,offset,stride,layout) - + ; dx.op.linAlgMatrixStoreToMemory call void @dx.op.linAlgMatrixStoreToMemory.mC4M5N4U0S2.f32(i32 -2147483627, %dx.types.LinAlgMatrixC4M5N4U0S2 %v15, float addrspace(3)* getelementptr inbounds ([64 x float], [64 x float] addrspace(3)* @"\01?SharedArr@@3PAMA", i32 0, i32 0), i32 0, i32 0, i32 0) ; LinAlgMatrixStoreToMemory(matrix,memory,offset,stride,layout) @@ -111,7 +114,7 @@ define void @MainGS() { call void @dx.op.storeOutput.f32(i32 5, i32 0, i32 0, i8 3, float 1.000000e+01) ; StoreOutput(outputSigId,rowIndex,colIndex,value) call void @dx.op.emitStream(i32 97, i8 0) ; EmitStream(streamId) call void @dx.op.cutStream(i32 98, i8 0) ; CutStream(streamId) - + ret void } @@ -148,6 +151,9 @@ declare <4 x i32> @dx.op.linAlgMatVecMulAdd.v4i32.mC4M5N4U0S2.v4i32.v4i32(i32, % ; Function Attrs: nounwind declare <4 x float> @dx.op.linAlgConvert.v4f32.v4i32(i32, <4 x i32>, i32, i32) #0 +; Function Attrs: nounwind +declare void @dx.op.linAlgVectorAccumulateToDescriptor.v4f32(i32, <4 x float>, %dx.types.Handle, i32, i32) #0 + ; Function Attrs: nounwind declare %dx.types.LinAlgMatrixC4M4N5U1S2 @dx.op.linAlgCopyConvertMatrix.mC4M4N5U1S2.mC4M5N4U0S2(i32, %dx.types.LinAlgMatrixC4M5N4U0S2, i1) #0 diff --git a/tools/clang/test/LitDXILValidation/LinAlgMatrix/linalgmatrix-hs.ll b/tools/clang/test/LitDXILValidation/LinAlgMatrix/linalgmatrix-hs.ll index c148cc60f3..c5411b9b2e 100644 --- a/tools/clang/test/LitDXILValidation/LinAlgMatrix/linalgmatrix-hs.ll +++ b/tools/clang/test/LitDXILValidation/LinAlgMatrix/linalgmatrix-hs.ll @@ -43,65 +43,68 @@ define void @MainHS() { ; dx.op.linAlgMatrixAccumulate %v1 = call %dx.types.LinAlgMatrixC4M5N4U2S2 @dx.op.linAlgMatrixAccumulate.mC4M5N4U2S2.mC4M5N4U0S2.mC4M4N5U1S2(i32 -2147483624, %dx.types.LinAlgMatrixC4M5N4U0S2 undef, %dx.types.LinAlgMatrixC4M4N5U1S2 undef) ; LinAlgMatrixAccumulate(matrixLHS,matrixRHS) - + ; dx.op.linAlgMatrixAccumulateToDescriptor call void @dx.op.linAlgMatrixAccumulateToDescriptor.mC4M5N4U0S2(i32 -2147483621, %dx.types.LinAlgMatrixC4M5N4U0S2 undef, %dx.types.Handle %handle, i32 1, i32 2, i32 3, i32 4) ; LinAlgMatrixAccumulateToDescriptor(matrix,handle,offset,stride,layout,align) - + ; dx.op.linAlgMatrixLength %v2 = call i32 @dx.op.linAlgMatrixLength.mC4M5N4U0S2(i32 -2147483632, %dx.types.LinAlgMatrixC4M5N4U0S2 undef) ; LinAlgMatrixLength(matrix) - + ; dx.op.linAlgMatrixLoadFromDescriptor %v3 = call %dx.types.LinAlgMatrixC4M5N4U0S2 @dx.op.linAlgMatrixLoadFromDescriptor.mC4M5N4U0S2(i32 -2147483634, %dx.types.Handle %handle, i32 5, i32 5, i32 5, i32 4) ; LinAlgMatrixLoadFromDescriptor(handle,offset,stride,layout,align) - + ; dx.op.linAlgMatrixOuterProduct %v4 = call %dx.types.LinAlgMatrixC4M5N4U0S2 @dx.op.linAlgMatrixOuterProduct.mC4M5N4U0S2.v4i32.v4i32(i32 -2147483619, <4 x i32> , <4 x i32> ) ; LinAlgMatrixOuterProduct(vectorA,vectorB) - + ; dx.op.linAlgMatrixQueryAccumulatorLayout %v5 = call i32 @dx.op.linAlgMatrixQueryAccumulatorLayout(i32 -2147483626) ; LinAlgMatrixQueryAccumulatorLayout() - + ; dx.op.linAlgMatVecMul %v6 = call <4 x i32> @dx.op.linAlgMatVecMul.v4i32.mC4M5N4U0S2.v4i32(i32 -2147483623, %dx.types.LinAlgMatrixC4M5N4U0S2 %v4, i1 true, <4 x i32> , i32 1) ; LinAlgMatVecMul(matrix,isOutputSigned,inputVector,interpretation) - + ; dx.op.linAlgMatVecMulAdd %v7 = call <4 x i32> @dx.op.linAlgMatVecMulAdd.v4i32.mC4M5N4U0S2.v4i32.v4i32(i32 -2147483622, %dx.types.LinAlgMatrixC4M5N4U0S2 %v4, i1 true, <4 x i32> , i32 2, <4 x i32> , i32 3) ; LinAlgMatVecMulAdd(matrix,isOutputSigned,inputVector,inputInterpretation,biasVector,biasInterpretation) - + ; dx.op.linAlgConvert %v16 = call <4 x float> @dx.op.linAlgConvert.v4f32.v4i32(i32 -2147483618, <4 x i32> zeroinitializer, i32 1, i32 2) ; LinAlgConvert(inputVector,inputInterpretation,outputInterpretation) + ; dx.op.linAlgVectorAccumulateToDescriptor + call void @dx.op.linAlgVectorAccumulateToDescriptor.v4f32(i32 -2147483617, <4 x float> zeroinitializer, %dx.types.Handle %handle, i32 0, i32 64) ; LinAlgVectorAccumulateToDescriptor(vector,handle,offset,align) + ; ; Built-ins restricted to compute, mesh and amplification shaders ; ; dx.op.linAlgCopyConvertMatrix %v8 = call %dx.types.LinAlgMatrixC4M4N5U1S2 @dx.op.linAlgCopyConvertMatrix.mC4M4N5U1S2.mC4M5N4U0S2(i32 -2147483635, %dx.types.LinAlgMatrixC4M5N4U0S2 %v4, i1 true) ; LinAlgCopyConvertMatrix(srcMatrix,transpose) - + ; dx.op.linAlgFillMatrix %v9 = call %dx.types.LinAlgMatrixC4M5N4U0S2 @dx.op.linAlgFillMatrix.mC4M5N4U0S2.i32(i32 -2147483636, i32 15) ; LinAlgFillMatrix(value) - + ; dx.op.linAlgMatrixGetCoordinate %v10 = call <2 x i32> @dx.op.linAlgMatrixGetCoordinate.mC4M5N4U0S2(i32 -2147483631, %dx.types.LinAlgMatrixC4M5N4U0S2 %v9, i32 0) ; LinAlgMatrixGetCoordinate(matrix,threadLocalIndex) - + ; dx.op.linAlgMatrixGetElement %v11 = call float @dx.op.linAlgMatrixGetElement.f32.mC4M5N4U0S2(i32 -2147483630, %dx.types.LinAlgMatrixC4M5N4U0S2 %v9, i32 0) ; LinAlgMatrixGetElement(matrix,threadLocalIndex) - + ; dx.op.linAlgMatrixMultiply %v12 = call %dx.types.LinAlgMatrixC4M5N4U2S2 @dx.op.linAlgMatrixMultiply.mC4M5N4U2S2.mC4M5N4U0S2.mC4M4N5U1S2(i32 -2147483625, %dx.types.LinAlgMatrixC4M5N4U0S2 %v9, %dx.types.LinAlgMatrixC4M4N5U1S2 %v8) ; LinAlgMatrixMultiply(matrixA,matrixB) - + ; dx.op.linAlgMatrixMultiplyAccumulate %v13 = call %dx.types.LinAlgMatrixC4M5N4U2S2 @dx.op.linAlgMatrixMultiplyAccumulate.mC4M5N4U2S2.mC4M5N4U0S2.mC4M4N5U1S2.mC4M5N4U2S2(i32 -2147483637, %dx.types.LinAlgMatrixC4M5N4U0S2 %v9, %dx.types.LinAlgMatrixC4M4N5U1S2 %v8, %dx.types.LinAlgMatrixC4M5N4U2S2 %v12) ; LinAlgMatrixMultiplyAccumulate(matrixA,matrixB,matrixC) - + ; dx.op.linAlgMatrixSetElement %v14 = call %dx.types.LinAlgMatrixC4M5N4U0S2 @dx.op.linAlgMatrixSetElement.mC4M5N4U0S2.mC4M5N4U0S2.i32(i32 -2147483629, %dx.types.LinAlgMatrixC4M5N4U0S2 %v9, i32 1, i32 1) ; LinAlgMatrixSetElement(matrix,threadLocalIndex,value) ; dx.op.linAlgMatrixStoreToDescriptor call void @dx.op.linAlgMatrixStoreToDescriptor.mC4M5N4U0S2(i32 -2147483628, %dx.types.LinAlgMatrixC4M5N4U0S2 %v14, %dx.types.Handle %handle, i32 1, i32 2, i32 3, i32 4) ; LinAlgMatrixStoreToDescriptor(matrix,handle,offset,stride,layout,align) - + ; dx.op.linAlgMatrixAccumulateToMemory call void @dx.op.linAlgMatrixAccumulateToMemory.mC4M5N4U0S2.f32(i32 -2147483620, %dx.types.LinAlgMatrixC4M5N4U0S2 %v14, float addrspace(3)* getelementptr inbounds ([64 x float], [64 x float] addrspace(3)* @"\01?SharedArr@@3PAMA", i32 0, i32 0), i32 0, i32 0, i32 0) ; LinAlgMatrixAccumulateToMemory(matrix,memory,offset,stride,layout) - + ; dx.op.linAlgMatrixLoadFromMemory %v15 = call %dx.types.LinAlgMatrixC4M5N4U0S2 @dx.op.linAlgMatrixLoadFromMemory.mC4M5N4U0S2.f32(i32 -2147483633, float addrspace(3)* getelementptr inbounds ([64 x float], [64 x float] addrspace(3)* @"\01?SharedArr@@3PAMA", i32 0, i32 0), i32 0, i32 0, i32 0) ; LinAlgMatrixLoadFromMemory(memory,offset,stride,layout) - + ; dx.op.linAlgMatrixStoreToMemory call void @dx.op.linAlgMatrixStoreToMemory.mC4M5N4U0S2.f32(i32 -2147483627, %dx.types.LinAlgMatrixC4M5N4U0S2 %v15, float addrspace(3)* getelementptr inbounds ([64 x float], [64 x float] addrspace(3)* @"\01?SharedArr@@3PAMA", i32 0, i32 0), i32 0, i32 0, i32 0) ; LinAlgMatrixStoreToMemory(matrix,memory,offset,stride,layout) @@ -154,6 +157,9 @@ declare <4 x i32> @dx.op.linAlgMatVecMulAdd.v4i32.mC4M5N4U0S2.v4i32.v4i32(i32, % ; Function Attrs: nounwind declare <4 x float> @dx.op.linAlgConvert.v4f32.v4i32(i32, <4 x i32>, i32, i32) #0 +; Function Attrs: nounwind +declare void @dx.op.linAlgVectorAccumulateToDescriptor.v4f32(i32, <4 x float>, %dx.types.Handle, i32, i32) #0 + ; Function Attrs: nounwind declare %dx.types.LinAlgMatrixC4M4N5U1S2 @dx.op.linAlgCopyConvertMatrix.mC4M4N5U1S2.mC4M5N4U0S2(i32, %dx.types.LinAlgMatrixC4M5N4U0S2, i1) #0 diff --git a/tools/clang/test/LitDXILValidation/LinAlgMatrix/linalgmatrix-ms.ll b/tools/clang/test/LitDXILValidation/LinAlgMatrix/linalgmatrix-ms.ll index 3542055c65..1575754a90 100644 --- a/tools/clang/test/LitDXILValidation/LinAlgMatrix/linalgmatrix-ms.ll +++ b/tools/clang/test/LitDXILValidation/LinAlgMatrix/linalgmatrix-ms.ll @@ -43,65 +43,68 @@ define void @mainMeS() { ; dx.op.linAlgMatrixAccumulate %v1 = call %dx.types.LinAlgMatrixC4M5N4U2S2 @dx.op.linAlgMatrixAccumulate.mC4M5N4U2S2.mC4M5N4U0S2.mC4M4N5U1S2(i32 -2147483624, %dx.types.LinAlgMatrixC4M5N4U0S2 undef, %dx.types.LinAlgMatrixC4M4N5U1S2 undef) ; LinAlgMatrixAccumulate(matrixLHS,matrixRHS) - + ; dx.op.linAlgMatrixAccumulateToDescriptor call void @dx.op.linAlgMatrixAccumulateToDescriptor.mC4M5N4U0S2(i32 -2147483621, %dx.types.LinAlgMatrixC4M5N4U0S2 undef, %dx.types.Handle %handle, i32 1, i32 2, i32 3, i32 4) ; LinAlgMatrixAccumulateToDescriptor(matrix,handle,offset,stride,layout,align) - + ; dx.op.linAlgMatrixLength %v2 = call i32 @dx.op.linAlgMatrixLength.mC4M5N4U0S2(i32 -2147483632, %dx.types.LinAlgMatrixC4M5N4U0S2 undef) ; LinAlgMatrixLength(matrix) - + ; dx.op.linAlgMatrixLoadFromDescriptor %v3 = call %dx.types.LinAlgMatrixC4M5N4U0S2 @dx.op.linAlgMatrixLoadFromDescriptor.mC4M5N4U0S2(i32 -2147483634, %dx.types.Handle %handle, i32 5, i32 5, i32 5, i32 4) ; LinAlgMatrixLoadFromDescriptor(handle,offset,stride,layout,align) - + ; dx.op.linAlgMatrixOuterProduct %v4 = call %dx.types.LinAlgMatrixC4M5N4U0S2 @dx.op.linAlgMatrixOuterProduct.mC4M5N4U0S2.v4i32.v4i32(i32 -2147483619, <4 x i32> , <4 x i32> ) ; LinAlgMatrixOuterProduct(vectorA,vectorB) - + ; dx.op.linAlgMatrixQueryAccumulatorLayout %v5 = call i32 @dx.op.linAlgMatrixQueryAccumulatorLayout(i32 -2147483626) ; LinAlgMatrixQueryAccumulatorLayout() - + ; dx.op.linAlgMatVecMul %v6 = call <4 x i32> @dx.op.linAlgMatVecMul.v4i32.mC4M5N4U0S2.v4i32(i32 -2147483623, %dx.types.LinAlgMatrixC4M5N4U0S2 %v4, i1 true, <4 x i32> , i32 1) ; LinAlgMatVecMul(matrix,isOutputSigned,inputVector,interpretation) - + ; dx.op.linAlgMatVecMulAdd %v7 = call <4 x i32> @dx.op.linAlgMatVecMulAdd.v4i32.mC4M5N4U0S2.v4i32.v4i32(i32 -2147483622, %dx.types.LinAlgMatrixC4M5N4U0S2 %v4, i1 true, <4 x i32> , i32 2, <4 x i32> , i32 3) ; LinAlgMatVecMulAdd(matrix,isOutputSigned,inputVector,inputInterpretation,biasVector,biasInterpretation) - + ; dx.op.linAlgConvert %v16 = call <4 x float> @dx.op.linAlgConvert.v4f32.v4i32(i32 -2147483618, <4 x i32> zeroinitializer, i32 1, i32 2) ; LinAlgConvert(inputVector,inputInterpretation,outputInterpretation) + ; dx.op.linAlgVectorAccumulateToDescriptor + call void @dx.op.linAlgVectorAccumulateToDescriptor.v4f32(i32 -2147483617, <4 x float> zeroinitializer, %dx.types.Handle %handle, i32 0, i32 64) ; LinAlgVectorAccumulateToDescriptor(vector,handle,offset,align) + ; ; Built-ins restricted to compute, mesh and amplification shaders ; ; dx.op.linAlgCopyConvertMatrix %v8 = call %dx.types.LinAlgMatrixC4M4N5U1S2 @dx.op.linAlgCopyConvertMatrix.mC4M4N5U1S2.mC4M5N4U0S2(i32 -2147483635, %dx.types.LinAlgMatrixC4M5N4U0S2 %v4, i1 true) ; LinAlgCopyConvertMatrix(srcMatrix,transpose) - + ; dx.op.linAlgFillMatrix %v9 = call %dx.types.LinAlgMatrixC4M5N4U0S2 @dx.op.linAlgFillMatrix.mC4M5N4U0S2.i32(i32 -2147483636, i32 15) ; LinAlgFillMatrix(value) - + ; dx.op.linAlgMatrixGetCoordinate %v10 = call <2 x i32> @dx.op.linAlgMatrixGetCoordinate.mC4M5N4U0S2(i32 -2147483631, %dx.types.LinAlgMatrixC4M5N4U0S2 %v9, i32 0) ; LinAlgMatrixGetCoordinate(matrix,threadLocalIndex) - + ; dx.op.linAlgMatrixGetElement %v11 = call float @dx.op.linAlgMatrixGetElement.f32.mC4M5N4U0S2(i32 -2147483630, %dx.types.LinAlgMatrixC4M5N4U0S2 %v9, i32 0) ; LinAlgMatrixGetElement(matrix,threadLocalIndex) - + ; dx.op.linAlgMatrixMultiply %v12 = call %dx.types.LinAlgMatrixC4M5N4U2S2 @dx.op.linAlgMatrixMultiply.mC4M5N4U2S2.mC4M5N4U0S2.mC4M4N5U1S2(i32 -2147483625, %dx.types.LinAlgMatrixC4M5N4U0S2 %v9, %dx.types.LinAlgMatrixC4M4N5U1S2 %v8) ; LinAlgMatrixMultiply(matrixA,matrixB) - + ; dx.op.linAlgMatrixMultiplyAccumulate %v13 = call %dx.types.LinAlgMatrixC4M5N4U2S2 @dx.op.linAlgMatrixMultiplyAccumulate.mC4M5N4U2S2.mC4M5N4U0S2.mC4M4N5U1S2.mC4M5N4U2S2(i32 -2147483637, %dx.types.LinAlgMatrixC4M5N4U0S2 %v9, %dx.types.LinAlgMatrixC4M4N5U1S2 %v8, %dx.types.LinAlgMatrixC4M5N4U2S2 %v12) ; LinAlgMatrixMultiplyAccumulate(matrixA,matrixB,matrixC) - + ; dx.op.linAlgMatrixSetElement %v14 = call %dx.types.LinAlgMatrixC4M5N4U0S2 @dx.op.linAlgMatrixSetElement.mC4M5N4U0S2.mC4M5N4U0S2.i32(i32 -2147483629, %dx.types.LinAlgMatrixC4M5N4U0S2 %v9, i32 1, i32 1) ; LinAlgMatrixSetElement(matrix,threadLocalIndex,value) ; dx.op.linAlgMatrixStoreToDescriptor call void @dx.op.linAlgMatrixStoreToDescriptor.mC4M5N4U0S2(i32 -2147483628, %dx.types.LinAlgMatrixC4M5N4U0S2 %v14, %dx.types.Handle %handle, i32 1, i32 2, i32 3, i32 4) ; LinAlgMatrixStoreToDescriptor(matrix,handle,offset,stride,layout,align) - + ; dx.op.linAlgMatrixAccumulateToMemory call void @dx.op.linAlgMatrixAccumulateToMemory.mC4M5N4U0S2.f32(i32 -2147483620, %dx.types.LinAlgMatrixC4M5N4U0S2 %v14, float addrspace(3)* getelementptr inbounds ([64 x float], [64 x float] addrspace(3)* @"\01?SharedArr@@3PAMA", i32 0, i32 0), i32 0, i32 0, i32 0) ; LinAlgMatrixAccumulateToMemory(matrix,memory,offset,stride,layout) - + ; dx.op.linAlgMatrixLoadFromMemory %v15 = call %dx.types.LinAlgMatrixC4M5N4U0S2 @dx.op.linAlgMatrixLoadFromMemory.mC4M5N4U0S2.f32(i32 -2147483633, float addrspace(3)* getelementptr inbounds ([64 x float], [64 x float] addrspace(3)* @"\01?SharedArr@@3PAMA", i32 0, i32 0), i32 0, i32 0, i32 0) ; LinAlgMatrixLoadFromMemory(memory,offset,stride,layout) - + ; dx.op.linAlgMatrixStoreToMemory call void @dx.op.linAlgMatrixStoreToMemory.mC4M5N4U0S2.f32(i32 -2147483627, %dx.types.LinAlgMatrixC4M5N4U0S2 %v15, float addrspace(3)* getelementptr inbounds ([64 x float], [64 x float] addrspace(3)* @"\01?SharedArr@@3PAMA", i32 0, i32 0), i32 0, i32 0, i32 0) ; LinAlgMatrixStoreToMemory(matrix,memory,offset,stride,layout) @@ -110,7 +113,7 @@ define void @mainMeS() { call void @dx.op.storeVertexOutput.f32(i32 171, i32 0, i32 0, i8 1, float 0.000000e+00, i32 %thread_id_group) ; StoreVertexOutput(outputSigId,rowIndex,colIndex,value,vertexIndex) call void @dx.op.storeVertexOutput.f32(i32 171, i32 0, i32 0, i8 2, float 0.000000e+00, i32 %thread_id_group) ; StoreVertexOutput(outputSigId,rowIndex,colIndex,value,vertexIndex) call void @dx.op.storeVertexOutput.f32(i32 171, i32 0, i32 0, i8 3, float 0.000000e+00, i32 %thread_id_group) ; StoreVertexOutput(outputSigId,rowIndex,colIndex,value,vertexIndex) - + ret void } @@ -147,6 +150,9 @@ declare <4 x i32> @dx.op.linAlgMatVecMulAdd.v4i32.mC4M5N4U0S2.v4i32.v4i32(i32, % ; Function Attrs: nounwind declare <4 x float> @dx.op.linAlgConvert.v4f32.v4i32(i32, <4 x i32>, i32, i32) #0 +; Function Attrs: nounwind +declare void @dx.op.linAlgVectorAccumulateToDescriptor.v4f32(i32, <4 x float>, %dx.types.Handle, i32, i32) #0 + ; Function Attrs: nounwind declare %dx.types.LinAlgMatrixC4M4N5U1S2 @dx.op.linAlgCopyConvertMatrix.mC4M4N5U1S2.mC4M5N4U0S2(i32, %dx.types.LinAlgMatrixC4M5N4U0S2, i1) #0 diff --git a/tools/clang/test/LitDXILValidation/LinAlgMatrix/linalgmatrix-node.ll b/tools/clang/test/LitDXILValidation/LinAlgMatrix/linalgmatrix-node.ll index f42208a5f6..1318eb5435 100644 --- a/tools/clang/test/LitDXILValidation/LinAlgMatrix/linalgmatrix-node.ll +++ b/tools/clang/test/LitDXILValidation/LinAlgMatrix/linalgmatrix-node.ll @@ -44,68 +44,71 @@ define void @mainNS() { ; dx.op.linAlgMatrixAccumulate %v1 = call %dx.types.LinAlgMatrixC4M5N4U2S2 @dx.op.linAlgMatrixAccumulate.mC4M5N4U2S2.mC4M5N4U0S2.mC4M4N5U1S2(i32 -2147483624, %dx.types.LinAlgMatrixC4M5N4U0S2 undef, %dx.types.LinAlgMatrixC4M4N5U1S2 undef) ; LinAlgMatrixAccumulate(matrixLHS,matrixRHS) - + ; dx.op.linAlgMatrixAccumulateToDescriptor call void @dx.op.linAlgMatrixAccumulateToDescriptor.mC4M5N4U0S2(i32 -2147483621, %dx.types.LinAlgMatrixC4M5N4U0S2 undef, %dx.types.Handle %handle, i32 1, i32 2, i32 3, i32 4) ; LinAlgMatrixAccumulateToDescriptor(matrix,handle,offset,stride,layout,align) - + ; dx.op.linAlgMatrixLength %v2 = call i32 @dx.op.linAlgMatrixLength.mC4M5N4U0S2(i32 -2147483632, %dx.types.LinAlgMatrixC4M5N4U0S2 undef) ; LinAlgMatrixLength(matrix) - + ; dx.op.linAlgMatrixLoadFromDescriptor %v3 = call %dx.types.LinAlgMatrixC4M5N4U0S2 @dx.op.linAlgMatrixLoadFromDescriptor.mC4M5N4U0S2(i32 -2147483634, %dx.types.Handle %handle, i32 5, i32 5, i32 5, i32 4) ; LinAlgMatrixLoadFromDescriptor(handle,offset,stride,layout,align) - + ; dx.op.linAlgMatrixOuterProduct %v4 = call %dx.types.LinAlgMatrixC4M5N4U0S2 @dx.op.linAlgMatrixOuterProduct.mC4M5N4U0S2.v4i32.v4i32(i32 -2147483619, <4 x i32> , <4 x i32> ) ; LinAlgMatrixOuterProduct(vectorA,vectorB) - + ; dx.op.linAlgMatrixQueryAccumulatorLayout %v5 = call i32 @dx.op.linAlgMatrixQueryAccumulatorLayout(i32 -2147483626) ; LinAlgMatrixQueryAccumulatorLayout() - + ; dx.op.linAlgMatVecMul %v6 = call <4 x i32> @dx.op.linAlgMatVecMul.v4i32.mC4M5N4U0S2.v4i32(i32 -2147483623, %dx.types.LinAlgMatrixC4M5N4U0S2 %v4, i1 true, <4 x i32> , i32 1) ; LinAlgMatVecMul(matrix,isOutputSigned,inputVector,interpretation) - + ; dx.op.linAlgMatVecMulAdd %v7 = call <4 x i32> @dx.op.linAlgMatVecMulAdd.v4i32.mC4M5N4U0S2.v4i32.v4i32(i32 -2147483622, %dx.types.LinAlgMatrixC4M5N4U0S2 %v4, i1 true, <4 x i32> , i32 2, <4 x i32> , i32 3) ; LinAlgMatVecMulAdd(matrix,isOutputSigned,inputVector,inputInterpretation,biasVector,biasInterpretation) - + ; dx.op.linAlgConvert %v16 = call <4 x float> @dx.op.linAlgConvert.v4f32.v4i32(i32 -2147483618, <4 x i32> zeroinitializer, i32 1, i32 2) ; LinAlgConvert(inputVector,inputInterpretation,outputInterpretation) + ; dx.op.linAlgVectorAccumulateToDescriptor + call void @dx.op.linAlgVectorAccumulateToDescriptor.v4f32(i32 -2147483617, <4 x float> zeroinitializer, %dx.types.Handle %handle, i32 0, i32 64) ; LinAlgVectorAccumulateToDescriptor(vector,handle,offset,align) + ; ; Built-ins restricted to compute, mesh and amplification shaders ; ; dx.op.linAlgCopyConvertMatrix %v8 = call %dx.types.LinAlgMatrixC4M4N5U1S2 @dx.op.linAlgCopyConvertMatrix.mC4M4N5U1S2.mC4M5N4U0S2(i32 -2147483635, %dx.types.LinAlgMatrixC4M5N4U0S2 %v4, i1 true) ; LinAlgCopyConvertMatrix(srcMatrix,transpose) - + ; dx.op.linAlgFillMatrix %v9 = call %dx.types.LinAlgMatrixC4M5N4U0S2 @dx.op.linAlgFillMatrix.mC4M5N4U0S2.i32(i32 -2147483636, i32 15) ; LinAlgFillMatrix(value) - + ; dx.op.linAlgMatrixGetCoordinate %v10 = call <2 x i32> @dx.op.linAlgMatrixGetCoordinate.mC4M5N4U0S2(i32 -2147483631, %dx.types.LinAlgMatrixC4M5N4U0S2 %v9, i32 0) ; LinAlgMatrixGetCoordinate(matrix,threadLocalIndex) - + ; dx.op.linAlgMatrixGetElement %v11 = call float @dx.op.linAlgMatrixGetElement.f32.mC4M5N4U0S2(i32 -2147483630, %dx.types.LinAlgMatrixC4M5N4U0S2 %v9, i32 0) ; LinAlgMatrixGetElement(matrix,threadLocalIndex) - + ; dx.op.linAlgMatrixMultiply %v12 = call %dx.types.LinAlgMatrixC4M5N4U2S2 @dx.op.linAlgMatrixMultiply.mC4M5N4U2S2.mC4M5N4U0S2.mC4M4N5U1S2(i32 -2147483625, %dx.types.LinAlgMatrixC4M5N4U0S2 %v9, %dx.types.LinAlgMatrixC4M4N5U1S2 %v8) ; LinAlgMatrixMultiply(matrixA,matrixB) - + ; dx.op.linAlgMatrixMultiplyAccumulate %v13 = call %dx.types.LinAlgMatrixC4M5N4U2S2 @dx.op.linAlgMatrixMultiplyAccumulate.mC4M5N4U2S2.mC4M5N4U0S2.mC4M4N5U1S2.mC4M5N4U2S2(i32 -2147483637, %dx.types.LinAlgMatrixC4M5N4U0S2 %v9, %dx.types.LinAlgMatrixC4M4N5U1S2 %v8, %dx.types.LinAlgMatrixC4M5N4U2S2 %v12) ; LinAlgMatrixMultiplyAccumulate(matrixA,matrixB,matrixC) - + ; dx.op.linAlgMatrixSetElement %v14 = call %dx.types.LinAlgMatrixC4M5N4U0S2 @dx.op.linAlgMatrixSetElement.mC4M5N4U0S2.mC4M5N4U0S2.i32(i32 -2147483629, %dx.types.LinAlgMatrixC4M5N4U0S2 %v9, i32 1, i32 1) ; LinAlgMatrixSetElement(matrix,threadLocalIndex,value) ; dx.op.linAlgMatrixStoreToDescriptor call void @dx.op.linAlgMatrixStoreToDescriptor.mC4M5N4U0S2(i32 -2147483628, %dx.types.LinAlgMatrixC4M5N4U0S2 %v14, %dx.types.Handle %handle, i32 1, i32 2, i32 3, i32 4) ; LinAlgMatrixStoreToDescriptor(matrix,handle,offset,stride,layout,align) - + ; dx.op.linAlgMatrixAccumulateToMemory call void @dx.op.linAlgMatrixAccumulateToMemory.mC4M5N4U0S2.f32(i32 -2147483620, %dx.types.LinAlgMatrixC4M5N4U0S2 %v14, float addrspace(3)* getelementptr inbounds ([64 x float], [64 x float] addrspace(3)* @"\01?SharedArr@@3PAMA", i32 0, i32 0), i32 0, i32 0, i32 0) ; LinAlgMatrixAccumulateToMemory(matrix,memory,offset,stride,layout) - + ; dx.op.linAlgMatrixLoadFromMemory %v15 = call %dx.types.LinAlgMatrixC4M5N4U0S2 @dx.op.linAlgMatrixLoadFromMemory.mC4M5N4U0S2.f32(i32 -2147483633, float addrspace(3)* getelementptr inbounds ([64 x float], [64 x float] addrspace(3)* @"\01?SharedArr@@3PAMA", i32 0, i32 0), i32 0, i32 0, i32 0) ; LinAlgMatrixLoadFromMemory(memory,offset,stride,layout) - + ; dx.op.linAlgMatrixStoreToMemory call void @dx.op.linAlgMatrixStoreToMemory.mC4M5N4U0S2.f32(i32 -2147483627, %dx.types.LinAlgMatrixC4M5N4U0S2 %v15, float addrspace(3)* getelementptr inbounds ([64 x float], [64 x float] addrspace(3)* @"\01?SharedArr@@3PAMA", i32 0, i32 0), i32 0, i32 0, i32 0) ; LinAlgMatrixStoreToMemory(matrix,memory,offset,stride,layout) - + ret void } @@ -142,6 +145,9 @@ declare <4 x i32> @dx.op.linAlgMatVecMulAdd.v4i32.mC4M5N4U0S2.v4i32.v4i32(i32, % ; Function Attrs: nounwind declare <4 x float> @dx.op.linAlgConvert.v4f32.v4i32(i32, <4 x i32>, i32, i32) #0 +; Function Attrs: nounwind +declare void @dx.op.linAlgVectorAccumulateToDescriptor.v4f32(i32, <4 x float>, %dx.types.Handle, i32, i32) #0 + ; Function Attrs: nounwind declare %dx.types.LinAlgMatrixC4M4N5U1S2 @dx.op.linAlgCopyConvertMatrix.mC4M4N5U1S2.mC4M5N4U0S2(i32, %dx.types.LinAlgMatrixC4M5N4U0S2, i1) #0 diff --git a/tools/clang/test/LitDXILValidation/LinAlgMatrix/linalgmatrix-ps.ll b/tools/clang/test/LitDXILValidation/LinAlgMatrix/linalgmatrix-ps.ll index d4d39c7f40..676f573fb5 100644 --- a/tools/clang/test/LitDXILValidation/LinAlgMatrix/linalgmatrix-ps.ll +++ b/tools/clang/test/LitDXILValidation/LinAlgMatrix/linalgmatrix-ps.ll @@ -42,65 +42,68 @@ define void @mainPS() { ; dx.op.linAlgMatrixAccumulate %v1 = call %dx.types.LinAlgMatrixC4M5N4U2S2 @dx.op.linAlgMatrixAccumulate.mC4M5N4U2S2.mC4M5N4U0S2.mC4M4N5U1S2(i32 -2147483624, %dx.types.LinAlgMatrixC4M5N4U0S2 undef, %dx.types.LinAlgMatrixC4M4N5U1S2 undef) ; LinAlgMatrixAccumulate(matrixLHS,matrixRHS) - + ; dx.op.linAlgMatrixAccumulateToDescriptor call void @dx.op.linAlgMatrixAccumulateToDescriptor.mC4M5N4U0S2(i32 -2147483621, %dx.types.LinAlgMatrixC4M5N4U0S2 undef, %dx.types.Handle %handle, i32 1, i32 2, i32 3, i32 4) ; LinAlgMatrixAccumulateToDescriptor(matrix,handle,offset,stride,layout,align) - + ; dx.op.linAlgMatrixLength %v2 = call i32 @dx.op.linAlgMatrixLength.mC4M5N4U0S2(i32 -2147483632, %dx.types.LinAlgMatrixC4M5N4U0S2 undef) ; LinAlgMatrixLength(matrix) - + ; dx.op.linAlgMatrixLoadFromDescriptor %v3 = call %dx.types.LinAlgMatrixC4M5N4U0S2 @dx.op.linAlgMatrixLoadFromDescriptor.mC4M5N4U0S2(i32 -2147483634, %dx.types.Handle %handle, i32 5, i32 5, i32 5, i32 4) ; LinAlgMatrixLoadFromDescriptor(handle,offset,stride,layout,align) - + ; dx.op.linAlgMatrixOuterProduct %v4 = call %dx.types.LinAlgMatrixC4M5N4U0S2 @dx.op.linAlgMatrixOuterProduct.mC4M5N4U0S2.v4i32.v4i32(i32 -2147483619, <4 x i32> , <4 x i32> ) ; LinAlgMatrixOuterProduct(vectorA,vectorB) - + ; dx.op.linAlgMatrixQueryAccumulatorLayout %v5 = call i32 @dx.op.linAlgMatrixQueryAccumulatorLayout(i32 -2147483626) ; LinAlgMatrixQueryAccumulatorLayout() - + ; dx.op.linAlgMatVecMul %v6 = call <4 x i32> @dx.op.linAlgMatVecMul.v4i32.mC4M5N4U0S2.v4i32(i32 -2147483623, %dx.types.LinAlgMatrixC4M5N4U0S2 %v4, i1 true, <4 x i32> , i32 1) ; LinAlgMatVecMul(matrix,isOutputSigned,inputVector,interpretation) - + ; dx.op.linAlgMatVecMulAdd %v7 = call <4 x i32> @dx.op.linAlgMatVecMulAdd.v4i32.mC4M5N4U0S2.v4i32.v4i32(i32 -2147483622, %dx.types.LinAlgMatrixC4M5N4U0S2 %v4, i1 true, <4 x i32> , i32 2, <4 x i32> , i32 3) ; LinAlgMatVecMulAdd(matrix,isOutputSigned,inputVector,inputInterpretation,biasVector,biasInterpretation) - + ; dx.op.linAlgConvert %v16 = call <4 x float> @dx.op.linAlgConvert.v4f32.v4i32(i32 -2147483618, <4 x i32> zeroinitializer, i32 1, i32 2) ; LinAlgConvert(inputVector,inputInterpretation,outputInterpretation) + ; dx.op.linAlgVectorAccumulateToDescriptor + call void @dx.op.linAlgVectorAccumulateToDescriptor.v4f32(i32 -2147483617, <4 x float> zeroinitializer, %dx.types.Handle %handle, i32 0, i32 64) ; LinAlgVectorAccumulateToDescriptor(vector,handle,offset,align) + ; ; Built-ins restricted to compute, mesh and amplification shaders ; ; dx.op.linAlgCopyConvertMatrix %v8 = call %dx.types.LinAlgMatrixC4M4N5U1S2 @dx.op.linAlgCopyConvertMatrix.mC4M4N5U1S2.mC4M5N4U0S2(i32 -2147483635, %dx.types.LinAlgMatrixC4M5N4U0S2 %v4, i1 true) ; LinAlgCopyConvertMatrix(srcMatrix,transpose) - + ; dx.op.linAlgFillMatrix %v9 = call %dx.types.LinAlgMatrixC4M5N4U0S2 @dx.op.linAlgFillMatrix.mC4M5N4U0S2.i32(i32 -2147483636, i32 15) ; LinAlgFillMatrix(value) - + ; dx.op.linAlgMatrixGetCoordinate %v10 = call <2 x i32> @dx.op.linAlgMatrixGetCoordinate.mC4M5N4U0S2(i32 -2147483631, %dx.types.LinAlgMatrixC4M5N4U0S2 %v9, i32 0) ; LinAlgMatrixGetCoordinate(matrix,threadLocalIndex) - + ; dx.op.linAlgMatrixGetElement %v11 = call float @dx.op.linAlgMatrixGetElement.f32.mC4M5N4U0S2(i32 -2147483630, %dx.types.LinAlgMatrixC4M5N4U0S2 %v9, i32 0) ; LinAlgMatrixGetElement(matrix,threadLocalIndex) - + ; dx.op.linAlgMatrixMultiply %v12 = call %dx.types.LinAlgMatrixC4M5N4U2S2 @dx.op.linAlgMatrixMultiply.mC4M5N4U2S2.mC4M5N4U0S2.mC4M4N5U1S2(i32 -2147483625, %dx.types.LinAlgMatrixC4M5N4U0S2 %v9, %dx.types.LinAlgMatrixC4M4N5U1S2 %v8) ; LinAlgMatrixMultiply(matrixA,matrixB) - + ; dx.op.linAlgMatrixMultiplyAccumulate %v13 = call %dx.types.LinAlgMatrixC4M5N4U2S2 @dx.op.linAlgMatrixMultiplyAccumulate.mC4M5N4U2S2.mC4M5N4U0S2.mC4M4N5U1S2.mC4M5N4U2S2(i32 -2147483637, %dx.types.LinAlgMatrixC4M5N4U0S2 %v9, %dx.types.LinAlgMatrixC4M4N5U1S2 %v8, %dx.types.LinAlgMatrixC4M5N4U2S2 %v12) ; LinAlgMatrixMultiplyAccumulate(matrixA,matrixB,matrixC) - + ; dx.op.linAlgMatrixSetElement %v14 = call %dx.types.LinAlgMatrixC4M5N4U0S2 @dx.op.linAlgMatrixSetElement.mC4M5N4U0S2.mC4M5N4U0S2.i32(i32 -2147483629, %dx.types.LinAlgMatrixC4M5N4U0S2 %v9, i32 1, i32 1) ; LinAlgMatrixSetElement(matrix,threadLocalIndex,value) ; dx.op.linAlgMatrixStoreToDescriptor call void @dx.op.linAlgMatrixStoreToDescriptor.mC4M5N4U0S2(i32 -2147483628, %dx.types.LinAlgMatrixC4M5N4U0S2 %v14, %dx.types.Handle %handle, i32 1, i32 2, i32 3, i32 4) ; LinAlgMatrixStoreToDescriptor(matrix,handle,offset,stride,layout,align) - + ; dx.op.linAlgMatrixAccumulateToMemory call void @dx.op.linAlgMatrixAccumulateToMemory.mC4M5N4U0S2.f32(i32 -2147483620, %dx.types.LinAlgMatrixC4M5N4U0S2 %v14, float addrspace(3)* getelementptr inbounds ([64 x float], [64 x float] addrspace(3)* @"\01?SharedArr@@3PAMA", i32 0, i32 0), i32 0, i32 0, i32 0) ; LinAlgMatrixAccumulateToMemory(matrix,memory,offset,stride,layout) - + ; dx.op.linAlgMatrixLoadFromMemory %v15 = call %dx.types.LinAlgMatrixC4M5N4U0S2 @dx.op.linAlgMatrixLoadFromMemory.mC4M5N4U0S2.f32(i32 -2147483633, float addrspace(3)* getelementptr inbounds ([64 x float], [64 x float] addrspace(3)* @"\01?SharedArr@@3PAMA", i32 0, i32 0), i32 0, i32 0, i32 0) ; LinAlgMatrixLoadFromMemory(memory,offset,stride,layout) - + ; dx.op.linAlgMatrixStoreToMemory call void @dx.op.linAlgMatrixStoreToMemory.mC4M5N4U0S2.f32(i32 -2147483627, %dx.types.LinAlgMatrixC4M5N4U0S2 %v15, float addrspace(3)* getelementptr inbounds ([64 x float], [64 x float] addrspace(3)* @"\01?SharedArr@@3PAMA", i32 0, i32 0), i32 0, i32 0, i32 0) ; LinAlgMatrixStoreToMemory(matrix,memory,offset,stride,layout) @@ -145,6 +148,9 @@ declare <4 x i32> @dx.op.linAlgMatVecMulAdd.v4i32.mC4M5N4U0S2.v4i32.v4i32(i32, % ; Function Attrs: nounwind declare <4 x float> @dx.op.linAlgConvert.v4f32.v4i32(i32, <4 x i32>, i32, i32) #0 +; Function Attrs: nounwind +declare void @dx.op.linAlgVectorAccumulateToDescriptor.v4f32(i32, <4 x float>, %dx.types.Handle, i32, i32) #0 + ; Function Attrs: nounwind declare %dx.types.LinAlgMatrixC4M4N5U1S2 @dx.op.linAlgCopyConvertMatrix.mC4M4N5U1S2.mC4M5N4U0S2(i32, %dx.types.LinAlgMatrixC4M5N4U0S2, i1) #0 diff --git a/tools/clang/test/LitDXILValidation/LinAlgMatrix/linalgmatrix-raytracing.ll b/tools/clang/test/LitDXILValidation/LinAlgMatrix/linalgmatrix-raytracing.ll index d6ff1a8c79..b687b5945e 100644 --- a/tools/clang/test/LitDXILValidation/LinAlgMatrix/linalgmatrix-raytracing.ll +++ b/tools/clang/test/LitDXILValidation/LinAlgMatrix/linalgmatrix-raytracing.ll @@ -127,7 +127,7 @@ target triple = "dxil-ms-dx" @"\01?SharedArr@@3PAMA" = external addrspace(3) global [64 x float], align 4 define void @"\01?MainRG@@YAXXZ"() #0 { - + %1 = load %dx.types.Handle, %dx.types.Handle* @"\01?buf@@3URWByteAddressBuffer@@A", align 4 %2 = call %dx.types.Handle @dx.op.createHandleForLib.dx.types.Handle(i32 160, %dx.types.Handle %1) ; CreateHandleForLib(Resource) %handle = call %dx.types.Handle @dx.op.annotateHandle(i32 216, %dx.types.Handle %2, %dx.types.ResourceProperties { i32 4107, i32 0 }) ; AnnotateHandle(res,props) resource: RWByteAddressBuffer @@ -143,7 +143,9 @@ define void @"\01?MainRG@@YAXXZ"() #0 { %v6 = call <4 x i32> @dx.op.linAlgMatVecMul.v4i32.mC4M5N4U0S2.v4i32(i32 -2147483623, %dx.types.LinAlgMatrixC4M5N4U0S2 %v4, i1 true, <4 x i32> , i32 1) ; LinAlgMatVecMul(matrix,isOutputSigned,inputVector,interpretation) %v7 = call <4 x i32> @dx.op.linAlgMatVecMulAdd.v4i32.mC4M5N4U0S2.v4i32.v4i32(i32 -2147483622, %dx.types.LinAlgMatrixC4M5N4U0S2 %v4, i1 true, <4 x i32> , i32 2, <4 x i32> , i32 3) ; LinAlgMatVecMulAdd(matrix,isOutputSigned,inputVector,inputInterpretation,biasVector,biasInterpretation) %v16 = call <4 x float> @dx.op.linAlgConvert.v4f32.v4i32(i32 -2147483618, <4 x i32> zeroinitializer, i32 1, i32 2) ; LinAlgConvert(inputVector,inputInterpretation,outputInterpretation) - + ; dx.op.linAlgVectorAccumulateToDescriptor + call void @dx.op.linAlgVectorAccumulateToDescriptor.v4f32(i32 -2147483617, <4 x float> zeroinitializer, %dx.types.Handle %handle, i32 0, i32 64) ; LinAlgVectorAccumulateToDescriptor(vector,handle,offset,align) + ; ; Built-ins restricted to compute, mesh and amplification shaders ; @@ -158,7 +160,7 @@ define void @"\01?MainRG@@YAXXZ"() #0 { call void @dx.op.linAlgMatrixAccumulateToMemory.mC4M5N4U0S2.f32(i32 -2147483620, %dx.types.LinAlgMatrixC4M5N4U0S2 %v14, float addrspace(3)* getelementptr inbounds ([64 x float], [64 x float] addrspace(3)* @"\01?SharedArr@@3PAMA", i32 0, i32 0), i32 0, i32 0, i32 0) ; LinAlgMatrixAccumulateToMemory(matrix,memory,offset,stride,layout) %v15 = call %dx.types.LinAlgMatrixC4M5N4U0S2 @dx.op.linAlgMatrixLoadFromMemory.mC4M5N4U0S2.f32(i32 -2147483633, float addrspace(3)* getelementptr inbounds ([64 x float], [64 x float] addrspace(3)* @"\01?SharedArr@@3PAMA", i32 0, i32 0), i32 0, i32 0, i32 0) ; LinAlgMatrixLoadFromMemory(memory,offset,stride,layout) call void @dx.op.linAlgMatrixStoreToMemory.mC4M5N4U0S2.f32(i32 -2147483627, %dx.types.LinAlgMatrixC4M5N4U0S2 %v15, float addrspace(3)* getelementptr inbounds ([64 x float], [64 x float] addrspace(3)* @"\01?SharedArr@@3PAMA", i32 0, i32 0), i32 0, i32 0, i32 0) ; LinAlgMatrixStoreToMemory(matrix,memory,offset,stride,layout) - + ret void } @@ -178,7 +180,9 @@ define void @"\01?MainIS@@YAXXZ"() #0 { %v6 = call <4 x i32> @dx.op.linAlgMatVecMul.v4i32.mC4M5N4U0S2.v4i32(i32 -2147483623, %dx.types.LinAlgMatrixC4M5N4U0S2 %v4, i1 true, <4 x i32> , i32 1) ; LinAlgMatVecMul(matrix,isOutputSigned,inputVector,interpretation) %v7 = call <4 x i32> @dx.op.linAlgMatVecMulAdd.v4i32.mC4M5N4U0S2.v4i32.v4i32(i32 -2147483622, %dx.types.LinAlgMatrixC4M5N4U0S2 %v4, i1 true, <4 x i32> , i32 2, <4 x i32> , i32 3) ; LinAlgMatVecMulAdd(matrix,isOutputSigned,inputVector,inputInterpretation,biasVector,biasInterpretation) %v16 = call <4 x float> @dx.op.linAlgConvert.v4f32.v4i32(i32 -2147483618, <4 x i32> zeroinitializer, i32 1, i32 2) ; LinAlgConvert(inputVector,inputInterpretation,outputInterpretation) - + ; dx.op.linAlgVectorAccumulateToDescriptor + call void @dx.op.linAlgVectorAccumulateToDescriptor.v4f32(i32 -2147483617, <4 x float> zeroinitializer, %dx.types.Handle %handle, i32 0, i32 64) ; LinAlgVectorAccumulateToDescriptor(vector,handle,offset,align) + ; ; Built-ins restricted to compute, mesh and amplification shaders ; @@ -193,7 +197,7 @@ define void @"\01?MainIS@@YAXXZ"() #0 { call void @dx.op.linAlgMatrixAccumulateToMemory.mC4M5N4U0S2.f32(i32 -2147483620, %dx.types.LinAlgMatrixC4M5N4U0S2 %v14, float addrspace(3)* getelementptr inbounds ([64 x float], [64 x float] addrspace(3)* @"\01?SharedArr@@3PAMA", i32 0, i32 0), i32 0, i32 0, i32 0) ; LinAlgMatrixAccumulateToMemory(matrix,memory,offset,stride,layout) %v15 = call %dx.types.LinAlgMatrixC4M5N4U0S2 @dx.op.linAlgMatrixLoadFromMemory.mC4M5N4U0S2.f32(i32 -2147483633, float addrspace(3)* getelementptr inbounds ([64 x float], [64 x float] addrspace(3)* @"\01?SharedArr@@3PAMA", i32 0, i32 0), i32 0, i32 0, i32 0) ; LinAlgMatrixLoadFromMemory(memory,offset,stride,layout) call void @dx.op.linAlgMatrixStoreToMemory.mC4M5N4U0S2.f32(i32 -2147483627, %dx.types.LinAlgMatrixC4M5N4U0S2 %v15, float addrspace(3)* getelementptr inbounds ([64 x float], [64 x float] addrspace(3)* @"\01?SharedArr@@3PAMA", i32 0, i32 0), i32 0, i32 0, i32 0) ; LinAlgMatrixStoreToMemory(matrix,memory,offset,stride,layout) - + ret void } @@ -213,7 +217,9 @@ define void @"\01?MainCL@@YAXUAttribs@@@Z"(%struct.Attribs* noalias nocapture %a %v6 = call <4 x i32> @dx.op.linAlgMatVecMul.v4i32.mC4M5N4U0S2.v4i32(i32 -2147483623, %dx.types.LinAlgMatrixC4M5N4U0S2 %v4, i1 true, <4 x i32> , i32 1) ; LinAlgMatVecMul(matrix,isOutputSigned,inputVector,interpretation) %v7 = call <4 x i32> @dx.op.linAlgMatVecMulAdd.v4i32.mC4M5N4U0S2.v4i32.v4i32(i32 -2147483622, %dx.types.LinAlgMatrixC4M5N4U0S2 %v4, i1 true, <4 x i32> , i32 2, <4 x i32> , i32 3) ; LinAlgMatVecMulAdd(matrix,isOutputSigned,inputVector,inputInterpretation,biasVector,biasInterpretation) %v16 = call <4 x float> @dx.op.linAlgConvert.v4f32.v4i32(i32 -2147483618, <4 x i32> zeroinitializer, i32 1, i32 2) ; LinAlgConvert(inputVector,inputInterpretation,outputInterpretation) - + ; dx.op.linAlgVectorAccumulateToDescriptor + call void @dx.op.linAlgVectorAccumulateToDescriptor.v4f32(i32 -2147483617, <4 x float> zeroinitializer, %dx.types.Handle %handle, i32 0, i32 64) ; LinAlgVectorAccumulateToDescriptor(vector,handle,offset,align) + ; ; Built-ins restricted to compute, mesh and amplification shaders ; @@ -228,7 +234,7 @@ define void @"\01?MainCL@@YAXUAttribs@@@Z"(%struct.Attribs* noalias nocapture %a call void @dx.op.linAlgMatrixAccumulateToMemory.mC4M5N4U0S2.f32(i32 -2147483620, %dx.types.LinAlgMatrixC4M5N4U0S2 %v14, float addrspace(3)* getelementptr inbounds ([64 x float], [64 x float] addrspace(3)* @"\01?SharedArr@@3PAMA", i32 0, i32 0), i32 0, i32 0, i32 0) ; LinAlgMatrixAccumulateToMemory(matrix,memory,offset,stride,layout) %v15 = call %dx.types.LinAlgMatrixC4M5N4U0S2 @dx.op.linAlgMatrixLoadFromMemory.mC4M5N4U0S2.f32(i32 -2147483633, float addrspace(3)* getelementptr inbounds ([64 x float], [64 x float] addrspace(3)* @"\01?SharedArr@@3PAMA", i32 0, i32 0), i32 0, i32 0, i32 0) ; LinAlgMatrixLoadFromMemory(memory,offset,stride,layout) call void @dx.op.linAlgMatrixStoreToMemory.mC4M5N4U0S2.f32(i32 -2147483627, %dx.types.LinAlgMatrixC4M5N4U0S2 %v15, float addrspace(3)* getelementptr inbounds ([64 x float], [64 x float] addrspace(3)* @"\01?SharedArr@@3PAMA", i32 0, i32 0), i32 0, i32 0, i32 0) ; LinAlgMatrixStoreToMemory(matrix,memory,offset,stride,layout) - + ret void } @@ -248,7 +254,9 @@ define void @"\01?MainAH@@YAXURayPayload@@UAttribs@@@Z"(%struct.RayPayload* noal %v6 = call <4 x i32> @dx.op.linAlgMatVecMul.v4i32.mC4M5N4U0S2.v4i32(i32 -2147483623, %dx.types.LinAlgMatrixC4M5N4U0S2 %v4, i1 true, <4 x i32> , i32 1) ; LinAlgMatVecMul(matrix,isOutputSigned,inputVector,interpretation) %v7 = call <4 x i32> @dx.op.linAlgMatVecMulAdd.v4i32.mC4M5N4U0S2.v4i32.v4i32(i32 -2147483622, %dx.types.LinAlgMatrixC4M5N4U0S2 %v4, i1 true, <4 x i32> , i32 2, <4 x i32> , i32 3) ; LinAlgMatVecMulAdd(matrix,isOutputSigned,inputVector,inputInterpretation,biasVector,biasInterpretation) %v16 = call <4 x float> @dx.op.linAlgConvert.v4f32.v4i32(i32 -2147483618, <4 x i32> zeroinitializer, i32 1, i32 2) ; LinAlgConvert(inputVector,inputInterpretation,outputInterpretation) - + ; dx.op.linAlgVectorAccumulateToDescriptor + call void @dx.op.linAlgVectorAccumulateToDescriptor.v4f32(i32 -2147483617, <4 x float> zeroinitializer, %dx.types.Handle %handle, i32 0, i32 64) ; LinAlgVectorAccumulateToDescriptor(vector,handle,offset,align) + ; ; Built-ins restricted to compute, mesh and amplification shaders ; @@ -263,7 +271,7 @@ define void @"\01?MainAH@@YAXURayPayload@@UAttribs@@@Z"(%struct.RayPayload* noal call void @dx.op.linAlgMatrixAccumulateToMemory.mC4M5N4U0S2.f32(i32 -2147483620, %dx.types.LinAlgMatrixC4M5N4U0S2 %v14, float addrspace(3)* getelementptr inbounds ([64 x float], [64 x float] addrspace(3)* @"\01?SharedArr@@3PAMA", i32 0, i32 0), i32 0, i32 0, i32 0) ; LinAlgMatrixAccumulateToMemory(matrix,memory,offset,stride,layout) %v15 = call %dx.types.LinAlgMatrixC4M5N4U0S2 @dx.op.linAlgMatrixLoadFromMemory.mC4M5N4U0S2.f32(i32 -2147483633, float addrspace(3)* getelementptr inbounds ([64 x float], [64 x float] addrspace(3)* @"\01?SharedArr@@3PAMA", i32 0, i32 0), i32 0, i32 0, i32 0) ; LinAlgMatrixLoadFromMemory(memory,offset,stride,layout) call void @dx.op.linAlgMatrixStoreToMemory.mC4M5N4U0S2.f32(i32 -2147483627, %dx.types.LinAlgMatrixC4M5N4U0S2 %v15, float addrspace(3)* getelementptr inbounds ([64 x float], [64 x float] addrspace(3)* @"\01?SharedArr@@3PAMA", i32 0, i32 0), i32 0, i32 0, i32 0) ; LinAlgMatrixStoreToMemory(matrix,memory,offset,stride,layout) - + ret void } @@ -283,7 +291,9 @@ define void @"\01?MainCH@@YAXURayPayload@@UAttribs@@@Z"(%struct.RayPayload* noal %v6 = call <4 x i32> @dx.op.linAlgMatVecMul.v4i32.mC4M5N4U0S2.v4i32(i32 -2147483623, %dx.types.LinAlgMatrixC4M5N4U0S2 %v4, i1 true, <4 x i32> , i32 1) ; LinAlgMatVecMul(matrix,isOutputSigned,inputVector,interpretation) %v7 = call <4 x i32> @dx.op.linAlgMatVecMulAdd.v4i32.mC4M5N4U0S2.v4i32.v4i32(i32 -2147483622, %dx.types.LinAlgMatrixC4M5N4U0S2 %v4, i1 true, <4 x i32> , i32 2, <4 x i32> , i32 3) ; LinAlgMatVecMulAdd(matrix,isOutputSigned,inputVector,inputInterpretation,biasVector,biasInterpretation) %v16 = call <4 x float> @dx.op.linAlgConvert.v4f32.v4i32(i32 -2147483618, <4 x i32> zeroinitializer, i32 1, i32 2) ; LinAlgConvert(inputVector,inputInterpretation,outputInterpretation) - + ; dx.op.linAlgVectorAccumulateToDescriptor + call void @dx.op.linAlgVectorAccumulateToDescriptor.v4f32(i32 -2147483617, <4 x float> zeroinitializer, %dx.types.Handle %handle, i32 0, i32 64) ; LinAlgVectorAccumulateToDescriptor(vector,handle,offset,align) + ; ; Built-ins restricted to compute, mesh and amplification shaders ; @@ -298,7 +308,7 @@ define void @"\01?MainCH@@YAXURayPayload@@UAttribs@@@Z"(%struct.RayPayload* noal call void @dx.op.linAlgMatrixAccumulateToMemory.mC4M5N4U0S2.f32(i32 -2147483620, %dx.types.LinAlgMatrixC4M5N4U0S2 %v14, float addrspace(3)* getelementptr inbounds ([64 x float], [64 x float] addrspace(3)* @"\01?SharedArr@@3PAMA", i32 0, i32 0), i32 0, i32 0, i32 0) ; LinAlgMatrixAccumulateToMemory(matrix,memory,offset,stride,layout) %v15 = call %dx.types.LinAlgMatrixC4M5N4U0S2 @dx.op.linAlgMatrixLoadFromMemory.mC4M5N4U0S2.f32(i32 -2147483633, float addrspace(3)* getelementptr inbounds ([64 x float], [64 x float] addrspace(3)* @"\01?SharedArr@@3PAMA", i32 0, i32 0), i32 0, i32 0, i32 0) ; LinAlgMatrixLoadFromMemory(memory,offset,stride,layout) call void @dx.op.linAlgMatrixStoreToMemory.mC4M5N4U0S2.f32(i32 -2147483627, %dx.types.LinAlgMatrixC4M5N4U0S2 %v15, float addrspace(3)* getelementptr inbounds ([64 x float], [64 x float] addrspace(3)* @"\01?SharedArr@@3PAMA", i32 0, i32 0), i32 0, i32 0, i32 0) ; LinAlgMatrixStoreToMemory(matrix,memory,offset,stride,layout) - + ret void } @@ -318,7 +328,9 @@ define void @"\01?MainMS@@YAXURayPayload@@@Z"(%struct.RayPayload* noalias nocapt %v6 = call <4 x i32> @dx.op.linAlgMatVecMul.v4i32.mC4M5N4U0S2.v4i32(i32 -2147483623, %dx.types.LinAlgMatrixC4M5N4U0S2 %v4, i1 true, <4 x i32> , i32 1) ; LinAlgMatVecMul(matrix,isOutputSigned,inputVector,interpretation) %v7 = call <4 x i32> @dx.op.linAlgMatVecMulAdd.v4i32.mC4M5N4U0S2.v4i32.v4i32(i32 -2147483622, %dx.types.LinAlgMatrixC4M5N4U0S2 %v4, i1 true, <4 x i32> , i32 2, <4 x i32> , i32 3) ; LinAlgMatVecMulAdd(matrix,isOutputSigned,inputVector,inputInterpretation,biasVector,biasInterpretation) %v16 = call <4 x float> @dx.op.linAlgConvert.v4f32.v4i32(i32 -2147483618, <4 x i32> zeroinitializer, i32 1, i32 2) ; LinAlgConvert(inputVector,inputInterpretation,outputInterpretation) - + ; dx.op.linAlgVectorAccumulateToDescriptor + call void @dx.op.linAlgVectorAccumulateToDescriptor.v4f32(i32 -2147483617, <4 x float> zeroinitializer, %dx.types.Handle %handle, i32 0, i32 64) ; LinAlgVectorAccumulateToDescriptor(vector,handle,offset,align) + ; ; Built-ins restricted to compute, mesh and amplification shaders ; @@ -333,7 +345,7 @@ define void @"\01?MainMS@@YAXURayPayload@@@Z"(%struct.RayPayload* noalias nocapt call void @dx.op.linAlgMatrixAccumulateToMemory.mC4M5N4U0S2.f32(i32 -2147483620, %dx.types.LinAlgMatrixC4M5N4U0S2 %v14, float addrspace(3)* getelementptr inbounds ([64 x float], [64 x float] addrspace(3)* @"\01?SharedArr@@3PAMA", i32 0, i32 0), i32 0, i32 0, i32 0) ; LinAlgMatrixAccumulateToMemory(matrix,memory,offset,stride,layout) %v15 = call %dx.types.LinAlgMatrixC4M5N4U0S2 @dx.op.linAlgMatrixLoadFromMemory.mC4M5N4U0S2.f32(i32 -2147483633, float addrspace(3)* getelementptr inbounds ([64 x float], [64 x float] addrspace(3)* @"\01?SharedArr@@3PAMA", i32 0, i32 0), i32 0, i32 0, i32 0) ; LinAlgMatrixLoadFromMemory(memory,offset,stride,layout) call void @dx.op.linAlgMatrixStoreToMemory.mC4M5N4U0S2.f32(i32 -2147483627, %dx.types.LinAlgMatrixC4M5N4U0S2 %v15, float addrspace(3)* getelementptr inbounds ([64 x float], [64 x float] addrspace(3)* @"\01?SharedArr@@3PAMA", i32 0, i32 0), i32 0, i32 0, i32 0) ; LinAlgMatrixStoreToMemory(matrix,memory,offset,stride,layout) - + ret void } @@ -370,6 +382,9 @@ declare <4 x i32> @dx.op.linAlgMatVecMulAdd.v4i32.mC4M5N4U0S2.v4i32.v4i32(i32, % ; Function Attrs: nounwind declare <4 x float> @dx.op.linAlgConvert.v4f32.v4i32(i32, <4 x i32>, i32, i32) #0 +; Function Attrs: nounwind +declare void @dx.op.linAlgVectorAccumulateToDescriptor.v4f32(i32, <4 x float>, %dx.types.Handle, i32, i32) #0 + ; Function Attrs: nounwind declare %dx.types.LinAlgMatrixC4M4N5U1S2 @dx.op.linAlgCopyConvertMatrix.mC4M4N5U1S2.mC4M5N4U0S2(i32, %dx.types.LinAlgMatrixC4M5N4U0S2, i1) #0 diff --git a/tools/clang/test/LitDXILValidation/LinAlgMatrix/linalgmatrix-type-allowed-in-dxil.ll b/tools/clang/test/LitDXILValidation/LinAlgMatrix/linalgmatrix-type-allowed-in-dxil.ll new file mode 100644 index 0000000000..7f7ec70488 --- /dev/null +++ b/tools/clang/test/LitDXILValidation/LinAlgMatrix/linalgmatrix-type-allowed-in-dxil.ll @@ -0,0 +1,35 @@ +; RUN: %dxv %s 2>&1 | FileCheck %s + +; CHECK-NOT: uses a reserved prefix. +; CHECK-NOT: Validation failed. +; CHECK: Validation succeeded. + +target datalayout = "e-m:e-p:32:32-i1:32-i8:8-i16:16-i32:32-i64:64-f16:16-f32:32-f64:64-n8:16:32:64" +target triple = "dxil-ms-dx" + +%dx.types.LinAlgMatrixC8M16N16U0S0 = type { i8* } +%struct.ByteAddressBuffer = type { i32 } + +define void @main() { + %1 = alloca %dx.types.LinAlgMatrixC8M16N16U0S0 + ret void +} + +!dx.targetTypes = !{!0} +!llvm.ident = !{!1} +!dx.version = !{!2} +!dx.valver = !{!2} +!dx.shaderModel = !{!3} +!dx.resources = !{!4} +!dx.entryPoints = !{!7} + +!0 = !{%dx.types.LinAlgMatrixC8M16N16U0S0 undef, i32 8, i32 16, i32 16, i32 0, i32 0} +!1 = !{!"dxc(private) 1.9.0.5348 (issue-8433, 167fd829e-dirty)"} +!2 = !{i32 1, i32 10} +!3 = !{!"cs", i32 6, i32 10} +!4 = !{!5, null, null, null} +!5 = !{!6} +!6 = !{i32 0, %struct.ByteAddressBuffer* undef, !"", i32 0, i32 0, i32 1, i32 11, i32 0, null} +!7 = !{void ()* @main, !"main", null, !4, !8} +!8 = !{i32 0, i64 8388625, i32 4, !9} +!9 = !{i32 8, i32 1, i32 1} diff --git a/tools/clang/test/LitDXILValidation/LinAlgMatrix/linalgmatrix-vs.ll b/tools/clang/test/LitDXILValidation/LinAlgMatrix/linalgmatrix-vs.ll index 09c9be8cf5..debf658676 100644 --- a/tools/clang/test/LitDXILValidation/LinAlgMatrix/linalgmatrix-vs.ll +++ b/tools/clang/test/LitDXILValidation/LinAlgMatrix/linalgmatrix-vs.ll @@ -43,65 +43,68 @@ define void @mainVS() { ; dx.op.linAlgMatrixAccumulate %v1 = call %dx.types.LinAlgMatrixC4M5N4U2S2 @dx.op.linAlgMatrixAccumulate.mC4M5N4U2S2.mC4M5N4U0S2.mC4M4N5U1S2(i32 -2147483624, %dx.types.LinAlgMatrixC4M5N4U0S2 undef, %dx.types.LinAlgMatrixC4M4N5U1S2 undef) ; LinAlgMatrixAccumulate(matrixLHS,matrixRHS) - + ; dx.op.linAlgMatrixAccumulateToDescriptor call void @dx.op.linAlgMatrixAccumulateToDescriptor.mC4M5N4U0S2(i32 -2147483621, %dx.types.LinAlgMatrixC4M5N4U0S2 undef, %dx.types.Handle %handle, i32 1, i32 2, i32 3, i32 4) ; LinAlgMatrixAccumulateToDescriptor(matrix,handle,offset,stride,layout) - + ; dx.op.linAlgMatrixLength %v2 = call i32 @dx.op.linAlgMatrixLength.mC4M5N4U0S2(i32 -2147483632, %dx.types.LinAlgMatrixC4M5N4U0S2 undef) ; LinAlgMatrixLength(matrix) - + ; dx.op.linAlgMatrixLoadFromDescriptor %v3 = call %dx.types.LinAlgMatrixC4M5N4U0S2 @dx.op.linAlgMatrixLoadFromDescriptor.mC4M5N4U0S2(i32 -2147483634, %dx.types.Handle %handle, i32 5, i32 5, i32 5, i32 4) ; LinAlgMatrixLoadFromDescriptor(handle,offset,stride,layout,align) - + ; dx.op.linAlgMatrixOuterProduct %v4 = call %dx.types.LinAlgMatrixC4M5N4U0S2 @dx.op.linAlgMatrixOuterProduct.mC4M5N4U0S2.v4i32.v4i32(i32 -2147483619, <4 x i32> , <4 x i32> ) ; LinAlgMatrixOuterProduct(vectorA,vectorB) - + ; dx.op.linAlgMatrixQueryAccumulatorLayout %v5 = call i32 @dx.op.linAlgMatrixQueryAccumulatorLayout(i32 -2147483626) ; LinAlgMatrixQueryAccumulatorLayout() - + ; dx.op.linAlgMatVecMul %v6 = call <4 x i32> @dx.op.linAlgMatVecMul.v4i32.mC4M5N4U0S2.v4i32(i32 -2147483623, %dx.types.LinAlgMatrixC4M5N4U0S2 %v4, i1 true, <4 x i32> , i32 1) ; LinAlgMatVecMul(matrix,isOutputSigned,inputVector,interpretation) - + ; dx.op.linAlgMatVecMulAdd %v7 = call <4 x i32> @dx.op.linAlgMatVecMulAdd.v4i32.mC4M5N4U0S2.v4i32.v4i32(i32 -2147483622, %dx.types.LinAlgMatrixC4M5N4U0S2 %v4, i1 true, <4 x i32> , i32 2, <4 x i32> , i32 3) ; LinAlgMatVecMulAdd(matrix,isOutputSigned,inputVector,inputInterpretation,biasVector,biasInterpretation) - + ; dx.op.linAlgConvert %v16 = call <4 x float> @dx.op.linAlgConvert.v4f32.v4i32(i32 -2147483618, <4 x i32> zeroinitializer, i32 1, i32 2) ; LinAlgConvert(inputVector,inputInterpretation,outputInterpretation) + ; dx.op.linAlgVectorAccumulateToDescriptor + call void @dx.op.linAlgVectorAccumulateToDescriptor.v4f32(i32 -2147483617, <4 x float> zeroinitializer, %dx.types.Handle %handle, i32 0, i32 64) ; LinAlgVectorAccumulateToDescriptor(vector,handle,offset,align) + ; ; Built-ins restricted to compute, mesh and amplification shaders ; ; dx.op.linAlgCopyConvertMatrix %v8 = call %dx.types.LinAlgMatrixC4M4N5U1S2 @dx.op.linAlgCopyConvertMatrix.mC4M4N5U1S2.mC4M5N4U0S2(i32 -2147483635, %dx.types.LinAlgMatrixC4M5N4U0S2 %v4, i1 true) ; LinAlgCopyConvertMatrix(srcMatrix,transpose) - + ; dx.op.linAlgFillMatrix %v9 = call %dx.types.LinAlgMatrixC4M5N4U0S2 @dx.op.linAlgFillMatrix.mC4M5N4U0S2.i32(i32 -2147483636, i32 15) ; LinAlgFillMatrix(value) - + ; dx.op.linAlgMatrixGetCoordinate %v10 = call <2 x i32> @dx.op.linAlgMatrixGetCoordinate.mC4M5N4U0S2(i32 -2147483631, %dx.types.LinAlgMatrixC4M5N4U0S2 %v9, i32 0) ; LinAlgMatrixGetCoordinate(matrix,threadLocalIndex) - + ; dx.op.linAlgMatrixGetElement %v11 = call float @dx.op.linAlgMatrixGetElement.f32.mC4M5N4U0S2(i32 -2147483630, %dx.types.LinAlgMatrixC4M5N4U0S2 %v9, i32 0) ; LinAlgMatrixGetElement(matrix,threadLocalIndex) - + ; dx.op.linAlgMatrixMultiply %v12 = call %dx.types.LinAlgMatrixC4M5N4U2S2 @dx.op.linAlgMatrixMultiply.mC4M5N4U2S2.mC4M5N4U0S2.mC4M4N5U1S2(i32 -2147483625, %dx.types.LinAlgMatrixC4M5N4U0S2 %v9, %dx.types.LinAlgMatrixC4M4N5U1S2 %v8) ; LinAlgMatrixMultiply(matrixA,matrixB) - + ; dx.op.linAlgMatrixMultiplyAccumulate %v13 = call %dx.types.LinAlgMatrixC4M5N4U2S2 @dx.op.linAlgMatrixMultiplyAccumulate.mC4M5N4U2S2.mC4M5N4U0S2.mC4M4N5U1S2.mC4M5N4U2S2(i32 -2147483637, %dx.types.LinAlgMatrixC4M5N4U0S2 %v9, %dx.types.LinAlgMatrixC4M4N5U1S2 %v8, %dx.types.LinAlgMatrixC4M5N4U2S2 %v12) ; LinAlgMatrixMultiplyAccumulate(matrixA,matrixB,matrixC) - + ; dx.op.linAlgMatrixSetElement %v14 = call %dx.types.LinAlgMatrixC4M5N4U0S2 @dx.op.linAlgMatrixSetElement.mC4M5N4U0S2.mC4M5N4U0S2.i32(i32 -2147483629, %dx.types.LinAlgMatrixC4M5N4U0S2 %v9, i32 1, i32 1) ; LinAlgMatrixSetElement(matrix,threadLocalIndex,value) ; dx.op.linAlgMatrixStoreToDescriptor call void @dx.op.linAlgMatrixStoreToDescriptor.mC4M5N4U0S2(i32 -2147483628, %dx.types.LinAlgMatrixC4M5N4U0S2 %v14, %dx.types.Handle %handle, i32 1, i32 2, i32 3, i32 4) ; LinAlgMatrixStoreToDescriptor(matrix,handle,offset,stride,layout) - + ; dx.op.linAlgMatrixAccumulateToMemory call void @dx.op.linAlgMatrixAccumulateToMemory.mC4M5N4U0S2.f32(i32 -2147483620, %dx.types.LinAlgMatrixC4M5N4U0S2 %v14, float addrspace(3)* getelementptr inbounds ([64 x float], [64 x float] addrspace(3)* @"\01?SharedArr@@3PAMA", i32 0, i32 0), i32 0, i32 0, i32 0) ; LinAlgMatrixAccumulateToMemory(matrix,memory,offset,stride,layout) - + ; dx.op.linAlgMatrixLoadFromMemory %v15 = call %dx.types.LinAlgMatrixC4M5N4U0S2 @dx.op.linAlgMatrixLoadFromMemory.mC4M5N4U0S2.f32(i32 -2147483633, float addrspace(3)* getelementptr inbounds ([64 x float], [64 x float] addrspace(3)* @"\01?SharedArr@@3PAMA", i32 0, i32 0), i32 0, i32 0, i32 0) ; LinAlgMatrixLoadFromMemory(memory,offset,stride,layout) - + ; dx.op.linAlgMatrixStoreToMemory call void @dx.op.linAlgMatrixStoreToMemory.mC4M5N4U0S2.f32(i32 -2147483627, %dx.types.LinAlgMatrixC4M5N4U0S2 %v15, float addrspace(3)* getelementptr inbounds ([64 x float], [64 x float] addrspace(3)* @"\01?SharedArr@@3PAMA", i32 0, i32 0), i32 0, i32 0, i32 0) ; LinAlgMatrixStoreToMemory(matrix,memory,offset,stride,layout) @@ -109,7 +112,7 @@ define void @mainVS() { call void @dx.op.storeOutput.f32(i32 5, i32 0, i32 0, i8 1, float 1.000000e+00) ; StoreOutput(outputSigId,rowIndex,colIndex,value) call void @dx.op.storeOutput.f32(i32 5, i32 0, i32 0, i8 2, float 1.000000e+00) ; StoreOutput(outputSigId,rowIndex,colIndex,value) call void @dx.op.storeOutput.f32(i32 5, i32 0, i32 0, i8 3, float 1.000000e+00) ; StoreOutput(outputSigId,rowIndex,colIndex,value) - + ret void } @@ -146,6 +149,9 @@ declare <4 x i32> @dx.op.linAlgMatVecMulAdd.v4i32.mC4M5N4U0S2.v4i32.v4i32(i32, % ; Function Attrs: nounwind declare <4 x float> @dx.op.linAlgConvert.v4f32.v4i32(i32, <4 x i32>, i32, i32) #0 +; Function Attrs: nounwind +declare void @dx.op.linAlgVectorAccumulateToDescriptor.v4f32(i32, <4 x float>, %dx.types.Handle, i32, i32) #0 + ; Function Attrs: nounwind declare %dx.types.LinAlgMatrixC4M4N5U1S2 @dx.op.linAlgCopyConvertMatrix.mC4M4N5U1S2.mC4M5N4U0S2(i32, %dx.types.LinAlgMatrixC4M5N4U0S2, i1) #0 diff --git a/tools/clang/test/SemaHLSL/decltype-ptr-ref-instance-vars.hlsl b/tools/clang/test/SemaHLSL/decltype-ptr-ref-instance-vars.hlsl new file mode 100644 index 0000000000..2b12371598 --- /dev/null +++ b/tools/clang/test/SemaHLSL/decltype-ptr-ref-instance-vars.hlsl @@ -0,0 +1,67 @@ +// RUN: %dxc -Tlib_6_3 -Wno-unused-value -verify %s +// RUN: %dxc -Tcs_6_0 -Wno-unused-value -verify %s + +// Verify that pointer and reference types produced by __decltype cannot be +// used as struct instance variable types or local variable types in HLSL. +// Also verifies that template instantiation with pointer/reference type +// arguments is rejected, and that valid __decltype uses are not affected. + +// __decltype is the GCC way of saying 'decltype', but doesn't require C++11. + +// groupshared variables are mutable (unlike plain global variables in HLSL), +// which allows their lvalue expressions to produce reference types via +// __decltype. +groupshared int g; + +// --- Struct field: reference type from __decltype --- +struct RefField { + __decltype(++g) ref_field; // expected-error {{references are unsupported in HLSL}} +}; + +// --- Struct field: pointer type via explicit cast in __decltype --- +struct PtrField { + __decltype((int *)0) ptr_field; // expected-error {{pointers are unsupported in HLSL}} +}; + +// --- Struct field: plain (non-reference) type from __decltype is valid --- +struct PlainField { + __decltype(0 + 1) plain_field; // no error: int rvalue, not a reference +}; + +// --- Local variable: reference type from __decltype --- +void test_local_ref() { + int x = 0; + __decltype(++x) local_ref; // expected-error {{references are unsupported in HLSL}} +} + +// --- Local variable: pointer type via __decltype --- +void test_local_ptr() { + __decltype((int *)0) local_ptr; // expected-error {{pointers are unsupported in HLSL}} +} + +// --- Template: field with explicit reference type is rejected at definition --- +template +struct RefContainer { + T &ref_field; // expected-error {{references are unsupported in HLSL}} +}; + +// --- Template instantiation: type argument is an explicit pointer type --- +// This verifies that pointer instance variables cannot be created through +// template instantiation with pointer type arguments. +template +struct Container { + T field; +}; + +void test_template_ptr_explicit() { + Container c; // expected-error {{pointers are unsupported in HLSL}} +} + +// --- Regression: __decltype in is_same template argument still works --- +// HLSL has a non-standard is_same extension that treats T and T& as the same +// type. This is used in scalar-operators tests and must not be broken. +void test_is_same_regression() { + int x = 0; + _Static_assert(std::is_same::value, + "regression: is_same with lvalue __decltype must still work"); +} diff --git a/tools/clang/test/SemaHLSL/hlsl/linalg/builtins/matrix-builtins-ast.hlsl b/tools/clang/test/SemaHLSL/hlsl/linalg/builtins/matrix-builtins-ast.hlsl index af2ab8d2a3..cb3a59cf5d 100644 --- a/tools/clang/test/SemaHLSL/hlsl/linalg/builtins/matrix-builtins-ast.hlsl +++ b/tools/clang/test/SemaHLSL/hlsl/linalg/builtins/matrix-builtins-ast.hlsl @@ -205,4 +205,13 @@ void main() { // CHECK-NEXT: AvailabilityAttr {{.*}} Implicit 6.10 0 0 "" int4 result2; __builtin_LinAlg_Convert(result2, vec, 0, 1); + +// CHECK: FunctionDecl {{.*}} implicit used __builtin_LinAlg_VectorAccumulateToDescriptor 'void (vector, RWByteAddressBuffer, unsigned int, unsigned int)' extern +// CHECK-NEXT: ParmVarDecl {{.*}} vec 'vector':'vector' +// CHECK-NEXT: ParmVarDecl {{.*}} buf 'RWByteAddressBuffer' +// CHECK-NEXT: ParmVarDecl {{.*}} offset 'unsigned int' +// CHECK-NEXT: ParmVarDecl {{.*}} align 'unsigned int' +// CHECK-NEXT: HLSLIntrinsicAttr {{.*}} Implicit "op" "" 423 +// CHECK-NEXT: AvailabilityAttr {{.*}} Implicit 6.10 0 0 "" + __builtin_LinAlg_VectorAccumulateToDescriptor(input, Buf, 10, 64); } diff --git a/tools/clang/test/SemaHLSL/hlsl/linalg/builtins/stage-errors.hlsl b/tools/clang/test/SemaHLSL/hlsl/linalg/builtins/stage-errors.hlsl index b174621ea3..b48cb88fff 100644 --- a/tools/clang/test/SemaHLSL/hlsl/linalg/builtins/stage-errors.hlsl +++ b/tools/clang/test/SemaHLSL/hlsl/linalg/builtins/stage-errors.hlsl @@ -88,6 +88,7 @@ void CallFunction() __builtin_LinAlg_MatrixVectorMultiplyAdd(vecA, mat1, true, vecB, 2, vecC, 3); int4 outVec; __builtin_LinAlg_Convert(outVec, vecA, 1, 2); + __builtin_LinAlg_VectorAccumulateToDescriptor(vecA, buf, 0, 64); // expected-error@+12{{builtin unavailable in shader stage 'pixel' (requires 'compute', 'mesh' or 'amplification')}} // expected-error@+11{{builtin unavailable in shader stage 'vertex' (requires 'compute', 'mesh' or 'amplification')}} diff --git a/tools/clang/test/SemaHLSL/hlsl/linalg/builtins/unavailable_pre_sm610.hlsl b/tools/clang/test/SemaHLSL/hlsl/linalg/builtins/unavailable_pre_sm610.hlsl index c39b89f781..0005925d1c 100644 --- a/tools/clang/test/SemaHLSL/hlsl/linalg/builtins/unavailable_pre_sm610.hlsl +++ b/tools/clang/test/SemaHLSL/hlsl/linalg/builtins/unavailable_pre_sm610.hlsl @@ -71,4 +71,7 @@ void main() { // expected-error@+1{{intrinsic __builtin_LinAlg_Convert potentially used by ''main'' requires shader model 6.10 or greater}} __builtin_LinAlg_Convert(result, vec1, 1, 1); + + // expected-error@+1{{intrinsic __builtin_LinAlg_VectorAccumulateToDescriptor potentially used by ''main'' requires shader model 6.10 or greater}} + __builtin_LinAlg_VectorAccumulateToDescriptor(vec1, Buf, 1, 64); } diff --git a/tools/clang/test/SemaHLSL/more-operators.hlsl b/tools/clang/test/SemaHLSL/more-operators.hlsl index cbd0250fb9..ed449051b6 100644 --- a/tools/clang/test/SemaHLSL/more-operators.hlsl +++ b/tools/clang/test/SemaHLSL/more-operators.hlsl @@ -276,25 +276,25 @@ float4 plain(float4 param4 /* : FOO */) /*: FOO */{ _Static_assert(std::is_same::value, ""); (--bool_l); // expected-error {{operator cannot be used with a bool lvalue}} fxc-error {{X3020: operator cannot be used with a bool lvalue}} (bool_l--); // expected-error {{operator cannot be used with a bool lvalue}} fxc-error {{X3020: operator cannot be used with a bool lvalue}} - _Static_assert(std::is_same::value, ""); // expected-error {{pointers are unsupported in HLSL}} fxc-pass {{}} + _Static_assert(std::is_same::value, ""); // expected-error {{references are unsupported in HLSL}} fxc-pass {{}} _Static_assert(std::is_same::value, ""); - _Static_assert(std::is_same::value, ""); // expected-error {{pointers are unsupported in HLSL}} fxc-pass {{}} + _Static_assert(std::is_same::value, ""); // expected-error {{references are unsupported in HLSL}} fxc-pass {{}} _Static_assert(std::is_same::value, ""); - _Static_assert(std::is_same::value, ""); // expected-error {{pointers are unsupported in HLSL}} fxc-pass {{}} + _Static_assert(std::is_same::value, ""); // expected-error {{references are unsupported in HLSL}} fxc-pass {{}} _Static_assert(std::is_same::value, ""); - _Static_assert(std::is_same::value, ""); // expected-error {{pointers are unsupported in HLSL}} fxc-pass {{}} + _Static_assert(std::is_same::value, ""); // expected-error {{references are unsupported in HLSL}} fxc-pass {{}} _Static_assert(std::is_same::value, ""); - _Static_assert(std::is_same::value, ""); // expected-error {{pointers are unsupported in HLSL}} fxc-pass {{}} + _Static_assert(std::is_same::value, ""); // expected-error {{references are unsupported in HLSL}} fxc-pass {{}} _Static_assert(std::is_same::value, ""); - _Static_assert(std::is_same::value, ""); // expected-error {{pointers are unsupported in HLSL}} fxc-pass {{}} + _Static_assert(std::is_same::value, ""); // expected-error {{references are unsupported in HLSL}} fxc-pass {{}} _Static_assert(std::is_same::value, ""); - _Static_assert(std::is_same::value, ""); // expected-error {{pointers are unsupported in HLSL}} fxc-pass {{}} + _Static_assert(std::is_same::value, ""); // expected-error {{references are unsupported in HLSL}} fxc-pass {{}} _Static_assert(std::is_same::value, ""); // fxc-pass {{}} - _Static_assert(std::is_same::value, ""); // expected-error {{pointers are unsupported in HLSL}} fxc-pass {{}} + _Static_assert(std::is_same::value, ""); // expected-error {{references are unsupported in HLSL}} fxc-pass {{}} _Static_assert(std::is_same::value, ""); - _Static_assert(std::is_same::value, ""); // expected-error {{pointers are unsupported in HLSL}} fxc-pass {{}} + _Static_assert(std::is_same::value, ""); // expected-error {{references are unsupported in HLSL}} fxc-pass {{}} _Static_assert(std::is_same::value, ""); // fxc-pass {{}} - _Static_assert(std::is_same::value, ""); // expected-error {{pointers are unsupported in HLSL}} fxc-pass {{}} + _Static_assert(std::is_same::value, ""); // expected-error {{references are unsupported in HLSL}} fxc-pass {{}} _Static_assert(std::is_same::value, ""); (--SamplerState_l); // expected-error {{scalar, vector, or matrix expected}} fxc-pass {{}} (SamplerState_l--); // expected-error {{scalar, vector, or matrix expected}} fxc-pass {{}} @@ -306,39 +306,39 @@ float4 plain(float4 param4 /* : FOO */) /*: FOO */{ (bool1_l--); // expected-error {{operator cannot be used with a bool lvalue}} fxc-error {{X3020: operator cannot be used with a bool lvalue}} (--bool2_l); // expected-error {{operator cannot be used with a bool lvalue}} fxc-error {{X3020: operator cannot be used with a bool lvalue}} (bool2_l--); // expected-error {{operator cannot be used with a bool lvalue}} fxc-error {{X3020: operator cannot be used with a bool lvalue}} - _Static_assert(std::is_same::value, ""); // expected-error {{pointers are unsupported in HLSL}} fxc-pass {{}} + _Static_assert(std::is_same::value, ""); // expected-error {{references are unsupported in HLSL}} fxc-pass {{}} _Static_assert(std::is_same::value, ""); - _Static_assert(std::is_same::value, ""); // expected-error {{pointers are unsupported in HLSL}} fxc-pass {{}} + _Static_assert(std::is_same::value, ""); // expected-error {{references are unsupported in HLSL}} fxc-pass {{}} _Static_assert(std::is_same::value, ""); - _Static_assert(std::is_same::value, ""); // expected-error {{pointers are unsupported in HLSL}} fxc-pass {{}} + _Static_assert(std::is_same::value, ""); // expected-error {{references are unsupported in HLSL}} fxc-pass {{}} _Static_assert(std::is_same::value, ""); /* fxc-pass {{}} */ - _Static_assert(std::is_same::value, ""); // expected-error {{pointers are unsupported in HLSL}} fxc-pass {{}} + _Static_assert(std::is_same::value, ""); // expected-error {{references are unsupported in HLSL}} fxc-pass {{}} _Static_assert(std::is_same::value, ""); - _Static_assert(std::is_same::value, ""); // expected-error {{pointers are unsupported in HLSL}} fxc-pass {{}} + _Static_assert(std::is_same::value, ""); // expected-error {{references are unsupported in HLSL}} fxc-pass {{}} _Static_assert(std::is_same::value, ""); - _Static_assert(std::is_same::value, ""); // expected-error {{pointers are unsupported in HLSL}} fxc-pass {{}} + _Static_assert(std::is_same::value, ""); // expected-error {{references are unsupported in HLSL}} fxc-pass {{}} _Static_assert(std::is_same::value, ""); (++bool_l); // expected-error {{operator cannot be used with a bool lvalue}} fxc-error {{X3020: operator cannot be used with a bool lvalue}} (bool_l++); // expected-error {{operator cannot be used with a bool lvalue}} fxc-error {{X3020: operator cannot be used with a bool lvalue}} - _Static_assert(std::is_same::value, ""); // expected-error {{pointers are unsupported in HLSL}} fxc-pass {{}} + _Static_assert(std::is_same::value, ""); // expected-error {{references are unsupported in HLSL}} fxc-pass {{}} _Static_assert(std::is_same::value, ""); - _Static_assert(std::is_same::value, ""); // expected-error {{pointers are unsupported in HLSL}} fxc-pass {{}} + _Static_assert(std::is_same::value, ""); // expected-error {{references are unsupported in HLSL}} fxc-pass {{}} _Static_assert(std::is_same::value, ""); - _Static_assert(std::is_same::value, ""); // expected-error {{pointers are unsupported in HLSL}} fxc-pass {{}} + _Static_assert(std::is_same::value, ""); // expected-error {{references are unsupported in HLSL}} fxc-pass {{}} _Static_assert(std::is_same::value, ""); - _Static_assert(std::is_same::value, ""); // expected-error {{pointers are unsupported in HLSL}} fxc-pass {{}} + _Static_assert(std::is_same::value, ""); // expected-error {{references are unsupported in HLSL}} fxc-pass {{}} _Static_assert(std::is_same::value, ""); - _Static_assert(std::is_same::value, ""); // expected-error {{pointers are unsupported in HLSL}} fxc-pass {{}} + _Static_assert(std::is_same::value, ""); // expected-error {{references are unsupported in HLSL}} fxc-pass {{}} _Static_assert(std::is_same::value, ""); - _Static_assert(std::is_same::value, ""); // expected-error {{pointers are unsupported in HLSL}} fxc-pass {{}} + _Static_assert(std::is_same::value, ""); // expected-error {{references are unsupported in HLSL}} fxc-pass {{}} _Static_assert(std::is_same::value, ""); - _Static_assert(std::is_same::value, ""); // expected-error {{pointers are unsupported in HLSL}} fxc-pass {{}} + _Static_assert(std::is_same::value, ""); // expected-error {{references are unsupported in HLSL}} fxc-pass {{}} _Static_assert(std::is_same::value, ""); // fxc-pass {{}} - _Static_assert(std::is_same::value, ""); // expected-error {{pointers are unsupported in HLSL}} fxc-pass {{}} + _Static_assert(std::is_same::value, ""); // expected-error {{references are unsupported in HLSL}} fxc-pass {{}} _Static_assert(std::is_same::value, ""); - _Static_assert(std::is_same::value, ""); // expected-error {{pointers are unsupported in HLSL}} fxc-pass {{}} + _Static_assert(std::is_same::value, ""); // expected-error {{references are unsupported in HLSL}} fxc-pass {{}} _Static_assert(std::is_same::value, ""); // fxc-pass {{}} - _Static_assert(std::is_same::value, ""); // expected-error {{pointers are unsupported in HLSL}} fxc-pass {{}} + _Static_assert(std::is_same::value, ""); // expected-error {{references are unsupported in HLSL}} fxc-pass {{}} _Static_assert(std::is_same::value, ""); (++SamplerState_l); // expected-error {{scalar, vector, or matrix expected}} fxc-pass {{}} (SamplerState_l++); // expected-error {{scalar, vector, or matrix expected}} fxc-pass {{}} @@ -350,17 +350,17 @@ float4 plain(float4 param4 /* : FOO */) /*: FOO */{ (bool1_l++); // expected-error {{operator cannot be used with a bool lvalue}} fxc-error {{X3020: operator cannot be used with a bool lvalue}} (++bool2_l); // expected-error {{operator cannot be used with a bool lvalue}} fxc-error {{X3020: operator cannot be used with a bool lvalue}} (bool2_l++); // expected-error {{operator cannot be used with a bool lvalue}} fxc-error {{X3020: operator cannot be used with a bool lvalue}} - _Static_assert(std::is_same::value, ""); // expected-error {{pointers are unsupported in HLSL}} fxc-pass {{}} + _Static_assert(std::is_same::value, ""); // expected-error {{references are unsupported in HLSL}} fxc-pass {{}} _Static_assert(std::is_same::value, ""); - _Static_assert(std::is_same::value, ""); // expected-error {{pointers are unsupported in HLSL}} fxc-pass {{}} + _Static_assert(std::is_same::value, ""); // expected-error {{references are unsupported in HLSL}} fxc-pass {{}} _Static_assert(std::is_same::value, ""); - _Static_assert(std::is_same::value, ""); // expected-error {{pointers are unsupported in HLSL}} fxc-pass {{}} + _Static_assert(std::is_same::value, ""); // expected-error {{references are unsupported in HLSL}} fxc-pass {{}} _Static_assert(std::is_same::value, ""); /* fxc-pass {{}} */ - _Static_assert(std::is_same::value, ""); // expected-error {{pointers are unsupported in HLSL}} fxc-pass {{}} + _Static_assert(std::is_same::value, ""); // expected-error {{references are unsupported in HLSL}} fxc-pass {{}} _Static_assert(std::is_same::value, ""); - _Static_assert(std::is_same::value, ""); // expected-error {{pointers are unsupported in HLSL}} fxc-pass {{}} + _Static_assert(std::is_same::value, ""); // expected-error {{references are unsupported in HLSL}} fxc-pass {{}} _Static_assert(std::is_same::value, ""); - _Static_assert(std::is_same::value, ""); // expected-error {{pointers are unsupported in HLSL}} fxc-pass {{}} + _Static_assert(std::is_same::value, ""); // expected-error {{references are unsupported in HLSL}} fxc-pass {{}} _Static_assert(std::is_same::value, ""); // Tests with multidimensional arrays. diff --git a/tools/clang/test/SemaHLSL/overloading-new-delete-errors.hlsl b/tools/clang/test/SemaHLSL/overloading-new-delete-errors.hlsl index ed68ecc4d9..c22e97479c 100644 --- a/tools/clang/test/SemaHLSL/overloading-new-delete-errors.hlsl +++ b/tools/clang/test/SemaHLSL/overloading-new-delete-errors.hlsl @@ -7,16 +7,16 @@ struct S { float foo; - void * operator new(int size) { // expected-error {{overloading 'operator new' is not allowed}} expected-error {{pointers are unsupported in HLSL}} - return (void *)0; // expected-error {{pointers are unsupported in HLSL}} expected-error {{cannot convert from 'literal int' to 'void *'}} expected-warning {{'operator new' should not return a null pointer unless it is declared 'throw()'}} + S operator new(int size) { // expected-error {{overloading 'operator new' is not allowed}} + return (S)0; } - void operator delete(void *ptr) { // expected-error {{overloading 'operator delete' is not allowed}} expected-error {{pointers are unsupported in HLSL}} + void operator delete(int ptr) { // expected-error {{overloading 'operator delete' is not allowed}} (void) ptr; } }; [shader("vertex")] void main() { - S *a = new S(); // expected-error {{'new' is a reserved keyword in HLSL}} expected-error {{pointers are unsupported in HLSL}} + S a = new S(); // expected-error {{'new' is a reserved keyword in HLSL}} delete a; // expected-error {{'delete' is a reserved keyword in HLSL}} } diff --git a/tools/clang/test/SemaHLSL/template-implicit-this-sfinae.hlsl b/tools/clang/test/SemaHLSL/template-implicit-this-sfinae.hlsl new file mode 100644 index 0000000000..e14ee1dbb1 --- /dev/null +++ b/tools/clang/test/SemaHLSL/template-implicit-this-sfinae.hlsl @@ -0,0 +1,65 @@ +// RUN: %dxc -T cs_6_0 %s 2>&1 | FileCheck %s --check-prefix=CHECK_COMPILE +// RUN: %dxc -T cs_6_0 -ast-dump %s 2>&1 | FileCheck %s + +// Test that template instantiation of member functions with SFINAE patterns +// involving static const members (accessed via implicit 'this') does not +// assert or crash. In HLSL, 'this' is an lvalue reference (not a pointer), +// so CXXDependentScopeMemberExpr must store the class type T (not T*) as the +// base type to avoid HLSL's ban on pointer types during template instantiation. + +namespace hlsl { +template struct enable_if {}; +template struct enable_if { + using type = T; +}; +template struct is_arithmetic { + static const bool value = false; +}; +template <> struct is_arithmetic { + static const bool value = true; +}; +template <> struct is_arithmetic { + static const bool value = true; +}; +} // namespace hlsl + +template +struct Wrapper { + static const bool IsArithmetic = hlsl::is_arithmetic::value; + + // SFINAE on a static const bool member accessed via implicit 'this'. + // This pattern previously triggered an assert when built with + // LLVM_ENABLE_ASSERTIONS=ON because template instantiation tried to rebuild + // the implicit 'this' pointer type, which is illegal in HLSL. + template + typename hlsl::enable_if::type Get() { + return val; + } + + T val; +}; + +// Verify that in the uninstantiated template the implicit 'this' is an lvalue +// of the class type (not a pointer), so HLSL's pointer ban is not violated. +// CHECK: CXXThisExpr {{.*}} 'Wrapper' lvalue this + +// Verify the same holds in the Wrapper instantiation's Get method. +// CHECK: CXXThisExpr {{.*}} 'Wrapper' lvalue this + +// Verify the same holds in the Wrapper instantiation's Get method. +// CHECK: CXXThisExpr {{.*}} 'Wrapper' lvalue this + +// Verify no CXXThisExpr carries a pointer type for 'this'. +// CHECK-NOT: CXXThisExpr {{.*}} '{{[^']*}} \*' lvalue this + +// CHECK_COMPILE: define void @main +[numthreads(1, 1, 1)] +void main() { + Wrapper wf; + wf.val = 1.0f; + float f = wf.Get(); + + Wrapper wi; + wi.val = 2; + int i = wi.Get(); +} diff --git a/tools/clang/test/SemaHLSL/varmods-syntax.hlsl b/tools/clang/test/SemaHLSL/varmods-syntax.hlsl index 17fa7cd810..b6788f4234 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 const float2 g_ext_pre_uni_con; -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 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 const float2 g_ext_pre_con; extern uniform float2 g_ext_uni; -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 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 const float2 g_ext_uni_con; -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 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 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 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 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 const float2 g_pre_sta_con; precise uniform float2 g_pre_uni; -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 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 const float2 g_pre_uni_con; -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 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 const float2 g_pre_con; static float2 g_sta; -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 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 const float2 g_sta_con; uniform float2 g_uni; -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 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 const float2 g_uni_con; -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'}} */ +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'}} */ 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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'}} */ +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'}} */ 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'}} */ -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 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 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'}} */ -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 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 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'}} */ -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 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 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'}} */ -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 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 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'}} */ -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 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 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'}} */ -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 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 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'}} */ -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 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 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'}} */ -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 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 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'}} */ -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 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 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'}} */ -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 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 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'}} */ -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 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 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'}} */ -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 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 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; -typedef precise volatile const float2 t_pre_vol_con; +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 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'}} */ -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 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 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'}} */ -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 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 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; -typedef volatile const float2 t_vol_con; +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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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'}} */ + 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'}} */ 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 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_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_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 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_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_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 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_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_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 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_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_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 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_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_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 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_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_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 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_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_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 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_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_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 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_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_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 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_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_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 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_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_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 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_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_con(precise uniform const float4 val) { return val; } -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_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_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 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_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_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 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_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_con(uniform const float4 val) { return val; } -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_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_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'}} */ - 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 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 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'}} */ - 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 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 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'}} */ - 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 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 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'}} */ - 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 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 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'}} */ - 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 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 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'}} */ - 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 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 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'}} */ - 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 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 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'}} */ - 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 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 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'}} */ - 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 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 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'}} */ - 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 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 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; - precise static volatile const float l_pre_sta_vol_con; + 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 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 {{X3047: 'l_pre_uni_vol_con': 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 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; - precise volatile const float l_pre_vol_con; /* fxc-error {{X3012: 'l_pre_vol_con': missing initial value}} */ + 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 const float l_pre_con; /* fxc-error {{X3012: 'l_pre_con': missing initial value}} */ static float l_sta; - static volatile float l_sta_vol; - static volatile const float l_sta_vol_con; + 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 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 {{X3047: 'l_uni_vol_con': 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 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; - volatile const float l_vol_con; /* fxc-error {{X3012: 'l_vol_con': missing initial value}} */ + 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}} */ 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'}} */ + 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 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'}} */ + 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 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'}} */ + 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 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'}} */ + 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 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'}} */ + 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 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'}} */ + 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 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'}} */ + 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 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'}} */ + 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 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'}} */ + 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 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'}} */ + 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 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; + precise static volatile const float l_pre_sta_vol_con_init = 0.0; /* expected-error {{'volatile' is a reserved keyword in HLSL}} */ 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'}} */ + 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 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; + precise volatile const float l_pre_vol_con_init = 0.0; /* expected-error {{'volatile' is a reserved keyword in HLSL}} */ precise const float l_pre_con_init = 0.0; - static volatile const float l_sta_vol_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 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'}} */ + 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 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; + volatile const float l_vol_con_init = 0.0; /* expected-error {{'volatile' is a reserved keyword in HLSL}} */ 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 {{}} */ +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 {{}} */ 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 {{}} */ + 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 {{}} */ const float fn_con() { return 1.0f; } // GENERATED_CODE:END diff --git a/tools/clang/unittests/HLSLExec/LinAlgTests.cpp b/tools/clang/unittests/HLSLExec/LinAlgTests.cpp index 961cc4f8a1..7b8aeeeba7 100644 --- a/tools/clang/unittests/HLSLExec/LinAlgTests.cpp +++ b/tools/clang/unittests/HLSLExec/LinAlgTests.cpp @@ -28,6 +28,10 @@ #include #include #include + +#define STREAM_FLOAT(stream, name, value) \ + stream << std::showpoint << " -D" << name << "=" << value << "F" \ + << std::noshowpoint #include #include @@ -505,7 +509,7 @@ static void runSplatStore(ID3D12Device *Device, const size_t BufferSize = Params.totalBytes(); std::stringstream ExtraDefs; - ExtraDefs << "-DFILL_VALUE=" << FillValue; + STREAM_FLOAT(ExtraDefs, "FILL_VALUE", FillValue); std::string Args = buildCompilerArgs(Params, ExtraDefs.str().c_str()); @@ -624,7 +628,7 @@ static const char ElementAccessShader[] = R"( // flatten the 2D index into a 1D index then scale by element size // Always store row-major and work it out in the test runner uint coordToByteOffset(uint2 coord) { - return (coord.y * M_DIM + coord.x) * ELEM_SIZE; + return (coord.x * N_DIM + coord.y) * ELEM_SIZE; } [WaveSize(4, 64)] @@ -936,8 +940,8 @@ static void runMatMatMul(ID3D12Device *Device, std::stringstream ExtraDefs; ExtraDefs << " -DK_DIM=" << K; - ExtraDefs << " -DA_FILL=" << AFill; - ExtraDefs << " -DB_FILL=" << BFill; + STREAM_FLOAT(ExtraDefs, "A_FILL", AFill); + STREAM_FLOAT(ExtraDefs, "B_FILL", BFill); std::string Args = buildCompilerArgs(Params, ExtraDefs.str().c_str()); @@ -1018,9 +1022,9 @@ static void runMatMatMulAccum(ID3D12Device *Device, std::stringstream ExtraDefs; ExtraDefs << " -DK_DIM=" << K; - ExtraDefs << " -DA_FILL=" << AFill; - ExtraDefs << " -DB_FILL=" << BFill; - ExtraDefs << " -DC_FILL=" << CFill; + STREAM_FLOAT(ExtraDefs, "A_FILL", AFill); + STREAM_FLOAT(ExtraDefs, "B_FILL", BFill); + STREAM_FLOAT(ExtraDefs, "C_FILL", CFill); std::string Args = buildCompilerArgs(Params, ExtraDefs.str().c_str()); @@ -1094,8 +1098,8 @@ static void runMatAccum(ID3D12Device *Device, const size_t BufferSize = Params.totalBytes(); std::stringstream ExtraDefs; - ExtraDefs << " -DLHS_FILL=" << LHSFill; - ExtraDefs << " -DRHS_FILL=" << RHSFill; + STREAM_FLOAT(ExtraDefs, "LHS_FILL", LHSFill); + STREAM_FLOAT(ExtraDefs, "RHS_FILL", RHSFill); std::string Args = buildCompilerArgs(Params, ExtraDefs.str().c_str()); @@ -1552,7 +1556,7 @@ static void runStoreMemory(ID3D12Device *Device, std::stringstream ExtraDefs; ExtraDefs << " -DOFFSET=" << 0; - ExtraDefs << " -DFILL_VALUE=" << FillValue; + STREAM_FLOAT(ExtraDefs, "FILL_VALUE", FillValue); std::string Args = buildCompilerArgs(Params, ExtraDefs.str().c_str()); @@ -1632,7 +1636,7 @@ static void runAccumulateMemory(ID3D12Device *Device, std::stringstream ExtraDefs; ExtraDefs << " -DOFFSET=" << 0; - ExtraDefs << " -DFILL_VALUE=" << FillValue; + STREAM_FLOAT(ExtraDefs, "FILL_VALUE", FillValue); std::string Args = buildCompilerArgs(Params, ExtraDefs.str().c_str()); diff --git a/utils/hct/gen_intrin_main.txt b/utils/hct/gen_intrin_main.txt index 2768e1b65d..c0d1d3dcfc 100644 --- a/utils/hct/gen_intrin_main.txt +++ b/utils/hct/gen_intrin_main.txt @@ -410,6 +410,7 @@ void [[min_sm=6.10]] __builtin_LinAlg_MatrixAccumulateToDescriptor(in LinAlgMatr void [[min_sm=6.10]] __builtin_LinAlg_MatrixAccumulateToMemory(in LinAlgMatrix matrix, groupshared numeric[] memory, in uint offset, in uint stride, in uint layout); void [[min_sm=6.10]] __builtin_LinAlg_MatrixOuterProduct(out LinAlgMatrix ret, in numeric vecA, in numeric vecB); void [[min_sm=6.10]] __builtin_LinAlg_Convert(out numeric ret, in numeric vec, in uint input_interp, in uint output_interp); +void [[min_sm=6.10]] __builtin_LinAlg_VectorAccumulateToDescriptor(in numeric<> vec, in RWByteAddressBuffer buf, in uint offset, in uint align); } namespace diff --git a/utils/hct/hctdb.py b/utils/hct/hctdb.py index 634b62cc6f..ac6eeee55a 100644 --- a/utils/hct/hctdb.py +++ b/utils/hct/hctdb.py @@ -1163,7 +1163,8 @@ def populate_categories_and_models_ExperimentalOps(self): for i in insts( "LinAlgMatrixQueryAccumulatorLayout,LinAlgMatrixLoadFromDescriptor," + "LinAlgMatrixAccumulateToDescriptor,LinAlgMatVecMul," - + "LinAlgMatVecMulAdd,LinAlgMatrixOuterProduct,LinAlgConvert" + + "LinAlgMatVecMulAdd,LinAlgMatrixOuterProduct,LinAlgConvert," + + "LinAlgVectorAccumulateToDescriptor" ): i.category = "Linear Algebra Operations" i.shader_model = experimental_sm @@ -6590,7 +6591,22 @@ def populate_ExperimentalOps(self): ], ) - op_table.reserve_dxil_op_range("ReservedE", 2) + add_dxil_op( + "LinAlgVectorAccumulateToDescriptor", + "LinAlgVectorAccumulateToDescriptor", + "Accumulates given vector to the buffer at the given offset", + "